* version.cc (version_string): Bump to 1.10.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
7af0c620
ILT
12010-08-03 Ian Lance Taylor <iant@google.com>
2
3 * version.cc (version_string): Bump to 1.10.
4
22f0da72
ILT
52010-08-03 Ian Lance Taylor <iant@google.com>
6
7 PR 11805
8 * layout.h (enum Output_section_order): Define.
9 (class Layout): Update declarations.
10 * layout.cc (Layout::get_output_section): Add order parameter.
11 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
12 is_first_non_relro parameters. Change all callers.
13 (Layout::choose_output_section): Likewise.
14 (Layout::add_output_section_data): Likewise.
15 (Layout::make_output_section): Likewise. Set order.
16 (Layout::default_section_order): New function.
17 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
18 * output.cc (Output_section::Output_section): Initialize order_.
19 Don't initialize deleted fields.
20 (Output_segment::Output_segment): Don't initialize deleted
21 fields.
22 (Output_segment::add_output_section_to_load): New function
23 replacing add_output_section. Change all callers to call this or
24 add_output_section_to_nonload.
25 (Output_segment::add_output_section_to_nonload): New function.
26 (Output_segment::remove_output_section): Rewrite.
27 (Output_segment::add_initial_output_data): Likewise.
28 (Output_segment::has_any_data_sections): Likewise.
29 (Output_segment::is_first_section_relro): Likewise.
30 (Output_segment::maximum_alignment): Likewise.
31 (Output_segment::has_dynamic_reloc): New function replacing
32 dynamic_reloc_count. Change all callers.
33 (Output_segment::has_dynamic_reloc_list): New function replacing
34 dynamic_reloc_count_list. Change all callers.
35 (Output_segment::set_section_addresses): Rewrite.
36 (Output_segment::set_offset): Rewrite.
37 (Output_segment::find_first_and_last_list): Remove.
38 (Output_segment::set_tls_offsets): Rewrite.
39 (Output_segment::first_section_load_address): Likewise.
40 (Output_segment::output_section_count): Likewise.
41 (Output_segment::section_with_lowest_load_address): Likewise.
42 (Output_segment::write_section_headers): Likewise.
43 (Output_segment::print_sections_to_map): Likewise.
44 * output.h (class Output_data): Remove dynamic_reloc_count_
45 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
46 (Output_data::add_dynamic_reloc): Rewrite.
47 (Output_data::has_dynamic_reloc): New function.
48 (Output_data::dynamic_reloc_count): Remove.
49 (class Output_section): Add order_ field. Remvoe is_relro_local_,
50 is_last_relro_, is_first_non_relro_, is_interp_,
51 is_dynamic_linker_section_ fields. Add order and set_order
52 functions. Remove is_relro_local, set_is_relro_local,
53 is_last_relro, set_is_last_relro, is_first_non_relro,
54 set_is_first_non_relro functions, is_interp, set_is_interp,
55 is_dynamic_linker_section, and set_is_dynamic_linker_section
56 functions.
57 (class Output_segment): Change Output_data_list from std::list to
58 std:;vector. Add output_lists_ field. Remove output_data_ and
59 output_bss_ fields. Update declarations.
60
3ff2ccb0
ILT
612010-08-02 Ian Lance Taylor <iant@google.com>
62
63 * arm.cc (Target_arm::gc_process_relocs): Use typename.
64 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
65 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
66
88a4108b
ILT
672010-08-02 Ian Lance Taylor <iant@google.com>
68
69 PR 11855
70 * script.cc (Script_options::Script_options): Initialize
71 symbol_definitions_ and symbol_references_.
72 (Script_options::add_symbol_assignment): Update
73 symbol_definitions_ and symbol_references_.
74 (Script_options::add_symbol_reference): New function.
75 (script_symbol): New function.
76 * script.h (class Script_options): Add symbol_definitions_ and
77 symbol_references_ fields.
78 (Script_options::referenced_const_iterator): New type.
79 (Script_options::referenced_begin): New function.
80 (Script_options::referenced_end): New function.
81 (Script_options::is_referenced): New function.
82 (Script_options::any_unreferenced): New function.
83 * script-c.h (script_symbol): Declare.
84 * yyscript.y (exp): Call script_symbol.
85 * symtab.cc: Include "script.h".
86 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
87 Change all callers. Check symbols referenced by scripts.
88 (Symbol_table::add_undefined_symbols_from_command_line): Add
89 layout parameter. Change all callers.
90 (Symbol_table::do_add_undefined_symbols_from_command_line):
91 Likewise. Break out loop body. Check symbols referenced by
92 scripts.
93 (Symbol_table::add_undefined_symbol_from_command_line): New
94 function broken out of
95 do_add_undefined_symbols_from_command_line.
96 * symtab.h (class Symbol_table): Update declarations.
97 * archive.cc: Include "layout.h".
98 (Archive::should_include_member): Add layout parameter. Change
99 all callers. Check for symbol mentioned in expression.
100 * archive.h (class Archive): Update declaration.
101 * object.cc (Sized_relobj::do_should_include_member): Add layout
102 parameter.
103 * object.h (Object::should_include_member): Add layout parameter.
104 Change all callers.
105 (Object::do_should_include_member): Add layout parameter.
106 (class Sized_relobj): Update declaration.
107 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
108 parameter.
109 * dynobj.h (class Sized_dynobj): Update declaration.
110 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
111 layout parameter.
112 * plugin.h (class Sized_pluginobj): Update declaration.
113
5f1ab67a
ILT
1142010-08-02 Ian Lance Taylor <iant@google.com>
115
116 PR 11866
117 * output.cc (Output_segment::set_offset): Search for the first and
118 last sections rather than assuming that the list is in order.
119 (Output_segment::find_first_and_last_list): New function.
120 * output.h (class Output_segment): Update declarations.
121 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
122 (relro_strip_test_SOURCES): New variable.
123 (relro_strip_test_DEPENDENCIES): New variable.
124 (relro_strip_test_LDFLAGS): New variable.
125 (relro_strip_test_LDADD): New variable.
126 (relro_strip_test.so): New target.
127
a8df5856
ILT
1282010-08-02 Ian Lance Taylor <iant@google.com>
129
130 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
131 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
132 (Target_i386::got_tlsdesc_section): New function.
133 (Target_i386::got_section): Create space for GOT entries for
134 TLSDESC relocations.
135 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
136 R_386_TLS_GOTDESC.
137 (Target_i386::Scan::global): Likewise.
138 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
139 using TLSDESC GOT.
140 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
141 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
142 (Target_x86_64::got_tlsdesc_section): New function.
143 (Target_x86_64::got_section): Create space for GOT entries for
144 TLSDESC relocations.
145 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
146 R_386_TLS_GOTDESC.
147 (Target_x86_64::Scan::global): Likewise.
148 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
149 using TLSDESC GOT.
150
0c10a0a6
ILT
1512010-08-02 Ian Lance Taylor <iant@google.com>
152
153 * testsuite/final_layout.sh: Use dc to convert from hex to
154 decimal.
155
41cbeecc
ST
1562010-07-29 Sriraman Tallam <tmsriram@google.com>
157
158 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
159 paramter to the call to gold::gc_process_relocs.
160 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
161 paramter to the call to gold::gc_process_relocs.
162 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
163 parameter to the call to gold::gc_process_relocs.
164 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
165 template parameter to the call to gold::gc_process_relocs.
166 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
167 paramter to the call to gold::gc_process_relocs.
168 * gc.h (get_embedded_addend_size): New function.
169 (gc_process_relocs): Save the size of the reloc for use by ICF.
170 * icf.cc (get_section_contents): Get the addend from the text section
171 for SHT_REL relocation sections.
172 * icf.h (Icf::Reloc_addend_size_info): New typedef.
173 (Icf::Reloc_info): Add new member reloc_addend_size_info.
174 * int_encoding.h (read_from_pointer): New overloaded function.
175 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
176 * testsuite/icf_sht_rel_addend_test.sh: New file.
177 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
178 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
179
6ea55b82
RW
1802010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
181
182 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
183 * Makefile.in: Regenerate.
184 * testsuite/Makefile.in: Regenerate.
185
9691462b
ILT
1862010-07-27 Jeffrey Yasskin <jyasskin@google.com>
187
188 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
189 * gold/testsuite/debug_msg.cc: Likewise.
190 * gold/testsuite/odr_violation1.cc
191 * gold/testsuite/odr_violation2.cc
192
76897331
CC
1932010-07-21 Cary Coutant <ccoutant@google.com>
194
195 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
196 string, and length fields.
197 (Output_merge_string::Merged_strings_list): New type.
198 (Output_merge_string::Merged_strings_lists): New typedef.
199 (Output_merge_string): Replace merged_strings_ with
200 merged_strings_lists_.
201 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
202 Merged_strings_list per input object and section. Don't store pointer
203 to the string. Don't store length with each merged string entry.
204 (Output_merge_string::finalize_merged_data): Loop over list of merged
205 strings lists. Recompute length of each merged string.
206
78384e8f
CC
2072010-07-15 Cary Coutant <ccoutant@google.com>
208
209 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
210 here.
211
783659f9
ILT
2122010-07-14 Ian Lance Taylor <iant@google.com>
213
214 * descriptors.cc (Descriptors::open): Report correct name in error
215 message.
216
131687b4
DK
2172010-07-13 Doug Kwan <dougkwan@google.com>
218
219 * arm.cc (Arm_input_section::Arm_input_section): For a
220 SHT_ARM_EXIDX section, always keeps the input sections.
221 (Arm_input_section::set_exidx_section_link): New method.
222 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
223 has_errors_ to false.
224 (Arm_exidx_input_section::has_errors,
225 Arm_exidx_input_section::set_has_errors): New methods.
226 (Arm_exidx_input_section::has_errors_): New data member.
227 (Arm_relobj::get_exidx_shndx_list): New method.
228 (Arm_output_section::append_text_sections_to_list): Do not skip
229 section without SHF_EXECINSTR.
230 (Arm_output_section::fix_exidx_coverage): Skip input sections with
231 errors.
232 (Arm_relobj::make_exidx_input_section): Add new parameter for text
233 section header. Make error messages more verbose. Check for
234 a non-executable section linked to an EXIDX section.
235 (Arm_relobj::do_read_symbols): Remove error checking, which has been
236 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
237 check that there is no deferred EXIDX section if we exit early.
238 Instead of not making an EXIDX section in case of an error, make one
239 and set the has_errors flag of it.
240 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
241 in a relocatable link.
242 (Target_arm::do_relax): Look for the EXIDX output section instead of
243 assuming that it is called .ARM.exidx.
244 (Target_arm::fix_exidx_coverage): Add a new parameter for input
245 section list. Do not check for SHF_EXECINSTR section flags but
246 skip any input section with errors.
247 * output.cc (Output_section::Output_section): Initialize
248 always_keeps_input_sections_ to false.
249 (Output_section::add_input_section): Check for
250 always_keeps_input_sections_.
251 * output.h (Output_section::always_keeps_input_sections,
252 Output_section::set_always_keeps_input_sections): New methods.
253 (Output_section::always_keeps_input_sections): New data member.
254
69517287
RÁE
2552010-07-13 Rafael Espindola <espindola@google.com>
256
257 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
258 * fileread.h (Input_file): Add try_extra_search_path and find_file.
259
82742395
ILT
2602010-07-13 Philip Herron <herron.philip@googlemail.com>
261 Ian Lance Taylor <iant@google.com>
262
263 * output.h (Output_section_lookup_maps::add_merge_section):
264 Correct check of whether value was inserted.
265 (Output_section_lookup_maps::add_merge_input_section): Likewise.
266 (Output_section_lookup_maps::add_relaxed_input_section):
267 Likewise.
268 * arm.cc (Target_arm::got_section): Remove used local os.
269 * i386.cc (Target_i386::got_section): Likewise.
270 * x86_64.cc (Target_x86_64::got_section): Likewise.
271 * sparc.cc (Target_sparc::got_section): Likewise.
272 (Target_sparc::relocate): Remove unused local have_got_offset.
273 * powerpc.cc (Target_powerpc::relocate): Likewise.
274
f2d707b5
ILT
2752010-07-13 Ian Lance Taylor <iant@google.com>
276
241531d6
ILT
277 * compressed_output.cc (zlib_decompress): Fix signature in
278 !HAVE_ZLIB_H case.
279
f2d707b5
ILT
280 * archive.cc (Archive::include_member): Unlock an external member
281 of a thin archive. Don't bother to delete an object we know is
282 NULL.
283
a2e47362
CC
2842010-07-12 Cary Coutant <ccoutant@google.com>
285
286 * compressed_output.cc (zlib_decompress): New function.
287 (get_uncompressed_size): New function.
288 (decompress_input_section): New function.
289 * compressed_output.h (get_uncompressed_size): New function.
290 (decompress_input_section): New function.
291 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
292 Handle compressed debug sections.
293 * layout.cc (is_compressed_debug_section): New function.
294 (Layout::output_section_name): Map compressed section names to
295 canonical names.
296 * layout.h (is_compressed_debug_section): New function.
297 (is_debug_info_section): Recognize compressed debug sections.
298 * merge.cc: Include compressed_output.h.
299 (Output_merge_data::do_add_input_section): Handle compressed
300 debug sections.
301 (Output_merge_string::do_add_input_section): Handle compressed
302 debug sections.
303 * object.cc: Include compressed_output.h.
304 (Sized_relobj::Sized_relobj): Initialize new data members.
305 (build_compressed_section_map): New function.
306 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
307 * object.h (Object::section_is_compressed): New method.
308 (Object::do_section_is_compressed): New method.
309 (Sized_relobj::Compressed_section_map): New type.
310 (Sized_relobj::do_section_is_compressed): New method.
311 (Sized_relobj::compressed_sections_): New data member.
312 * output.cc (Output_section::add_input_section): Handle compressed
313 debug sections.
314 * reloc.cc: Include compressed_output.h.
315 (Sized_relobj::write_sections): Handle compressed debug sections.
316
ce279a62
CC
3172010-07-08 Cary Coutant <ccoutant@google.com>
318
319 * resolve.cc (Symbol_table::resolve): Remember whether undef was
320 weak when resolving to a dynamic def.
321 (Symbol_table::should_override): Add adjust_dyndef flag; set it
322 for weak undef/dynamic def cases. Adjust callers.
323 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
324 undef_binding_weak_.
325 (Symbol_table::sized_write_globals): Adjust symbol binding.
326 (Symbol_table::sized_write_symbol): Add binding parameter.
327 * symtab.h (Symbol::set_undef_binding): New method.
328 (Symbol::is_undef_binding_weak): New method.
329 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
330 (Symbol_table::should_override): Add new parameter.
331 (Symbol_table::sized_write_symbol): Add new parameter.
332
333 * testsuite/weak_undef_file1.cc: Add new test case.
334 * testsuite/weak_undef_file2.cc: Fix header comment.
335 * testsuite/weak_undef_test.cc: Add new test case.
336
b2286c10
DK
3372010-06-29 Doug Kwan <dougkwan@google.com>
338
339 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
340 Initialize USE_SYMBOL_.
341 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
342 definition.
343 (Arm_reloc_property::uses_symbol_): New data member declaration.
344 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
345 uses symbol value and symbol is undefined but not weakly undefined.
346
4802450a
RÁE
3472010-06-28 Rafael Espindola <espindola@google.com>
348
349 * plugin.cc (Plugin::load): Use dlerror.
350
e5ca47ba
ILT
3512010-06-26 Jeffrey Yaskin <jyasskin@google.com>
352
353 * symtab.cc (detect_odr_violations): When reporting an ODR
354 violation, report an object where the symbol is defined.
355
8a75a161
DK
3562010-06-25 Doug Kwan <dougkwan@google.com>
357
358 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
359 (Target_arm::section_may_have_icf_unsafe_pointers): New method
360 definition.
361 (Target_arm::Scan::local_reloc_may_be_function_pointer,
362 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
363 target hook to detect function points.
364 (Target_arm::Scan::possible_function_pointer_reloc): New method.
365 * icf.h (Icf::check_section_for_function_pointers): Change type of
366 parameter SECTION_NAME to const reference to std::string. Use
367 target hook to determine if section may have unsafe pointers.
368 * target.h (Target::section_may_have_icf_unsafe_pointers): New
369 method definition.
370
42218b9f
RÁE
3712010-06-21 Rafael Espindola <espindola@google.com>
372
373 * fileread.cc (Input_file::find_fie): New
374 (Input_file::open): Use Input_file::find_fie.
375 * fileread.h (Input_file::find_fie): New
376 * plugin.cc (set_extra_library_path): New.
377 (Plugin::load): Add set_extra_library_path to the transfer vector.
378 (Plugin_manager::set_extra_library_path): New.
379 (Plugin_manager::add_input_file): Use the extra search path if set.
380 (set_extra_library_path(): New.
381 * plugin.h (Plugin_manager): Add set_extra_library_path and
382 extra_search_path_.
383
a0506cca
CC
3842010-06-19 Cary Coutant <ccoutant@google.com>
385
386 * layout.cc (gdb_sections): Add .debug_types.
387 (lines_only_debug_sections): Likewise.
388
6508b958
RÁE
3892010-06-18 Rafael Espindola <espindola@google.com>
390
391 * plugin.cc (add_input_file,add_input_library)
392 (Plugin_manager::add_input_file): Make filename arguments const.
393 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
394 const.
395
3e235302
DK
3962010-06-16 Doug Kwan <dougkwan@google.com>
397
398 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
399 .ARM.attributes section if we have not merged any input
400 attributes sections.
401
106e8a6c
DK
4022010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
403
404 * arm.cc: Allow combining objects with no EABI version
405 information.
406
91ff43fe
RÁE
4072010-06-15 Rafael Espindola <espindola@google.com>
408
409 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
410
68ed838c
ILT
4112010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
412
413 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
414 (struct iovec): Correct !HAVE_READV definition.
415
f3a2388f
CC
4162010-06-10 Cary Coutant <ccoutant@google.com>
417
418 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
419 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
420 reloc sections.
421 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
422
423 PR 11683
424 * symtab.h (Symbol::is_placeholder): New member function.
425 * target-reloc.h (relocate_section): Check for placeholder symbols.
426
427 * testsuite/Makefile.am (plugin_test_8): New test.
428 (plugin_test_9): New test.
429 * testsuite/Makefile.in: Regenerate.
430
e1df38aa
NC
4312010-06-09 Nick Clifton <nickc@redhat.com>
432
433 * yyscript.y (input_list_element): Allow strings prefixed with
434 the '-' character. Treat these as libraries.
435 * script.cc (script_add_library): New function. Adds a library
436 specified by "-l<name>" found in an input script.
437 * script-c.h: Add prototype for script_add_library.
438
25bbe950
DK
4392010-06-07 Doug Kwan <dougkwan@google.com>
440
441 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
442 Restrict stub-group size to be within long conditional branch
443 range when working around cortex-A8 erratum.
444
0f32ea4c
ILT
4452010-06-07 Damien Diederen <dd@crosstwine.com>
446
447 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
448 #ifdef typo.
449
8fe2a369
ST
4502010-06-03 Sriraman Tallam <tmsriram@google.com>
451
452 PR gold/11658
453 * output.cc
454 (Output_section::Input_section_sort_entry::compare_section_ordering):
455 Change to return non-zero correctly.
456 (Output_section::Input_section_sort_section_order_index_compare
457 ::operator()): Change to fix ambiguity in comparisons.
458
6e9ba2ca
ST
4592010-06-01 Sriraman Tallam <tmsriram@google.com>
460
461 * gold.h (is_wildcard_string): New function.
462 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
463 (Layout::layout_eh_frame): Ditto.
464 (Layout::find_section_order_index): New method.
465 (Layout::read_layout_from_file): New method.
466 * layout.h (Layout::find_section_order_index): New method.
467 (Layout::read_layout_from_file): New method.
468 (Layout::input_section_position_): New private member.
469 (Layout::input_section_glob_): New private member.
470 * main.cc (main): Call read_layout_from_file here.
471 * options.h (--section-ordering-file): New option.
472 * output.cc (Output_section::input_section_order_specified_): New
473 member.
474 (Output_section::Output_section): Initialize new member.
475 (Output_section::add_input_section): Add new parameter.
476 Keep input sections when --section-ordering-file is used.
477 (Output_section::set_final_data_size): Sort input sections when
478 section ordering file is specified.
479 (Output_section::Input_section_sort_entry): Add new parameter.
480 Check sorting type.
481 (Output_section::Input_section_sort_entry::compare_section_ordering):
482 New method.
483 (Output_section::Input_section_sort_compare::operator()): Change to
484 consider section_order_index.
485 (Output_section::Input_section_sort_init_fini_compare::operator()):
486 Change to consider section_order_index.
487 (Output_section::Input_section_sort_section_order_index_compare
488 ::operator()): New method.
489 (Output_section::sort_attached_input_sections): Change to sort
490 according to section order when specified.
e1df38aa
NC
491 (Output_section::add_input_section<32, true>): Add new parameter.
492 (Output_section::add_input_section<64, true>): Add new parameter.
493 (Output_section::add_input_section<32, false>): Add new parameter.
494 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
495 * output.h (Output_section::add_input_section): Add new parameter.
496 (Output_section::input_section_order_specified): New
497 method.
498 (Output_section::set_input_section_order_specified): New method.
499 (Input_section::Input_section): Initialize section_order_index_.
500 (Input_section::section_order_index): New method.
501 (Input_section::set_section_order_index): New method.
502 (Input_section::section_order_index_): New member.
503 (Input_section::Input_section_sort_section_order_index_compare): New
504 struct.
505 (Output_section::input_section_order_specified_): New member.
506 * script-sections.cc (is_wildcard_string): Delete and move modified
507 method to gold.h.
508 (Output_section_element_input::Output_section_element_input): Modify
509 call to is_wildcard_string.
510 (Output_section_element_input::Input_section_pattern
511 ::Input_section_pattern): Ditto.
512 (Output_section_element_input::Output_section_element_input): Ditto.
513 * testsuite/Makefile.am (final_layout): New test case.
514 * testsuite/Makefile.in: Regenerate.
515 * testsuite/final_layout.cc: New file.
516 * testsuite/final_layout.sh: New file.
517
3537c84b
RÁE
5182010-06-01 Rafael Espindola <espindola@google.com>
519
520 * plugin.cc (Plugin::load): Pass the output name to the plugin.
521
105b6afd
RÁE
5222010-06-01 Rafael Espindola <espindola@google.com>
523
524 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
525 visibility of symbols.
526
29e11421
DK
5272010-05-27 Doug Kwan <dougkwan@google.com>
528
529 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
530 from start of output section instead of address for a local symbol
531 in a merged or relaxed section when doing a relocatable link.
532
5e0f337e
RÁE
5332010-05-26 Rafael Espindola <espindola@google.com>
534
535 PR 11604
536 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
537 adding sections the garbage collector removed.
538 * gold/testsuite/Makefile.am: Add test.
539 * gold/testsuite/Makefile.in: Regenerate.
540 * gold/testsuite/plugin_test_7.sh: New.
541 * gold/testsuite/plugin_test_7_1.c: New.
542 * gold/testsuite/plugin_test_7_2.c: New.
543
f4187277
RÁE
5442010-05-26 Rafael Espindola <espindola@google.com>
545
546 * script-sections.cc (Output_section_definition::set_section_addresses):
547 Check for --section-start.
548
5c388529
DK
5492010-05-26 Doug Kwan <dougkwan@google.com>
550
551 * arm.cc (Arm_scan_relocatable_relocs): New class.
552 (Target_arm::relocate_special_relocatable): New method.
553 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
554 (Arm_relocate_functions::thumb_branch_common): Same.
555 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
556 instead of Default_scan_relocatable_relocs.
557 * target-reloc.h (relocate_for_relocatable): Let target handle
558 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
559 * target.h (Sized_target::relocate_special_relocatable): New method.
560
bca1c3ae
ILT
5612010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
562
563 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
564
0439c796
DK
5652010-05-23 Doug Kwan <dougkwan@google.com>
566
567 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
568 instead of a cast.
569 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
570 with a direct branch, not a conditional branch, to a stub.
571 * merge.cc (Output_merge_base::record_input_section): New method
572 defintion.
573 (Output_merge_data::do_add_input_section): Record input section if
574 keeps-input-sections flag is set.
575 (Output_merge_string::do_add_input_section): Ditto.
576 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
577 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
578 INPUT_SECTIONS_.
579 (Output_merge_base::keeps_input_sections,
580 Output_merge_base::set_keeps_input_sections,
581 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
582 method definitions.
583 (Output_merge_base::Input_sections): New type declaration.
584 (Output_merge_base::input_sections_begin,
585 Output_merge_base::input_sections_end,
586 Output_merge_base::do_set_keeps_input_sections): New method definitions.
587 (Output_merge_base::bool keeps_input_sections_,
588 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
589 Output_merge_base::input_sections_): New data members.
590 (Output_merge_data::do_set_keeps_input_sections): New method
591 defintion.
592 (Output_merge_string::do_set_keeps_input_sections): Ditto.
593 * output.cc (Output_section::Input_section::relobj): Move method
594 defintion from class declaration to here and handle merge sections.
595 (Output_section::Input_section::shndx): Ditto.
596 (Output_section::Output_section): Remove initializations of removed
597 data members and initialize new data member LOOKUP_MAPS_.
598 (Output_section::add_input_section): Set keeps-input-sections flag
599 for a newly created merge output section as appropriate. Adjust code
600 to use Output_section_lookup_maps class.
601 (Output_section::add_relaxed_input_section): Adjst code for lookup
602 maps code refactoring.
603 (Output_section::add_merge_input_section): Add a new parameter
604 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
605 class. If adding input section to a newly created merge output
606 section fails, remove the new merge section.
607 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 608 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
609 (Output_section::find_merge_section): Ditto.
610 (Output_section::build_lookup_maps): New method defintion.
611 (Output_section::find_relaxed_input_section): Adjust code to use
612 Output_section_lookup_maps class.
613 (Output_section::get_input_sections): Export merge sections. Adjust
614 code to use Output_section_lookup_maps class.
615 (Output_section:::add_script_input_section): Adjust code to use
616 Output_section_lookup_maps class. Update lookup maps for merge
617 sections also.
618 (Output_section::discard_states): Use Output_section_lookup_maps.
619 (Output_section::restore_states): Same.
620 * output.h (Merge_section_properties): Move class defintion out of
621 Output_section.
622 (Output_section_lookup_maps): New class.
623 (Output_section::Input_section::is_merge_section): New method
624 defintion.
625 (Output_section::Input_section::relobj): Move defintion out of class
626 defintion. Declare method only.
627 (Output_section::Input_section::shndx): Ditto.
628 (Output_section::Input_section::output_merge_base): New method defintion.
629 (Output_section::Input_section::u2_.pomb): New union field.
630 (Output_section::Merge_section_by_properties_map,
631 Output_section::Output_section_data_by_input_section_map,
632 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
633 Remove types.
634 (Output_section::add_merge_input_section): Add new parameter
635 KEEPS_INPUT_SECTIONS.
636 (Output_section::build_lookup_maps): New method declaration.
637 (Output_section::merge_section_map_,
638 Output_section::merge_section_by_properties_map_,
639 Output_section::relaxed_input_section_map_,
640 Output_section::is_relaxed_input_section_map_valid_): Remove data
641 members.
642 (Output_section::lookup_maps_): New data member.
643
76295588
L
6442010-05-21 Doug Kwan <dougkwan@google.com>
645
646 PR gold/11619
647 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
648 avoid a compilation error.
649
d103a984
RÁE
6502010-05-19 Rafael Espindola <espindola@google.com>
651
652 * script-sections.cc (Output_section_definition::allocate_to_segment):
653 Update the phdrs_list even when the output section is NULL.
654 * testsuite/Makefile.am: Add test.
655 * testsuite/Makefile.in: Regenerate.
656 * testsuite/script_test_9.cc: New.
657 * testsuite/script_test_9.sh: New.
658 * testsuite/script_test_9.t: New.
659
6625d24e
DK
6602010-05-19 Doug Kwan <dougkwan@google.com>
661
662 * arm.cc (Arm_input_section::original_size): New method.
663 (Arm_input_section::do_addralign): Add a cast.
664 (Arm_input_section::do_output_offset): Remove static cast.
665 (Arm_input_section::original_addralign,
666 Arm_input_section::original_size_): Change type to uint32_t.
667 (Arm_input_section::init): Add safe casts for section alignment
668 and size.
669 (Arm_input_section::set_final_data_size): Do not set address and
670 offset of stub table.
671 (Arm_output_section::fix_exidx_coverage): Change use of of
672 Output_section::Simple_input_section to that of
673 Output_section::Input_section.
674 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
675 except for the first pass.
676 * output.cc (Output_section::get_input_sections): Change type of
677 input_sections to std::list<Input_section>.
678 (Output_section::add_script_input_section): Rename from
679 Output_section::add_simple_input_section. Change type of SIS
680 parameter from Simple_input_section to Input_section.
681 * output.h (Output_section::Simple_input_section): Remove class.
682 (Output_section::Input_section): Change class visibility to public.
683 (Output_section::Input_section::addralign): Use stored alignments
684 for special input sections if set.
685 (Output_section::Input_section::set_addralign): New method.
686 (Output_section::get_input_sections): Change parameter type from
687 list of Simple_input_section to list of Input_section.
688 (Output_section::add_script_input_section): Rename from
689 Output_section::add_simple_input_section. Change first parameter's
690 type from Simple_input_section to Input_section and remove the
691 second and third parameters.
692 * script-sections.cc (Input_section::Input_section_list): Change
693 type to list of Output_section::Input_section/
694 (Input_section_info::Input_section_info): Change parameter type of
695 INPUT_SECTION to Output_section::Input_section.
696 (Input_section_info::input_section): Change return type.
697 (Input_section_info::input_section_): Change type to
698 Output_section::Input_section.
699 (Output_section_element_input::set_section_addresses): Adjust code
700 to use Output_section::Input_section instead of
701 Output_section::Simple_input_section. Adjust code for renaming
702 of Output_section::add_simple_input_section.
703 (Orphan_output_section::set_section_addresses): Ditto.
704
e1e82ea4
RW
7052010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
706
707 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
708 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
709
91e75c8a
RÁE
7102010-05-18 Rafael Espindola <espindola@google.com>
711
712 * options.cc (General_options::finalize): Handle -nostdlib.
713 * options.h (nostdlib): New option.
714 * script.cc (script_add_search_dir): Handle -nostdlib.
715
da59ad79
DK
7162010-05-12 Doug Kwan <dougkwan@google.com>
717
718 * arm.cc (Target_arm::do_finalize_sections): Create an empty
719 attributes section only if there no attributes section after merging.
720 (Target_arm::merge_object_attributes): Move value of
e1df38aa 721 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
722 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
723 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
724 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
725 and arm_attr_merge_7.stdout.
726 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
727 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
728 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
729 arm_attr_merge_7b.o): New rules.
730 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
731 arm_attr_merge_7
732 * testsuite/Makefile.in: Regenerate.
733 * testsuite/arm_attr_merge.sh: New file.
734 * testsuite/arm_attr_merge_[67][ab].s: Same.
735
3e01a7fd
NC
7362010-05-05 Nick Clifton <nickc@redhat.com>
737
738 * po/es.po: Updated Spanish translation.
739
7ad2014a
L
7402010-04-27 H.J. Lu <hongjiu.lu@intel.com>
741
742 * Makefile.am (install-exec-local): Properly install gold as
743 default cross linker.
744 * Makefile.in: Regenerated.
745
4fda8867
NC
7462010-04-27 H.J. Lu <hongjiu.lu@intel.com>
747 Nick Clifton <nickc@redhat.com>
748
749 * configure.ac (install_as_default): Define and set to false
750 unless --enable-gold or --enable-gold=both/gold has been
751 specified.
752 * configure: Regenerate.
753
754 * Makefile.am (install-exec-local): Install the executable as
755 'ld.gold'. If install_as_default is true then also install it as
756 'ld'.
757 * Makefile.in: Regenerated.
758
bd288ea2
ILT
7592010-04-24 Ian Lance Taylor <iant@google.com>
760
761 * layout.cc (Layout::layout_reloc): In relocatable link don't
762 combine reloc sections for grouped sections.
763
ef38fd8a
ST
7642010-04-23 Sriraman Tallam <tmsriram@google.com>
765
766 * gc.h (gc_process_relocs): Pass information on relocs pointing to
767 sections that are not ordinary to icf.
768 * icf.cc (get_section_contents): Handle relocation pointing to section
769 with no object or shndx information.
770 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
771 * testsuite/Makefile.in: Regenerate.
772 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
773 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
774
f6973bdc
ILT
7752010-04-22 Ian Lance Taylor <iant@google.com>
776
777 * expression.cc (Expression::Expression_eval_info): Add
778 result_alignment_pointer field.
779 (Expression::eval_with_dot): Add result_alignment_pointer
780 parameter. Change all callers.
781 (Expression::eval_maybe_dot): Likewise.
782 (class Binary_expression): Add alignment_pointer parameter to
783 left_value and right_value. Change all callers.
784 (BINARY_EXPRESSION): Set result alignment.
785 (class Trinary_expression): Add alignment_pointer parameter to
786 arg2_value and arg3_value. Change all callers.
787 (Trinary_cond::value): Set result alignment.
788 (Max_expression::value, Min_expression::value): Likewise.
789 (Align_expression::value): Likewise.
790 * script-sections.cc (class Sections_element): Add dot_alignment
791 parameter to set_section_addresses virtual function. Update
792 instantiations.
793 (class Output_section_element): Likewise.
794 (Script_sections::create_segments): Add dot_alignment parameter.
795 Change all callers.
796 (Script_sections::create_segments_from_phdrs_clause): Likewise.
797 (Script_sections::set_phdrs_clause_addresses): Likewise.
798 * script-sections.h: Update declarations.
799 * script.h: Update declarations.
800 * output.h (Output_segment::set_minimum_p_align): Don't decrease
801 min_p_align.
802 * testsuite/script_test_3.t: Set large alignment.
803 * testsuite/script_test_3.sh: Make sure that at least one LOAD
804 segment has expected alignment.
805
9c9c98a5
NC
8062010-04-22 Nick Clifton <nickc@redhat.com>
807
808 * po/gold.pot: Updated by the Translation project.
809 * po/vi.po: Updated Vietnamese translation.
810
2253bfba
L
8112010-04-22 H.J. Lu <hongjiu.lu@intel.com>
812
813 * testsuite/Makefile.am (check_PROGRAMS): Add
814 icf_virtual_function_folding_test.
815 * testsuite/Makefile.in: Regenerated.
816
85fdf906
AH
8172010-04-15 Andrew Haley <aph@redhat.com>
818
819 * options.h (merge_exidx_entries): New option.
820 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
821 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
822 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
823 (Target_arm::merge_exidx_entries): New function.
824 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
825 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
826 to Arm_exidx_fixup constructor.
827 Add new arg, merge_exidx_entries.
828 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
829 Arm_output_section::fix_exidx_coverage.
830
ce97fa81
ST
8312010-04-18 Sriraman Tallam <tmsriram@google.com>
832
833 * icf.cc (get_section_contents): Check for preemptible functions.
834 Ignore addend when appropriate.
835 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
836 section folded.
837 (add_from_relobj): Check for section folded.
838 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
839 * symtab.h (should_add_dynsym_entry): Add new parameter.
840 * target-reloc.h (scan_relocs): Check for section folded.
841 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
842 Check reloc types for function pointers in shared objects.
843 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
844 case.
845 (icf_preemptible_functions_test): New test case.
846 (icf_string_merge_test): New test case.
847 * testsuite.Makefile.in: Regenerate.
848 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
849 bar_glob. Refactor code.
850 * testsuite/icf_preemptible_functions_test.cc: New file.
851 * testsuite/icf_preemptible_functions_test.sh: New file.
852 * testsuite/icf_string_merge_test.cc: New file.
853 * testsuite/icf_string_merge_test.sh: New file.
854 * testsuite/icf_virtual_function_folding_test.cc: New file.
855 * testsuite/icf_virtual_function_folding_test.sh: New file.
856
04ceb17c
DK
8572010-04-14 Doug Kwan <dougkwan@google.com>
858
859 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
860 for local symbol recounting if we remove a section due to ICF.
861 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
862 there are no regular objects in input.
863
153e7da4
DK
8642010-04-13 Doug Kwan <dougkwan@google.com>
865
866 * arm.cc (Arm_input_section::set_final_data_size): Compute
867 accurate final data size instead of using current data size.
868
4dbd9faf
DK
8692010-04-09 Doug Kwan <dougkwan@google.com>
870
871 * layout.cc (Layout::choose_output_section): Handle script section
872 types.
873 (Layout::make_output_section_for_script): Add section type parameter.
874 Handle script section types.
875 * layout.h (Layout::make_output_section_for_script): Add section
876 type parameter.
877 * output.cc (Output_section::Output_section): Initialize data member
878 is_noload_.
879 (Output_section::do_reset_address_and_file_offset): Do not set address
880 to 0 if section is a NOLOAD section.
881 * output.h (Output_section::is_noload): New method.
882 (Output_section::set_is_noload): Ditto.
883 (Output_section::is_noload_): New data member.
884 * script-c.h (Script_section_type): New enum type.
885 (struct Parser_output_section_header): Add new file section_type.
886 * script-sections.cc (Sections_element::output_section_name): Add
887 parameter for returning script section type.
888 (Output_section_definition::output_section_name): Ditto.
889 (Output_section_definition::section_type)P; New method.
890 (Output_section_definiton::script_section_type_name): Ditto.
891 (Output_section_definition::script_section_type_): New data member.
892 (Output_section_definition::Output_section_definition): Initialize
893 data member Output_section_definition::script_section_type_.
894 (Output_section_definition::create_sections): Pass script section type
895 to Layout::make_output_section_for_script.
896 (Output_section_definition::output_section_name): Return script
897 section type to caller.
898 (Output_section_definition::set_section_address): Do not advance
899 dot value and load address if section type is NOLOAD. Set address
900 of NOLOAD sections regardless of section flags.
901 (Output_section_definition::print): Print section type if it is
902 not SCRIPT_SECTION_TYPE_NONE.
903 (Output_section_definition::section_type): New method.
904 (Output_section_definition::script_section_type_name): Ditto.
905 (Script_sections::output_section_name): Add new parameter
906 PSECTION_TYPE for returning script section type. Pass it to
907 section elements. Handle discard sections.
908 (Sort_output_sections::operator()): Handle NOLOAD sections.
909 * script-sections.h (Script_sections::Section_type): New enum type.
910 (Script_sections::output_section_name): Add a new parameter for
911 returning script section type.
912 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
913 INFO and NOLOAD.
914 * yyscript.y (union): Add new field SECTION_TYPE.
915 (COPY, DSECT, INFO, NOLOAD): New tokens.
916 (opt_address_and_section_type): Change type to output_section_header.
917 (section_type): New non-terminal
918 (section_header): Handle section type.
2253bfba 919 (opt_address_and_section_type): Return section type value.
4dbd9faf 920
721ea635
L
9212010-04-09 H.J. Lu <hongjiu.lu@intel.com>
922
923 * testsuite/plugin_common_test_1.c (foo): Add prototype.
924 * testsuite/plugin_common_test_2.c (foo): Likewise.
925
6bf924b0
DK
9262010-04-08 Doug Kwan <dougkwan@google.com>
927
928 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
929 Output_merge_data.
930 * output.cc (Output_section::add_merge_input_section): Simplify
931 code and return status of Output_merge_base::add_input_section.
e1df38aa 932 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
933 returns true.
934
24af6f92
DK
9352010-04-07 Doug Kwan <dougkwan@google.com>
936
937 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
938 if section is marked as containing instructions but has no mapping
939 symbols.
940 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
941 correct section index.
942 (Arm_relobj::find_linked_text_section): Ditto.
943
00698fc5
CC
9442010-04-07 Cary Coutant <ccoutant@google.com>
945
946 * archive.cc (include_member): Destroy Read_symbols_data object before
947 releasing file.
948 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
949 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
950 (Read_symbols_data::~Read_symbols_data) New destructor.
951 (Section_relocs::Section_relocs) New constructor.
952 (Section_relocs::~Section_relocs) New destructor.
953 (Read_relocs_data::Read_relocs_data) New constructor.
954 (Read_relocs_data::~Read_relocs_data) New destructor.
955 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
956 pointers to NULL after deleting.
957
7296d933
DK
9582010-04-07 Doug Kwan <dougkwan@google.com>
959
960 * arm.cc: Replace "endianity" with "endianness" in comments.
961 (Arm_exidx_cantunwind): Ditto.
962 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
963 (Arm_relobj::merge_flags_and_attributes): New method.
964 (Arm_relobj::merge_flags_and_attributes_): New data member.
965 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
966 (Arm_relobj::scan_sections_for_stubs): Ditto.
967 (Arm_relobj::do_read_symbols): Check to see if we really want to
968 merge processor-specific flags and attributes. Exit early if
969 an object is empty except for section names and the undefined symbol.
970 (Target_arm::do_finalize_sections): Move check for ELF format to
971 Arm_relobj::do_read_symbols. Merge processor specific flags and
972 attributes from a regular object only when we have determined that
973 it is aapropriate. Do not create an .ARM.attributes section in
974 output if there is no regular input object.
975 (Target_arm::merge_processor_specific_flags): Check
976 --warn-mismatch before printing any error.
977 (Target_arm::merge_object_attributes): Ditto.
978 * gold.cc (queue_middle_tasks): Handle the case in which there is
979 no regular object in input.
980 * options.cc (General_options::parse_EB): New method.
981 (General_options::parse_EL): Same.
982 (General_options::General_options): Initialize endianness_.
983 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
984 New options.
985 (General_options::Endianness): New enum.
986 (General_options::endianness): New method.
987 (General_options::endianness_): New data member.
988 * parameters.cc (Parameters::set_options): Check target endianness.
989 (Parameters::set_target_once): Ditto.
990 (Parameters::check_target_endianness): New method.
991 (parameters_force_valid_target): If either -EL or -EB is specified,
992 use it to define endianness of default target.
993 * parameters.h (Parameters::check_target_endianness): New method
994 declaration.
995 * target.h (class Target): Change "endianity" to "endianness"
996 in comments.
997
efc8d4f2
RW
9982010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
999
1000 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
1001 * configure: Regenerate.
1002 * Makefile.in: Regenerate.
1003 * testsuite/Makefile.in: Regenerate.
1004
be234d88
CC
10052010-04-06 Cary Coutant <ccoutant@google.com>
1006
1007 gcc PR lto/42757
1008 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
1009 prevailing definitions of common symbols.
1010 * testsuite/plugin_test_6.sh: New test case.
1011 * testsuite/plugin_common_test_1.c: New test case.
1012 * testsuite/plugin_common_test_2.c: New test case.
1013 * testsuite/Makefile.am (plugin_test_6): New test case.
1014 * testsuite/Makefile.in: Regenerate.
1015
bd32c6bd
NC
10162010-04-06 Nick Clifton <nickc@redhat.com>
1017
1018 * po/vi.po: New Vietnamese translation.
1019
323c532f
DK
10202010-03-30 Doug Kwan <dougkwan@google.com>
1021
1022 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
1023
4fcd97eb
DK
10242010-03-25 Doug Kwan <dougkwan@google.com>
1025
1026 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
1027 to avoid a conversion warning on a 32-bit host.
1028
4ebf39db
ILT
10292010-03-24 Ian Lance Taylor <iant@google.com>
1030
1031 * testsuite/script_test_3.t: Add a TLS segment.
1032 * testsuite/Makefile.am (check_PROGRAMS): Add
1033 tls_phdrs_script_test.
1034 (tls_phdrs_script_test_SOURCES): Define.
1035 (tls_phdrs_script_test_DEPENDENCIES): Define.
1036 (tls_phdrs_script_test_LDFLAGS): Define.
1037 (tls_phdrs_script_test_LDADD): Define.
1038 * testsuite/Makefile.in: Rebuild.
1039
4a599bdd
CC
10402010-03-23 Cary Coutant <ccoutant@google.com>
1041
1042 * fileread.cc (find_or_make_view): Fix comment.
1043
6c93b22c
ILT
10442010-03-23 Ian Lance Taylor <iant@google.com>
1045
1046 * script-sections.cc (class Orphan_section_placement): Define
1047 PLACE_TLS and PLACE_TLS_BSS.
1048 (Orphan_section_placement::Orphan_section_placement): Initialize
1049 new places.
1050 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
1051 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
1052 (tls_script_test_SOURCES): Define.
1053 (tls_script_test_DEPENDENCIES): Define.
1054 (tls_script_test_LDFLAGS): Define.
1055 (tls_script_test_LDADD): Define.
1056 * testsuite/Makefile.in: Rebuild.
1057
a2c7281b
DK
10582010-03-22 Doug Kwan <dougkwan@google.com>
1059
1060 * arm.cc (Arm_relocate_functions::abs8,
1061 Arm_relocate_functions::abs16): Use correct check for overflow
1062 specified in the ARM ELF specs.
1063 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
1064 target of a BLX instruction specially.
1065 (Reloc_stub::stub_type_for_reloc): Ditto.
1066 (Relocate::relocate): Use symbolic names instead of numeric relocation
1067 codes to report error.
1068 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
1069 workaround.
1070 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
1071 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
1072 thumb2_blx_out_of_range.stdout
1073 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
1074 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
1075 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
1076 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
1077 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
1078 thumb2_blx_in_range, thumb2_blx_in_range.o,
1079 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
1080 thumb2_blx_out_of_range.o): New rules.
1081 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
1082 thumb2_blx_in_range and thumb2_blx_out_of_range.
1083 * testsuite/Makefile.in: Regenerate.
1084 * arm_branch_in_range.sh: Add tests for THUMB BLX.
1085 * testsuite/thumb_blx_in_range.s: New file.
1086 * testsuite/thumb_blx_out_of_range.s: New file.
1087
b0193076
RÁE
10882010-03-22 Rafael Espindola <espindola@google.com>
1089
1090 * archive.cc (Should_include): Move to archive.h.
1091 (should_include_member): Make it a member of Archive.
1092 (Lib_group): New.
1093 (Add_lib_group_symbols): New.
1094 * archive.h: Include options.h.
1095 (Archive_member): Moved from Archive.
1096 (Should_include): Moved from archive.cc.
1097 (Lib_group): New.
1098 (Add_lib_group_symbols): New.
1099 * dynobj.cc (do_should_include_member): New.
1100 * dynobj.h (do_should_include_member): New.
1101 * gold.cc (queue_initial_tasks): Update call to queue.
1102 * main.cc (main): Print lib group stats.
1103 * object.cc (do_should_include_member): New.
1104 * object.h: Include archive.h.
1105 (Object::should_include_member): New.
1106 (Object::do_should_include_member): New.
1107 (Sized_relobj::do_should_include_member): New.
1108 * options.cc (General_options::parse_start_lib): New.
1109 (General_options::parse_end_lib): New.
1110 (Input_arguments::add_file): Handle lib groups.
1111 (Input_arguments::start_group): Check we are not in a lib.
1112 (Input_arguments::start_lib): New.
1113 (Input_arguments::end_lib): New.
1114 * options.h (General_options): Add start_lib and end_lib.
1115 (Input_argument::lib_): New.
1116 (Input_argument::lib): New.
1117 (Input_argument::is_lib): New.
1118 (Input_file_lib): New.
1119 (Input_arguments::in_lib_): New.
1120 (Input_arguments::in_lib): New.
1121 (Input_arguments::start_lib): New.
1122 (Input_arguments::end_lib_): New.
1123 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
1124 in unused members as preempted.
1125 (Sized_pluginobj::do_should_include_member): New.
1126 * plugin.h (Sized_pluginobj::do_should_include_member): New.
1127 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
1128 return the blocker.
1129 (Read_symbols::do_whole_lib_group): New.
1130 (Read_symbols::do_lib_group): New.
1131 (Read_symbols::do_read_symbols): Handle lib groups.
1132 (Read_symbols::get_name): Handle lib groups.
1133 * readsyms.h (Read_symbols): Add an archive member pointer.
1134 (Read_symbols::do_whole_lib_group): New.
1135 (Read_symbols::do_lib_group): New.
1136 (Read_symbols::member_): New.
1137 * script.cc (read_input_script): Update call to queue_soon.
1138
d099120c
DK
11392010-03-19 Doug Kwan <dougkwan@google.com>
1140
1141 * arm.cc (Stub_table::Stub_table): Initialize new data members
1142 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
1143 (Stub_table::add_reloc_stub): Assign stub offset and update
1144 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
1145 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
1146 New data members.
1147 (Stub_table::update_data_size_and_addralign): Use
1148 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
1149 instead of going over all reloc stubs.
1150 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
1151 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
1152 Stringpool_template::offset_ to size of Stringpool_char.
1153 (Stringpool_template::new_key_offset): Remove code to initialize
1154 Stringpool_template::offset_.
1155 * stringpool.h (Stringpool_template::set_no_zero_null): Set
1156 Stringpool_template::offset_ to zero.
1157
1aa37384
DK
11582010-03-15 Doug Kwan <dougkwan@google.com>
1159
1160 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
1161 offset_.
1162 (Stringpool_template::new_key_offset): New method.
1163 (Stringpool_template::add_string): Assign offsets when adding new
1164 strings.
1165 (Stringpool_template::set_string_offsets): Do not set string offsets
1166 when not optimizing.
1167 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
1168 member size_.
1169 (Chunked_vector::clear): Clear size_.
1170 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
1171 (Chunked_vector::size): Return size_.
1172 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 1173 (Chunked_vector::size_): New data member.
1aa37384
DK
1174 (Stringpool_template::set_no_zero_null): Assert string set is empty.
1175 (Stringpool_template::new_key_offset): New method declaration.
1176 (Stringpool_template::offset_): New data member.
1177
b672b057
RÁE
11782010-03-15 Rafael Espindola <espindola@google.com>
1179
1180 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
1181 Add_symbols' constructor.
1182 * readsyms.h (Add_symbols): Remove the input_group member.
1183
b6848d3c
ILT
11842010-03-10 Ian Lance Taylor <iant@google.com>
1185
1186 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
1187 target to ask whether a reference to a symbol requires a stack
1188 split.
1189 * target.h (Target::is_call_to_non_split): New function.
1190 (Target::do_is_call_to_non_split): Declare virtual function.
1191 * target.cc: Include "symtab.h".
1192 (Target::do_is_call_to_non_split): New function.
1193 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
1194
a2a5469e
CC
11952010-03-10 Cary Coutant <ccoutant@google.com>
1196
1197 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
1198 (File_read::open[1]): Remove initial mapping of whole_file_view_.
1199 (File_read::open[2]): Add whole_file_view_ to list of views.
1200 (File_read::make_view): Remove test of whole_file_view_.
1201 (File_read::find_or_make_view): Create whole_file_view_ if
1202 necessary.
1203 (File_read::clear_views): Replace bool parameter with enum;
1204 adjust all callers. Don't delete views with permanent data;
1205 do delete cached views and views from archives if
1206 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
1207 if clearing the corresponding view.
1208 * fileread.h (File_read::Clear_views_mode): New enum.
1209 (File_read::View::is_permanent_view): New method.
1210 (File_read::clear_views): Replace bool parameter
1211 with enum; adjust all callers.
1212 * options.h (General_options): Change keep_files_mapped option;
1213 add map_whole_files.
1214 * readsyms.cc (Add_symbols::run): Delete sd_ object before
1215 releasing the file.
1216 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
1217 the file.
1218
8861f32b
DM
12192010-03-10 David S. Miller <davem@davemloft.net>
1220
1221 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
1222
d62d0f5f
ST
12232010-03-09 Sriraman Tallam <tmsriram@google.com>
1224
1225 * icf.cc (get_section_contents): Add '@' marker after processing the
1226 merge reloc.
1227
9177756d
DK
12282010-03-08 Doug Kwan <dougkwan@google.com>
1229
1230 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
1231 due to a conversion warning.
1232 (Arm_relobj::update_output_local_symbol_count): Check for local
1233 symbol with unset output index.
1234
9e9e071b
ILT
12352010-03-05 Ian Lance Taylor <iant@google.com>
1236
1237 * options.h (class General_options): Add --spare-dynamic-tags.
1238 * output.cc (Output_data_dynamic::set_final_data_size): Implement
1239 --spare-dynamic-tags.
1240
a81ee015
ILT
12412010-03-05 Ian Lance Taylor <iant@google.com>
1242
1243 * incremental.cc: Include "libiberty.h".
1244
44ec90b9
RO
12452010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1246
1247 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
1248 function, is_info_ member.
1249 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
1250 (Versions::Versions): Update caller.
1251 (Versions::define_base_version): Likewise.
1252 (Versions::add_def): Likewise.
1253
0897ed3b
ST
12542010-03-03 Sriraman Tallam <tmsriram@google.com>
1255
1256 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
1257 (Scan::possible_function_pointer_reloc): New function.
1258 (Scan::local_reloc_may_be_function_pointer): Change to call
1259 possible_function_pointer_reloc.
1260 (Scan::global_reloc_may_be_function_pointer): Ditto.
1261 * icf.h (Icf::check_section_for_function_pointers): Change to reject
1262 relocations in ".data.rel.ro._ZTV" section.
1263 * testsuite/icf_safe_so_test.sh: Change to pass i386.
1264 * testsuite/icf_safe_so_test.cc: Ditto.
1265 * testsuite/icf_safe_test.cc: Ditto.
1266 * testsuite/icf_safe_test.sh: Ditto.
1267
d3bbad62
ILT
12682010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1269 Ian Lance Taylor <iant@google.com>
1270
1271 * target-reloc.h (relocate_section): Check the symbol table index
1272 for -1U before setting the local symbol index.
1273 (scan_relocatable_relocs): If copying the relocation, record that
1274 the local symbol is required.
1275 * object.h (Symbol_value::is_output_symtab_index_set): New
1276 function.
1277 (Symbol_value::may_be_discarded_from_output_symtab): New
1278 function.
1279 (Symbol_value::has_output_symtab_entry): New function.
1280 (Symbol_value::needs_output_symtab_entry): Remove.
1281 (Symbol_value::output_symtab_index): Make sure the symbol index is
1282 set.
1283 (Symbol_value::set_output_symtab_index): Make sure the symbol
1284 index is not set. Make sure the new index is valid.
1285 (Symbol_value::set_must_have_output_symtab_entry): New function.
1286 (Symbol_value::has_output_dynsym_entry): New function.
1287 (Symbol_value::set_output_dynsym_index): Make sure the new index
1288 is valid.
1289 (Sized_relobj::set_must_have_output_symtab_entry): New function.
1290 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
1291 local symbol if permitted.
1292 (Sized_relobj::do_finalize_local_symbols): Call
1293 is_output_symtab_index_set rather than needs_output_symtab_entry.
1294 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
1295 rather than needs_output_symtab_entry. Call
1296 has_output_dynsym_entry rather than needs_output_dynsym_entry.
1297 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
1298 is_output_symtab_index_set rather than needs_output_symtab_entry.
1299 * testsuite/discard_locals_relocatable_test.c: New file.
1300 * testsuite/discard_locals_test.sh: Test -r.
1301 * testsuite/Makefile.am (check_DATA): Add
1302 discard_locals_relocatable_test1.syms,
1303 discard_local_relocatable_test2.syms.
1304 (MOSTLYCLEANFILES): Likewise. Also add
1305 discard_locals_relocatable_test1.lout and
1306 discard_locals_relocatable_test2.out.
1307 (discard_locals_relocatable_test1.syms): New target.
1308 (discard_locals_relocatable_test.o): New target.
1309 (discard_locals_relocatable_test1.out): New target.
1310 (discard_locals_relocatable_test2.syms): New target.
1311 (discard_locals_relocatable_test2.out): New target.
1312 (various): Add missing ../ld-new dependencies.
1313 * testsuite/Makefile.in: Rebuild.
1314
7e8ccf26
NC
13152010-03-03 Nick Clifton <nickc@redhat.com>
1316
1317 * po/fi.po: New Finnish translation.
1318
2a0ff005
DK
13192010-03-01 Doug Kwan <dougkwan@google.com>
1320
1321 * layout.cc (Layout::Layout): Force section types of .init_array*,
1322 .preinit_array* and .fini_array* sections.
1323 * output.cc (Output_section::Input_section_sort_entry::has_priority):
1324 Fix check of return value of std::string::find.().
1325 (Output_section::Input_section_sort_compare::operator()): Remove
1326 comment about .init_array.
1327 (Output_section::Input_section_sort_init_fini_compare::operator()):
1328 New method.
1329 (Output_section::sort_attached_input_sections): Handle .init_array
1330 and .fini_array specially.
1331 * output.h (Output_section::Inut_section_sort_compare): Update
1332 comment.
1333 (Output_section::Input_section_sort_init_fini_compare): New struct.
1334
c3e4ae29
DK
13352010-02-26 Doug Kwan <dougkwan@google.com>
1336
1337 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
1338 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
1339 * testsuite/debug_msg.sh: Avoid matching source line number for
1340 use of global variable undef_int.
1341
2fd9ae7a
DK
13422010-02-26 Doug Kwan <dougkwan@google.com>
1343
1344 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
1345 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
1346 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
1347 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
1348 * options.cc (General_options::General_options): Initialize member
1349 fix_v4bx_.
1350 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
1351 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
1352 and rm_no_fix_v4bx.stdout
1353 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
1354 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
1355 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
1356 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
1357 and arm_no_fix_v4bx.
1358 * Makefile.in: Regenerate.
1359 * testsuite/arm_fix_v4bx.s: New file.
1360 * testsuite/arm_fix_v4bx.sh: Ditto.
1361
67ec7d0b
DK
13622010-02-24 Doug Kwan <dougkwan@google.com>
1363
1364 * arm.cc (Target_arm::got_section): Make the .got section the first
1365 non RELRO section in the data segment.
1366 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
1367 suffixes of section names.
1368
10165461
DK
13692010-02-24 Doug Kwan <dougkwan@google.com>
1370
1371 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
1372 flags and attributes merging if an input file is a binary file.
1373 * fileread.cc (Input_file::open): Record format of original file.
1374 * fileread.h (Input_file::Format): New enum type.
1375 (Input_file::Input_file): Initialize data member format_.
1376 (Input_file::format): New method definition.
1377 (Input_file::format_):: New data member.
1378
4a54abbb
DK
13792010-02-24 Doug Kwan <dougkwan@google.com>
1380
1381 * arm.cc (Arm_output_data_got): New class.
1382 (ARM_TCB_SIZE): New constant
1383 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
1384 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
1385 If user uses a script with a SECTIONS clause, issue only a warning
1386 for a misplaced EXIDX input section. Otherwise, issue an error.
1387 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
1388 garbage collection.
1389 (Target_arm::got_mode_index_entry): Handle static linking.
1390 (Target_arm::Scan::local): Ditto.
1391 (Target_arm::Scan::global): Ditto.
1392 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
1393 all incorrectly implemented relocations.
e1df38aa 1394 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
1395 Arm_output_section::fix_exidx_coverage.
1396 * layout.cc (Layout::section_name_mapping): Remove trailing dots
1397 from ".ARM.exidx." and ".ARM.extab.".
1398
ca419a6f
ILT
13992010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1400
1401 * arm.cc (Target_arm::do_finalize_sections): Create attribute
1402 section if it does not already exist.
1403 * attributes.cc (Attributes_section_data::Attributes_section_data):
1404 Don't crash if size is zero.
1405
135b9c78
ILT
14062010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1407 Ian Lance Taylor <iant@google.com>
1408
1409 * gold.cc (queue_middle_tasks): If no input files were opened,
1410 exit.
1411 * workqueue.h (Task_function::Task_function): Assert that there is
1412 a blocker.
1413
bb0bfe4f
DK
14142010-02-22 Doug Kwan <dougkwan@google.com>
1415
1416 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
1417 * icf.cc (get_section_contents): Cast snprintf arguments to long long
1418 types to avoid warnings due to different uint64_t implementations
1419 on different hosts.
1420
2a2b6d42
DK
14212010-02-21 Doug Kwan <dougkwan@google.com>
1422
1423 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
1424 handling of the maximum backward branch offset.
1425 (Arm_relocate_functions::thumb_branch_common): Ditto.
1426 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
1427 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 1428 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
1429 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
1430 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
1431 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
1432 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
1433 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
1434 thumb_bl_out_of_range thumb_bl_out_of_range.o,
1435 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
1436 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
1437 thumb2_bl_out_of_range.o): New rules.
1438 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
1439 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
1440 thumb2_bl_out_of_range
1441 * testsuite/Makefile.in: Regenerate.
1442 * testsuite/arm_bl_in_range.s: New file.
1443 * testsuite/arm_bl_out_of_range.s: Ditto.
1444 * testsuite/arm_branch_in_range.sh: Ditto.
1445 * testsuite/arm_branch_range.t: Ditto.
1446 * testsuite/thumb2_branch_range.t: Ditto.
1447 * testsuite/thumb_bl_in_range.s: Ditto.
1448 * testsuite/thumb_bl_out_of_range.s: Ditto.
1449 * testsuite/thumb_branch_range.t: Ditto.
1450
b487ad64
ST
14512010-02-20 Sriraman Tallam <tmsriram@google.com>
1452
1453 * gc.h (gc_process_relocs): Change vectors to point to the new list.
1454 Add reloc offset information.
1455 * icf.cc (get_section_contents): Change iterators to point to the new
1456 vectors. Add reloc offset information to the contents.
1457 * icf.h (Icf::Sections_reachable_info): New typedef.
1458 (Icf::Sections_reachable_list): New typedef.
1459 (Icf::Offset_info): New typedef.
1460 (Icf::Reloc_info): New struct typedef.
1461 (Icf::Reloc_info_list): New typedef.
1462 (Icf::symbol_reloc_list): Delete method.
1463 (Icf::addend_reloc_list): Delete method.
1464 (Icf::section_reloc_list): Delete method.
1465 (Icf::reloc_info_list): New method.
1466 (Icf::reloc_info_list_): New member.
1467
f96accdf
DK
14682010-02-19 Doug Kwan <dougkwan@google.com>
1469
1470 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
1471 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
1472 * arm.cc (Arm_relocation_functions): New forward declaration.
1473 (Target_arm::Target_arm): Initialize new data members
1474 got_mod_index_offset_ and tls_base_symbol_defined_.
1475 (Target_arm::Relocate::relocate_tls): New method.
1476 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
1477 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
1478 New methods.
1479 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
1480 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
1481 (Target_arm::got_mod_index_offset_,
1482 Target_arm::tls_base_symbol_defined_): New data members.
1483 (Target_arm::Scan::local, Target::Scan::global,
1484 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
1485 relocations.
1486
c8761b9a
DK
14872010-02-18 Doug Kwan <dougkwan@google.com>
1488
1489 * arm.cc (Arm_relobj::find_linked_text_section): New method.
1490 (Arm_relobj::make_exidx_input_section): Pass section index of linked
1491 text section as a parameter becuase some broken tools may not set
1492 the link in section header.
1493 (Target_arm::has_got_section): New method.
1494 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
1495 without any mapping symbol as data only. Remove warning.
1496 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
1497 link in its section header, try to discover the link by inspecting the
1498 REL31 relocation at the beginning of the section.
1499 (Target_arm::Scan::check_non_pic): Report name of offending relocation
1500 in error message.
1501 (Target_arm::Scan::global): Treat any reference to the symbol
1502 _GLOBAL_OFFSET_TABLE_ as a GOT access.
1503
21bb3914
ST
15042010-02-12 Sriraman Tallam <tmsriram@google.com>
1505
1506 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
1507 (Scan::global_reloc_may_be_function_pointer): New function.
1508 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
1509 (Scan::global_reloc_may_be_function_pointer): New function.
1510 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
1511 (Scan::global_reloc_may_be_function_pointer): New function.
1512 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
1513 (Scan::global_reloc_may_be_function_pointer): New function.
1514 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
1515 (Scan::global_reloc_may_be_function_pointer): New function.
1516 (Scan::possible_function_pointer_reloc): New function.
1517 (Target_x86_64::can_check_for_function_pointers): New function.
1518 * gc.h (gc_process_relocs): Scan relocation types to determine if
1519 function pointers were taken for targets that support it.
1520 * icf.cc (Icf::find_identical_sections): Include functions for
1521 folding in safe ICF whose pointer is not taken.
1522 * icf.h (Secn_fptr_taken_set): New typedef.
1523 (fptr_section_id_): New member.
1524 (section_has_function_pointers): New function.
1525 (set_section_has_function_pointers): New function.
1526 (check_section_for_function_pointers): New function.
1527 * options.h: Fix comment for safe ICF option.
1528 * target.h (can_check_for_function_pointers): New function.
1529 * testsuite/Makefile.am: Add icf_safe_so_test test case.
1530 Modify icf_safe_test for X86-64.
1531 * testsuite/Makefile.in: Regenerate.
1532 * testsuite/icf_safe_so_test.cc: New file.
1533 * testsuite/icf_safe_so_test.sh: New file.
1534 * testsuite/icf_safe_test.cc (kept_func_3): New function.
1535 (main): Change to take pointer to function kept_func_3.
1536 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
1537 folding is done correctly for X86-64.
1538
0da6fa6c
DM
15392010-02-12 David S. Miller <davem@davemloft.net>
1540
1541 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
1542 is_symbolless parameter.
1543 (Output_reloc<SHT_REL>::is_symbolless): New.
1544 (Output_reloc<SHT_REL>::is_symbolless_): New.
1545 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
1546 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
1547 (Output_reloc<SHT_RELA>::is_symbolless): New.
1548 (Output_data_reloc::add_global): Handle is_symbolless.
1549 (Output_data_reloc::add_global_relative): Likewise.
1550 (Output_data_reloc::add_local): Likewise.
1551 (Output_data_reloc::add_local_relative): Likewise.
1552 (Output_data_reloc::add_symbolless_global_addend): New.
1553 (Output_data_reloc::add_symbolless_local_addend): New.
1554 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
1555 is_symbolless.
1556 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
1557 instead of ->is_relative_
1558 (Output_reloc::write): Likewise.
1559 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
1560 (Output_reloc::write_rel): Simplify.
1561
1562 * sparc.cc (Target_sparc::Scan::local): Use
1563 ->add_symbolless_local_addend as needed.
1564 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
1565 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
1566 based upon relocation offset.
1567
e4782e83
DK
15682010-02-11 Doug Kwan <dougkwan@google.com>
1569
1570 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
1571 (Target_arm::Scan::global): Ditto. Also remove a comment before the
1572 beginning of function.
1573 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
1574 and MOVT_ABS relocations. Those are non issued in scanning. Fix
1575 parameter is_32bit in calls to should_apply_static_reloc.
1576 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
1577 (check_DATA): Add arm_abs_global.stdout.
1578 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
1579 arm_abs_global.stdout): New rules.
1580 (MOSTLLYCLEANFILES): Add arm_abs_global
1581 * Makefile.in: Regenerate.
1582 * testsuite/arm_abs_global.s: New file.
1583 * testsuite/arm_abs_global.sh: Ditto.
1584 * testsuite/arm_abs_lib.s: Ditto.
1585
93ceb764
ILT
15862010-02-11 Ian Lance Taylor <iant@google.com>
1587
1588 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
1589 Read_relocs task.
1590 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
1591 Allocate_commons_task first.
1592 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
1593 task, rather than symtab_lock_.
1594 (Gc_process_relocs::~Gc_process_relocs): New function.
1595 (Gc_process_relocs::is_runnable): Check this_blocker_.
1596 (Gc_process_relocs::locks): Use next_blocker_ rather than
1597 blocker_.
1598 (Scan_relocs::~Scan_relocs): New function.
1599 (Scan_relocs::is_runnable): Check this_blocker_ rather than
1600 symtab_lock_.
1601 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
1602 next_blocker_.
1603 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
1604 fields. Add this_blocker_ and next_blocker_ fields. Adjust
1605 constructor accordingly.
1606 (class Gc_process_relocs): Likewise.
1607 (class Scan_relocs): Likewise.
1608 * common.h (class Allocate_commons_task): Remove symtab_lock_
1609 field, and corresponding constructor parameter.
1610 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
1611 symtab_lock_.
1612 (Allocate_commons_task::locks): Likewise.
1613
114dfbe1
ILT
16142010-02-11 Ian Lance Taylor <iant@google.com>
1615
1616 * gold-threads.h (class Once): Define.
1617 (class Initialize_lock): Rewrite as child of Once.
1618 * gold-threads.cc (class Once_initialize): Define.
1619 (once_pointer_control): New static variable.
1620 (once_pointer, once_arg): New static variables.
1621 (c_run_once): New static function.
1622 (Once::Once, Once::run_once, Once::internal_run): New functions.
1623 (class Initialize_lock_once): Remove.
1624 (initialize_lock_control): Remove.
1625 (initialize_lock_pointer): Remove.
1626 (initialize_lock_once): Remove.
1627 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
1628 (Initialize_lock::initialize): Rewrite.
1629 (Initialize_lock::do_run_once): New function.
1630 * archive.cc (Archive::interpret_header): Only clear name if it is
1631 not already empty.
1632 * fileread.cc: Include "gold-threads.h"
1633 (file_counts_lock): New static variable.
1634 (file_counts_initialize_lock): Likewise.
1635 (File_read::release): Only increment counts when using --stats.
1636 Use a lock around the increment.
1637 * parameters.cc (class Set_parameters_target_once): Define.
1638 (set_parameters_target_once): New static variable.
1639 (Parameters::Parameters): Move here from parameters.h.
1640 (Parameters::set_target): Rewrite.
1641 (Parameters::set_target_once): New function.
1642 (Parameters::clear_target): Move here and rewrite.
1643 * parameters.h (class Parameters): Update declarations. Add
1644 set_parameters_target_once_ field.
1645 (Parameters::Parameters): Move to parameters.cc.
1646 (Parameters::clear_target): Likewise.
1647 * readsyms.cc (Read_symbols::do_group): Create a Start_group
1648 task.
1649 (Start_group::~Start_group): New function.
1650 (Start_group::is_runnable): New function.
1651 (Start_group::locks, Start_group::run): New functions.
1652 (Finish_group::run): Change saw_undefined to size_t.
1653 * readsyms.h (class Start_group): Define.
1654 (class Finish_group): Change saw_undefined_ field to size_t.
1655 (Finish_group::Finish_group): Remove saw_undefined and
1656 this_blocker parameters. Change all callers.
1657 (Finish_group::set_saw_undefined): New function.
1658 (Finish_group::set_blocker): New function.
1659 * symtab.h (class Symbol_table): Change saw_undefined to return
1660 size_t. Change saw_undefined_ field to size_t.
1661 * target-select.cc (Set_target_once::do_run_once): New function.
1662 (Target_selector::Target_selector): Initialize set_target_once_
1663 field. Don't initialize lock_ and initialize_lock_ fields.
1664 (Target_selector::instantiate_target): Rewrite.
1665 (Target_selector::set_target): New function.
1666 * target-select.h (class Set_target_once): Define.
1667 (class Target_selector): Update declarations. Make
1668 Set_target_once a friend. Remove lock_ and initialize_lock_
1669 fields. Add set_target_once_ field.
1670
fa17a3f4
ILT
16712010-02-10 Ian Lance Taylor <iant@google.com>
1672
1673 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
1674 queueing any tasks.
1675 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
1676 (queue_middle_tasks): Add all blockers before queueing any tasks.
1677 (queue_final_tasks): Likewise.
1678 * token.h (Task_token::add_blockers): New function.
1679 * object.h (Input_objects::number_of_relobjs): New function.
1680
c7177d31
ILT
16812010-02-10 Ian Lance Taylor <iant@google.com>
1682
5de0e392
ILT
1683 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
1684 shared, not if not position independent.
1685 * x86_64.cc (Relocate::relocate_tls): Likewise.
1686 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
1687 (tls_pie_pic_test): New target.
1688 * testsuite/Makefile.in: Rebuild.
1689
c7177d31
ILT
1690 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
1691 (tls_test_main_pie.o, tls_test_pie.o): New targets.
1692 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
1693 * testsuite/Makefile.in: Rebuild.
1694
684b268a
DM
16952010-02-09 David S. Miller <davem@davemloft.net>
1696
1697 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
1698 R_SPARC_RELATIVE using ->add_local_relative().
1699 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
1700
612a8d3d
DM
1701 * output.h (Output_data_dynamic::add_section_size): New method
1702 that takes two Output_data objects.
1703 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
1704 entry param. Handle it in initializers.
1705 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
1706 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
1707 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
1708 arg.
1709 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
1710 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
1711 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
1712 for dynrel_includes_plt.
1713 * i386.cc (Target_i386::do_finalize_sections): Likewise.
1714 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1715 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
1716 before .rela.plt
1717 (Target_sparc::do_finalize_sections): Update to pass true for
1718 dynrel_includes_plt.
1719 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
1720 output before .rela.plt
1721 (Target_powerpc::do_finalize_sections): Update to pass true for
1722 dynrel_includes_plt when 32-bit.
1723
cb1be87e
DK
17242010-02-08 Doug Kwan <dougkwan@google.com>
1725
1726 * arm.cc (Arm_relobj::simple_input_section_output_address): New
1727 method.
1728 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
1729 Arm_relobj::scan_section_for_cortex_a8_stubs,
1730 Arm_relobj::do_relocation_section): Instead of calling
1731 Output_section::output_address, use faster
1732 Arm_relobj::simple_input_section_output_address.
1733
705b5121
DM
17342010-02-08 David S. Miller <davem@davemloft.net>
1735
1736 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
1737 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
1738 relocation helper function.
1739
024c4466
DM
1740 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
1741 just like R_SPARC_GOT{10,13,22}.
1742 (Target_sparc::Scan::local): Likewise.
1743 (Target_sparc::Relocate:relocate): Likewise.
1744
9109c078
ILT
17452010-02-06 Ian Lance Taylor <iant@google.com>
1746
1747 * configure.ac: Rewrite targetobjs duplicate removal code to use
1748 only shell constructs.
1749 * configure: Rebuild.
1750
cf846138
DK
17512010-02-05 Doug Kwan <dougkwan@google.com>
1752
1753 PR 11247
1754 * arm.cc (Arm_relobj::section_is_scannable): New method.
1755 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
1756 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
1757
6cfaf60b
DK
17582010-02-04 Doug Kwan <dougkwan@google.com>
1759
1760 PR 11247
1761 * arm-reloc-property.cc (cstdio): Include.
1762 * configure.ac (targetobjs): Remove duplicates.
1763 * configure: Regenerate.
1764 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
1765 big and little endian version for a given address size.
1766
5c57f1be
DK
17672010-02-03 Doug Kwan <dougkwan@google.com>
1768
1769 * arm-reloc-property.cc
1770 (Arm_reloc_property_table::reloc_name_in_error_message): New method
1771 definition.
1772 * arm-reloc-property.h
1773 (Arm_reloc_property_table::get_implemented_static_reloc_property):
1774 New method definition.
1775 (Arm_reloc_property_table::reloc_name_in_error_message): New method
1776 declaration.
1777 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
1778 overflow to N.
1779 (GOT_PREL): Change implemented to Y.
1780 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
1781 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
1782 (Arm_relocate_functions::movw_abs_nc): Remove method.
1783 (Arm_relocate_functions::movt_abs): Ditto.
1784 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
1785 (Arm_relocate_functions::thm_movt_abs): Ditto.
1786 (Arm_relocate_functions::movw_rel_nc): Ditto.
1787 (Arm_relocate_functions::movw_rel): Ditto.
1788 (Arm_relocate_functions::movt_rel): Ditto.
1789 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
1790 (Arm_relocate_functions:thm_movw_rel): Ditto.
1791 (Arm_relocate_functions:thm_movt_rel): Ditto.
1792 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
1793 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
1794 New method definitions.
1795 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
1796 (Arm_relocation_functions::arm_grp_ldr): Ditto.
1797 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
1798 (Arm_relocation_functions::arm_grp_ldc): Ditto.
1799 (Target_arm::Relocate::relocate): Check for non-static or
1800 unimplemented relocation code and exit early. Change calls to
1801 Target_arm::reloc_uses_thumb_bit and
1802 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
1803 instead. Refactor code to handle similar relocations to increase
1804 code sharing. Remove check for unsupported relocation code in switch
1805 statement.
1806 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
1807 relocation property table to find out size. Change error message to
1808 print out the name of a relocation code instead of the numeric value.
1809 (Target_arm::scan_reloc_for_stub): Use relocation property table
1810 instead of calling Target_arm::reloc_uses_thumb_bit().
1811
218c5831
DK
18122010-02-02 Doug Kwan <dougkwan@google.com>
1813
1814 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
1815 types of relaxed input section.
1816
0d31c79d
DK
18172010-02-02 Doug Kwan <dougkwan@google.com>
1818
1819 * Makefile.am (HFILES): Add arm-reloc-property.h.
1820 (DEFFILES): New.
1821 (TARGETSOURCES): Add arm-reloc-property.cc
1822 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
1823 (libgold_a_SOURCES): $(DEFFILES)
1824 * Makefile.in: Regenerate.
1825 * arm-reloc-property.cc: New file.
1826 * arm-reloc-property.h: New file.
1827 * arm-reloc.def: New file.
1828 * arm.cc: Update comments.
1829 (arm-reloc-property.h): New included header.
1830 (arm_reloc_property_table): New global variable.
1831 (Target_arm::do_select_as_default_target): New method definition.
1832 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
1833 arm-reloc-property to targ_extra_obj.
1834 * parameters.cc (set_parameters_target): Call
1835 Target::select_as_default_target().
1836 * target.h (Target::select_as_default_target): New method definition.
1837 (Target::do_select_as_default_target): Same.
1838
546c7457
DK
18392010-02-01 Doug Kwan <dougkwan@google.com>
1840
1841 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
1842 first_output_text_section_.
1843 (Arm_exidx_fixup::first_output_text_section): New method definition.
1844 (Arm_exidx_fixup::first_output_text_section_): New data member.
1845 (Arm_exidx_fixup::process_exidx_section): Record the first text
1846 output section seen.
1847 (Arm_output_section::fix_exidx_coverage): Set correct linked section
1848 and entsize in output section header.
1849
11b861d5
DK
18502010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1851
1852 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
1853 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
1854 (Arm_relocate_functions::thm_alu11): New Method.
1855 (Arm_relocate_functions::thm_pc8): New Method.
1856 (Arm_relocate_functions::thm_pc12): New Method.
1857 (Target_arm::Scan::local): Handle the relocations.
1858 (Target_arm::Scan::global): Likewise.
1859 (Target_arm::Relocate::relocate): Likewise.
1860 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
1861
c9a2c125
DK
18622010-01-29 Doug Kwan <dougkwan@google.com>
1863
1864 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
1865 of relocation types as ld.
1866
1521477a
DK
18672010-01-29 Doug Kwan <dougkwan@google.com>
1868
1869 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
1870 to public.
1871 (Arm_relocate_functions::thumb_branch_common): Ditto.
1872 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
1873 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
1874 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
1875 Arm_relocate_functions::jump24): Remove.
1876 (Target_arm::Relocate::relocate): Adjust code to call
1877 Arm_relocation_functions::arm_branch_common and
1878 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 1879 wrappers. Merge switch-cases together to reduce source code size.
1521477a 1880
e7eca48c
DK
18812010-01-29 Doug Kwan <dougkwan@google.com>
1882
1883 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
1884 output_local_symbol_count_needs_update_.
1885 (Arm_relobj::output_local_symbol_count_needs_update,
1886 Arm_relobj::set_output_local_symbol_count_needs_update,
1887 Arm_relobj::update_output_local_symbol_count): New methods.
1888 (Arm_relobj::output_local_symbol_count_needs_update_): New data
1889 member.
1890 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
1891 of pointed function as in a R_ARM_PREL31 relocation.
1892 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
1893 for output local symbol count updating.
1894 (Target_arm::do_relax): Update output local symbol counts in objects
1895 if necessary.
1896 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
1897
02961d7e
ILT
18982010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1899
1900 * arm.cc: Added support for the ARM relocations:
1901 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
1902 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
1903 (Arm_relocate_functions::movw_rel_nc): Renamed (was
1904 movw_prel_nc).
1905 (Arm_relocate_functions::movw_rel): New method.
1906 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
1907 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
1908 thm_movw_prel_nc).
1909 (Arm_relocate_functions::thm_movw_rel): New method.
1910 (Arm_relocate_functions::thm_movt_rel): Renamed (was
1911 thm_movt_prel).
1912 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
1913 relocations.
1914 (Target_arm::Scan::global): Likewise.
1915 (Target_arm::Relocate::relocate): Likewise.
1916 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
1917 Likewise.
1918
b10d2873
ILT
19192010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1920
1921 * arm.cc: Added support for ARM group relocations.
1922 (Target_arm::reloc_needs_sym_origin): New method.
1923 (Arm_relocate_functions::calc_grp_kn): New method.
1924 (Arm_relocate_functions::calc_grp_residual): New method.
1925 (Arm_relocate_functions::calc_grp_gn): New method.
1926 (Arm_relocate_functions::arm_grp_alu): New Method.
1927 (Arm_relocate_functions::arm_grp_ldr): New Method.
1928 (Arm_relocate_functions::arm_grp_ldrs): New Method.
1929 (Arm_relocate_functions::arm_grp_ldc): New Method.
1930 (Target_arm::Scan::local): Handle the ARM group relocations.
1931 (Target_arm::Scan::global): Likewise.
1932 (Target_arm::Relocate::relocate): Likewise.
1933 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
1934 Likewise.
1935
2b328d4e
DK
19362010-01-26 Doug Kwan <dougkwan@google.com>
1937
1938 * arm.cc (set): Include.
1939 (class Arm_exidx_fixup): Change type of last_input_section_ to const
1940 pointer type.
1941 (Arm_output_section::Text_section_list): New type.
1942 (Arm_output_section::append_text_sections_to_list): New method.
1943 (Arm_output_section::fix_exidx_coverage): Ditto.
1944 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
1945 (Arm_relobj::convert_input_section_to_relaxed_section): Use
1946 Relobj::set_section_offset() instead of
1947 Sized_relobj::invalidate_section_offset().
1948 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
1949 parameter for section headers. Ignore relocation sections for
1950 unallocated sections and EXIDX sections.
1951 (Target_arm::fix_exidx_coverage): New method.
1952 (Target_arm::output_section_address_less_than): New type.
1953 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
1954 linked text section instead of the EXIDX section.
1955 (Arm_output_section::create_stub_group): Add an assertion to check
1956 that this is not an EXIDX output section.
1957 (Arm_output_section::append_text_sections_to_list): New method.
1958 (Arm_output_section::fix_exidx_coverage): Ditto.
1959 (Arm_relobj::scan_sections_for_stubs): Adjust call to
1960 Arm_relobj::section_needs_reloc_stub_scanning.
1961 (Target_arm::do_relax): Fix EXIDX output section coverage in the
1962 first pass.
1963 (Target_arm::fix_exidx_coverage): New method.
1964 * object.h (Relobj::set_output_section): New method.
1965 (Sized_relobj::invalidate_section_offset): Remove method.
1966 (Sized_relobj::do_invalidate_section_offset): Remove method.
1967 (Sized_relobj::do_set_section_offset): Handle offset value -1.
1968
c7f3c371
DK
19692010-01-25 Doug Kwan <dougkwan@google.com>
1970
1971 * arm.cc (Arm_exidx_merged_section::do_output_offset):
1972 Fix warning due to signed and unsigned comparison on a 32-bit host.
1973
8923b24c
DK
19742010-01-22 Doug Kwan <dougkwan@google.com>
1975
1976 * arm.cc (Target_arm::do_relax): Record an output section for section
1977 offset adjustment it contains any stub table that has changed.
1978 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
1979 offsets in an output section if necessary.
1980 * output.cc (Output_section::Output_section): Initialize
1981 section_offsets_need_adjustments_.
1982 (Output_section::add_input_section_for_script): Renamed to
1983 Output_section::add_simple_input_section.
1984 (Output_section::save_states): Add a comment.
1985 (Output_section::discard_states): New method defintion.
1986 (Output_section::adjust_section_offsets): Same.
1987 * output.h (Output_section::add_input_section_for_script): Renamed to
1988 Output_section::add_simple_input_section.
1989 (Output_section::discard_states): New method declaration.
1990 (Output_section::adjust_section_offsets): Same.
1991 (Output_section::section_offsets_need_adjustment,
1992 Output_section::set_section_offsets_need_adjustment): New method
1993 definitions.
1994 (Output_section::section_offsets_need_adjustment_): New data member.
1995 * script-sections.cc
1996 (Output_section_element_input::set_section_address): Adjust code for
1997 renaming of Output_section::add_input_section_for_script.
1998 (Orphan_output_section::set_section_address): Same.
1999
9b2fd367
DK
20002010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2001
2002 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
2003 Fix_v4bx enum values .
2004 * gold/options.h (General_options): New option definitions.
2005 (General_options::fix_v4bx): New method.
2006 (General_options::Fix_v4bx): New enum.
2007 * gold/options.cc (General_options::parse_fix_v4bx): New method.
2008 (General_options::parse_fix_v4bx_interworking): New method.
2009
80d0d023
DK
20102010-01-22 Doug Kwan <dougkwan@google.com>
2011
2012 * arm.cc (Arm_exidx_fixup): New class.
2013
af2cdeae
DK
20142010-01-21 Doug Kwan <dougkwan@google.com>
2015
2016 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
2017 classes.
2018 (Arm_exidx_section_offset_map): New type.
2019
993d07c1
DK
20202010-01-21 Doug Kwan <dougkwan@google.com>
2021
2022 * arm.cc (Arm_exidx_input_section): New class.
2023 (Arm_relobj::exidx_input_section_by_link,
2024 Arm_relobj::exidx_input_section_by_shndx,
2025 Arm_relobj::make_exidx_input_section): New methods.
2026 (read_arm_attributes_section): Remove.
2027 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
2028 information about them.
2029 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
2030 to here.
2031
5ac169d4
DK
20322010-01-20 Doug Kwan <dougkwan@google.com>
2033
2034 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
2035 Input_section_specifier to Section_id.
2036 (Target_arm::new_arm_input_section: Adjust code for change of key
2037 type.
2038 (Target_arm::find_arm_input_section): Ditto.
2039 * gc.h (object.h): Include for Section_id nand Section_id_hash.
2040 (Section_id): Remove.
2041 (Garbage_collection::Section_id_hash): Remove.
2042 * icf.h (object.h): Include for Section_id nand Section_id_hash.
2043 (Section_id): Remove.
2044 (Icf::Section_id_hash): Remove.
2045 * object.h (Section_id, Const_section_id, Section_id_hash,
2046 Const_section_id_hash): New type definitions.
2047 * output.cc (Output_section::add_relaxed_input_section): Change to
2048 use Const_section_id instead of Input_section_specifier as key type.
2049 (Output_section::add_merge_input_section): Ditto.
2050 (Output_section::build_relaxation_map): Change to use Section_id
2051 instead of Input_section_specifier as key type.
2052 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2053 Ditto.
2054 (Output_section::convert_input_sections_to_relaxed_sections): Change
2055 to use Const_section_id instead of Input_section_specifier as key type.
2056 (Output_section::find_merge_section): Ditto.
2057 (Output_section::find_relaxed_input_section): Ditto.
2058 * output.h (Input_section_specifier): Remove class.
2059 (Output_section::Output_section_data_by_input_section_map): Change
2060 key type to Const_section_id.
2061 (Output_section::Output_relaxed_input_section_by_input_section_map):
2062 Ditto.
2063 (Output_section::Relaxation_map): Change key type to Section_id.
2064
a2162063
ILT
20652010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2066
2067 * gold/arm.cc: Added support for R_ARM_V4BX relocation
2068 (class Arm_v4bx_stub): New class.
2069 (DEF_STUBS): Updated definition to support v4_veneer_bx.
2070 (Stub_factory::make_arm_v4bx_stub): New method.
2071 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
2072 (Stub_table::empty): Handle v4bx stubs.
2073 (Stub_table::add_arm_v4bx_stub): New method.
2074 (Stub_table::find_arm_v4bx_stub): New method.
2075 (Arm_relocate_functions::v4bx): New method.
2076 (Target_arm::fix_v4bx): New method.
2077 (Target_arm::Target_arm): Handle R_ARM_V4BX.
2078 (Stub_table::relocate_stubs): Likewise.
2079 (Stub_table::do_write): Likewise.
2080 (Stub_table::update_data_size_and_addralign): Likewise.
2081 (Stub_table::finalize_stubs): Likewise.
2082 (Target_arm::Scan::local): Likewise.
2083 (Target_arm::Scan::global): Likewise.
2084 (Target_arm::do_finalize_sections): Likewise.
2085 (Target_arm::Relocate::relocate): Likewise.
2086 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2087 Likewise.
2088 (Target_arm::scan_reloc_for_stub): Likewise.
2089 (Target_arm::scan_reloc_section_for_stubs): Likewise.
2090
5696ab0b
ILT
20912010-01-19 Ian Lance Taylor <iant@google.com>
2092
2093 * output.cc (Output_section_headers::do_sized_write): Write large
2094 segment count to sh_info field.
2095 (Output_file_header::do_sized_write): For large segment count,
2096 write PN_XNUM to e_phnum field.
2097
800d0f56
ILT
20982010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2099
2100 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
2101 (Arm_relocate_functions::thm_jump8): New function.
2102 (Arm_relocate_functions::thm_jump11): New function.
2103 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
2104 R_ARM_THM_JUMP11.
2105 (Target_arm::Scan::global): Likewise.
2106 (Target_arm::Relocate::relocate): Likewise.
2107 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2108 Likewise.
2109
41263c05
DK
21102010-01-14 Doug Kwan <dougkwan@google.com>
2111
2112 * arm.cc (map, utility): Include headers.
2113 (Target_arm::apply_cortex_a8_workaround): New method.
2114 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
2115 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
2116 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
2117 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
2118 the --[no-]fix-cortex-a8 command line options.
2119 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
2120 (Target_arm::relocate_stub): Use addend in instruction template.
2121 * options.h (DEFINE_bool): Set the user-set flag.
2122 (General_options): Add --[no-]-fix-cortex options.
2123 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 2124 : Update fast look-up map after conversion.
41263c05 2125
459e9b03
ST
21262010-01-14 Sriraman Tallam <tmsriram@google.com>
2127
2128 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
2129 in the first pass of do_layout.
2130
b521dfe4
DK
21312010-01-13 Doug Kwan <dougkwan@google.com>
2132
2133 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
2134 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
2135 apparent compiler problem of not folding static constant integral
2136 data members of elfcpp::Elf_sizes<32>.
2137
44272192
DK
21382010-01-13 Doug Kwan <dougkwan@google.com>
2139
2140 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
2141 Arm_relobj::section_needs_cortex_a8_stub_scanning,
2142 Arm_relobj::scan_section_for_cortex_a8_erratum,
2143 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
2144 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
2145 sections to scan for relocation stubs into a new method
2146 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
2147 relocation and Cortex-A8 stub scanning.
2148 (Target_arm::do_relax): Force stubs to be after stubbed sections
2149 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 2150 the beginning of a new relaxation pass. Update a comment.
44272192
DK
2151 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
2152
44b71ece
ILT
21532010-01-12 Ian Lance Taylor <iant@google.com>
2154
2155 * target-reloc.h (visibility_error): New inline function.
2156 (relocate_section): Call visibility_error.
2157 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
2158 (MOSTLYCLEANFILES): Likewise.
2159 (protected_4_pic.o, protected_3.err): New targets.
2160 * testsuite/protected_4.cc: New file.
2161
a120bc7f
DK
21622010-01-12 Doug Kwan <dougkwan@google.com>
2163
2164 * arm.cc (Cortex_a8_reloc): New class.
2165 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
2166 and cortex_a8_relocs_info_.
2167 (Target_arm::fix_cortex_a8): New method definition.
2168 (Target_arm::Cortex_a8_relocs_info): New type.
2169 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
2170 New data member declarations.
2171 (Target_arm::scan_reloc_for_stub): Record information about
2172 relocations for THUMB branches that might be exempted from the
2173 Cortex-A8 workaround.
2174 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
2175 at the beginning of a relaxation pass.
2176
20138696
DK
21772010-01-12 Doug Kwan <dougkwan@google.com>
2178
2179 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
2180 (Arm_relobj::Mapping_symbol_position,
2181 Arm_reloj::Mapping_symbol_position_less,
2182 Arm_relobj::Mapping_symbols_info): New types.
2183 (Target_arm::is_mapping_symbol_name): New method definition.
2184 (Arm_relobj::do_count_local_symbols): Save information about mapping
2185 symbols.
2186
089d69dc
DK
21872010-01-11 Doug Kwan <dougkwan@google.com>
2188
2189 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
2190 Arm_relocate_functions::thumb32_branch_upper,
2191 Arm_relocate_functions::thumb32_branch_lower,
2192 Arm_relocate_functions::thumb32_cond_branch_offset,
2193 Arm_relocate_functions::thumb32_cond_branch_upper,
2194 Arm_relocate_functions::thumb32_cond_branch_lower,
2195 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
2196 branch offset encoding.
2197 (Arm_relocate_functions::thumb_branch_common): Use new branch
2198 offset encoding methods to avoid code duplication.
2199 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
2200 (Stub_addend_reader::operator()): Use new branch encoding method
2201 to avoid code duplication.
2202
99e5bff2
DK
22032010-01-11 Doug Kwan <dougkwan@google.com>
2204
2205 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
2206 (Target_arm::do_finalize_sections): Define special EXIDX section
2207 symbols only if referenced.
2208 * gc.h (Garbage_collection::add_reference): New method.
2209 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
2210 code duplication.
2211
98e090bd
ILT
22122010-01-11 Ian Lance Taylor <iant@google.com>
2213
d0a91bd8
ILT
2214 * script.cc (Version_script_info::build_expression_list_lookup):
2215 Change complaing about duplicate wildcard match from error to
2216 warning.
2217
98e090bd
ILT
2218 * script.cc (class Lazy_demangler): Recreate--revert part of patch
2219 of 2009-12-30.
2220 (Version_script_info::Version_script_info): Initialize globs_,
2221 default_version_, default_is_global_, and exact_. Don't
2222 initialize globals_ or locals_.
2223 (Version_script_info::build_lookup_tables): Build local symbols
2224 first.
2225 (Version_script_info::unquote): New function.
2226 (Version_script_info::add_exact_match): New function.
2227 (Version_script_info::build_expression_list_lookup): Remove lookup
2228 parameter. Add is_global parameter. Change all callers. Handle
2229 wildcard pattern specially. Unquote pattern. Call
2230 add_exact_match.
2231 (Version_script_info::get_name_to_match): New function.
2232 (Version_script_info::get_symbol_version): New function.
2233 (Version_script_info::get_symbol_version_helper): Remove.
2234 (Version_script_info::check_unmatched_names): Call unquote.
2235 * script.h (class Version_script_info): Change get_symbol_version
2236 to be non-inline and add is_global parameter; change all callers.
2237 Rewrite symbol_is_local. Update declarations. Define struct
2238 Version_tree_match, Exact, Globs. Don't define struct Lookup.
2239 Remove globals_ and locals_ members. Add exact_, globs_,
2240 default_version_, is_global_.
2241 (Version_script_info::Glob): Remove pattern, add expression and
2242 is_global. Update constructor. Change all callers.
2243 * dynobj.cc (Versions::finalize): Mark the version symbol as the
2244 default version.
2245 (Versions::symbol_section_contents): If a symbol is undefined, or
2246 defined in a dynamic object, set the version index to
2247 VER_NDX_LOCAL.
2248 * symtab.cc (Symbol_table::add_from_relobj): Don't call
2249 symbol_is_local.
2250 (Symbol_table::add_from_pluginobj): Likewise.
2251 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
2252
d56962d3
DK
22532010-01-11 Doug Kwan <dougkwan@google.com>
2254
2255 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
2256 (incremental_dump_LDADD): Add linking option for libintl.
2257 * Makefile.in: Regenerate.
2258
94e6ee91
L
22592010-01-11 H.J. Lu <hongjiu.lu@intel.com>
2260
2261 PR gold/11144
2262 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
2263 instead of -Ds.
2264 * testsuite/Makefile.in: Regenerated.
2265
e96c574b
DK
22662010-01-10 Doug Kwan <dougkwan@google.com>
2267
2268 * options.h (DEFINE_var): Use parentheses around argument varname__
2269 in macro body to avoid any unintended subsequent substitutions.
2270
7198066b
ILT
22712010-01-10 Ian Lance Taylor <iant@google.com>
2272
ba4d53bf
ILT
2273 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
2274 candidates before doing symbol resolution.
2275
7198066b
ILT
2276 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
2277 ODR candidates if only one is weak.
2278
a2beed37
ILT
22792010-01-08 Ian Lance Taylor <iant@google.com>
2280
2281 * script.cc (Version_script_info::build_expression_list_lookup):
2282 Don't warn about ambiguous version, just record the ambiguity.
2283 (Version_script_info::get_symbol_version_helper): Give error if
2284 version is ambiguous.
2285
2fb7225c
DK
22862010-01-08 Doug Kwan <dougkwan@google.com>
2287
2288 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
2289 prev_data_size_ and prev_addralign_. Remove initializer for
2290 deleted data member has_been_changed_.
2291 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
2292 to determine if the table is empty.
2293 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
2294 Remove.
2295 (Stub_table::add_reloc_stub): Define method in class definition
2296 instead of just declaring it there.
2297 (Stub_table::add_cortex_a8_stub): New method definition.
2298 (Stub_table::update_data_size_and_addralign): Ditto.
2299 (Stub_table::finalize_stubs): Ditto.
2300 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
2301 (Stub_table::do_addralign_): Return address alignment in the
2302 (Stub_table::do_reset_address_and_file_offset): Define method in
2303 class definition instead of declaring it there. Set current data
2304 size to be the data size of the previous pass.
2305 (Stub_table::set_final_data_size): Use current data size as the
2306 final data size.
2307 (Stub_table::relocate_stub): Change parameter type of stub from
2308 Reloc_stub pointer to Stub pointer.
2309 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
2310 (Stub_table::Cortex_a8_stub_list): New typedef.
2311 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
2312 Stub_table::prev_addralign_): New data member.
2313 (Arm_relobj::Arm_relobj): Initialize data member
2314 section_has_cortex_a8_workaround_.
2315 (Arm_relobj::section_has_cortex_a8_workaround,
2316 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
2317 definitions.
2318 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
2319 declarations.
2320 (Target_arm::relocate_stub): Change parameter type of stub from
2321 Reloc_stub pointer to Stub pointer.
2322 (Insn_template::size, Insn_template::alignment): Handle
2323 THUMB16_SPECIAL_TYPE.
2324 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
2325 Stub_table::update_data_size_and_addralign,
2326 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
2327 definitions.
2328 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2329 (Stub_table::do_write): Ditto.
2330 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2331
880cd20d
ILT
23322010-01-08 Ian Lance Taylor <iant@google.com>
2333
2334 PR 11108
2335 * symtab.h (class Symbol): Remove fields is_target_special_ and
2336 has_plt_offset_. Add field is_defined_in_discarded_section_.
2337 (Symbol::is_defined_in_discarded_section): New function.
2338 (Symbol::set_is_defined_in_discarded_section): New function.
2339 (Symbol::has_plt_offset): Rewrite.
2340 (Symbol::set_plt_offset): Verify that new offset is not -1U.
2341 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
2342 Don't initialize is_target_special_ or has_plt_offset_.
2343 Initialize is_defined_in_discarded_section_.
2344 (Symbol_table::add_from_relobj): If appropriate, set
2345 is_defined_in_discarded_section.
2346 * resolve.cc (Symbol::override_base_with_special): Don't test
2347 is_target_special_. Change has_plt_offset_ to has_plt_offset().
2348 * target-reloc.h (relocate_section): Do special handling for
2349 symbols defined in discarded sections for global symbols as well
2350 as local symbols.
2351
2703e3eb
ILT
23522010-01-08 Ian Lance Taylor <iant@google.com>
2353
2354 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
2355 the SHT_SYMTAB case.
2356
339d40a3
ILT
23572010-01-08 Ian Lance Taylor <iant@google.com>
2358
2359 * object.cc (Sized_relobj::do_layout): Don't get confused if
2360 layout_eh_frame returns NULL.
2361
abecea76
ILT
23622010-01-08 Ian Lance Taylor <iant@google.com>
2363
2364 PR 11084
2365 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
2366 dynamic symbol table, use the normal symbol table.
2367 (Sized_dynobj::do_read_symbols): Remove assertion about type of
2368 symbol table.
2369
6b7dd3f3
ILT
23702010-01-08 Ian Lance Taylor <iant@google.com>
2371
2372 PR 11072
2373 * layout.cc (Layout::include_section): Remove .gnu_debuglink
2374 sections.
2375
36c50e63
L
23762010-01-08 H.J. Lu <hongjiu.lu@intel.com>
2377
2378 * version.cc (print_version): Change to "Copyright 2010".
2379
e291e7b9
ILT
23802010-01-08 Ian Lance Taylor <iant@google.com>
2381
2382 PR 10287
2383 PR 11063
2384 * i386.cc (class Target_i386): Change return type of plt_section
2385 to be non-const.
2386 (class Output_data_plt_i386): Add tls_desc_rel_ field.
2387 (Output_data_plt_i386::Output_data_plt_i386): Initialize
2388 tls_desc_rel_ field.
2389 (Output_data_plt_i386::rel_tls_desc): New function.
2390 (Target_i386::rel_tls_desc_section): New function.
2391 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
2392 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
2393 R_386_TLS_DESC reloc in rel_tls_desc_section.
2394 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
2395 Define struct Tlsdesc_info.
2396 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
2397 (Target_x86_64::do_reloc_symbol_index): New function.
2398 (Target_x86_64::add_tlsdesc_info): New function.
2399 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
2400 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
2401 tlsdesc_rel_ field.
2402 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
2403 all callers.
2404 (Output_data_plt_x86_64::rela_tlsdesc): New function.
2405 (Target_x86_64::rela_tlsdesc_section): New function.
2406 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
2407 handling.
2408 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
2409 (Target_x86_64::do_reloc_addend): New function.
2410 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
2411 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
2412 declarations. Define TARGET_CODE. Add arg field to u1_ union.
2413 (Output_reloc::type): New function.
2414 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
2415 (Output_reloc::is_target_specific): New function.
2416 (Output_reloc::target_arg): New function.
2417 (class Output_reloc) [SHT_RELA]: Add four new constructors for
2418 absolute relocs and target specific relocs.
2419 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
2420 add_target_specific.
2421 (class Output_data_reloc) [SHT_RELA]: Likewise.
2422 * output.cc (Output_reloc::Output_reloc): Add four new versions
2423 for absolute relocs and target specific relocs.
2424 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
2425 (Output_reloc::get_symbol_index): Likewise.
2426 (Output_reloc::local_section_offset): Check that local_sym_index_
2427 is not TARGET_CODE or 0.
2428 (Output_reloc::symbol_value): Likewise.
2429 (Output_reloc::write) [SHT_RELA]: Call target for target specific
2430 reloc.
2431 * target.h (class Target): Add reloc_symbol_index and reloc_addend
2432 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
2433 functions.
2434 * layout.cc (add_target_dynamic_tags): Use output section for
2435 DT_PLTRELSZ and DT_JMPREL.
2436
3a44184e
ILT
24372010-01-07 Ian Lance Taylor <iant@google.com>
2438
2439 PR 11061
2440 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
2441 function.
2442 (class Output_data_reloc_generic): Define.
2443 (class Output_data_reloc_base): Change base class to
2444 Output_data_reloc_generic. Change add() method to call
2445 bump_relative_reloc_count for a relative reloc. Remove
2446 sort_relocs_ field.
2447 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
2448 to sort_relocs().
2449 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
2450 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
2451 appropriate.
2452 * layout.h (class Layout): Update declaration.
2453
ea715a34
ILT
24542010-01-07 Ian Lance Taylor <iant@google.com>
2455
2456 * output.h (class Output_data): Add const version of
2457 output_section and do_output_section.
2458 (class Output_section_data): Add const version of
2459 do_output_section.
2460 (class Output_section): Likewise.
2461 * layout.cc (Layout::add_target_dynamic_tags): New function.
2462 * layout.h (class Layout): Update declarations.
2463 * arm.cc (Target_arm::do_finalize_sections): Use
2464 add_target_dynamic_tags.
2465 * i386.cc (Target_i386::do_finalize_sections): Likewise.
2466 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
2467 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
2468 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2469
659948a4
ILT
24702010-01-07 Ian Lance Taylor <iant@google.com>
2471
2472 PR 11042
2473 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
2474 object as needed.
2475
9d3b86f6
ILT
24762010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
2477 Ian Lance Taylor <iant@google.com>
2478
2479 PR 11019
2480 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
2481 Xindex::read_symtab_xindex.
2482
bb0d3eb0
DK
24832010-01-07 Doug Kwan <dougkwan@google.com>
2484
2485 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
2486 (Insn_template::thumb16_bcond_insn): New method declaration.
2487 (Insn_template): Fix spelling.
2488 (Stub::thumb16_special): New method declaration.
2489 (Stub::do_write): Define virtual method which was previously pure
2490 virtual.
2491 (Stub::do_thumb16_special): New method declaration.
2492 (Stub::do_fixed_endian_write): New template member.
2493 (Reloc_stub::do_write): Remove.
2494 (Reloc_stub::do_fixed_endian_write): Remove.
2495 (Cortex_a8_stub): New class definition.
2496 (Stub_factory::make_cortex_a8_stub): New method definition.
2497 (Stub_factory::Stub_factory): Add missing static storage class
2498 qualifier for elf32_arm_stub_a8_veneer_blx.
2499
ffeef7df
ILT
25002010-01-07 Ian Lance Taylor <iant@google.com>
2501
dc3f80fe
ILT
2502 PR 10980
2503 * options.h (class General_options): Add --warn-unresolved-symbols
2504 and --error-unresolved-symbols.
2505 * errors.cc (Errors::undefined_symbol): Implement
2506 --warn-unresolved-symbols.
2507
ffeef7df
ILT
2508 * options.h (class General_options): Add -z text and -z textoff.
2509 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
2510
f1ec9ded
ST
25112010-01-06 Sriraman Tallam <tmsriram@google.com>
2512
2513 * gc.h (Garbage_collection::Cident_section_map): New typedef.
2514 (Garbage_collection::cident_sections): New function.
2515 (Garbage_collection::add_cident_section): New function.
2516 (Garbage_collection::cident_sections_): New member.
2517 (gc_process_relocs): Add references to sections whose names are C
2518 identifiers.
2519 * gold.h (cident_section_start_prefix): New constant.
2520 (cident_section_stop_prefix): New constant.
2521 (is_cident): New function.
2522 * layout.cc (Layout::define_section_symbols): Replace string constants
2523 with the newly defined constants.
2524 * object.cc (Sized_relobj::do_layout): Track sections whose names are
2525 C identifiers.
2526 * testsuite/Makefile.am: Add gc_orphan_section_test.
2527 * testsuite/Makefile.in: Regenerate.
2528 * testsuite/gc_orphan_section_test.cc: New file.
2529 * testsuite/gc_orphan_section_test.sh: New file.
2530
6eda8c29
ILT
25312010-01-06 Ian Lance Taylor <iant@google.com>
2532
b9674e17
ILT
2533 PR 10980
2534 * options.h (class General_options): Add --warn-shared-textrel.
2535 * layout.cc (Layout::finish_dynamic_section): Implement
2536 --warn-shared-textrel.
2537
6eda8c29
ILT
2538 PR 10980
2539 * options.h (class General_options): Add --warn-multiple-gp.
2540
32dcd44e
ILT
25412010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2542
2543 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
2544 $(THREADSLIB) and $(LIBDL).
2545 * Makefile.in: Rebuild.
2546
a192ba05
ILT
25472010-01-06 Ian Lance Taylor <iant@google.com>
2548
2549 PR 10980
2550 * options.cc (General_options::parse_section_start): New function.
2551 (General_options::section_start): New function.
2552 (General_options::General_options): Initialize all members.
2553 * options.h: Include <map>
2554 (class General_options): Add --section-start. Add section_starts_
2555 member.
2556 * layout.cc (Layout::attach_allocated_section_to_segment): If
2557 --section-start was used, set the address of the segment. Remove
2558 local sort_sections.
2559 (Layout::relaxation_loop_body): If the address of the load segment
2560 has been set by --section-start, don't use it.
2561 * output.h (Output_segment::update_flags_for_output_section): New
2562 function.
2563 * output.cc (Output_segment::add_output_section): Call
2564 update_flags_for_output_section.
2565
dde3f402
ILT
25662010-01-05 Ian Lance Taylor <iant@google.com>
2567
62dfdd4d
ILT
2568 PR 10980
2569 * options.h (class General_options): Add --undefined-version.
2570 * script.cc (struct Version_expression): Add was_matched_by_symbol
2571 field.
2572 (Version_script_info::matched_symbol): New function.
2573 (Version_script_info::get_symbol_version_helper): Call
2574 matched_symbol.
2575 (Version_script_info::check_unmatched_names): New function.
2576 * script.h (class Version_script_info): Update declarations.
2577 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
2578
9c4ae156
ILT
2579 * options.h (class General_options): Use DEFINE_bool_alias for
2580 allow_multiple_definition.
2581 * resolve.cc (Symbol_table::should_override): Don't test
2582 allow_multiple_definition.
2583
dde3f402
ILT
2584 PR 10980
2585 * options.h (class General_options): Add --cref.
2586 * main.cc (main): Print cref table if --cref. Don't close mapfile
2587 until after printing cref table.
2588 * cref.cc: Include "symtab.h".
2589 (class Cref_inputs): Define Cref_table_compare and Cref_table.
2590 (Cref_table_compare::operator()): New function.
2591 (Cref_inputs::gather_cref): New function.
2592 (filecol): New static const.
2593 (Cref_inputs::print_cref): New function.
2594 (Cref::print_cref): New function.
2595 * cref.h: Include <cstdio>.
2596 (class Cref): Update declarations.
2597 * mapfile.h (Mapfile::file): New function.
2598 * object.h (class Object): Define Symbols. Declare virtual
2599 do_get_global_symbols.
2600 (Object::get_global_symbols): New function.
2601 * object.cc (Input_objects::add_object): Pass object to cref_ if
2602 --cref.
2603 (Input_objects::archive_start): Likewise.
2604 (Input_objects::archive_stop): Likewise.
2605 (Input_objects::print_cref): New function.
2606 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
2607 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
2608 --cref.
2609 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
2610 function.
2611 * plugin.h (class Sized_pluginobj): Update declarations.
2612
8781f709
ILT
26132010-01-05 Ian Lance Taylor <iant@google.com>
2614
2615 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
2616 to is_default_version. Rename insdef to insdefault.
2617 (Symbol_table::add_from_relobj): Rename def to is_default_version
2618 and local to is_forced_local.
2619 (Symbol_table::add_from_pluginobj): Likewise.
2620 (Symbol_table::add_from_dynobj): Likewise.
2621 (Symbol_table::define_special_symbol): Rename insdef to
2622 insdefault.
2623
fe35d28d
ILT
26242010-01-04 Ian Lance Taylor <iant@google.com>
2625
30bc8c46
ILT
2626 PR 10980
2627 * options.h (class General_options): Add
2628 --allow-multiple-definition and -z muldefs.
2629 * resolve.cc (Symbol_table::should_override): Don't warn about a
2630 multiple symbol definition if --allow-multiple-definition or -z
2631 muldefs.
2632
7eaea549
ILT
2633 PR 10980
2634 * options.h (class General_options): Add --add-needed and
2635 --copy-dt-needed-entries. Tweak --as-needed help entry.
2636 * object.cc (Input_objects::check_dynamic_dependencies): Give an
2637 error if --copy-dt-needed-entries aka --add-needed is used and
2638 would cause a change in behaviour.
2639
fe35d28d
ILT
2640 PR 10980
2641 * options.h (class General_options): Add -G as a short version of
2642 --shared. Add no-op options -assert, -g, and -i.
2643
55a2bb35
ST
26442010-01-04 Sriraman Tallam <tmsriram@google.com>
2645
2646 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
2647 check for .text or .gnu.linkonce.t sections.
2648 * icf.cc (Icf::find_identical_sections): Ditto.
2649 Change the detection for mangled function name within the section
2650 name.
2651 * icf.h (is_section_foldable_candidate): New function.
2652
719328e1
ILT
26532009-12-30 Ian Lance Taylor <iant@google.com>
2654
2655 PR 10980
2656 * options.h (class General_options): Permit two dashes with
2657 --retain-symbols-file.
2658
d7bb5745
ILT
26592009-12-30 Ian Lance Taylor <iant@google.com>
2660
403a15dd
ILT
2661 PR 10979
2662 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
2663 don't put the file header and segment headers in the text
2664 segment.
2665
eda294df
ILT
2666 PR 10979
2667 * common.cc (Sort_commons::operator()): Stabilize sort when both
2668 entries are NULL.
2669 (Symbol_table::do_allocate_commons_list): When allocating common
2670 symbols, skip a symbol which is no longer common.
2671 * symtab.h (Symbol::is_common): Test whether the symbol comes from
2672 an object before checking its type.
2673 * testsuite/common_test_2.c: New file.
2674 * testsuite/common_test_3.c: New file.
2675 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
2676 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
2677 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
2678 (common_test_2_pic.o, common_test_2.so): New targets.
2679 (common_test_3_pic.o, common_test_3.so): New targets.
2680 * testsuite/Makefile.in: Rebuild.
2681
d7bb5745
ILT
2682 PR 10979
2683 * script.cc (read_input_script): If we see a new SECTIONS clause,
2684 and we have added an input section, give an error.
2685 * layout.h (class Layout): Add have_added_input_section function.
2686 Add have_added_input_section_ field.
2687 * layout.cc (Layout::Layout): Initialize
2688 have_added_input_section_.
2689 (Layout::layout): Set have_added_input_section_.
2690 (Layout::layout_eh_frame): Likewise.
2691
fc59c572
ILT
26922009-12-30 Ian Lance Taylor <iant@google.com>
2693
2694 PR 10931
2695 * options.h (class General_options): Add --sort-common option.
2696 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
2697 * common.cc (Sort_common): Add sort_order parameter to
2698 constructor. Add sort_order_ field.
2699 (Sort_commons::operator): Check sort_order_.
2700 (Symbol_table::allocate_commons): Determine the sort order.
2701 (Symbol_table::do_allocate_commons): Add sort_order parameter.
2702 Change all callers.
2703 (Symbol_table::do_allocate_commons_list): Likewise.
2704
1c74fab0
ILT
27052009-12-30 Ian Lance Taylor <iant@google.com>
2706
2707 PR 10916
2708 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
2709 symbols from this object, don't change the visibility of an
2710 undefined symbol.
2711 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
2712
6affe781
ILT
27132009-12-30 Ian Lance Taylor <iant@google.com>
2714
2715 PR 10861
2716 * script.h (class Version_script_info): Define Language enum.
2717 Update declarations. Define Glob, Exact, and Lookup types. Add
2718 new fields globals_, locals_, and is_finalized_.
2719 * script.cc: Various formatting fixes.
2720 (class Parser_closure): Change language_stack_ from a vector of
2721 std::string to one of Version_script_info::Language. Adjust all
2722 uses accordingly.
2723 (class Lazy_demangler): Remove.
2724 (struct Version_expression): Change language from std::string to
2725 Version_script_info::Language.
2726 (Version_script_info::Version_script_info): New function.
2727 (Version_script_info::~Version_script_info): Don't call clear.
2728 (Version_script_info::finalize): New function.
2729 (Version_script_info::build_lookup_tables): New function.
2730 (Version_script_info::build_expression_list_lookup): New
2731 function.
2732 (Version_script_info::get_symbol_version_helper): Rewrite to use
2733 lookup tables.
2734 (Version_script_info::print_expression_list): Adjust to use
2735 Version_script_info::Language.
2736 (script_push_lex_into_version_mode): Check that the version script
2737 has not been finalized.
2738 (version_script_push_lang): Change language string to
2739 Version_script_info::Language.
2740 * options.cc (Command_line::version_script): New function.
2741 * options.h (class General_options): Add finalize_dynamic_list
2742 function. Change version_script from declaration to definition.
2743 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
2744 * testsuite/version_script.map: Remove duplicate def of foo.
2745 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
2746 version_script.map.
2747 * testsuite/Makefile.in: Rebuild.
2748
818bf354
ILT
27492009-12-30 Ian Lance Taylor <iant@google.com>
2750
2751 PR 10843
2752 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
2753 if the input symbol index is 0, make the output symbol index 0.
2754
ebcc8304
ILT
27552009-12-30 Ian Lance Taylor <iant@google.com>
2756
2757 PR 10670
2758 * options.h (class General_options): Add -x/--discard-all.
2759 * object.cc (Sized_relobj::do_count_local_symbols): Handle
2760 --discard-all. If the local symbol needs a dynamic entry, check
2761 that before handling --discard-locals.
2762
176fe33f
ILT
27632009-12-30 Ian Lance Taylor <iant@google.com>
2764
bb321bb1
ILT
2765 PR 10450
2766 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
2767 flags to PF_R.
2768 (Output_segment::add_output_section): Don't change the flags if
2769 the type is PT_TLS.
2770
176fe33f
ILT
2771 PR 10450
2772 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
2773 GNU hash table if they need a dynamic value. Otherwise, don't add
2774 them if they are defined in a dynamic object or are forced local.
2775
e8cd95c7
ILT
27762009-12-29 Ian Lance Taylor <iant@google.com>
2777
1b81fb71
ILT
2778 PR 10450
2779 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
2780 .gnu.hash table for a 32-bit target.
2781
8d6d383d
ILT
2782 PR 10450
2783 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
2784 regular and a dynamic object only needs a dynamic symbol table
2785 entry if it is externally visible.
2786
e785ec03
ILT
2787 PR 10450
2788 * i386.cc (class Target_i386): Initialize global_offset_table_ in
2789 constructor. Add global_offset_table_ field.
2790 (Target_i386::got_section): Set global_offset_table_.
2791 (Target_i386::do_finalize_sections): Set global_offset_table_
2792 size.
2793 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
2794 in constructor. Add global_offset_table_ field.
2795 (Target_x86_64::got_section): Set global_offset_table_.
2796 (Target_x86_64::do_finalize_sections): Set global_offset_table_
2797 size.
2798
1a2dff53
ILT
2799 * layout.cc (Layout::Layout): Initialize increase_relro_.
2800 (Layout::get_output_section): Add is_relro, is_last_relro, and
2801 is_first_non_relro parameters. Change all callers.
2802 (Layout::choose_output_section): Likewise.
2803 (Layout::add_output_section_data): Likewise.
2804 (Layout::make_output_section): Likewise.
2805 (Layout::set_segment_offsets): Clear increase_relro when using a
2806 linker script.
2807 * layout.h (class Layout): Add increase_relro method. Add
2808 increase_relro_ field. Update declarations.
2809 * output.cc (Output_section::Output_section): Initialize
2810 is_last_relro_ and is_first_non_relro_.
2811 (Output_segment::add_output_section): Group relro sections is
2812 do_sort is true. Handle is_last_relro and is_first_non_relro.
2813 (Output_segment::maximum_alignment): Remove relro handling.
2814 (Output_segment::set_section_addresses): Add increase_relro
2815 parameter. Change all callers. Add initial alignment to align
2816 relro sections on separate page. Remove old relro handling.
2817 (Output_segment::set_section_list_addresses): Remove in_relro
2818 parameter. Change all callers.
2819 (Output_segment::set_offset): Add increase parameter. Change all
2820 callers. Remove old relro handling.
2821 * output.h (class Output_section): Add new methods: is_last_relro,
2822 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
2823 Add is_last_relro_ and is_first_non_relro_ fields.
2824 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
2825 Create separate .got.plt section. Call increase_relro.
2826 * x86_64.cc (Target_x86_64::got_section): Likewise.
2827 * testsuite/relro_script_test.t: Add .got.plt.
2828
f0ba79e2
ILT
2829 PR 10450
2830 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
2831 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
2832 (Layout::finalize): Call set_dynamic_symbol_size.
2833 (Layout::set_dynamic_symbol_size): New function.
2834 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
2835 set_dynamic_symbol_size.
2836
e8cd95c7
ILT
2837 PR 10450
2838 * output.h (class Output_section): Add is_entsize_zero_ field.
2839 * output.cc (Output_section::Output_section): Initialize
2840 is_entsize_zero_.
2841 (Output_section::set_entsize): If two different entsizes are
2842 requested, force it to zero.
2843 (Output_section::add_input_section): Set flags for .debug_str
2844 before updating section flags. Set entsize.
2845 (Output_section::update_flags_for_input_section): Set SHF_MERGE
2846 and SHF_STRING if all input sections have those flags.
2847
3e1b9a8a
RÁE
28482009-12-29 Rafael Espindola <espindola@google.com>
2849
2850 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
2851 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
2852 reporting.
3e1b9a8a 2853
3dcad376
ST
28542009-12-29 Sriraman Tallam <tmsriram@google.com>
2855
2856 * options.cc (General_options::parse_version): Allow -v to exit
2857 without an error if there is nothing to link.
2858
084e2665
ILT
28592009-12-29 Ian Lance Taylor <iant@google.com>
2860
2861 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
2862 using a version of gcc before 4.1.
2863 * configure: Rebuild.
2864
250acde3
CD
28652009-12-28 Chris Demetriou <cgd@google.com>
2866
2867 * attributes.cc (Output_attributes_section_data::do_write): Use
2868 std::vector::front rather than std::vector::data.
2869
99fff23b
ILT
28702009-12-28 Ian Lance Taylor <iant@google.com>
2871
2872 * symtab.h (class Symbol_table): Add enum Defined.
2873 * resolve.cc (Symbol_table::should_override): Add defined
2874 parameter. Change all callers. Test whether object is NULL
2875 before calling a method on it.
2876 (Symbol_table::report_resolve_problem): Add defined parameter.
2877 Change all callers.
2878 (Symbol_table::should_override_with_special): Likewise.
2879 * symtab.cc (Symbol_table::define_in_output_data): Add defined
2880 parameter. Change all callers.
2881 (Symbol_table::do_define_in_output_data): Likewise.
2882 (Symbol_table::define_in_output_segment): Likewise.
2883 (Symbol_table::do_define_in_output_segment): Likewise.
2884 (Symbol_table::define_as_constant): Likewise.
2885 (Symbol_table::do_define_as_constant): Likewise.
2886 * script.h (class Symbol_assignment): Add is_defsym parameter to
2887 constructor; change all callers.
2888 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
2889 parameter. Change all callers. Add is_defsym_ field.
2890 (class Parser_closure): Add parsing_defsym parameter to
2891 constructor; change all callers. Add parsing_defsym accessor
2892 function. Add parsing_defsym_ field.
2893
556bd683
ILT
28942009-12-28 Ian Lance Taylor <iant@google.com>
2895
2896 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 2897 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 2898
1782c879
ILT
28992009-12-23 Ian Lance Taylor <iant@google.com>
2900
2901 * i386.cc (Target_i386::do_calls_non_split): Recognize
2902 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
2903 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
2904 -fsplit-stack prologue when using %r11.
1782c879 2905
329ca2b1
ST
29062009-12-21 Sriraman Tallam <tmsriram@google.com>
2907
2908 * options.cc (General_options::parse_version): Make -v continue and do
2909 the link like GNU ld does.
2910
d675ff46
RÁE
29112009-12-17 Rafael Avila de Espindola <espindola@google.com>
2912
2913 * Makefile.am (CCFILES): Add timer.cc.
2914 (HFILES): Add timer.h.
2915 * configure.ac: Check for sysconf and times.
2916 * main.cc: include timer.h.
2917 (main): Use Timer instead of get_run_time.
2918 * timer.cc: New.
2919 * timer.h: New.
2920 * workqueue.cc: include timer.h.
2921 (Workqueue::find_and_run_task):
2922 Report user, sys and wall time.
2923 * Makefile.in: Regenerate.
2924 * config.in: Regenerate.
2925 * configure: Regenerate.
2926
d6344fb5
DK
29272009-12-16 Doug Kwan <dougkwan@google.com>
2928
2929 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
2930 sections.
2931 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
2932 relaxed input sections.
2933 * output.cc (Output_section::find_relaxed_input_section): Change
2934 return type to Output_relaxed_input_section pointer. Adjust code
2935 for new type of relaxed_input_section_map_.
2936 * output.h (Output_section::find_relaxed_input_section): Change
2937 return type to Output_relaxed_input_section pointer.
2938 (Output_section::Output_relaxed_input_section_by_input_section_map):
2939 New type.
2940 (Output_section::relaxed_input_section_map_): Change type to
2941 Output_section::Output_relaxed_input_section_by_input_section_map.
2942 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
2943 input section.
2944
0e0d5469
ILT
29452009-12-15 Ian Lance Taylor <iant@google.com>
2946
2947 * layout.cc (Layout::create_shstrtab): Only write out after input
2948 sections if we are compressing debug sections.
2949
0649a889
ILT
29502009-12-15 Ian Lance Taylor <iant@google.com>
2951
2952 * archive.cc (Archive::add_symbols): Only look up a symbol without
2953 a version if there is, in fact, a version.
2954
2ea97941
ILT
29552009-12-14 Ian Lance Taylor <iant@google.com>
2956
2957 Revert -Wshadow changes, all changes from:
2958 2009-12-11 Doug Kwan <dougkwan@google.com>
2959 2009-12-11 Nick Clifton <nickc@redhat.com>
2960 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
2961
b0eec2cc
DK
29622009-12-11 Doug Kwan <dougkwan@google.com>
2963
2964 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
2965 due to -Wshadow.
2966 * attributes.cc (Object_attribute::size): Ditto.
2967 (Attributes_section_data::size): Ditto.
2968 (Attributes_section_data::Attributes_section_data): Ditto.
2969 (Output_attributes_section_data::do_write): Ditto.
2970 * attributes.h (Object_attribute::set_type): Ditto.
2971 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
2972
91d6fa6a
NC
29732009-12-11 Nick Clifton <nickc@redhat.com>
2974
2975 * archive.cc: Fix shadowed variable warnings.
2976 * arm.cc: Likewise.
2977 * compressed_output.cc: Likewise.
2978 * compressed_output.h: Likewise.
2979 * configure: Likewise.
2980 * dwarf_reader.cc: Likewise.
2981 * dynobj.cc: Likewise.
2982 * dynobj.h: Likewise.
2983 * ehframe.cc: Likewise.
2984 * ehframe.h: Likewise.
2985 * errors.cc: Likewise.
2986 * expression.cc: Likewise.
2987 * fileread.cc: Likewise.
2988 * fileread.h: Likewise.
2989 * freebsd.h: Likewise.
2990 * i386.cc: Likewise.
2991 * icf.cc: Likewise.
2992 * incremental.h: Likewise.
2993 * layout.cc: Likewise.
2994 * layout.h: Likewise.
2995 * mapfile.cc: Likewise.
2996 * merge.cc: Likewise.
2997 * merge.h: Likewise.
2998 * object.cc: Likewise.
2999 * object.h: Likewise.
3000 * options.h: Likewise.
3001 * output.cc: Likewise.
3002 * output.h: Likewise.
3003 * parameters.cc: Likewise.
3004 * plugin.cc: Likewise.
3005 * powerpc.cc: Likewise.
3006 * reduced_debug_output.cc: Likewise.
3007 * reduced_debug_output.h: Likewise.
3008 * reloc.cc: Likewise.
3009 * reloc.h: Likewise.
3010 * resolve.cc: Likewise.
3011 * script-sections.cc: Likewise.
3012 * script.cc: Likewise.
3013 * script.h: Likewise.
3014 * sparc.cc: Likewise.
3015 * symtab.cc: Likewise.
3016 * symtab.h: Likewise.
3017 * target-select.cc: Likewise.
3018 * target-select.h: Likewise.
3019 * token.h: Likewise.
3020 * workqueue.cc: Likewise.
3021 * workqueue.h: Likewise.
3022 * x86_64.cc: Likewise.
3023
a0351a69
DK
30242009-12-10 Doug Kwan <dougkwan@google.com>
3025
3026 * arm.cc (attributes.h): New include.
3027 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
3028 (Arm_relobj::~Arm_relobj): Delete object pointed by
3029 attributes_section_data_.
3030 (Arm_relobj::attributes_section_data): New method definition.
3031 (Arm_relobj::attributes_section_data_): New data member declaration.
3032 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
3033 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
3034 attributes_section_data_.
3035 (Arm_dynobj::attributes_section_data): New method definition.
3036 (Arm_dynobj::attributes_section_data_): New data member declaration.
3037 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
3038 initialization value of may_use_blx_ to false.
3039 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
3040 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
3041 object attributes to compute results instead of hard-coding.
3042 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
3043 Target_arm::get_secondary_compatible_arch,
3044 Target_arm::set_secondary_compatible_arch
3045 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
3046 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
3047 New method declarations.
3048 (Target_arm::get_aeabi_object_attribute): New method definition.
3049 (Target_arm::attributes_section_data_): New data member declaration.
3050 (read_arm_attributes_section): New template definition.
3051 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
3052 (Arm_dynobj::do_read_symbols): Ditto.
3053 (Target_arm::do_finalize_sections): Merge attributes sections from
3054 input. Check for BLX use after attributes section merging.
3055 Fix __exidx_start and __exidx_end visibility. Create an
3056 .ARM.attributes section if necessary.
3057 (Target_arm::get_secondary_compatible_arch,
3058 Target_arm::set_secondary_compatible_arch,
3059 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
3060 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 3061 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
3062 New method definitions.
3063
b59befec
ILT
30642009-12-09 Ian Lance Taylor <iant@google.com>
3065
3066 * plugin.cc (Plugin::load): Don't cast from void* to a function
3067 pointer.
3068
1276bc89
ILT
30692009-12-09 Ian Lance Taylor <iant@google.com>
3070
3071 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
3072 information fields.
3073
2f2de248
L
30742009-12-09 H.J. Lu <hongjiu.lu@intel.com>
3075
3076 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
3077 Replace two_file_shared_1.so with two_file_shared_2.so.
3078 * testsuite/Makefile.in: Regenerated.
3079
4f787271
DK
30802009-12-08 Doug Kwan <dougkwan@google.com>
3081
3082 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
3083 (HFILES): Add attributes.h and int_encoding.h.
3084 * Makefile.in: Regenerate.
3085 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
3086 function definitions to int_encoding.cc
3087 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
3088 prototypes to int_encoding.h
3089 * reduced_debug_output.cc (int_encoding.h): New include.
3090 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
3091 function definitions to int_encoding.cc
3092 (insert_into_vector, read_from_pointer): Move template definitions to
3093 int_encoding.h
3094 * attributes.cc: New file.
3095 * attributes.h: New file.
3096 * int_encoding.cc: New file.
3097 * int_encoding.h: New file.
3098
20b52f1a
RÁE
30992009-12-07 Rafael Avila de Espindola <espindola@google.com>
3100
3101 PR gold/11055
3102 * incremental-dump.cc (dump_incremental_inputs): New.
3103 (main): Use dump_incremental_inputs.
3104
53d7974c
L
31052009-12-07 H.J. Lu <hongjiu.lu@intel.com>
3106
3107 PR gold/10893
3108 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
3109 checking elfcpp::STT_FUNC.
3110 (Target_i386::Relocate::relocate): Likewise.
3111 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3112
3113 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
3114 symbols from shared libraries into normal FUNC symbols.
3115
3116 * symtab.h (Symbol): Add is_func and use it.
3117
05a352e6
DK
31182009-12-05 Doug Kwan <dougkwan@google.com>
3119
3120 * arm.cc (Target_arm::arm_info): Initialize new fields
3121 attributes_section and attributes_vendor.
3122 * i386.cc (Target_i386::i386_info): Same.
3123 * object.cc (Sized_relobj::do_layout): Skip attribute section.
3124 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
3125 fields attributes_section and attributes_vendor.
53d7974c 3126 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
3127 * target.h (Target::attributes_section, Target::attributes_vendor,
3128 Target::is_attributes_section, Target::attribute_arg_type,
3129 Target::attributes_order): New method definitions.
3130 (Target::Target_info::attributes_section,
3131 Target::Target_info::attributes_vendor): New fields.
3132 (Target::do_attribute_arg_type, Target::do_attributes_order): New
3133 virtual method definitions.
3134 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
3135 attributes_section and attributes_vendor.
3136 * testsuite/testfile.cc (Target_test::test_target_info): Same.
3137
f4e5969c
DK
31382009-12-05 Doug Kwan <dougkwan@google.com>
3139
3140 * arm.cc: Update comments about interworking and stub generation.
3141 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
3142 considered as non-PIC.
3143 (Arm_relocate_functions::base_abs): Fix formatting.
3144 (Arm_relocate_functions::got_prel): Fix comment. Change interface
3145 of function to use GOT entry address instead of offset.
3146 (Target_arm::Scan::global): Issue an error if a symbol would need a
3147 PLT does not get one because it is untyped. Remove code to create
3148 dynamic symbols for relative branches.
3149 (Target_arm::Relocate::relocate: Use 0 instead of false since function
3150 takes unsigned integer instead of boolean.
3151
1abce4a6
L
31522009-12-05 H.J. Lu <hongjiu.lu@intel.com>
3153
3154 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
3155 (two_file_test_LDADD): Likewise.
3156 (common_test_1_LDADD): Likewise.
3157 (exception_test_LDADD) Likewise.
3158 (weak_test_LDADD): Likewise.
3159 (many_sections_test_LDADD): Likewise.
3160 (initpri1_LDADD): Likewise.
3161 (script_test_1_LDADD): Likewise.
3162 (script_test_2_LDADD): Likewise.
3163 (justsyms_LDADD): Likewise.
3164 (binary_test_LDADD): Likewise.
3165 (large_LDADD): Likewise.
3166 * testsuite/Makefile.in: Regenerated.
3167
adcf2816 31682009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 3169
adcf2816
L
3170 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
3171 (Symbol_table::override_with_special): Likewise.
3172 (Symbol_table::add_from_object): Likewise.
3173
28e67f5d
RÁE
31742009-12-04 Rafael Avila de Espindola <espindola@google.com>
3175
3176 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
3177 Don't set the data_offset twice.
3178
ae10a101
RÁE
31792009-12-04 Rafael Avila de Espindola <espindola@google.com>
3180
3181 * testsuite/Makefile.in: Regenerate.
3182
f59f41f3
DK
31832009-12-03 Doug Kwan <dougkwan@google.com>
3184
3185 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
3186 (Target_arm::do_finalize_sections): Add parameter for symbol table
3187 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
3188 * i386.cc (Target_i386::do_finalize_sections): Add an additional
3189 parameter for symbol table pointer.
3190 * layout.cc (Layout::finalize): Call Target::finalize_sections with
3191 an additional parameter for a pointer to symbol table.
3192 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
3193 parameter for a symbol table pointer.
3194 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
3195 * target.h (Target::finalize_sections, Target::do_finalize_sections):
3196 Ditto.
3197 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
3198 parameter for a symbol table pointer.
3199
ca55d848
RÁE
32002009-12-03 Rafael Avila de Espindola <espindola@google.com>
3201
3202 * incremental.cc (Incremental_inputs_header)
3203 (Incremental_inputs_header_write, Incremental_inputs_entry)
3204 (Incremental_inputs_entry_write): Move ...
3205 * incremental.h (Incremental_inputs_header)
3206 (Incremental_inputs_header_write, Incremental_inputs_entry)
3207 (Incremental_inputs_entry_write): here.
3208
3aec4f9c
RÁE
32092009-12-02 Rafael Avila de Espindola <espindola@google.com>
3210
3211 * incremental.cc (make_sized_incremental_binary): Set the target.
3212 Error if it is incompatible.
3213 * output.h (Output_file): Add filename method.
3214
9c0ae74d
RÁE
32152009-12-02 Rafael Avila de Espindola <espindola@google.com>
3216
3217 * incremental.cc (Incremental_inputs_entry): Remove unused argument
3218 from the get_* methods.
3219
a45500ae
RÁE
32202009-12-02 Rafael Avila de Espindola <espindola@google.com>
3221
3222 * incremental-dump.cc (main): Check that the offeset of a script is 0.
3223 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
3224 Write 0 for the data_offset of scripts.
3225
325e6408
RÁE
32262009-12-02 Rafael Avila de Espindola <espindola@google.com>
3227
3228 * testsuite/Makefile.am: Add the incremental_test.sh test.
3229 * testsuite/incremental_test.sh: New.
3230 * testsuite/incremental_test_1.c: New.
3231 * testsuite/incremental_test_2.c: New.
3232
954c3e2e
RÁE
32332009-12-01 Rafael Avila de Espindola <espindola@google.com>
3234
3235 * incremental-dump.cc (main): Fix typos.
3236
f8086623
RÁE
32372009-11-27 Rafael Avila de Espindola <espindola@google.com>
3238
3239 PR gold/11025
3240 * incremental-dump.cc (main): Use llu to print 64 bit values.
3241
3b0dd6ac
L
32422009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
3243 H.J. Lu <hongjiu.lu@intel.com>
3244
3245 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
3246 $(LIBDL).
3247 (incremental_dump_LDADD): Likewise.
3248 * Makefile.in: Regenerated.
3249
a6d1ef57 32502009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 3251
a6d1ef57
DK
3252 Revert:
3253
3254 2009-11-25 Doug Kwan <dougkwan@google.com>
3255
3256 * arm.cc (Target_arm::Target_arm): Move method definition
3257 outside of class definition. Add code to handle
3258 --target1-rel, --target1-abs and --target2= options.
3259 (Target_arm::get_reloc_reloc_type): Change method to be
3260 non-static and const.
3261 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
3262 New data member declaration.
3263 (Target_arm::Scan::local, Target_arm::Scan::global,
3264 Target_arm::Relocate::relocate,
3265 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3266 Adjust call to Target_arm::get_real_reloc_type.
3267 (Target_arm::get_real_reloc_type): Use command line options
3268 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
3269 * options.h (--target1-rel, --target1-abs, --target2): New
3270 ARM-only options.
3271
50aeb7d4
DK
32722009-11-25 Doug Kwan <dougkwan@google.com>
3273
3274 * arm.cc (Target_arm::Target_arm): Move method definition outside of
3275 class definition. Add code to handle --target1-rel, --target1-abs
3276 and --target2= options.
3277 (Target_arm::get_reloc_reloc_type): Change method to be non-static
3278 and const.
3279 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
3280 member declaration.
3281 (Target_arm::Scan::local, Target_arm::Scan::global,
3282 Target_arm::Relocate::relocate,
3283 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
3284 call to Target_arm::get_real_reloc_type.
3285 (Target_arm::get_real_reloc_type): Use command line options to
3286 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
3287 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
3288 options.
3289
51938283
DK
32902009-11-25 Doug Kwan <dougkwan@google.com>
3291
3292 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
3293 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
3294 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
3295 formatting.
3296 (Arm_relocate_functions::thm_call): Replace body with a call to
3297 Arm_relocate_functions::thumb_branch_common.
3298 (Arm_relocate_functions::thm_jump24,
3299 Arm_relocate_functions::thm_xpc22): New method definitions.
3300 (Arm_relocate_functions::thumb_branch_common): New method definition.
3301 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
3302 operator.
3303 (Target_arm::Relocate::relocate): Adjust call to thm_call.
3304 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
3305
e2b8f3c4
RÁE
33062009-11-24 Rafael Avila de Espindola <espindola@google.com>
3307
3308 * Makefile.am: Build incremental-dump
3309 * Makefile.in: Regenerate.
3310 * incremental-dump.cc: New.
3311 * incremental.cc (Incremental_inputs_header_data,
3312 Incremental_inputs_entry_data): Move to incremental.h
3313 * incremental.h: (Incremental_inputs_header_data,
3314 Incremental_inputs_entry_data): Move from incremental.cc
3315
bcba9aec
RÁE
33162009-11-24 Rafael Avila de Espindola <espindola@google.com>
3317
3318 * incremental.cc (Incremental_inputs_header,
3319 Incremental_inputs_header_write, Incremental_inputs_entry,
3320 Incremental_inputs_entry_write): Add a typedef with the data type.
3321
7c3afe08
RÁE
33222009-11-24 Rafael Avila de Espindola <espindola@google.com>
3323
3324 * incremental.cc (Incremental_inputs_header,
3325 Incremental_inputs_header_write, Incremental_inputs_entry,
3326 Incremental_inputs_entry_write): Update comment about which
3327 type has the filed descriptions.
3328
d204b6e9
DK
33292009-11-15 Doug Kwan <dougkwan@google.com>
3330
3331 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
3332 (Arm_relocate_functions::arm_branch_common): Change method defintion
3333 in class definition to a method declaration and update list of formal
3334 parameters.
3335 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
3336 Arm_relocation_functions::jump24): Adjust call to
3337 Arm_relocate_functions::arm_branch_common. Update list of formal
3338 parameters.
3339 (Arm_relocate_functions::xpc25): New method definition.
3340 (Arm_relocate_functions::arm_branch_common): Move method defintion
3341 out from class definition. Use stubs for mode-switching and extending
3342 branch ranges.
3343 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
3344 specially. Change code to enable use of stubs in ARM branches.
3345
43d12afe
DK
33462009-11-10 Doug Kwan <dougkwan@google.com>
3347
3348 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
3349 in method declaration.
3350 (Target_arm::relocate_stub): New method declaration.
3351 (Target_arm::default_target): Change to return a pointer instead of
3352 a const reference.
3353 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
3354 Target_arm::default_target.
3355 (Arm_Relobj::do_relocate_sections): Remove options paramater in
3356 method definition.
3357 (Target_arm::relocate_section): Adjust view.
3358 (Target_arm::relocate_stub): New method definition.
3359
ac33a407
DK
33602009-11-10 Doug Kwan <dougkwan@google.com>
3361
3362 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
3363 a format warning.
3364 * incremental.cc (open_incremental_binary): Initialized local
3365 variables to avoid warnings.
3366 * object.cc (make_elf_object): Ditto.
3367 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
3368 a format warning.
e1df38aa 3369
88ee28e9
L
3370009-11-09 H.J. Lu <hongjiu.lu@intel.com>
3371
3372 PR gold/10930
3373 * testsuite/plugin_test.c: Include "config.h".
3374
2daedcd6
DK
33752009-11-09 Doug Kwan <dougkwan@google.com>
3376
3377 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
3378 (arm_symbol_value): Remove.
3379 (Arm_relocate_functions::arm_branch_common,
3380 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
3381 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
3382 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
3383 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
3384 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
3385 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
3386 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
3387 Arm_relocate_functions::thm_mobw_abs_nc,
3388 Arm_relocate_functions::thm_mov_abs,
3389 Arm_relocate_functions::movw_prel_nc,
3390 Arm_relocate_functions::thm_movt_abs,
3391 Arm_relocate_functions::movt_prel,
3392 Arm_relocate_functions::thm_movw_prel_nc,
3393 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
3394 (Target_arm::Relocate::relocate): Only decompose address into two
3395 parts if relocation type uses the thumb-bit and pass the actual
3396 bit instead of a flag indicating that the thumb-bit is used. Adjust
3397 calls to methods in Arm_relocate_functions for this change.
3398
1276bc89 33992009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
3400
3401 PR 10925
3402 * reloc.cc: Instantiate
3403 Sized_relobj::initialize_input_to_output_maps and
3404 Sized_relobj:free_input_to_output_maps.
3405
e53ad1b5
ILT
34062009-11-06 Ian Lance Taylor <iant@google.com>
3407
3408 PR 10876
3409 * defstd.cc (in_segment): Set only_if_ref true for "end".
3410
eb44217c
DK
34112009-11-06 Doug Kwan <dougkwan@google.com>
3412
3413 * arm.cc (class Reloc_stub): Correct a comment.
3414 (Target_arm::Target_arm): Initialize arm_input_section_map_.
3415 (Target_arm::scan_section_for_stubs): New method declaration.
3416 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
3417 Change methods from private to protected.
3418 (Target_arm::do_may_relax): New method definition.
3419 (Target_arm::do_relax, Target_arm::group_sections,
3420 Target_arm::scan_reloc_for_stub,
3421 Target_arm::scan_reloc_section_for_stubs): New method declarations.
3422 (Target_arm::arm_input_section_map_): New data member declaration.
3423 (Target_arm::scan_reloc_for_stub,
3424 Target_arm::scan_reloc_section_for_stubs,
3425 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
3426 Target_arm::do_relax): New method definitions.
3427
5d329b7d
ILT
34282009-11-06 Mikolaj Zalewski <mikolaj@google.com>
3429
3430 * configure.ac: Check for (struct stat)::st_mtim
3431 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
3432 * config.in: Regenerate.
3433 * configure: Regenerate.
3434
96a0d71b
ILT
34352009-11-05 Ian Lance Taylor <iant@google.com>
3436
3437 PR 10910
3438 * output.cc (Output_segment::add_output_section): Add missing
3439 return statement.
3440
594c8e5e
ILT
34412009-11-04 Ian Lance Taylor <iant@google.com>
3442
3443 PR 10880
3444 * object.h (class Object): Add is_needed and set_is_needed
3445 methods. Add is_needed_ field. Make bool fields into bitfields.
3446 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
3447 defined in a dynamic object and referenced by a regular object,
3448 set is_needed for the dynamic object.
3449 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
3450 if the file is marked with as_needed and it is not needed.
3451
22b127cc
ILT
34522009-11-04 Ian Lance Taylor <iant@google.com>
3453
3454 PR 10887
3455 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
3456 tags if data is discarded by linker script.
3457 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3458 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
3459 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
3460 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3461
f5c870d2
ILT
34622009-11-04 Ian Lance Taylor <iant@google.com>
3463
3464 * layout.cc (Layout::get_output_section): Add is_interp and
3465 is_dynamic_linker_section parameters. Change all callers.
3466 (Layout::choose_output_section): Likewise.
3467 (Layout::make_output_section): Likewise.
3468 (Layout::add_output_section_data): Add is_dynamic_linker_section
3469 parameter. Change all callers.
3470 * layout.h (class Layout): Update declarations.
3471 * output.h (class Output_section): Add is_interp, set_is_interp,
3472 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
3473 Add is_interp_, is_dynamic_linker_section_ fields. Change
3474 generate_code_fills_at_write_ to a bitfield.
3475 * output.cc (Output_section::Output_sections): Initialize new
3476 fields.
3477 (Output_segment::add_output_section): Add do_sort parameter.
3478 Change all callers.
3479
1ae4d23b
ILT
34802009-11-03 Ian Lance Taylor <iant@google.com>
3481
3482 PR 10860
3483 * options.h (class General_options): Add --warn-common.
3484 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
3485 merging two common symbols.
3486 (Symbol_table::should_override): Handle --warn-common when merging
3487 a common symbol with a defined symbol. Use report_resolve_problem
3488 for multiple definitions.
3489 (Symbol_table::report_resolve_problem): New function.
3490 * symtab.h (class Symbol_table): Declare report_resolve_problem.
3491
55da9579
DK
34922009-11-03 Doug Kwan <dougkwan@google.com>
3493
3494 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
3495 stub_factory_.
3496 (Target_arm::stub_factory): New method definition.
3497 (Target_arm::new_arm_input_section,
3498 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
3499 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 3500 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
3501 New type definitions.
3502 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
3503 member declarations.
3504 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
3505 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
3506 New method definitions.
3507
37a9ac43
ILT
35082009-11-03 Ian Lance Taylor <iant@google.com>
3509
3510 * options.h (class General_options): Add --warn_constructors.
3511
b3d6a3d4
ILT
35122009-11-03 Ian Lance Taylor <iant@google.com>
3513
3514 PR 10893
3515 * defstd.cc (in_section): Add entries for __rel_iplt_start,
3516 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
3517
934b01dd
ILT
35182009-11-03 Ian Lance Taylor <iant@google.com>
3519
3520 PR 10895
3521 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
3522 --msgid-bugs-address.
3523 (install-pdf): New target.
3524 (install-data_yes): Look up one directory to find mkinstalldirs.
3525
03c1939b
L
35262009-11-03 H.J. Lu <hongjiu.lu@intel.com>
3527
3528 * po/Make-in (.po.gmo): Don't generate .gmo files in source
3529 tree.
3530
ebd95253
DK
35312009-10-30 Doug Kwan <dougkwan@google.com>
3532
3533 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
3534
e9bbb538
DK
35352009-10-30 Doug Kwan <dougkwan@google.com>
3536
3537 * arm.cc (Stub_addend_reader): New struct template definition
3538 and partial specializations.
3539 (Stub_addend_reader::operator()): New method definition for a
3540 partially specialized template.
3541
d5b40221
DK
35422009-10-30 Doug Kwan <dougkwan@google.com>
3543
3544 * arm.cc (Arm_relobj::processor_specific_flags): New method
3545 definition.
3546 (Arm_relobj::do_read_symbols): New method declaration.
3547 (Arm_relobj::processor_specific_flags_): New data member declaration.
3548 (Arm_dynobj): New class definition.
3549 (Target_arm::do_finalize_sections): Add input_objects parameter.
3550 (Target_arm::do_adjust_elf_header): New method declaration.
3551 (Target_arm::are_eabi_versions_compatible,
3552 (Target_arm::merge_processor_specific_flags): New method declaration.
3553 (Target_arm::do_make_elf_object): New overloaded method definitions
3554 and declaration.
3555 (Arm_relobj::do_read_symbols): New method definition.
3556 (Arm_dynobj::do_read_symbols): Ditto.
3557 (Target_arm::do_finalize_sections): Add input_objects parameters.
3558 Merge processor-specific flags from all input objects.
3559 (Target_arm::are_eabi_versions_compatible,
3560 Target_arm::merge_processor_specific_flags,
3561 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
3562 New method definitions.
3563 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
3564 Input_objects pointer type parameter.
3565 * layout.cc (Layout::finalize): Pass input objects to target's.
3566 finalize_sections function.
3567 * output.cc (Output_file_header::do_sized_write): Set ELF file
3568 header's processor-specific flags.
3569 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
3570 Input_objects pointer type parameter.
3571 * sparc.cc (Target_sparc::do_finalize_sections): Same.
3572 * target.h (Input_objects): New forward class declaration.
3573 (Target::processor_specific_flags,
3574 Target::are_processor_specific_flags_sect): New method definitions.
3575 (Target::finalize_sections): Add input_objects parameter.
3576 (Target::Target): Initialize processor_specific_flags_ and
3577 are_processor_specific_flags_set_.
3578 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
3579 parameter.
3580 (Target::set_processor_specific_flags): New method definition.
3581 (Target::processor_specific_flags_,
3582 Target::are_processor_specific_flags_set_): New data member
3583 declarations.
3584 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
3585 Input_objects pointer type parameter.
3586
ebabffbd
DK
35872009-10-30 Doug Kwan <dougkwan@google.com>
3588
3589 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
3590
ad0f2072
ILT
35912009-10-28 Ian Lance Taylor <iant@google.com>
3592
3593 * object.h (class Relobj): Drop options parameter from
3594 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
3595 do_scan_relocs, do_relocate. Change all callers.
3596 (class Sized_relobj): Drop options parameters from
3597 do_gc_process_relocs, do_scan_relocs, do_relocate,
3598 do_relocate_sections, relocate_sections, emit_relocs_scan,
3599 emit_relocs_scan_reltype. Change all callers.
3600 (struct Relocate_info): Remove options field and all references to
3601 it.
3602 * reloc.h (class Read_relocs): Remove options constructor
3603 parameter and options_ field. Change all callers.
3604 (class Gc_process_relocs, class Scan_relocs): Likewise.
3605 (class Relocate_task): Likewise.
3606 * target-reloc.h (scan_relocs): Remove options parameter. Change
3607 all callers.
3608 (scan_relocatable_relocs): Likewise.
3609 * target.h (class Sized_target): Remove options parameter from
3610 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
3611 all callers.
3612 * gc.h (gc_process_relocs): Remove options parameter. Change all
3613 callers.
3614 * arm.cc: Update functions to remove options parameters.
3615 * i386.cc: Likewise.
3616 * powerpc.cc: Likewise.
3617 * sparc.cc: Likewise.
3618 * x86_64.cc: Likewise.
3619 * testsuite/testfile.cc: Likewise.
3620
8ffa3667
DK
36212009-10-28 Doug Kwan <dougkwan@google.com>
3622
3623 * arm.cc (Arm_relobj): New class definition.
e1df38aa 3624 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
3625 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
3626 New method definitions.
3627
40f36857
CC
36282009-10-28 Cary Coutant <ccoutant@google.com>
3629
3630 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
3631 (Plugin::cleanup_done_): New member.
3632 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
3633 (Plugin_manager::cleanup_done_): Remove.
3634 (Plugin_manager::add_input_file): Edit error message.
3635 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
3636 (Plugin_manager::cleanup): Remove use of cleanup_done_.
3637
2c849493
ILT
36382009-10-27 Mikolaj Zalewski <mikolajz@google.com>
3639
3640 * fileread.cc: (File_read::View::~View): Use the new
3641 data_ownership_ filed.
3642 (File_read::~File_read): Dispose the new whole_file_view_.
3643 (File_read::open): Mmap the whole file if needed.
3644 (File_read::open): Use whole_file_view_ instead of contents_.
3645 (File_read::find_view): Use whole_file_view_ if applicable.
3646 (File_read::do_read): Use whole_file_view_ instead of contents_.
3647 (File_read::make_view): Use whole_file_view_ instead of contents_,
3648 update File_read::View::View call.
3649 (File_read::find_or_make_view): Update File_read::View::View
3650 call.
3651 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
3652 remove contents_
3653 (File_read::View::Data_ownership): New enum.
3654 (File_read::View::View): Replace bool mapped_ with Data_ownership
3655 argument.
3656 (File_read::View::mapped_): Remove (replaced by data_ownership_).
3657 (File_read::View::data_ownership_): New field.
3658 (File_read::contents_): Remove (replaced by whole_file_view_).
3659 (File_read::whole_file_view_): New field.
3660 * options.h (class General_options): Add --keep-files-mapped.
3661
24998053
CC
36622009-10-27 Cary Coutant <ccoutant@google.com>
3663
3664 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
3665 * testsuite/Makefile.am (plugin_test_5): New test case.
3666 * testsuite/Makefile.in: Regenerate.
3667
72adc4fa
DK
36682009-10-25 Doug Kwan <dougkwan@google.com>
3669
3670 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
3671 from private to protected to allow access by child class.
3672 (Sized_relobj::do_relocate_sections): New method declaration.
3673 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 3674 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
3675 Sized_relobj::relocate_sections. Instantiate template explicitly
3676 for different target sizes and endianity.
3677
07f508a2
DK
36782009-10-24 Doug Kwan <dougkwan@google.com>
3679
3680 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
3681 (Arm_input_section::as_arm_input_section): New method.
3682 (Arm_output_section): New class definition.
3683 (Arm_output_section::create_stub_group,
3684 Arm_output_section::group_sections): New method definitions.
3685
10ad9fe5
DK
36862009-10-22 Doug Kwan <dougkwan@google.com>
3687
3688 * arm.cc (Arm_input_section): New class definition.
3689 (Arm_input_section::init, Arm_input_section:do_write,
3690 Arm_input_section::set_final_data_size,
3691 Arm_input_section::do_reset_address_and_file_offset): New method
3692 definitions.
3693
56ee5e00
DK
36942009-10-21 Doug Kwan <dougkwan@google.com>
3695
3696 * arm.cc (Stub_table, Arm_input_section): New forward class
3697 declarations.
3698 (Stub_table): New class defintion.
3699 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
3700 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
3701 New method definition.
3702
b569affa
DK
37032009-10-21 Doug Kwan <dougkwan@google.com>
3704
3705 * arm.cc: Update copyright comments.
3706 (Target_arm): New forward class template declaration.
3707 (Arm_address): New type.
3708 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
3709 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
3710 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
3711 constants.
3712 (Insn_template): Same.
3713 (DEF_STUBS): New macro.
3714 (Stub_type): New enum type.
3715 (Stub_template): New class definition.
3716 (Stub): Same.
3717 (Reloc_stub): Same.
3718 (Stub_factory): Same.
3719 (Target_arm::Target_arm): Initialize may_use_blx_ and
3720 should_force_pic_veneer_.
3721 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
3722 Target_arm::should_force_pic_veneer,
3723 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
3724 Target_arm::using_thumb_only, Target_arm:;default_target): New
3725 method defintions.
3726 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
3727 New data member declarations.
3728 (Insn_template::size, Insn_template::alignment): New method defintions.
3729 (Stub_template::Stub_template): New method definition.
3730 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
3731 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
3732 (Stub_factory::Stub_factory): New method definition.
3733 * gold.h (string_hash): New template.
3734 * output.h (Input_section_specifier::hash_value): Use
3735 gold::string_hash.
3736 (Input_section_specifier::string_hash): Remove.
3737 * stringpool.cc (Stringpool_template::string_hash): Use
3738 gold::string_hash.
3739
6c172549
DK
37402009-10-20 Doug Kwan <dougkwan@google.com>
3741
3742 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
3743 symbols of relaxed input sections.
3744 * output.h (Output_section::find_relaxed_input_section): Make
3745 method public.
3746
c5617f2f
DK
37472009-10-16 Doug Kwan <dougkwan@google.com>
3748
3749 * dynobj.cc (Versions::Versions): Initialize version_script_.
3750 Only insert base version symbol definition for a shared object
3751 if version script defines any version versions.
3752 (Versions::define_base_version): New method definition.
3753 (Versions::add_def): Check that base version is not needed.
3754 (Versions::add_need): Define base version lazily.
3755 * dynobj.h (Versions::define_base_version): New method declaration.
3756 (Versions::needs_base_version_): New data member declaration.
3757 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
3758 (check_DATA): Add no_version_test.stdout.
3759 (libno_version_test.so, no_version_test.o no_version_test.stdout):
3760 New make rules.
3761 * testsuite/Makefile.in: Regenerate.
3762 * testsuite/no_version_test.c: New file.
3763 * testsuite/no_version_test.sh: Ditto.
3764
3c12dcdb
DK
37652009-10-16 Doug Kwan <dougkwan@google.com>
3766
3767 * expression.cc (class Segment_start_expression): New class definition.
3768 (Segment_start_expression::value): New method definition.
3769 (script_exp_function_segment_start): Return a new
3770 Segment_start_expression.
3771 * gold/script-c.h (script_saw_segment_start_expression): New function
3772 prototype.
3773 * script-sections.cc (Script_sections::Script_sections): Initialize
3774 SAW_SEGMENT_START_EXPRESSION_ to false.
3775 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
3776 and -Tbbs options to specify section addresses if given in
3777 command line and no SEGMENT_START expression is seen in a script.
3778 * script-sections.h (Script_sections::saw_segment_start_expression,
3779 Script_sections::set_saw_segment_start_expression): New method
3780 definition.
3781 (Script_sections::saw_segment_start_expression_): New data member
3782 declaration.
3783 * script.cc (script_saw_segment_start_expression): New function.
3784 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
3785 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
3786 script_test_7.sh and script_test_8.sh.
3787 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
3788 script_test_8.stdout.
3789 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
3790 (script_test_6, script_test_6.stdout, script_test_7,
3791 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
3792 * Makefile.in: Regenerate.
3793 * testsuite/script_test_6.sh: New file.
3794 * testsuite/script_test_6.t: Same.
3795 * testsuite/script_test_7.sh: Same.
3796 * testsuite/script_test_7.t: Same.
3797 * testsuite/script_test_8.sh: Same.
3798
64b1ae37
DK
37992009-10-16 Doug Kwan <dougkwan@google.com>
3800
3801 * output.cc (Output_segment::set_section_list_address): Cast
3802 expressions to unsigned long long type to avoid format warnings.
3803
661be1e2
ILT
38042009-10-15 Ian Lance Taylor <iant@google.com>
3805
12edd763 3806 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 3807 dot assignment to script_sections_.
12edd763
ILT
3808 * script-sections.cc (Script_sections::add_dot_assignment):
3809 Initialize if necessary.
3810
68b6574b
ILT
3811 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
3812 program headers with no load segment if there is a linker script.
3813
661be1e2
ILT
3814 * layout.cc (Layout::set_segment_offsets): Align the file offset
3815 to the segment aligment for -N or -n with no load segment.
3816 * output.cc (Output_segment::add_output_section): Don't crash if
3817 the first section is a TLS section.
3818 (Output_segment::set_section_list_addresses): Print an error
3819 message if the address moves backward in a linker script.
3820 * script-sections.cc
3821 (Output_section_element_input::set_section_addresses): Don't
3822 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
3823 (Orphan_output_section::set_section_addresses): Likewise.
3824
f15f61a7
DK
38252009-10-15 Doug Kwan <dougkwan@google.com>
3826
3827 * layout.cc (Layout::finish_dynamic_section): Generate tags
3828 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
3829 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
3830 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
3831
82bb573a
ILT
38322009-10-14 Ian Lance Taylor <iant@google.com>
3833
3834 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
3835 fields.
3836 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
3837 data_shdr fields of relinfo.
3838 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
3839 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
3840 R_386_TLS_LDO_32, adjust based on section flags.
3841 (Target_i386::Relocate::fix_up_ldo): Remove.
3842
374ad285
ILT
38432009-10-13 Ian Lance Taylor <iant@google.com>
3844
3845 Add support for -pie.
3846 * options.h (class General_options): Add -pie and
3847 --pic-executable.
3848 (General_options::output_is_position_independent): Test -pie.
3849 (General_options::output_is_executable): Return true if not shared
3850 and not relocatable.
3851 (General_options::output_is_pie): Remove.
3852 * options.cc (General_options::finalize): Reject incompatible uses
3853 of -pie.
3854 * gold.cc (queue_middle_tasks): A -pie link is not static.
3855 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
3856 * symtab.cc (Symbol::final_value_is_known): Return false if
3857 output_is_position_independent.
3858 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
3859 output_is_position_independent.
3860 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
3861 output_is_position_independent.
3862 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
3863 output_is_position_independent.
3864 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
3865 two_file_pie_test.
3866 (basic_pie_test.o, basic_pie_test): New targets.
3867 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
3868 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
3869 (two_file_pie_test): New target.
3870 * testsuite/Makefile.in: Rebuild.
3871 * README: Remove note saying that -pie is not supported.
3872
c6585162
ILT
38732009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
3874
3875 * options.h (class General_options): Add -init and -fini.
3876 * layout.cc (Layout::finish_dynamic_section): Emit
3877 given init and fini functions.
3878
032ce4e9
ST
38792009-10-13 Sriraman Tallam <tmsriram@google.com>
3880
3881 * gc.h (gc_process_relocs): Check if icf is enabled using new
3882 function.
3883 * gold.cc (queue_initial_tasks): Likewise.
3884 (queue_middle_tasks): Likewise.
3885 * object.cc (do_layout): Likewise.
3886 * symtab.cc (is_section_folded): Likewise.
3887 * main.cc (main): Likewise.
3888 * reloc.cc (Read_relocs::run): Likewise.
3889 (Sized_relobj::do_scan_relocs): Likewise.
3890 * icf.cc (is_function_ctor_or_dtor): New function.
3891 (Icf::find_identical_sections): Check if function is ctor or dtor when
3892 safe icf is chosen.
3893 * options.h (General_options::icf): Change option to be an enum.
3894 (Icf_status): New enum.
3895 (icf_enabled): New method.
3896 (icf_safe_folding): New method.
3897 (set_icf_status): New method.
3898 (icf_status_): New variable.
3899 * (options.cc) (General_options::finalize): Set icf_status_.
3900 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
3901 icf_test and icf_keep_unique_test to use the --icf enum flag.
3902 * testsuite/icf_safe_test.sh: New file.
e1df38aa 3903 * testsuite/icf_safe_test.cc: New file.
032ce4e9 3904
f345227a
ST
39052009-10-12 Sriraman Tallam <tmsriram@google.com>
3906
3907 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
3908 includes to gc.h and icf.h.
3909 * arm.cc: Include gc.h.
3910 * gold.cc: Likewise.
3911 * i386.cc: Likewise.
3912 * powerpc.cc: Likewise.
3913 * sparc.cc: Likewise.
3914 * x86_64.cc: Likewise.
3915 * gc.h: Include icf.h.
3916
1c7814ed
ILT
39172009-10-11 Ian Lance Taylor <iant@google.com>
3918
3919 * plugin.cc: Include "gold.h" before other header files.
3920
ae3b5189
CD
39212009-10-10 Chris Demetriou <cgd@google.com>
3922
3923 * options.h (Input_file_argument::Input_file_type): New enum.
3924 (Input_file_argument::is_lib_): Replace with...
3925 (Input_file_argument::type_): New member.
3926 (Input_file_argument::Input_file_argument): Take Input_file_type
3927 'type' rather than boolean 'is_lib' as second argument.
3928 (Input_file_argument::is_lib): Use type_.
3929 (Input_file_argument::is_searched_file): New function.
3930 (Input_file_argument::may_need_search): Handle is_searched_file.
3931 * options.cc (General_options::parse_library): Support -l:filename.
3932 (General_options::parse_just_symbols): Update for Input_file_argument
3933 changes.
3934 (Command_line::process): Likewise.
3935 * archive.cc (Archive::get_file_and_offset): Likewise.
3936 * plugin.cc (Plugin_manager::release_input_file): Likewise.
3937 * script.cc (read_script_file, script_add_file): Likewise.
3938 * fileread.cc (Input_file::Input_file): Likewise.
3939 (Input_file::will_search_for): Handle is_searched_file.
3940 (Input_file::open): Likewise.
3941 * readsyms.cc (Read_symbols::get_name): Likewise.
3942 * testsuite/Makefile.am (searched_file_test): New test.
3943 * testsuite/Makefile.in: Regenerate.
3944 * testsuite/searched_file_test.cc: New file.
3945 * testsuite/searched_file_test_lib.cc: New file.
3946
f3048a1d
ILT
39472009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
3948 Ian Lance Taylor <iant@google.com>
3949
3950 * descriptor.cc: Include <cstdio> and "binary-io.h".
3951 (Descriptors::open): Open the files in binary mode always.
3952 * script.cc (Lex::get_token): Treat \r as whitespace.
3953
d4780e57
ILT
39542009-10-09 Ian Lance Taylor <iant@google.com>
3955
3956 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
3957
d9a893b8
ILT
39582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
3959 Ian Lance Taylor <iant@google.com>
3960
3961 * configure.ac: Check for readv function also.
3962 * fileread.cc (readv): Define if not HAVE_READV.
3963 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
3964 does not exist.
3965 * config.in: Regenerate.
3966 * configure: Regenerate.
3967
c0a62865
DK
39682009-10-09 Doug Kwan <dougkwan@google.com>
3969
3970 * layout.cc (Layout::make_output_section): Call target hook to make
3971 ordinary output section.
3972 (Layout::finalize): Adjust parameter list of call the
3973 Target::may_relax().
3974 * layout.h (class Layout::section_list): New method.
3975 * merge.h (Output_merge_base::entsize): Change visibility to public.
3976 (Output_merge_base::is_string, Output_merge_base::do_is_string):
3977 New methods.
3978 (Output_merge_string::do_is_string): New method.
3979 * object.cc (Sized_relobj::do_setup): renamed from
3980 Sized_relobj::set_up.
3981 * object.h (Sized_relobj::adjust_shndx,
3982 Sized_relobj::initializ_input_to_output_maps,
3983 Sized_relobj::free_input_to_output_maps): Change visibilities to
3984 protected.
3985 (Sized_relobj::setup): Virtualize.
3986 (Sized_relobj::do_setup): New method declaration.
3987 (Sized_relobj::invalidate_section_offset,
3988 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
3989 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
3990 * options.cc (parse_int): New function.
3991 * options.h (parse_int): New declaration.
3992 (DEFINE_int): New macro.
3993 (stub_group_size): New option.
3994 * output.cc (Output_section::Output_section): Initialize memebers
3995 merge_section_map_, merge_section_by_properties_map_,
3996 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
3997 (Output_section::add_input_section): Handled deferred code-fill
3998 generation and remove an old comment.
3999 (Output_section::add_relaxed_input_section): New method definition.
4000 (Output_section::add_merge_input_section): Use merge section by
4001 properties map to speed to search. Update merge section maps
4002 as appropriate.
4003 (Output_section::build_relaxation_map): New method definition.
4004 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4005 Same.
4006 (Output_section::relax_input_section): Renamed to
4007 Output_section::convert_input_sections_to_relaxed_sections and change
4008 interface to take a vector of pointers to relaxed sections.
4009 (Output_section::find_merge_section,
4010 Output_section::find_relaxed_input_section): New method definitions.
4011 (Output_section::is_input_address_mapped,
4012 Output_section::output_offset, Output_section::output_address):
4013 Use output section data maps to speed up searching.
4014 (Output_section::find_starting_output_address): Add comments.
4015 (Output_section::do_write,
4016 Output_section::write_to_postprocessing_buffer): Do code-fill
4017 generation as appropriate.
4018 (Output_section::get_input_sections): Invalidate relaxed input section
4019 map.
4020 (Output_section::restore_states): Adjust type of checkpoint .
4021 Invalidate relaxed input section map.
4022 * output.h (Output_merge_base): New class declaration.
4023 (Input_section_specifier): New class defintion.
4024 (class Output_relaxed_input_section) Change base class to
4025 Output_section_data_build.
4026 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
4027 base class initializer.
4028 (Output_section::add_relaxed_input_section): New method declaration.
4029 (Output_section::Input_section): Change visibility to protected.
4030 (Output_section::Input_section::relobj,
4031 Output_section::Input_section::shndx): Handle relaxed input sections.
4032 Output_section::input_sections) Change visibility to protected. Also
4033 define overload to return a non-const pointer.
4034 (Output_section::Merge_section_properties): New class defintion.
4035 (Output_section::Merge_section_by_properties_map,
4036 Output_section::Output_section_data_by_input_section_map,
4037 Output_section::Relaxation_map): New types.
4038 (Output_section::relax_input_section): Rename method to
4039 Output_section::convert_input_sections_to_relaxed_sections and change
4040 interface to take a vector of relaxed section pointers.
4041 (Output_section::find_merge_section,
4042 Output_section::find_relaxed_input_section,
4043 Output_section::build_relaxation_map,
4044 Output_section::convert_input_sections_in_list_to_relaxed_sections):
4045 New method declarations.
4046 (Output_section::merge_section_map_
4047 Output_section::merge_section_by_properties_map_,
4048 Output_section::relaxed_input_section_map_,
4049 Output_section::is_relaxed_input_section_map_valid_,
4050 Output_section::generate_code_fills_at_write_): New data members.
4051 * script-sections.cc
4052 (Output_section_element_input::set_section_addresses): Call
4053 current_data_size and addralign methods of relaxed input sections.
4054 (Orphan_output_section::set_section_addresses): Call current_data_size
4055 and addralign methods of relaxed input sections.
4056 * symtab.cc (Symbol_table::compute_final_value): Extract template
4057 from the body of Symbol_table::sized_finalize_symbol.
4058 (Symbol_table::sized_finalized_symbol): Call
4059 Symbol_table::compute_final_value.
4060 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
4061 (Symbol_table::compute_final_value): New templated method declaration.
4062 * target.cc (Target::do_make_output_section): New method defintion.
4063 * target.h (Target::make_output_section): New method declaration.
4064 (Target::relax): Add more parameters for input objects, symbol table
4065 and layout. Adjust call to do_relax.
4066 (Target::do_make_output_section): New method declaration.
4067 (Target::do_relax): Add parameters for input objects, symbol table
4068 and layout.
4069
d446d6c4
ILT
40702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4071
4072 * pread.c: Include stdio.h.
4073
bc06c745
ILT
40742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4075
4076 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
4077 defined.
4078
75aea3d0
ILT
40792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4080
4081 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4082 Change read_shndx type to unsigned int.
4083 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
4084 int.
4085 (Sized_dwarf_line_info::read_line_mappings): Likewise.
4086 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
4087 Change read_shndx type to unsigned int.
4088 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
4089 int.
4090 (Sized_dwarf_line_info::read_line_mappings): Likewise.
4091 * layout.cc (Layout::create_symtab_sections): Cast the result of
4092 local_symcount * symsize to off_t in the gold_assert.
4093
be8fcb75
ILT
40942009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4095
4096 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
4097 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
4098 R_ARM_BASE_ABS.
4099 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
4100 (Arm_relocate_functions::thm_abs5): New function.
4101 (Arm_relocate_functions::abs12): New function.
4102 (Arm_relocate_functions::abs16): New function.
4103 (Arm_relocate_functions::base_abs): New function.
4104 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
4105 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
4106 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
4107 R_ARM_BASE_ABS.
4108 (Scan::global): Likewise.
4109 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
4110 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
4111 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
4112 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
4113 R_ARM_BASE_ABS.
4114
c2a122b6
ILT
41152009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4116
4117 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
4118 (Arm_relocate_functions::movt_prel): New function.
4119 (Arm_relocate_functions::thm_movw_prel_nc): New function.
4120 (Arm_relocate_functions::thm_movt_prel): New function.
4121 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
4122 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
4123 (Scan::global, Relocate::relocate): Likewise.
4124 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4125
c4aa1e2d
ILT
41262009-10-09 Mikolaj Zalewski <mikolajz@google.com>
4127
4128 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
4129 Incremental_checker.
4130 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
4131 unsigned int.
4132 (class Incremental_inputs_header): New class.
4133 (Incremental_inputs_header_writer): Edit comment.
4134 (Incremental_inputs_entry): New class.
4135 (Incremental_inputs_entry_writer): Edit comment.
4136 (Sized_incremental_binary::do_find_incremental_inputs_section):
4137 Add *strtab_shndx parameter, fill it.
4138 (Sized_incremental_binary::do_check_inputs): New method.
4139 (Incremental_checker::can_incrementally_link_output_file): Use
4140 Sized_incremental_binary::check_inputs.
4141 (Incremental_inputs::report_command_line): Save command line in
4142 command_line_.
4143 * incremental.h:
4144 (Incremental_binary::find_incremental_inputs_section): New
4145 method.
4146 (Incremental_binary::do_find_incremental_inputs_section): Add
4147 strtab_shndx parameter.
4148 (Incremental_binary::do_check_inputs): New pure virtual method.
4149 (Sized_incremental_binary::do_check_inputs): Declare.
4150 (Incremental_checker::Incremental_checker): Add incremental_inputs
4151 parameter, use it to initialize incremental_inputs_.
4152 (Incremental_checker::incremental_inputs_): New field.
4153 (Incremental_checker::command_line): New method.
4154 (Incremental_checker::inputs): New method.
4155 (Incremental_checker::command_line_): New field.
4156
c549a694
ILT
41572009-10-09 Mikolaj Zalewski <mikolajz@google.com>
4158
4159 * incremental.cc: Include <cstdarg> and "target-select.h".
4160 (vexplain_no_incremental): New function.
4161 (explain_no_incremental): New function.
4162 (Incremental_binary::error): New method.
4163 (Sized_incremental_binary::do_find_incremental_inputs_section): New
4164 method.
4165 (make_sized_incremental_binary): New function.
4166 (open_incremental_binary): New function.
4167 (can_incrementally_link_file): Add checks if output is ELF and has
4168 inputs section.
4169 * incremental.h: Include "elfcpp_file.h" and "output.h".
4170 (Incremental_binary): New class.
4171 (Sized_incremental_binary): New class.
4172 (open_incremental_binary): Declare.
4173 * object.cc (is_elf_object): Use
4174 elfcpp::Elf_recognizer::is_elf_file.
4175 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
4176 * output.h (Output_file::filesize): New method.
4177
fd3c5f0b
ILT
41782009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4179
4180 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
4181 New function.
4182 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
4183 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
4184 function.
4185 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
4186 function.
4187 (Arm_relocate_functions::movw_abs_nc): New function.
4188 (Arm_relocate_functions::movt_abs): New function.
4189 (Arm_relocate_functions::thm_movw_abs_nc): New function.
4190 (Arm_relocate_functions::thm_movt_abs): New function.
4191 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
4192 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
4193 (Scan::global): Likewise.
4194 (Relocate::relocate): Likewise.
4195 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4196
7f5309a5
ILT
41972009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4198
4199 * arm.cc (Arm_relocate_functions::got_prel) New function.
4200 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
4201 (Relocate::relocate): Likewise.
4202 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4203
364c7fa5
ILT
42042009-10-06 Ian Lance Taylor <iant@google.com>
4205
4206 * options.h (class General_options): Define
4207 split_stack_adjust_size parameter.
4208 * object.h (class Object): Add uses_split_stack_ and
4209 has_no_split_stack_ fields. Add uses_split_stack and
4210 has_no_split_stack accessor functions. Declare
4211 handle_split_stack_section.
4212 (class Reloc_symbol_changes): Define.
4213 (class Sized_relobj): Define Function_offsets. Declare
4214 split_stack_adjust, split_stack_adjust_reltype, and
4215 find_functions.
4216 * object.cc (Object::handle_split_stack_section): New function.
4217 (Sized_relobj::do_layout): Call handle_split_stack_section.
4218 * dynobj.cc (Sized_dynobj::do_layout): Call
4219 handle_split_stack_section.
4220 * reloc.cc (Sized_relobj::relocate_sections): Call
4221 split_stack_adjust for executable sections in split_stack
4222 objects. Pass reloc_map to relocate_section.
4223 (Sized_relobj::split_stack_adjust): New function.
4224 (Sized_relobj::split_stack_adjust_reltype): New function.
4225 (Sized_relobj::find_functions): New function.
4226 * target-reloc.h: Include "object.h".
4227 (relocate_section): Add reloc_symbol_changes parameter. Change
4228 all callers.
4229 * target.h (class Target): Add calls_non_split method. Declare
4230 do_calls_non_split virtual method. Declare match_view and
4231 set_view_to_nop.
4232 * target.cc: Include "elfcpp.h".
4233 (Target::do_calls_non_split): New function.
4234 (Target::match_view): New function.
4235 (Target::set_view_to_nop): New function.
4236 * gold.cc (queue_middle_tasks): Give an error if mixing
4237 split-stack and non-split-stack objects with -r.
4238 * i386.cc (Target_i386::relocate_section): Add
4239 reloc_symbol_changes parameter.
4240 (Target_i386::do_calls_non_split): New function.
4241 * x86_64.cc (Target_x86_64::relocate_section): Add
4242 reloc_symbol_changes parameter.
4243 (Target_x86_64::do_calls_non_split): New function.
4244 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
4245 parameter.
4246 * powerpc.cc (Target_powerpc::relocate_section): Add
4247 reloc_symbol_changes parameter.
4248 * sparc.cc (Target_sparc::relocate_section): Add
4249 reloc_symbol_changes parameter.
4250 * configure.ac: Call AM_CONDITIONAL for the default target.
4251 * configure: Rebuild.
4252 * testsuite/Makefile.am (TEST_AS): New variable.
4253 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
4254 (check_DATA): Add split_i386 and split_x86_64 files.
4255 (SPLIT_DEFSYMS): Define.
4256 (split_i386_[1234n].o): New targets.
4257 (split_i386_[124]): New targets.
4258 (split_i386_[1234r].stdout): New targets.
4259 (split_x86_64_[1234n].o): New targets.
4260 (split_x86_64_[124]): New targets.
4261 (split_x86_64_[1234r].stdout): New targets.
4262 (MOSTLYCLEANFILES): Add new executables.
4263 * testsuite/split_i386.sh: New file.
4264 * testsuite/split_x86_64.sh: New file.
4265 * testsuite/split_i386_1.s: New file.
4266 * testsuite/split_i386_2.s: New file.
4267 * testsuite/split_i386_3.s: New file.
4268 * testsuite/split_i386_4.s: New file.
4269 * testsuite/split_i386_n.s: New file.
4270 * testsuite/split_x86_64_1.s: New file.
4271 * testsuite/split_x86_64_2.s: New file.
4272 * testsuite/split_x86_64_3.s: New file.
4273 * testsuite/split_x86_64_4.s: New file.
4274 * testsuite/split_x86_64_n.s: New file.
4275 * testsuite/testfile.cc (Target_test): Update relocation_section
4276 function.
4277 * testsuite/Makefile.in: Rebuild.
4278
e8a9fcda
ILT
42792009-10-06 Ian Lance Taylor <iant@google.com>
4280
4281 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
4282 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
4283 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
4284 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
4285 the address on ldo_addrs_.
4286 (Target_i386::Relocate::fix_up_ldo): New function.
4287
e99daf92
ILT
42882009-10-06 Rafael Espindola <espindola@google.com>
4289
4290 * plugin.cc (add_input_library): New.
4291 (Plugin::load): Add add_input_library to tv.
4292 (Plugin_manager::add_input_file): Add the is_lib argument.
4293 (add_input_file): Update call to Plugin_manager::add_input_file.
4294 (add_input_library): New.
4295 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
4296
966d4097
DK
42972009-09-30 Doug Kwan <dougkwan@google.com>
4298
4299 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
4300 symbol and call Symbol::may_need_copy_reloc to determine if
4301 a copy reloc is needed.
4302 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
4303 nocopyreloc is given in command line.
4304 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
4305 given in command line.
4306 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
4307 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
4308 of the removed Target_i386::may_need_copy_reloc.
4309 * options.h (copyreloc): New option with default value false.
4310 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
4311 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
4312 instead of the removed Target_powerpc::may_need_copy_reloc.
4313 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
4314 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
4315 instead of the removed Target_sparc::may_need_copy_reloc.
4316 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
4317 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
4318 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
4319 instead of the removed Target_x86_64::may_need_copy_reloc.
4320
029ba973
ILT
43212009-09-30 Ian Lance Taylor <iant@google.com>
4322
4323 * object.h (class Object): Remove target_ field, and target,
4324 sized_target, and set_target methods.
4325 (Object::sized_target): Remove.
4326 (class Sized_relobj): Update declarations. Remove sized_target.
4327 * object.cc (Sized_relobj::setup): Remove target parameter.
4328 Change all callers.
4329 (Input_objects::add_object): Don't do anything with the target.
4330 (make_elf_sized_object): Add punconfigured parameter. Change all
4331 callers. Set or test parameter target.
4332 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
4333 Change all callers.
4334 * parameters.cc (Parameters::set_target): Change parameter type to
4335 be non-const.
4336 (Parameters::default_target): Remove.
4337 (set_parameters_target): Change parameter type to be non-const.
4338 (parameters_force_valid_target): New function.
4339 (parameters_clear_target): New function.
4340 * parameters.h (class Parameters): Update declarations. Remove
4341 default_target method. Add sized_target and clear_target
4342 methods. Change target_ to be non-const.
4343 (set_parameters_target): Update declaration.
4344 (parameters_force_valid_target): Declare.
4345 (parameters_clear_target): Declare.
4346 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
4347 as NULL if we aren't searching.
4348 (Add_symbols::run): Don't check for compatible target.
4349 * fileread.cc (Input_file::open_binary): Call
4350 parameters_force_valid_target.
4351 * gold.cc (queue_middle_tasks): Likewise.
4352 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
4353 set_target on object.
4354 * dynobj.h (class Sized_dynobj): Update declarations.
4355 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
4356 make_elf_object returns NULL.
4357 (Archive::include_member): Don't check whether object target is
4358 compatible.
4359 * output.cc (Output_section::add_input_section): Get target from
4360 parameters.
4361 (Output_section::relax_input_section): Likewise.
4362 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
4363 parameters.
4364 (Sized_relobj::do_scan_relocs): Likewise.
4365 (Sized_relobj::relocate_sections): Likewise.
4366 * resolve.cc (Symbol_table::resolve): Likewise.
4367 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
4368 parameter. Change all callers.
4369 (Symbol_table::add_from_object): Get target from parameters.
4370 (Symbol_table::add_from_relobj): Don't check object target.
4371 (Symbol_table::add_from_dynobj): Likewise.
4372 (Symbol_table::define_special_symbol): Get target from
4373 parameters.
4374 * symtab.h (class Symbol_table): Update declaration.
4375 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
4376 parameter. Change all callers. Clear parameter target.
4377 (Binary_test): Test target here.
4378 * testsuite/object_unittest.cc (gold_testsuite): Remove
4379 target_test_pointer parameter. Change all callers.
4380 (Object_test): Test target here.
4381
a6a22b83
ILT
43822009-09-26 Ian Lance Taylor <iant@google.com>
4383
4384 * testsuite/initpri1.c: Don't try to use constructor priorities if
4385 compiling with gcc before 4.3.
4386
6a8f49fe
ILT
43872009-09-22 Mikolaj Zalewski <mikolajz@google.com>
4388
4389 * testsuite/retain_symbols_file_test.sh (check_present): Change
4390 output file name to retain_symbols_file_test.stdout.
4391 (check_absent): Likewise.
4392
8c604651
CS
43932009-09-18 Craig Silverstein <csilvers@google.com>
4394
4395 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
4396 * options.cc: Include <cerrno> and <fstream>.
4397 (General_options::finalize): Parse -retain-symbols-file tag.
4398 * options.h: New flag.
4399 (General_options): New method should_retain_symbol, new
4400 variable symbols_to_retain.
4401 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
4402 should_retain_symbol map.
4403 * testsuite/Makefile.am (retain_symbols_file_test): New test.
4404 * testsuite/Makefile.in: Regenerate.
4405 * testsuite/retain_symbols_file_test.sh: New file.
4406
ca58b19f
NC
44072009-09-18 Nick Clifton <nickc@redhat.com>
4408
4409 * po/es.po: Updated Spanish translation.
4410
20e6d0d6
DK
44112009-09-17 Doug Kwan <dougkwan@google.com>
4412
4413 * debug.h (DEBUG_RELAXATION): New constant.
4414 (DEBUG_ALL): Add DEBUG_RELAXATION.
4415 (debug_string_to_enum): Add relaxation debug option.
4416 * layout.cc
4417 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
4418 Layout::Relaxation_debug_check::read_sections,
4419 Layout::Relaxation_debug_check::read_sections): New method definitions.
4420 (Layout::Layout): Initialize data members
4421 record_output_section_data_from_scrips_,
4422 script_output_section_data_list_ and relaxation_debug_check_.
4423 (Layout::save_segments, Layout::restore_segments,
4424 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
4425 Layout::relaxation_loop_body): New method definitions.
4426 (Layout::finalize): Support relaxation. Move section layout code to
4427 Layout::relaxation_loop_body.
4428 (Layout::set_asection_address_from_script): Move code for orphan
4429 section placement out.
4430 (Layout::place_orphan_sections_in_script): New method definition.
4431 * layout.h (Output_segment_headers, Output_file_header):
4432 New forward class declarations.
4433 (Layout::~Layout): Define.
4434 (Layout::new_output_section_data_from_script): New method definition.
4435 (Layout::place_orphan_sections_in_script): New method declaration.
4436 (Layout::Segment_states): New type declaration.
4437 (Layout::save_segments, Layout::restore_segments,
4438 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
4439 Layout::relaxation_loop_body): New method declarations.
4440 (Layout::Output_section_data_list): New type declaration.
4441 (Layout::Relaxation_debug_check): New class definition.
4442 (Layout::record_output_section_data_from_script_,
4443 Layout::script_output_section_data_list_, Layout::segment_states_,
4444 Layout::relaxation_debug_check_): New data members.
4445 * output.cc: (Output_section_headers::do_size): New method definition.
4446 (Output_section_headers::Output_section_headers): Move size
4447 computation to Output_section_headers::do_size.
4448 (Output_segment_headers::do_size): New method definition.
e1df38aa 4449 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
4450 Output_file_header::do_size and call it.
4451 (Output_file_header::do_size): New method definition.
4452 (Output_data_group::Output_data_group): Adjust call to
4453 Output_section_data.
4454 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
4455 (Output_symtab_xindex::do_write): Add array bound check.
4456 (Output_section::Input_section::print_to_mapfile): Handle
4457 RELAXED_INPUT_SECTION_CODE.
4458 (Output_section::Output_section): Initialize data member checkpoint_.
4459 (Output_section::~Output_section): Delete checkpoint object pointed
4460 by checkpoint_.
4461 (Output_section::add_input_section): Always add an Input_section if
4462 relaxing.
4463 (Output_section::add_merge_input_section): Add assert.
4464 (Output_section::relax_input_section): New method definition.
4465 (Output_section::set_final_data_size): Set load address to zero for
4466 an unallocated section.
4467 (Output_section::do_address_and_file_offset_have_reset_values):
4468 New method definition.
4469 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
4470 Handle relaxed input section.
4471 (Output_section::sort_attached_input_sections): Checkpoint input
4472 section list lazily.
4473 (Output_section::get_input_sections): Change type of input_sections to
4474 list of Simple_input_section pointers. Checkpoint input section list
4475 lazily. Also handle relaxed input sections.
4476 (Output_section::add_input_section_for_script): Take a reference to
4477 a Simple_input_section object instead of Relobj pointer and section
4478 index as parameter. Handle relaxed input sections.
4479 (Output_section::save_states, Output_section::restore_states): New
4480 method definitions.
4481 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
4482 (Output_data::is_data_size_fixed): New method definition.
4483 (Output_data::reset_addresss_and_file_offset): Do not reset data size
4484 if it is fixed.
4485 (Output_data::address_and_file_offset_have_reset_values): New method
4486 definition.
4487 (Output_data::do_address_and_file_offset_have_reset_values): New method
4488 definition.
4489 (Output_data::set_data_size): Check that data size is not fixed.
4490 (Output_data::fix_data_size): New method definition.
4491 (Output_data::is_data_size_fixed_): New data member.
4492 (Output_section_headers::set_final_data_size): New method definition.
4493 (Output_section_headers::do_size): New method declaration.
4494 (Output_segment_headers::set_final_data_size): New method definition.
4495 (Output_segment_headers::do_size): New method declaration.
4496 (Output_file_header::set_final_data_size)::New method definition.
4497 (Output_file_header::do_size)::New method declaration.
4498 (Output_section_data::Output_section_data): Add new parameter
4499 is_data_size_fixed and use it to fix data size.
4500 (Output_data_const::Output_data_const): Adjust call to base class
4501 constructor and fix data size.
4502 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
4503 base class constructor and fix data size.
4504 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
4505 base class constructor and fix data size.
4506 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
4507 class constructor and fix data size.
4508 (Output_data_group::set_final_data_size): New method definition.
4509 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
4510 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
4511 class constructor and fix data size.
4512 (Output_relaxed_input_section): New class definition.
4513 (Output_section::Simple_input_section): New class definition.
4514 (Output_section::get_input_sections): Adjust parameter list.
4515 (Output_section::add_input_section_for_script): Same.
4516 (Output_section::save_states, Output_section::restore_states,
4517 Output_section::do_address_and_file_offset_have_reset_values,
4518 (Output_section::Input_section::Input_section): Handle
4519 RELAXED_INPUT_SECTION_CODE. Add new overload for
4520 Output_relaxed_input_section.
4521 (Output_section::Input_section::is_input_section,
4522 Output_section::Input_section::set_output_section): Handle relaxed
4523 input section.
4524 (Output_section::Input_section::is_relaxed_input_section,
4525 Output_section::Input_section::output_section_data,
4526 Output_section::Input_section::relaxed_input_section): New method
4527 definitions.
4528 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
4529 value.
4530 (Output_section::Input_section::u1_): Update comments.
4531 (Output_section::Input_section::u2_): Add new union member poris.
4532 (Output_section::Checkpoint_output_section): New classs definition.
4533 (Output_section::relax_input_section): New method declaration.
4534 (Output_section::checkpoint_): New data member.
4535 (Output_segment): Update comments.
4536 (Output_segment::Output_segment): Un-privatize copy constructor.
4537 (Output_segment::operator=): Un-privatize.
4538 * script-sections.cc (Output_section_element::Input_section_list):
4539 Change element type to Output_section::Simple_input_section.
4540 (Output_section_element_dot_assignment::set_section_addresses):
4541 Register output section data for relaxation clean up.
4542 (Output_data_exression::Output_data_expression): Adjust call to base
4543 constructor to fix data size.
4544 (Output_section_element_data::set_section_addresses): Register
4545 Output_data_expression object for relaxation clean up.
4546 (struct Input_section_info): Replace Relobj pointer and section index
4547 pair with Output_section::Simple_input_section and Convert struct to a
4548 class.
4549 (Input_section_sorter::operator()): Adjust access to
e1df38aa 4550 Input_section_info data member to use accessors.
20e6d0d6
DK
4551 (Output_section_element_input::set_section_addresses): Use layout
4552 parameter. Adjust code to use Output_section::Simple_input_section
4553 and Input_secction_info classes. Register filler for relaxation
4554 clean up.
4555 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
4556 and section index pair with Output_section::Simple_input_section
4557 class. Adjust code accordingly.
4558 (Phdrs_element::release_segment): New method definition.
4559 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
4560 segment list.
4561 (Script_sections::release_segments): New method definition.
4562 * gold/script-sections.h (Script_sections::release_segments): New
4563 method declaration.
4564 * gold/target.h (Target::may_relax, Target::relax,
4565 Target::do_may_relax, Target::do_relax): New method definitions.
4566
5e445df6
ILT
45672009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4568
4569 * arm.cc (has_signed_unsigned_overflow): New function.
4570 (Arm_relocate_functions::abs8): New function.
4571 (Target_arm::Scan::local): Handle R_ARM_ABS8.
4572 (Target_arm::Scan::global): Likewise.
4573 (Target_arm::relocate::relocate): Likewise.
4574 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4575 Likewise.
4576
8c604651 45772009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
4578
4579 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
4580 * testsuite/Makefile.in: Regenerate.
4581
1e9cc1c2
NC
45822009-09-11 Nick Clifton <nickc@redhat.com>
4583
4584 * po/gold.pot: Updated by the Translation project.
4585
6a89f575
CC
45862009-09-08 Cary Coutant <ccoutant@google.com>
4587
4588 * output.cc (Output_file::open): Add execute permission to empty file.
4589 * testsuite/Makefile.am (permission_test): New test.
4590 * testsuite/Makefile.in: Regenerate.
4591
fdcac5af
ILT
45922009-09-02 Ian Lance Taylor <iant@google.com>
4593
4594 * output.cc (Output_file::resize): Call map_no_anonymous rather
4595 than map.
4596
44453f85
ILT
45972009-09-01 Mikolaj Zalewski <mikolajz@google.com>
4598
4599 * gold.cc: Include "incremental.h".
4600 (queue_initial_tasks): Call Incremental_checker methods.
4601 * incremental.cc: Include "output.h".
4602 (Incremental_checker::can_incrementally_link_output_file): New
4603 method.
4604 * incremental.h (Incremental_checker): New class.
4605
4606 * output.cc (Output_file::open_for_modification): New method.
4607 (Output_file::map_anonymous): Changed return type to bool. Record
4608 map in base_ field.
4609 (Output_file::map_no_anonymous): New method, broken out of map.
4610 (Output_file::map): Use map_no_anonymous and map_anonymous.
4611 * output.h (class Output_file): Update declarations.
4612
293c1386
CC
46132009-08-24 Cary Coutant <ccoutant@google.com>
4614
4615 * options.h (Command_line::Pre_options): New class.
4616 (Command_line::pre_options): New member.
4617 * options.cc (gold::options::ready_to_register): New variable.
4618 (One_option::register_option): Do nothing if not registering options.
4619 Assert if same short option registered twice.
4620 (General_options::General_options): Turn off option registration when
4621 done constructing.
4622 (Command_line::Pre_options::Pre_options): New constructor.
4623
f773f3d2
CC
46242009-08-24 Cary Coutant <ccoutant@google.com>
4625
06a73cfe
CC
4626 * options.h (General_options::no_keep_memory): Remove incorrect
4627 short option.
f773f3d2 4628
a15af8e2
RW
46292009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4630
4631 * Makefile.am (am__skiplex, am__skipyacc): New.
4632 * Makefile.in: Regenerate.
4633
c462b41b
RW
46342009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4635
14ec8efd
RW
4636 * Makefile.am (AM_CPPFLAGS): Renamed from ...
4637 (INCLUDES): ... this.
4638 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
4639 (AM_CPPFLAGS): Renamed from ...
4640 (INCLUDE): ... this.
4641 * Makefile.in, testsuite/Makefile.in: Regenerate.
4642
81ecdfbb
RW
4643 * Makefile.in: Regenerate.
4644 * aclocal.m4: Likewise.
4645 * config.in: Likewise.
4646 * configure: Likewise.
4647 * testsuite/Makefile.in: Likewise.
4648
c462b41b
RW
4649 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
4650 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
4651 * Makefile.in: Regenerate.
4652 * testsuite/Makefile.in: Regenerate.
4653
2da73f13
CC
46542009-08-19 Cary Coutant <ccoutant@google.com>
4655
4656 * resolve.cc (Symbol_table::resolve): Don't complain about defined
4657 symbols in shared libraries overridden by hidden or internal symbols
4658 in the main program.
4659
2db70501
CD
46602009-08-19 Chris Demetriou <cgd@google.com>
4661
4662 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
4663 checking source file names in error messages.
4664
f733487b
DK
46652009-08-18 Doug Kwan <dougkwan@google.com>
4666
4667 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
4668 an elcpp::Ehdr as parameter. Adjust call to set_target.
4669 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
4670 an elfcpp::Ehdr as parameter.
4671 * object.cc (Object::set_target): Remove the version that looks up
4672 a target and sets it.
4673 (Sized_relobj::setup): Take a Target object instead of
4674 an elfcpp::Ehdr as parameter. Adjust call to set_target.
4675 (make_elf_sized_object): Find target and ask target to
4676 make an ELF object.
4677 * object.h: (Object::set_target): Remove the version that looks up
4678 a target and sets it.
4679 (Sized_relobj::setup): Take a Target object instead of
4680 an elfcpp:Ehdr as parameter.
4681 * target.cc: Include dynobj.h.
4682 (Target::do_make_elf_object_implementation): New.
4683 (Target::do_make_elf_object): New.
4684 * target.h (Target::make_elf_object): New template declaration.
4685 (Target::do_make_elf_object): New method declarations.
4686 (Target::do_make_elf_object_implementation): New template declaration.
4687
cc70f101
ILT
46882009-08-14 Ian Lance Taylor <iant@google.com>
4689
4690 * gold.h (FUNCTION_NAME): Define.
4691 (gold_unreachable): Use FUNCTION_NAME.
4692
ef5e0cb1
ST
46932009-08-12 Sriraman Tallam <tmsriram@google.com>
4694
4695 * icf.cc (Icf::find_identical_sections): Issue a warning when a
4696 symbol in the --keep-unique list is not found.
4697
48c187ce
ST
46982009-08-12 Sriraman Tallam <tmsriram@google.com>
4699
4700 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
4701 been maked as --keep-unique.
4702 (Icf::unfold_section): New function.
4703 * icf.h (Icf::unfold_section): New function.
4704 * options.h (General_options::keep_unique): New option.
4705 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
4706 * testsuite/Makefile.in: Regenerate.
4707 * testsuite/icf_keep_unique_test.sh: New file.
4708 * testsuite/icf_keep_unique_test.cc: New file.
4709
645afe0c
CC
47102009-08-12 Cary Coutant <ccoutant@google.com>
4711
4712 PR 10471
4713 * resolve.cc (Symbol_table::resolve): Check for references from
4714 dynamic objects to hidden and internal symbols.
4715 * testsuite/Makefile.am (hidden_test.sh): New test.
4716 * testsuite/Makefile.in: Regenerate.
4717 * testsuite/hidden_test.sh: New script.
4718 * testsuite/hidden_test_1.c: New test source.
4719 * testsuite/hidden_test_main.c: New test source.
4720
11af873f
DK
47212009-08-11 Doug Kwan <dougkwan@google.com>
4722
4723 * arm.cc: Update comments.
4724 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
4725 segment to locate the .ARM.exidx section if present.
4726
b9f7d72d
DK
47272009-08-09 Doug Kwan <dougkwan@google.com>
4728
4729 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
4730 patch.
4731
ddd3c53c
ST
47322009-08-07 Sriraman Tallam <tmsriram@google.com>
4733 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
4734 compiler warnings.
4735
27721062
ST
47362009-08-06 Sriraman Tallam <tmsriram@google.com>
4737
4738 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
4739 valid tls_segment only for non-debug-section relocations.
4740 * testsuite/Makefile.am: Add gc_tls_test.
4741 * testsuite/Makefile.in: Regenerate.
4742 * testsuite/gc_tls_test.cc: New file.
4743 * testsuite/gc_tls_test.sh: New file.
4744
ef15dade 47452009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 4746
ef15dade
ST
4747 * icf.cc: New file.
4748 * icf.h: New file.
4749 * Makefile.am (CCFILES): Add icf.cc.
4750 (HFILES): Add icf.h
4751 * Makefile.in: Regenerate.
4752 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
4753 * gc.h (gc_process_relocs): Populate lists used by icf to contain
4754 section, symbol and addend information for the relocs.
4755 * gold.cc (queue_middle_tasks): Call identical code folding.
4756 * gold.h: Add defines for multimap.
4757 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
4758 to the call of finalize_local_symbols.
4759 * main.cc (main): Create object of class Icf.
4760 * object.cc (Sized_relobj::do_layout): Allow this function to be
4761 called twice during icf.
4762 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
4763 to sections marked as identical by icf.
4764 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
4765 when available.
4766 (Sized_relobj::do_section_entsize): New function.
4767 * object.h (Object::section_entsize): New function.
4768 (Object::do_section_entsize): New pure virtual function.
4769 (Relobj::finalize_local_symbols): Add new parameter.
4770 (Relobj::do_section_entsize): New function.
4771 * options.h (General_options::icf): New option.
4772 (General_options::icf_iterations): New option.
4773 (General_options::print_icf_sections): New option.
4774 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
4775 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
4776 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
4777 icf.
4778 * symtab.cc (Symbol_table::is_section_folded): New function.
4779 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
4780 to sections marked as identical by icf.
4781 * symtab.h (Symbol_table::set_icf): New function.
4782 (Symbol_table::icf): New function.
4783 (Symbol_table::is_section_folded): New function.
4784 (Symbol_table::icf_): New data member.
4785 * target-reloc.h (relocate_section): Ignore sections folded by icf.
4786 * testsuite/Makefile.am: Add commands to build icf_test.
4787 * testsuite/Makefile.in: Regenerate.
4788 * testsuite/icf_test.sh: New file.
4789 * testsuite/icf_test.cc: New file.
4790
c3b65ac4
CD
47912009-07-24 Chris Demetriou <cgd@google.com>
4792
4793 * layout.cc (is_compressible_debug_section): Fix incorrect
4794 comment about compressed section names.
4795
1caf2c51
ILT
47962009-07-20 Ian Lance Taylor <ian@airs.com>
4797
4798 PR 10419
4799 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
4800
1ef4d87f
ILT
48012009-07-16 Ian Lance Taylor <iant@google.com>
4802
4803 PR 10400
4804 * layout.h: #include <map>.
4805 (class Kept_section): Change from struct to class. Add accessors
4806 and setters. Add section size to Comdat_group mapping. Change
4807 Comdat_group to std::map. Add is_comdat_ field. Add
4808 linkonce_size field in union.
4809 (class Layout): Update declaration of find_or_add_kept_section.
4810 Don't declare find_kept_object.
4811 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
4812 parameter. Add object, shndx, is_comdat, and is_group_name
4813 parameters. Change all callers. Adjust for new Kept_section.
4814 (Layout::find_kept_object): Remove.
4815 * object.cc (Sized_relobj::include_section_group): Update use of
4816 Kept_section. Rename secnum to shndx. Only record
4817 Kept_comdat_section if sections are the same size.
4818 (Sized_relobj::include_linkonce_section): Update use of
4819 Kept_section. Only record Kept_comdat_section if sections are the
4820 same size. Set size of linkonce section.
4821 (Sized_relobj::map_to_kept_section): Update call to
4822 get_kept_comdat_section.
4823 * object.h (class Sized_relobj): Rename fields in
4824 Kept_comdat_section to drop trailing underscores; change object
4825 field to Relobj*. Change Kept_comdat_section_table to store
4826 struct rather than pointer.
4827 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
4828 Add kept_object and kept_shndx parameters. Change all callers.
4829 (Sized_relobj::get_kept_comdat_section): Change return type to
4830 bool. Add kept_object and kept_shndx parameters. Change all
4831 callers.
4832 * plugin.cc (Pluginobj::include_comdat_group): Update call to
4833 Layout::find_or_add_kept_section.
4834
37c3b7b0
ILT
48352009-07-09 Ian Lance Taylor <iant@google.com>
4836
4837 * merge.cc (Object_merge_map::initialize_input_to_output_map):
4838 Reserve space in the hash table.
4839
98fa85cb
ILT
48402009-07-06 Mikolaj Zalewski <mikolajz@google.com>
4841
4842 * fileread.cc (File_read::get_mtime): New method.
4843 * fileread.h (Timespec): New structure.
4844 (File_read::get_mtime): New method.
4845 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
4846 Renamed from timestamp_nsec.
4847 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
4848 Elf_Xword.
e1df38aa 4849 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 4850 timestamp_nsec.
e1df38aa 4851 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
4852 (Incremental_inputs::report_obejct): Save mtime; style fix.
4853 (Incremental_inputs::report_script): Save mtime; style fix.
4854 (Incremental_inputs::finalize_inputs): Style fix.
4855 (Incremental_inputs::finalize): Style fix.
4856 (Incremental_inputs::create_input_section_data): Store inputs
4857 mtime.
4858 * incremental.h (Incremental_inputs::report_script): Add mtime
4859 argument.
4860 (Incremental_inputs::Input_info::Input_info): Intialize only one
4861 union member.
4862 (Incremental_inputs::Input_info::archive): Move to nameless
4863 union.
4864 (Incremental_inputs::Input_info::obejct): Move to nameless union.
4865 (Incremental_inputs::Input_info::script): Move to nameless union.
4866 (Incremental_inputs::mtime): New field.
4867 * script.cc (read_input_script): Pass file mtime to
4868 Incremental_input.
4869 * script.h (Script_info::inputs): Style fix.
4870
c9d70757
ILT
48712009-07-01 Ian Lance Taylor <ian@airs.com>
4872
4873 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
4874 instead of 32.
4875
9c547ec3
ILT
48762009-06-24 Ian Lance Taylor <iant@google.com>
4877
4878 PR 10156
4879 * layout.cc (Layout::choose_output_section): If we find an
4880 existing section, update the flags.
4881 (Layout::create_notes): New function, broken out of
4882 Layout::finalize.
4883 (Layout::finalize): Don't create note sections.
4884 (Layout::create_note): Don't crash if linker script discards
4885 section.
4886 (Layout::create_gold_note): Likewise.
4887 (Layout::create_build_id): Likewise. Don't set
4888 after_input_sections on the section.
4889 (Layout::create_executable_stack_info): Remove target parameter.
4890 Change caller.
4891 * layout.h (class Layout): Declare create_notes. Update
4892 declaration of create_executable_stack_info.
4893 * gold.cc (queue_middle_tasks): Call create_notes.
4894 * output.cc (Output_section::update_flags_for_input_section): Move
4895 here from output.h. If SHF_ALLOC flag is newly set, mark address
4896 invalid.
4897 * output.h (Output_data::mark_address_invalid): New function.
4898 (class Output_section): Only declare, not define,
4899 update_flags_for_input_section. Remove set_flags.
4900
55458500
ILT
49012009-06-24 Ian Lance Taylor <iant@google.com>
4902
4903 * script-sections.cc (Output_section_definition::
4904 set_section_addresses): Rename shadowing local load_address to
4905 laddr.
4906
1307d6cd
ILT
49072009-06-24 Ian Lance Taylor <iant@google.com>
4908
4909 PR 10244
4910 * reloc.cc (relocate_sections): Skip empty relocation sections.
4911
ec3f783e
ILT
49122009-06-23 Ian Lance Taylor <iant@google.com>
4913
4914 PR 10156
4915 * layout.cc (Layout::create_note): Use choose_output_section
4916 rather than make_output_section.
4917
459c9f1c
ILT
49182009-06-23 Ian Lance Taylor <iant@google.com>
4919
4920 PR 10237
4921 * options.cc (General_options::parse_V): Set printed_version_.
4922 (General_options::General_options): Initialize printed_version_.
4923 * options.h (class General_options): Add printed_version_ field.
4924 * gold.cc (queue_initial_tasks): If there are no input files,
4925 don't give a fatal error if we printed the version information.
4926 (queue_middle_tasks): If using -r with a shared object, give a
4927 fatal error rather than an ordinary error.
4928
1518dc8f
ILT
49292009-06-23 Ian Lance Taylor <iant@google.com>
4930
4931 PR 10219
4932 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
4933 (Layout::make_output_section): Set have_stabstr_section_ if we see
4934 a .stab*str section.
4935 (Layout::finalize): Call link_stabs_sections.
4936 (Layout::link_stabs_sections): New file.
4937 * layout.h (class Layout): Add have_stabstr_section_ field.
4938 Declare link_stabs_sections.
4939
3d857b98
DK
49402009-06-23 Doug Kwan <dougkwan@google.com>
4941
4942 * Makefile.am (libgold_a_LIBADD): New.
4943 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
4944 * Makefile.in: Regenerate.
4945 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
4946 * configure: Regenerate.
4947 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
4948 * fileread.cc: Include sys/state.h
4949 * gold.h: Declare memmem and strndup if found missing.
4950 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
4951
0639a6f6
ILT
49522009-06-23 Ian Lance Taylor <iant@google.com>
4953
4954 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
4955 * configure: Rebuild.
4956
8d63875c
ILT
49572009-06-23 Ian Lance Taylor <iant@google.com>
4958
4959 PR 10147
4960 * object.cc (Object::section_contents): Don't try to get a view if
4961 the section has length zero.
4962 (Object::handle_gnu_warning_section): If the section is empty, use
4963 the name of the section as the warning.
4964
f7c8a183
ILT
49652009-06-23 Ian Lance Taylor <iant@google.com>
4966
4967 PR 10133
4968 * stringpool.h (class Stringpool_template): Add optimize_ field.
4969 (Stringpool_template::set_optimize): New function.
4970 * stringpool.cc (Stringpool_template::Stringpool_template):
4971 Initialize optimize_ field.
4972 (Stringpool_template::set_string_offsets): Test local optimize
4973 fild rather than parameter.
4974 * layout.cc (Layout::Layout): Call set_optimize on the section
4975 name stringpool.
4976
e6a307ba
ILT
49772009-06-22 Ian Lance Taylor <iant@google.com>
4978
4979 PR 10030
4980 * yyscript.y: Parse TARGET.
4981 * script.cc (script_set_target): New function.
4982 * script-c.h (script_set_target): Declare.
4983 * options.cc (General_options::string_to_object_format): Rename
4984 from string_to_object_format in anonymous namespace. Change
4985 callers.
4986 * options.h (class General_options): Declare
4987 string_to_object_format.
4988
3ee173de
ILT
49892009-06-22 Ian Lance Taylor <iant@google.com>
4990
4991 * script-sections.cc (Script_sections::create_segments): Don't put
4992 program headers in a PT_LOAD segment if -n or -N.
4993
49942009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
4995
4996 PR 10141
4997 * options.h (class General_options): Add -z lazy and -z now. Sort
4998 -z options into alphabetical order.
4999 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
5000
cd6739a1 50012009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
5002
5003 * layout.cc (Layout::make_output_section): Call
5004 Target::new_output_section.
5005 (Layout::attach_allocated_section_to_segment): Put large section
5006 sections in a separate load segment with the large segment flag
5007 set.
5008 (Layout::segment_precedes): Sort large data segments after other
5009 load segments.
5010 (align_file_offset): New static function.
5011 (Layout::set_segment_offsets): Use align_file_offset.
5012 * output.h (class Output_section): Add is_small_section_ and
5013 is_large_section_ fields.
5014 (Output_section::is_small_section): New function.
5015 (Output_section::set_is_small_section): New function.
5016 (Output_section::is_large_section): New function.
5017 (Output_section::set_is_large_section): New function.
5018 (Output_section::is_large_data_section): New function.
5019 (class Output_segment): Add is_large_data_segment_ field.
5020 (Output_segment::is_large_data_segment): New function.
5021 (Output_segment::set_is_large_data_segment): New function.
5022 * output.cc (Output_section::Output_section): Initialize new
5023 fields.
5024 (Output_segment::Output_segment): Likewise.
5025 (Output_segment::add_output_section): Add assertion that large
5026 data sections always go in large data segments. Force small data
5027 sections to the end of the list of data sections. Force small BSS
5028 sections to the start of the list of BSS sections. For large BSS
5029 sections to the end of the list of BSS sections.
5030 * symtab.h (class Symbol): Declare is_common_shndx.
5031 (Symbol::is_defined): Check Symbol::is_common_shndx.
5032 (Symbol::is_common): Likewise.
5033 (class Symbol_table): Define enum Commons_section_type. Update
5034 declarations. Add small_commons_ and large_commons_ fields.
5035 * symtab.cc (Symbol::is_common_shndx): New function.
5036 (Symbol_table::Symbol_table): Initialize new fields.
5037 (Symbol_table::add_from_object): Put small and large common
5038 symbols in the right list.
5039 (Symbol_table::sized_finalized_symbol): Check
5040 Symbol::is_common_shndx.
5041 (Symbol_table::sized_write_globals): Likewise.
5042 * common.cc (Symbol_table::do_allocate_commons): Allocate new
5043 common symbol lists. Don't call do_allocate_commons_list if the
5044 list is empty.
5045 (Symbol_table::do_allocate_commons_list): Remove is_tls
5046 parameter. Add comons_section_type parameter. Change all
5047 callers. Handle small and large common symbols.
5048 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
5049 Symbol::is_common_shndx.
5050 * resolve.cc (symbol_to_bits): Likewise.
5051 * target.h (Target::small_common_shndx): New function.
5052 (Target::small_common_section_flags): New function.
5053 (Target::large_common_shndx): New function.
5054 (Target::large_common_section_flags): New function.
5055 (Target::new_output_section): New function.
5056 (Target::Target_info): Add small_common_shndx, large_common_shndx,
5057 small_common_section_flags, and large_common_section_flags
5058 fields.
5059 (Target::do_new_output_section): New virtual function.
5060 * arm.cc (Target_arm::arm_info): Initialize new fields.
5061 * i386.cc (Target_i386::i386_info): Likewise.
5062 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5063 Likewise.
5064 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
5065 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5066 (Target_x86_64::do_new_output_section): New function.
5067 * configure.ac: Define conditional MCMODEL_MEDIUM.
5068 * testsuite/Makefile.am (check_PROGRAMS): Add large.
5069 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
5070 (large_LDFLAGS): Define.
5071 * testsuite/large.c: New file.
5072 * testsuite/testfile.cc (Target_test::test_target_info):
5073 Initialize new fields.
5074 * configure, testsuite/Makefile.in: Rebuild.
5075
bb04269c
DK
50762009-06-05 Doug Kwan <dougkwan@google.com>
5077
5078 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 5079 * Makefile.in: Regenerate.
bb04269c
DK
5080 * i386.cc (class Target_i386): Define new virtual method to
5081 override do_is_local_label_name in parent.
5082 * object.cc (Sized_relobj::do_count_local_symbols): Discard
5083 local symbols if --discard-locals or -X is given.
5084 * options.h (class General_options): Declare new options
5085 '--discard-locals' and '-X' for discarding locals.
5086 * target.h (class Target): Define new methods is_local_label_name.
5087 Declare new virtual method do_is_local_label_name.
5088 * target.cc: New file.
5089 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
5090 (check_SCRIPTS): Add discard_locals_test.sh.
5091 (check_DATA): Add discard_local_tests.syms.
5092 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
5093 (discard_local_tests.syms, discard_locals_test.o): New make rules.
5094 * testsuite/Makefile.in: Regenerate.
5095 * testsuite/discard_locals_test.c: New file.
5096 * testsuite/discard_locals_test.sh: Same.
5097
805bb01c
DK
50982009-06-05 Doug Kwan <dougkwan@google.com>
5099
5100 * object.cc (Sized_relobj::Sized_relobj): Initialize
5101 discarded_eh_frame_shndx_ to -1U.
5102 (Sized_relobj::do_layout): Record index of a discard .eh_frame
5103 section.
5104 (Sized_relobj::do_count_local_symbols): Skip local symbols in
5105 a discarded .eh_frame section.
5106 (Sized_relobj::do_finalize_local_symbols): Ditto.
5107 * object.h (class Sized_relobj): Declare new member
5108 discarded_eh_frame_shndx_.
5109 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
5110 (local_labels_test.o, local_labels_test): New rules.
5111 * testsuite/Makefile.in: Regenerate.
5112
1dcd334d
DK
51132009-06-04 Doug Kwan <dougkwan@google.com>
5114
5115 * layout.cc (Layout::section_name_mapping): Add mapping for
5116 special ARM sections.
5117
96d49306
DK
51182009-06-03 Doug Kwan <dougkwan@google.com>
5119
5120 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
5121 (utils::has_overflow): Same.
5122
dff16297
ILT
51232009-06-03 Ian Lance Taylor <iant@google.com>
5124
5125 * layout.cc (Layout::section_name_mapping): New array, replacing
5126 Layout::linkonce_mapping.
5127 (Layout::section_name_mapping_count): New variable, replacing
5128 Layout::linkonce_mapping_count.
5129 (Layout::linkonce_output_name): Remove.
5130 (Layout::output_section_name): Rewrite.
5131 * layout.h (class Layout): Rename Linkonce_mapping to
5132 Section_name_mapping, linkonce_mapping to section_name_mapping,
5133 linkonce_mapping_count to section_name_mapping_count. Don't
5134 declare linkonce_output_name.
5135
c121c671
DK
51362009-06-03 Doug Kwan <dougkwan@google.com>
5137
5138 * gold/arm.cc (namespace utils): New.
5139 (Target_arm::reloc_is_non_pic): Define new method.
5140 (class Arm_relocate_functions): New.
5141 (Target_arm::Relocate::relocate): Handle relocation types used by
5142 Android.
5143
07800fab
ILT
51442009-06-03 Ian Lance Taylor <iant@google.com>
5145
5146 * arm.cc (Target_arm::scan::global): Use || instead of |.
5147
c121c671
DK
51482009-06-02 Doug Kwan <dougkwan@google.com>
5149
5150 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
5151 issued_non_pic_error_.
5152 (class Target_arm::Scan): Declare new method check_non_pic.
5153 Define new method symbol_needs_plt_entry.
5154 Declare new data member issued_non_pic_error_.
5155 (class Target_arm::Relocate): Declare new method
5156 should_apply_static_reloc.
5157 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
5158 (Target_arm::Scan::check_non_pic): Define new method.
5159 (Target_arm::Scan::local): Handle a small subset of reloc types used
5160 by Android.
5161 (Target_arm::Scan::local): Same.
5162 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
5163
b19b0c6d
ILT
51642009-05-31 Mikolaj Zalewski <mikolajz@google.com>
5165
5166 * incremental.cc (Incremental_inputs::report_command_line): Filter
5167 out --incremental-* options.
5168
94cdfcff
DK
51692009-05-29 Doug Kwan <dougkwan@google.com>
5170
5171 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
5172 template class.
5173 (class Target_arm): Update comment.
5174 (Target_arm::Target_arm): Initialize new data members GOT_,
5175 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
5176 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
5177 and Target_arm::rel_dyn_section.
5178 Declare new_enum Target_arm::Got_type.
5179 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
5180 and DYNBSS_.
5181 Update commments for member do_dynsym_value.
5182 (Target_arm::got_size, Target_arm::plt_section,
5183 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
5184 new methods inside class defintion.
5185 (Target_arm::got_section): Define new method.
5186 (Target_arm::rel_dyn_section): Same.
5187 (Output_data_plt_arm): New template class.
5188 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
5189 (Output_data_plt_arm:do_adjust_output_section): Define new method.
5190 (Output_data_plt_arm::add_entry): Same.
5191 (Output_data_plt_arm::first_plt_entry): Define new
5192 static data member for PLT instruction template.
5193 (Output_data_plt_arm::plt_entry): Same.
5194 (Output_data_plt_arm::do_write): Define new method.
5195 (Target_arm::make_plt_entry): Same.
5196 (Target_arm::do_finalize_sections): Same.
5197 (Target_arm::do_dynsym_value): Same.
5198
4a657b0d
DK
51992009-05-28 Doug Kwan <dougkwan@google.com>
5200
5201 * Makefile.am (TARGETSOURCES): Add arm.cc.
5202 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
5203 * Makefile.in: Regenerate.
5204 * arm.cc: New file.
5205 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
5206
e7ae8c36
DK
52072009-05-26 Doug Kwan <dougkwan@google.com>
5208
5209 * options.cc (General_options::parse_exclude_libs). Fix a comment.
5210 (General_options::check_excluded_libs): Strip off directories in
5211 archive name before matching like GNU ld does.
5212 * testsuite/Makefile.am (MOSTLYCLEANFILES,
5213 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
5214 (exclude_libs_test_LDFLAGS): Add linker option
5215 -Wl,--exclude-libs,libexclude_libs_test_3
5216 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
5217 an explicit archive without using -l.
5218 (alt/libexclude_libs_test_3.a): New make rule.
5219 * testsuite/Makefile.in: Regenerate.
5220 * testsuite/exclude_libs_test.c : Declare lib3_default().
5221 (main): Call it.
5222 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
5223 * exclude_libs_test_3.c: New file.
5224
f12e7348
NC
52252009-05-26 Nick Clifton <nickc@redhat.com>
5226
5227 * po/id.po: New Indonesian translation.
5228 * po/gold.pot: Updated template file.
5229
4daadc0d
ST
52302009-05-22 Sriraman Tallam <tmsriram@google.com>
5231
e1df38aa 5232 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
5233 gc_comdat_test files. Add -Wl,--gc-sections to build
5234 gc_comdat_test.
5235 * testsuite/Makefile.in: Regenerate.
5236 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
5237
531813ad
ST
52382009-05-21 Sriraman Tallam <tmsriram@google.com>
5239
5240 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
5241 kept comdat section was garbage collected.
5242 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
5243 * testsuite/Makefile.in: Regenerate.
5244 * testsuite/gc_comdat_test.sh: New file.
5245 * testsuite/gc_comdat_test_1.cc: New file.
5246 * testsuite/gc_comdat_test_2.cc: New file.
5247
65514900
CC
52482009-05-19 Doug Kwan <dougkwan@google.com>
5249
5250 * archive.cc (Archive::Archive): Move constructor from archive.h
5251 to here. Initialize no_export_.
5252 (Archive::get_elf_object_for_member): Set no_export flag of object.
5253 * archive.h (Archive::Archive): Move constructor body to
5254 archive.cc.
5255 (Archive::no_export): New method.
5256 (Archive::no_export_): New field.
5257 * object.h (Object::Object): Initialize no_export_ to false.
5258 (Object::no_export, Object::set_no_export): New methods.
5259 (Object::no_export_): New field.
5260 * options.cc (General_options::parse_exclude_libs): New method.
5261 (General_options::check_excluded_libs) Same.
5262 * options.h (exclude_libs): New option.
5263 (General_options::check_excluded_libs): New method declaration.
5264 (General_options::excluded_libs_): New field.
5265 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
5266 default or protected visibility if an object has no-export flag set.
5267 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
5268 (check_SCRIPTS): Add exclude_libs_test.sh.
5269 (check_DATA): Add exclude_libs_test.syms.
5270 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
5271 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
5272 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
5273 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
5274 (exclude_libs_test.syms, libexclude_libs_test_1.a,
5275 libexclude_libs_test_2.a): New rules.
5276 * testsuite/Makefile.in: Regenerate.
5277 * testsuite/exclude_libs_test.c: New file.
5278 * testsuite/exclude_libs_test.sh: Ditto.
5279 * testsuite/exclude_libs_test_1.c: Ditto.
5280 * testsuite/exclude_libs_test_2.c: Ditto.
5281
1b77ea50
ILT
52822009-05-15 Ian Lance Taylor <iant@google.com>
5283
5284 * configure.ac: Check for declarations for cases where libiberty.h
5285 checks HAVE_DECL_xxx.
5286 * configure, config.in: Rebuild.
5287
072fe7ce
ILT
52882009-05-15 Mikolaj Zalewski <mikolajz@google.com>
5289
5290 * gold.h (Incremental_argument_list): Remove (invalid) forward
5291 declaration.
5292 * incremental.cc (Incremental_inputs::report_achive): New method.
5293 (Incremental_inputs::report_object): New method.
5294 (Incremental_inputs::report_script): New method.
5295 (Incremental_inputs::finalize_inputs): New method.
5296 (Incremental_inputs::finalize): Call finalize_inputs().
5297 (Incremental_inputs::sized_create_incremental_inputs_section_data):
5298 Create inputs entries.
5299 * incremental.h (Incremental_input_type): New enum.
5300 (Incremental_inputs::Incremental_input): Initialize new fields.
5301 (Incremental_inputs::report_inputs): New method.
5302 (Incremental_inputs::report_achive): New method.
5303 (Incremental_inputs::report_object): New method.
5304 (Incremental_inputs::report_script): New method.
5305 (Incremental_inputs::finalize_inputs): New method.
5306 (Incremental_inputs::Input_info): New struct.
5307 (Incremental_inputs::Input_info_map): New typedef.
5308 (Incremental_inputs::lock_): New field.
5309 (Incremental_inputs::Inputs_): New field.
5310 (Incremental_inputs::Inputs_map): New field.
5311 * main.cc (main): Call Incremental_input::report_inputs.
5312 * options.h (Input_argument_list): Typedef moved from
5313 Input_arguments.
5314 (Input_file_group::Files): Remove, use ::Input_argument_list.
5315 (Input_file_group::Input_argument_list): Remove, use
5316 ::Input_argument_list.
5317 * plugin.cc (Plugin_manager::add_input_file): Add error in
5318 incremental build.
5319 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
5320 functions.
5321 * script.cc (read_input_script): Call
5322 Incremental_input::report_script.
5323 * script.h (Script_info): New class.
5324
b0481b0b
ILT
53252009-04-27 Ian Lance Taylor <iant@google.com>
5326
5327 * x86_64.cc (do_adjust_output_section): Set entsize to
5328 plt_entry_size.
5329
b22a5a41 53302009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
5331
5332 * output.cc (Output_file::close): After short writes, continue
5333 writing from the correct offset in the buffer being written.
5334
40fde488
CD
53352009-04-23 Chris Demetriou <cgd@google.com>
5336
5337 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
5338 * configure: Regenerate.
5339 * config.in: Regenerate.
5340 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
5341 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
5342
3ce2c28e
ILT
53432009-04-21 Mikolaj Zalewski <mikolajz@google.com>
5344
5345 * incremental.cc (Incremental_inputs_header_data): Renamed from
5346 Incremental_input_header_data.
5347 (Incremental_inputs_header_data::data_size): New field.
5348 (Incremental_inputs_header_data::put_input_file_count): Renamed
5349 from input_file_count.
5350 (Incremental_inputs_header_data::put_command_line_offset): Renamed
5351 from command_line_offset.
5352 (Incremental_inputs_header_data::put_reserved): Renamed from
5353 put_reserved.
5354 (Incremental_inputs_entry_data): Renamed from
5355 Incremental_input_entry_data.
5356 (Incremental_inputs_entry_data::data_size): New field.
5357 (Incremental_inputs::report_command_line): New method.
5358 (Incremental_inputs::finalize): New method.
5359 (Incremental_inputs::create_incremental_inputs_data): New method.
5360 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
5361 * incremental.h: New file.
5362 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
5363 (Layout::finalize): Create incremental inputs section in
5364 incremental builds.
5365 (Layout::create_incremental_info_sections): New method.
5366 * layout.h (Layout::incremental_inputs): New method.
5367 (Layout::create_incremental_info_sections): New method.
5368 (Layout::incremental_inputs_): New field.
5369 * main.cc (main): Notify Incremental_input of the command line.
5370
e55bde5e
ILT
53712009-04-01 Ian Lance Taylor <iant@google.com>
5372 Mikolaj Zalewski <mikolajz@google.com>
5373
5374 * gold.h (reserve_unordered_map): Define, three versions, one for
5375 each version of Unordered_map.
5376 * layout.cc (Layout::Layout): Remove options parameter. Add
5377 number_of_input_files parameter. Don't initialize options_.
5378 Initialize number_of_input_files_ and resized_signatures_. Move
5379 sections_are_attached_.
5380 (Layout::layout_group): Reserve space for group_signatures_.
5381 (Layout::find_or_add_kept_section): Change name parameter to be a
5382 reference. Resize signatures_ map when it gets large enough.
5383 (Layout::layout_eh_frame): Use parameters->options() instead of
5384 this->options_.
5385 (Layout::make_output_section): Likewise.
5386 (Layout::attach_allocated_section_to_segment): Likewise.
5387 (Layout::finalize, Layout::create_executable_stack): Likewise.
5388 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
5389 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
5390 * layout.h (class Layout): Update declarations. Remove options_
5391 field. Add number_of_input_files_ and resized_signatures_
5392 fields. Move sections_are_attached_ field.
5393 * main.cc (main): Pass number of input files to Layout
5394 constructor. Don't pass options.
5395
154b857c
ILT
53962009-03-30 Ian Lance Taylor <iant@google.com>
5397
5398 * ffsll.c (ffsll): Correct implementation.
5399
2f35ab9b
ILT
54002009-03-27 Ian Lance Taylor <iant@google.com>
5401
fd03461a
ILT
5402 * ffsll.c: New file.
5403 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
5404 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
5405 * ftruncate.c (ftruncate): Declare before definition.
5406 * mremap.c (mremap): Likewise.
5407 * pread.c (pread): Likewise.
5408 * configure, Makefile.in, config.in: Rebuild.
5409
2f35ab9b
ILT
5410 * mremap.c: New file.
5411 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
5412 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
5413 (mremap): Declare if HAVE_MREMAP is not defined.
5414 * configure, Makefile.in, config.in: Rebuild.
5415
33aea2fd
CC
54162009-03-27 Cary Coutant <ccoutant@google.com>
5417
5418 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
5419 position independent.
5420 * sparc.cc (Target_sparc::check_non_pic): Likewise.
5421 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
5422
6d479619
CC
54232009-03-24 Cary Coutant <ccoutant@google.com>
5424
5425 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
5426 an executable.
5427 (needs_dynamic_reloc): Likewise.
5428
afc06bb8
ILT
54292009-03-24 Ian Lance Taylor <iant@google.com>
5430
5431 * yyscript.y (file_cmd): Recognize EXTERN.
5432 (extern_name_list, extern_name_list_body): New nonterminals.
5433 * script.cc (script_add_extern): Define.
5434 * script-c.h (script_add_extern): Declare.
5435
f6060a4d
ILT
54362009-03-24 Rafael Avila de Espindola <espindola@google.com>
5437
5438 * object.cc (is_elf_object): Define.
5439 * object.h (is_elf_object): Declare.
5440 * archive.cc (Archive::get_elf_object_for_member): Call
5441 is_elf_object.
33aea2fd 5442 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 5443
26736d8e
ILT
54442009-03-24 Elliott Hughes <enh@google.com>
5445
5446 * output.cc (Output_file::map_anonymous): Define.
5447 (Output_file::map): Use map_anonymous. If the regular mmap fails,
5448 try an anonymous one. Report the size if the mmap fails.
5449 * output.h (class Output_file): Declare map_anonymous.
5450
22fd9730
ILT
54512009-03-24 Ian Lance Taylor <iant@google.com>
5452
5453 * target-select.cc (instantiate_target): Don't acquire the lock if
5454 the instantiated_target_ field has already been set.
5455
cb010894
ILT
54562009-03-23 Ian Lance Taylor <iant@google.com>
5457
7f055c20
ILT
5458 * gold-threads.h (class Initialize_lock): Define.
5459 * gold-threads.cc (class Initialize_lock_once): Define.
5460 (initialize_lock_control): New static variable.
5461 (initialize_lock_pointer): New static variable.
5462 (initialize_lock_once): New static function.
5463 (Initialize_lock::Initialize_lock): Define.
5464 (Initialize_lock::initialize): Define.
5465 * target-select.h: Include "gold-threads.h".
5466 (class Target_selector): Add lock_ and initialize_lock_ fields.
5467 Don't define instantiate_target, just declare it.
5468 * target-select.cc (Target_selector::Target_selector): Initialize
5469 new fields.
5470 (Target_selector::instantiate_target): Define.
5471 * descriptors.h: Include "gold-threads.h".
5472 (class Descriptors): Add initialize_lock_ field.
5473 * descriptors.cc (Descriptors::Descriptors): Initialize new
5474 field.
5475 (Descriptors::open): Use initialize_lock_ field
5476 * errors.h (class Errors): Add initialize_lock_ field.
5477 * errors.cc (Errors::Errors): Initialize new field.
5478 (Errors::initialize_lock): Use initialize_lock_ field.
5479 * powerpc.cc (class Target_selector_powerpc): Remove
5480 instantiated_target_ field. In do_recognize call
5481 instantiate_target rather than do_instantiate_target. In
5482 do_instantiate_target just allocate a new target.
5483 * sparc.cc (class Target_selector_sparc): Likewise.
5484
36959681
ILT
5485 * freebsd.h: New file.
5486 * i386.cc: Include "freebsd.h".
5487 (Target_i386): Derive from Target_freebsd rather than
5488 Sized_target.
5489 (Target_selector_i386): Derive from Target_selector_freebsd rather
5490 than Target_selector.
5491 * x86_64.cc: Include "freebsd.h".
5492 (Target_x86_64): Derive from Target_freebsd rather than
5493 Sized_target.
5494 (Target_selector_x86_64): Derive from Target_selector_freebsd
5495 rather than Target_selector.
5496 * target.h (class Target): Add adjust_elf_header and
5497 do_adjust_elf_header.
5498 * output.cc (Output_file_header:: do_sized_write): Call target
5499 adjust_elf_header routine.
5500 * configure.tgt: Set targ_osabi.
5501 * configure.ac: Define GOLD_DEFAULT_OSABI.
5502 * parameters.cc (Parameters::default_target): Pass
5503 GOLD_DEFAULT_OSABI to select_target.
5504 * target-select.h (class Target_selector): Make instantiate_target
5505 protected rather than private.
5506 * Makefile.am (HFILES): Add freebsd.h.
5507 * configure, Makefile.in, config.in: Rebuild.
5508
cb010894
ILT
5509 * merge.cc (do_add_input_section): Correct pend value. Change
5510 message about last entry not being null terminated from error to
5511 warning.
5512
0e879927
ILT
55132009-03-20 Mikolaj Zalewski <mikolajz@google.com>
5514
5515 * incremental.cc: New file.
5516 * Makefile.am (CCFILES): Add incremental.cc.
5517 * Makefile.in: Rebuild.
5518
41105937
PP
55192009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
5520
5521 * layout.cc (Layout::output_section_name): Preserve names
5522 of '.note.' sections.
e1df38aa 5523
60439920
ILT
55242009-03-19 Ian Lance Taylor <iant@google.com>
5525
5526 * descriptors.cc (Descriptors::open): Check that the options are
5527 valid before using them.
5528
0d371ad3
ILT
55292009-03-18 Ian Lance Taylor <iant@google.com>
5530
5531 * script-sections.h: Include <list>.
5532 (class Script_sections): Change Sections_elements from std::vector
5533 to std::list. Typedef public Elements_iterator. Add
5534 orphan_section_placement_, data_segment_align_start_, and
5535 saw_data_segment_align_ fields. Remove data_segment_align_index_
5536 field.
5537 * script-sections.cc (class Orphan_section_placement): New class.
5538 (class Sections_element): Add virtual functions is_relro and
5539 orphan_section_init. Remove virtual function place_orphan_here.
5540 (class Output_section_definition): Add is_relro and
5541 orphan_section_init. Remove place_orphan_here.
5542 (class Orphan_output_section): Likewise.
5543 (Script_sections::Script_sections): Update for field changes.
5544 (Script_sections::data_segment_align): Set saw_data_segment_align_
5545 and data_segment_align_start_, not data_segment_align_index.
5546 (Script_sections::data_segment_relro_end): Check
5547 saw_data_segment_align_. Use data_segment_align_start_ rather
5548 than data_segment_align_index_.
5549 (Script_sections::place_orphan): Rewrite to use
5550 Orphan_section_placement.
5551
9201d894
ILT
55522009-03-17 Ian Lance Taylor <iant@google.com>
5553
9c5b8369
ILT
5554 * archive.cc (Archive::add_symbols): Check for a version attached
5555 to the symbol name in the archive map.
5556 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
5557 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
5558 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
5559 (ver_test_11.a): New target.
5560 * testsuite/Makefile.in: Rebuild.
5561
9201d894
ILT
5562 * configure.ac: Check for chsize and posix_fallocate. Replace
5563 ftruncate.
5564 * ftruncate.c: New file, from gnulib.
5565 * output.cc (posix_fallocate): Define dummy version if not
5566 HAVE_POSIX_FALLOCATE.
5567 (Output_file::map): Call posix_fallocate rather than lseek and
5568 write.
5569 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
5570 * configure, Makefile.in, config.in: Rebuild.
5571
ef4ab7a8 55722009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 5573
ef4ab7a8
PP
5574 * layout.h (Layout::create_note): Add section_name parameter.
5575 * layout.cc (Layout::create_note): Likewise.
5576 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 5577
8c500701
ILT
55782009-03-17 Ian Lance Taylor <iant@google.com>
5579
e85b18e1
ILT
5580 * descriptors.cc: Include "options.h".
5581 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
5582 (Descriptors::open): Always use O_CLOEXEC when opening a new
5583 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
5584 then set FD_CLOEXEC.
5585
9efe6174
ILT
5586 * sparc.cc (class Target_sparc): Add has_got_section.
5587 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
5588 make sure we have a GOT section.
5589
5590 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
5591 (Target_sparc::Scan::local): Likewise.
5592 (Target_sparc::Scan::global): Likewise.
5593 (Target_sparc::Relocate::relocate): Likewise.
5594 (Target_sparc::Relocate::relocate_tls): Likewise.
5595
8c500701
ILT
5596 * symtab.cc (Symbol_table::define_default_version): New function,
5597 broken out of add_from_object.
5598 (Symbol_table::add_from_object): Call define_default_version.
5599 (Symbol_table::define_special_symbol): Add resolve_oldsym
5600 parameter. Change all callers. If the version for a symbol comes
5601 from a version script, resolve it with the symbol with the same
5602 name with no version. Also add the symbol without a version if
5603 appropriate.
5604 (do_define_in_output_data): If resolving with oldsym, don't delete
5605 sym.
5606 (do_define_in_output_segment): Likewise.
5607 (do_define_as_constant): Likewise.
5608 * symtab.h (class Symbol_table): Update declarations.
5609
f1ed28fb
ILT
56102009-03-13 Ian Lance Taylor <iant@google.com>
5611
15f8229b
ILT
5612 * readsyms.cc (Read_symbols::incompatible_warning): New function.
5613 (Read_symbols::requeue): New function.
5614 (Read_symbols::do_read_symbols): If make_elf_object fails because
5615 the target type is not configured, and the file was searched for,
5616 issue a warning and retry with the next directory.
5617 (Add_symbols::run): If the file has an incompatible format, and
5618 it was searched for, requeue the Read_symbols task. On error,
5619 release the object.
5620 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
5621 dirindex parameter to constructor. Change all callers. Declare
5622 incompatible_warning and requeue.
5623 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
5624 input_argument_ and input_group_ fields. Add them to
5625 constructor. Change all callers.
5626 (class Read_script): Add dirindex_ field. Add it to constructor.
5627 Change all callers.
5628 * archive.cc (Archive::setup): Remove input_objects parameter.
5629 Change all callers.
5630 (Archive::get_file_and_offset): Likewise.
5631 (Archive::read_all_symbols): Likewise.
5632 (Archive::read_symbols): Likewise.
5633 (Archive::get_elf_object_for_member): Remove input_objects
5634 parameter. Add punconfigured parameter. Change all callers.
5635 (Archive::add_symbols): Change return type to bool. Check return
5636 value of include_member.
5637 (Archive::include_all_members): Likewise.
5638 (Archive::include_member): Change return type to bool. Return
5639 false if first included object has incompatible target. Set
5640 included_member_ field.
5641 (Add_archive_symbols::run): If add_symbols returns false, requeue
5642 Read_symbols task.
5643 * archive.h (class Archive): Add included_member_ field.
5644 Initialize it in constructor. Add input_file and searched_for
5645 methods. Update declarations.
5646 (class Add_archive_symbols): Add dirpath_, dirindex_, and
5647 input_argument_ fields. Add them to constructor. Change all
5648 callers.
5649 * script.cc: Include "target-select.h".
5650 (class Parser_closure): Add skip_on_incompatible_target_ and
5651 found_incompatible_target_ fields. Add
5652 skip_on_incompatible_target parameter to constructor. Change all
5653 callers. Add methods skip_on_incompatible_target,
5654 clear_skip_on_incompatible_target, found_incompatible_target, and
5655 set_found_incompatible_target.
5656 (read_input_script): Add dirindex parameter. Change all callers.
5657 If parser finds an incompatible target, requeue Read_symbols
5658 task.
5659 (script_set_symbol): Clear skip_on_incompatible_target in
5660 closure.
5661 (script_add_assertion, script_parse_option): Likewise.
5662 (script_start_sections, script_add_phdr): Likewise.
5663 (script_check_output_format): New function.
5664 * script.h (read_input_script): Update declaration.
5665 * script-c.h (script_check_output_format): Declare.
5666 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
5667 (ignore_cmd): Remove OUTPUT_FORMAT.
5668 * fileread.cc (Input_file::Input_file): Add explicit this.
5669 (Input_file::will_search_for): New function.
5670 (Input_file::open): Add pindex parameter. Change all callers.
5671 * fileread.h (class Input_file): Add input_file_argument method.
5672 Declare will_search_for. Update declarations.
5673 * object.cc (make_elf_object): Add punconfigured parameter.
5674 Change all callers.
5675 * object.h (class Object): Make input_file public. Add
5676 searched_for method.
5677 (make_elf_object): Update declaration.
5678 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
5679 restart search.
5680 * dirsearch.h (class Dirsearch): Update declaration.
5681 * options.h (class General_options): Add --warn-search-mismatch.
5682 * parameters.cc (Parameters::is_compatible_target): New function.
5683 * parameters.h (class Parameters): Declare is_compatible_target.
5684 * workqueue.cc (Workqueue::add_blocker): New function.
5685 * workqueue.h (class Workqueue): Declare add_blocker.
5686
f1ed28fb
ILT
5687 * fileread.cc (Input_file::open): Remove options parameter.
5688 Change all callers.
5689 (Input_file::open_binary): Likewise.
5690 * script.cc (read_input_script): Likewise.
5691 * readsyms.h (class Read_symbols): Remove options_ field. Remove
5692 options parameter from constructor. Change all callers.
5693 (class Read_script): Likewise.
5694 * fileread.h (class Input_file): Update declarations.
5695 * script.h (read_input_script): Update declaration.
5696
34dd024a
NC
56972009-03-10 Nick Clifton <nickc@redhat.com>
5698
5699 * po/es.po: New Spanish translation.
5700
6d71b17c
CC
57012009-03-06 Cary Coutant <ccoutant@google.com>
5702
5703 * options.cc (parse_short_option): Keep dash_z from registering itself.
5704
031cdbed
ILT
57052009-03-03 Ian Lance Taylor <iant@google.com>
5706
5707 PR 9918
5708 * target-reloc.h (relocate_section): Pass output_section to
5709 relocate.
5710 * i386.cc (Target_i386::should_apply_static_reloc): Add
5711 output_section parameter. Change all callers.
5712 (Target_i386::Relocate::relocate): Add output_section parameter.
5713 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
5714 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
5715 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
5716 * testsuite/two_file_shared.sh: New script.
5717 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
5718 (check_DATA): Add two_file_shared.dbg.
5719 (two_file_shared.dbg): New target.
5720 * testsuite/Makefile.in: Rebuild.
5721
15d5fa16
ILT
57222009-03-01 Ian Lance Taylor <iant@google.com>
5723
5724 * configure.ac: Check for byteswap.h.
5725 * configure: Rebuild.
5726 * config.in: Rebuild.
5727
8a4c0b0d
ILT
57282009-03-01 Mikolaj Zalewski <mikolajz@google.com>
5729
5730 * layout.cc (Layout::find_or_add_kept_section): New function.
5731 (Layout::add_comdat): Removed.
5732 * layout.h (struct Kept_section): Move out of class Layout.
5733 Remove trailing underscores from field names. Add group_sections
5734 field. Rename group_ field to is_group. Change all uses.
5735 (class Layout): Declare find_or_add_kept_section, not add_comdat.
5736 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
5737 comdat_groups_ field.
5738 (Sized_relobj::include_section_group): Use
5739 find_or_add_kept_section and Kept_section::group_sections.
5740 (Sized_relobj::include_linkonce_section): Likewise.
5741 * object.cc (class Sized_relobj): Don't define Comdat_group or
5742 Comdat_group_table. Remove find_comdat_group and
5743 add_comdat_group. Remove comdat_groups_ field.
5744 * plugin.cc (include_comdat_group): Use
5745 Layout::find_or_add_kept_section.
5746
b4ecf66b
ILT
57472009-02-28 Ian Lance Taylor <iant@google.com>
5748
14359ca0
ILT
5749 * README: --gc-sections and map files are now supported. Document
5750 some build requirements.
5751
b4ecf66b
ILT
5752 PR 6992
5753 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
5754 relocatable link set the value of the section symbol to zero.
5755 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
5756 relocatable link don't include the section address in the local
5757 symbol value.
5758
0602e05a
ILT
57592009-02-27 Ian Lance Taylor <iant@google.com>
5760
fd9d194f
ILT
5761 PR 6811
5762 * options.h (class Search_directory): Add is_system_directory.
5763 (class General_options): Declare is_in_system_directory.
5764 * options.cc (get_relative_sysroot): Make static.
5765 (get_default_sysroot): Make static.
5766 (General_optoins::is_in_system_directory): New function.
5767 * fileread.cc (Input_file::is_in_system_directory): New function.
5768 * fileread.h (class Input_file): Declare is_in_system_directory.
5769 * object.h (class Object): Add is_in_system_directory.
5770 (class Input_objects): Remove system_library_directory_ field.
5771 * object.cc (Input_objects::add_object): Don't set
5772 system_library_directory_.
5773 (input_objects::found_in_system_library_directory): Remove.
5774 * symtab.cc (Symbol_table::write_globals): Remove input_objects
5775 parameter. Change all callers.
5776 (Symbol_table::sized_write_globals): Likewise.
5777 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
5778 Call Object::is_in_system_directory.
5779 * symtab.h (class Symbol_table): Update declarations.
5780
61edd21f
ILT
5781 PR 5990
5782 * descriptors.h (Open_descriptor): Add is_on_stack field.
5783 * descriptors.cc (Descriptors::open): If the descriptor is on the
5784 top of the stack, remove it. Initialize is_on_stack field.
5785 (Descriptors::release): Only add pod to stack if it is not on the
5786 stack already.
5787 (Descriptors::close_some_descriptor): Clear stack_next and
5788 is_on_stack fields.
5789
e29e076a
ILT
5790 PR 7091
5791 * output.cc (Output_section::find_starting_output_address): Rename
5792 from starting_output_address; add PADDR parameter; change return
5793 type.
5794 * output.h (class Output_section): Declare
5795 find_starting_output_address instead of starting_output_address.
5796 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
5797 section symbol for which we can't find a merge section.
5798
0602e05a
ILT
5799 PR 9836
5800 * symtab.cc (Symbol_table::add_from_object): If the visibility is
5801 hidden or internal, force the symbol to be local.
5802 * resolve.cc (Symbol::override_visibility): Define.
5803 (Symbol::override_base): Use override_visibility.
5804 (Symbol_table::resolve): Likewise.
5805 (Symbol::override_base_with_special): Likewise.
5806 (Symbol_table::override_with_special): If the visibility is hidden
5807 or internal, force the symbol to be local.
5808 * symtab.h (class Symbol): Add set_visibility and
5809 override_visibility.
5810 * testsuite/ver_test_1.sh: New file.
5811 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
5812 (check_DATA): Add ver_test_1.syms.
5813 (ver_test_1.syms): New target.
5814 * testsuite/Makefile.in: Rebuild.
5815
401a9a73
CC
58162009-02-25 Cary Coutant <ccoutant@google.com>
5817
5818 * layout.cc (Layout::choose_output_section): Don't rename sections
5819 when using a linker script that has a SECTIONS clause.
5820 * Makefile.in: Regenerate.
5821
5822 * testsuite/Makefile.am (script_test_5.sh): New test case.
5823 * testsuite/Makefile.in: Regenerate.
5824 * testsuite/script_test_5.cc: New file.
5825 * testsuite/script_test_5.sh: New file.
5826 * testsuite/script_test_5.t: New file.
5827
f488e4b0
CC
58282009-02-13 Rafael Avila de Espindola <espindola@google.com>
5829
5830 * archive.cc (Archive::include_member): Update calls to add_symbols.
5831 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
5832 the Layout argument.
5833 * dynobj.h (do_add_symbols): Add the Layout argument.
5834 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
5835 Layout argument.
5836 * object.h (Object::add_symbols): Add the Layout argument.
5837 (Object::do_add_symbols): Add the Layout argument.
5838 (Sized_relobj::do_add_symbols): Add the Layout argument.
5839 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
5840 Unify the two versions.
5841 (Add_plugin_symbols): Remove.
5842 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
5843 (Sized_pluginobj::do_add_symbols): Unify the two versions.
5844 (Add_plugin_symbols): Remove.
5845 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
5846 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
5847 (Add_symbols::run): Make it work with Pulginobj.
5848
89dd1680
ILT
58492009-02-06 Ian Lance Taylor <iant@google.com>
5850
5851 * object.cc (Sized_relobj::do_layout): Make info message start
5852 with lower case letter.
5853
266d0a74
ILT
58542009-02-06 Mikolaj Zalewski <mikolajz@google.com>
5855
602b464e
ILT
5856 * binary.cc: Fix file comment.
5857
266d0a74
ILT
5858 * options.h (enum Incremental_disposition): Define.
5859 (class General_options): Add new options: --incremental,
5860 --incremental_changed, --incremental_unchanged,
5861 --incremental_unknown. Add incremental_disposition_ and
5862 implicit_incremental_ fields.
5863 (General_options::incremental_disposition): New function.
5864 (class Position_dependent_options): Add incremental_disposition
5865 option.
5866 (Position_dependent_options::copy_from_options): Set incremental
5867 dispositions.
5868 * options.cc (General_options::parse_incremental_changed): New
5869 function.
5870 (General_options::parse_incremental_unchanged): New function.
5871 (General_options::parse_incremental_unknown): New function.
5872 (General_options::General_options): Initialize new fields
5873 incremental_disposition_ and implicit_incremental_.
5874 (General_options::finalize): Check for uasge of --incremental-*
5875 without --incremental.
5876
f073bbf7
CD
58772009-02-06 Chris Demetriou <cgd@google.com>
5878
5879 * gold.h (gold_undefined_symbol): Change to take only a Symbol
5880 pointer and to report location as the file name associated with
5881 the symbol.
5882 (gold_undefined_symbol_at_location): New function to replace the
5883 old gold_undefined_symbol functionality.
5884 * target-reloc.h (relocate_section): Update to use
5885 gold_undefined_symbol_at_location.
5886 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
5887 Call gold_undefined_symbol function rather than gold_error.
5888 * errors.h (Errors::undefined_symbol): Take location as a
5889 string, rather than calculating it from a relocation.
5890 * errors.cc (Errors::fatal): Print "fatal error:" before the
5891 formatted message.
5892 (Errors::error, Errors::error_at_location): Print "error: "
5893 before the formatted message.
5894 (Errors::undefined_symbol): Take location as a string, rather
5895 than calculating it from a relocation.
5896 (gold_undefined_symbol_at_location): New function akin to
5897 old gold_undefined_symbol, calculates location from relocation.
5898 (gold_undefined_symbol): Change to take only a Symbol pointer
5899 and to report location as the file name associated with the symbol.
5900 * testsuite/debug_msg.sh: Update for changed error messages.
5901 * testsuite/undef_symbol.sh: Likewise.
5902
8e94a90c
ILT
59032009-02-04 Duncan Sands <baldrick@free.fr>
5904
5905 PR 9812
5906 * reduced_debug_output.h
5907 (Output_reduced_debug_abbrev_section::failed): Use format for
5908 gold_warning.
5909 (Output_reduced_debug_info_section::faild): Likewise.
5910
88a0e15b
ILT
59112009-01-31 Mikolaj Zalewski <mikolajz@google.com>
5912
5913 * script.cc (Lazy_demangler): New class.
5914 (Version_script_info::get_symbol_version_helper): Demangle a
5915 symbol only once.
5916
5efc7cd2
CC
59172009-01-29 Cary Coutant <ccoutant@google.com>
5918
5919 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
5920 to __tls_get_addr.
5921 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
5922
e0ebcf42
ILT
59232009-01-28 Ian Lance Taylor <iant@google.com>
5924
5efc7cd2 5925 * version.cc (version_string): Bump to 1.9.
75fe7426 5926
e0ebcf42
ILT
5927 * gold.h: Include <cstring> and <stdint.h>.
5928 * version.cc: Include <cstdio>.
5929 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
5930 warning.
5931 * reduced_debug_output.cc (insert_into_vector): Rename from
5932 Insert_into_vector; change all callers. Use Swap_unaligned to
5933 avoid aliasing issue; remove union since it is unnecessary.
5934
8e2813be 59352009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
5936
5937 * Makefile.am (CCFILES): Add gc.cc.
5938 (HFILES): Add gc.h.
5939 * Makefile.in: Regenerate.
5940 * gold.cc (Gc_runner): New class.
5941 (queue_initial_tasks): Call garbage collection related tasks
5942 when corresponding options are invoked.
5943 (queue_middle_gc_tasks): New function.
5944 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
5945 processed early before laying out sections during garbage collection.
5946 * gold.h (queue_middle_gc_tasks): New function.
5947 (is_prefix_of): Move from "layout.cc".
5948 * i386.cc (Target_i386::gc_process_relocs): New function.
5949 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
5950 * main.cc (main): Create object of class "Garbage_collection".
5951 * object.cc (Relobj::copy_symbols_data): New function.
5952 (Relobj::is_section_name_included): New function.
e1df38aa
NC
5953 (Sized_relobj::do_layout): Allow this function to be called twice
5954 during garbage collection and defer layout of section during the
6d03d481
ST
5955 first call.
5956 * object.h (Relobj::get_symbols_data): New function.
5957 (Relobj::is_section_name_included): New function.
5958 (Relobj::copy_symbols_data): New function.
5959 (Relobj::set_symbols_data): New function.
5960 (Relobj::get_relocs_data): New function.
5961 (Relobj::set_relocs_data): New function.
5962 (Relobj::is_output_section_offset_invalid): New pure virtual function.
5963 (Relobj::gc_process_relocs): New function.
5964 (Relobj::do_gc_process_relocs): New pure virtual function.
5965 (Relobj::sd_): New data member.
5966 (Sized_relobj::is_output_section_offset_invalid): New function.
5967 (Sized_relobj::do_gc_process_relocs): New function.
5968 * options.h (General_options::gc_sections): Modify to not be a no-op.
5969 (General_options::print_gc_sections): New option.
5970 * plugin.cc (Plugin_finish::run): Remove function call to
5971 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
5972 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
5973 * reloc.cc (Read_relocs::run): Add task to process relocs and
5974 determine unreferenced sections when doing garbage collection.
5975 (Gc_process_relocs): New class.
5976 (Sized_relobj::do_gc_process_relocs): New function.
5977 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
5978 sections that are garbage collected.
5979 * reloc.h (Gc_process_relocs): New class.
5980 * sparc.cc (Target_sparc::gc_process_relocs): New function.
5981 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
5982 symbols whose corresponding sections are garbage collected.
5983 (Symbol_table::Symbol_table): Add new parameter for the garbage
5984 collection object.
5985 (Symbol_table::gc_mark_undef_symbols): New function.
5986 (Symbol_table::gc_mark_symbol_for_shlib): New function.
5987 (Symbol_table::gc_mark_dyn_syms): New function.
5988 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
5989 as garbage.
5990 (Symbol_table::add_from_object): Likewise.
5991 (Symbol_table::add_from_relobj): When building shared objects, do not
5992 treat externally visible symbols as garbage.
5993 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
5994 table information for static and relocatable links.
5995 * symtab.h (Symbol_table::set_gc): New function.
5996 (Symbol_table::gc): New function.
5997 (Symbol_table::gc_mark_undef_symbols): New function.
5998 (Symbol_table::gc_mark_symbol_for_shlib): New function.
5999 (Symbol_table::gc_mark_dyn_syms): New function.
6000 (Symbol_table::gc_): New data member.
e1df38aa 6001 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
6002 function.
6003 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
6004 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
6005
3b293544
CF
60062009-01-20 Chris Faylor <me.sourceware@sourceware.org>
6007
6008 * options.h (General_options::gc_sections): Define as a no-op for now.
6009 (General_options::no_keep_memory): Ditto.
6010 (General_options::Bshareable): Define.
6011 * options.cc (General_options::finalize): Honor -Bshareable.
6012
83d22aa8
AS
60132009-01-20 Andreas Schwab <schwab@suse.de>
6014
6015 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
6016 read the value in the contents, since we don't use it. Use the
6017 template endianness when writing.
6018 (Relocate::relocate): Use it for R_PPC_REL16_HA.
6019
cd536b21
AS
60202009-01-19 Andreas Schwab <schwab@suse.de>
6021
6022 * configure.tgt (powerpc64-*): Fix targ_obj.
6023
99e9a495
ILT
60242009-01-15 Ian Lance Taylor <iant@google.com>
6025
6026 * object.cc (Sized_relobj::write_local_symbols): Don't write out
6027 local symbols when stripping all symbols.
6028
bbbfea06
CC
60292009-01-14 Cary Coutant <ccoutant@google.com>
6030
99e9a495 6031 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 6032
0f7c0701
CC
60332009-01-14 Cary Coutant <ccoutant@google.com>
6034
6035 * archive.cc (Archive::get_elf_object_for_member): Remove call
6036 to File_read::claim_for_plugin.
6037 * descriptors.cc (Descriptors::open): Remove reference to
6038 is_claimed.
6039 (Descriptors::claim_for_plugin): Remove.
6040 * descriptors.h (Descriptors::claim_for_plugin): Remove.
6041 (Descriptors::is_claimed): Remove.
6042 (claim_descriptor_for_plugin): Remove.
6043 * fileread.cc (File_read::claim_for_plugin): Remove.
6044 * fileread.h (File_read::claim_for_plugin): Remove.
6045 (File_read::descriptor): Reopen descriptor if necessary.
6046 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
6047 (Plugin_manager::all_symbols_read): Add task parameter. Change
6048 all callers.
6049 (Plugin_manager::get_input_file): New function.
6050 (Plugin_manager::release_input_file): New function.
6051 (Pluginobj::Pluginobj): Add filesize parameter and initialize
6052 corresponding data member.
6053 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
6054 and pass to base constructor. Change all callers.
6055 (get_input_file, release_input_file): New functions.
6056 (make_sized_plugin_object): Add filesize parameter. Change all callers.
6057 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
6058 (Plugin_manager::all_symbols_read): Add task parameter.
6059 (Plugin_manager::get_input_file): New function.
6060 (Plugin_manager::release_input_file): New function.
6061 (Plugin_manager::task_): New data member.
6062 (Pluginobj::Pluginobj): Add filesize parameter.
6063 (Pluginobj::filename): New function.
6064 (Pluginobj::descriptor): New function.
6065 (Pluginobj::filesize): New function.
6066 (Pluginobj::filesize_): New data member.
6067 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
6068 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
6069 File_read::claim_for_plugin; use Object::unlock to unlock the file.
6070
6071 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
6072 with archive libraries.
6073 * testsuite/Makefile.in: Regenerate.
6074 * testsuite/plugin_test.c (struct sym_info): New type.
6075 (get_input_file, release_input_file): New static variables.
6076 (onload): Capture new transfer vector entries.
6077 (claim_file_hook): Stop reading at end of file according to filesize.
6078 Factor out parsing of readelf output into separate function.
6079 (all_symbols_read_hook): Exercise get_input_file and release_input_file
6080 APIs and get the source file name from the symbol table. Convert
6081 source file name to corresponding object file name. Print info
6082 message when adding new input files.
6083 (parse_readelf_line): New function.
6084 * testsuite/plugin_test_1.sh: Add checks for new info messages.
6085 * testsuite/plugin_test_2.sh: Likewise.
6086 * testsuite/plugin_test_3.sh: Likewise.
6087 * testsuite/plugin_test_4.sh: New test case.
6088
62a6d109
ILT
60892009-01-07 Ian Lance Taylor <iant@google.com>
6090
6091 * version.cc (version_string): Bump to 1.8.
6092
483620e8
CC
60932008-12-23 Cary Coutant <ccoutant@google.com>
6094
6095 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
6096 * plugin.cc (Plugin_manager::finish): Rename as
6097 layout_deferred_objects. Move cleanup to separate function.
6098 (Plugin_manager::cleanup): New function.
6099 (Plugin_finish::run): Call layout_deferred_objects and cleanup
6100 separately.
6101 * plugin.h (Plugin_manager::finish): Rename as
6102 layout_deferred_objects.
6103 (Plugin_manager::cleanup): New function.
6104 (Plugin_manager::cleanup_done): New field.
6105
d66a9eb3
CC
61062008-12-23 Cary Coutant <ccoutant@google.com>
6107
6108 * plugin.cc (is_visible_from_outside): New function.
6109 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
6110 so we don't return "IR only" status for exported symbols or -r links.
6111
6112 * testsuite/Makefile.am (plugin_test_3): New test case.
6113 * testsuite/Makefile.in: Regenerate.
6114 * testsuite/plugin_test_3.sh: New file.
6115
5995b570
CC
61162008-12-22 Cary Coutant <ccoutant@google.com>
6117
6118 * object.cc (Sized_relobj::layout_section): New function.
6119 (Sized_relobj::do_layout): Defer layout of input sections until after
6120 plugin has provided replacement files.
6121 (Sized_relobj::do_layout_deferred_sections): New function.
6122 * object.h (Relobj::set_section_offset): Remove virtual keyword.
6123 (Relobj::layout_deferred_sections): New function.
6124 (Relobj::do_layout_deferred_sections): New function.
6125 (Sized_relobj::do_layout_deferred_sections): New function.
6126 (Sized_relobj::layout_section): New function.
6127 (Sized_relobj::Deferred_layout): New structure.
6128 (Sized_relobj::deferred_layout_): New field.
6129 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
6130 Change all callers. Layout deferred sections.
6131 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
6132 references.
6133 (Plugin_hook::run): Move code from do_plugin_hook inline.
6134 (Plugin_hook::do_plugin_hook): Remove.
6135 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
6136 (Plugin_manager::finish): Renamed, was cleanup.
6137 (Plugin_manager::should_defer_layout): New function.
6138 (Plugin_manager::add_deferred_layout_object): New function.
6139 (Plugin_manager::Deferred_layout_list): New type.
6140 (Plugin_manager::deferred_layout_objects_): New field.
6141 (Plugin_hook::do_plugin_hook): Remove.
6142
ee769c88
ILT
61432008-12-17 Ian Lance Taylor <iant@google.com>
6144
6145 * options.h (class General_options): Add --no case for
6146 --export-dynamic.
6147
abc8dcba
CC
61482008-12-16 Cary Coutant <ccoutant@google.com>
6149
6150 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
6151 vector.
6152 (Plugin_manager::claim_file): Create plugin object even if
6153 plugin did not call the add_symbols callback.
6154 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
6155 asking for more symbols than were added.
6156 * testsuite/Makefile.am (plugin_test_1): Add test case with
6157 no global symbols.
6158 (empty.syms): New target.
6159 * testsuite/Makefile.in: Regenerate.
6160 * testsuite/plugin_test.c (claim_file_hook): Add new debug
6161 message. Don't call add_symbols if no globals.
6162 (all_symbols_read_hook): Don't provide replacement for empty
6163 claimed file.
6164
b0074644
ILT
61652008-12-12 Ian Lance Taylor <iant@google.com>
6166
68943102
ILT
6167 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
6168 r_type == 0 for a local symbol with r_sym == 0.
6169 (scan_relocatable_relocs): Pass r_sym to
6170 local_non_section_strategy.
6171 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
6172 r_sym parameter.
6173
b0074644
ILT
6174 * configure.ac: Update test for TLS descriptors: they are
6175 supported as of glibc 2.9.
6176 * configure: Rebuild.
6177
c2508178
ILT
61782008-12-11 Ian Lance Taylor <iant@google.com>
6179
6180 PR 7091
6181 * target-reloc.h (Default_scan_relocatable_relocs): For each
6182 function, map r_type == 0 to RELOC_DISCARD.
6183
2756a258
CC
61842008-12-10 Cary Coutant <ccoutant@google.com>
6185
6186 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
6187 object to override a kept COMDAT group from a plugin object.
6188
bb6f53d3
ILT
61892008-12-09 Ian Lance Taylor <iant@google.com>
6190
fbc558e1
ILT
6191 PR 7088
6192 * yyscript.y (file_cmd): Handle INPUT.
6193
bb6f53d3
ILT
6194 * testsuite/initpri1.c: Change all declarations to be full
6195 prototypes by adding void, to avoid compiler warnings.
6196
4674ecfc
CC
61972008-12-05 Rafael Avila de Espindola <espindola@google.com>
6198
6199 * options.cc (General_options::parse_plugin_opt): New.
6200 (General_options::add_plugin): The argument now is just the filename.
6201 (General_options::add_plugin_option): New.
6202 * options.h (plugin_opt): New.
6203 (add_plugin): Change argument name.
6204 (add_plugin_option): New.
6205 * plugin.cc (Plugin::load): Don't parse the plugin option.
6206 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
6207 (Plugin::add_option): New.
6208 (Plugin::args_): Change type.
6209 (Plugin::filename_): New.
6210 (Plugin_manager::add_plugin_option): New.
6211 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
6212 * testsuite/Makefile.in: Regenerate.
6213
fd06b4aa
CC
62142008-12-05 Cary Coutant <ccoutant@google.com>
6215
6216 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
6217 Handle --strip-lto-sections option.
6218 * options.h (strip_lto_sections): New option.
6219
6c52134c
CC
62202008-12-01 Cary Coutant <ccoutant@google.com>
6221
6222 * plugin.cc (ld_plugin_message): Change format parameter to const.
6223 Fix mismatch between new[] and delete.
6224
a45248e0
CC
62252008-11-14 Cary Coutant <ccoutant@google.com>
6226
6227 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
6228 instead of -1U.
6229
c82fbeee
CS
62302008-11-05 Craig Silverstein <csilvers@google.com>
6231
6232 * options.cc (General_options::parse_dynamic_list): New function.
6233 * options.h (General_options): New flags dynamic_list,
6234 dynamic_list_data, dynamic_list_cpp_new, and
6235 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
6236 (General_options::in_dynamic_list): New function.
6237 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
6238 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
6239 (Lex::can_continue_name): Likewise.
6240 (yylex): Likewise.
6241 (read_script_file): New parameter script_options.
6242 (read_dynamic_list): New function.
6243 (Script_options::define_dynamic_list): New function.
6244 (dynamic_list_keyword_parsecodes): New variable.
6245 (dynamic_list_keywords): New variable.
6246 * script.h (Script_options::define_dynamic_list): New function
6247 prototype.
6248 (read_dynamic_list): New function prototype.
6249 * symtab.cc (strprefix): New macro.
6250 (Symbol::should_add_dynsym_entry): Support dynamic_list,
6251 dynamic_list_data, dynamic_list_cpp_new, and
6252 dynamic_list_cpp_typeinfo.
6253 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
6254 (dynamic_list_expr): New rule.
6255 (dynamic_list_nodes): Likewise.
6256 (dynamic_list_node): Likewise.
6257 * testsuite/Makefile.am (dynamic_list): New test.
6258 * testsuite/Makefile.in: Regenerated.
6259 * testsuite/dynamic_list.t: New file.
6260 * testsuite/dynamic_list.sh: New file.
6261
e0bb29a5
CS
62622008-11-05 Craig Silverstein <csilvers@google.com>
6263
6264 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
6265 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
6266 (t11_last): Likewise.
6267 * testsuite/ver_test_6.c (main): Likewise.
6268
4e1e25e0
CC
62692008-10-07 Cary Coutant <ccoutant@google.com>
6270
6271 * options.c (General_options::finalize): Add check for -static and
6272 -shared.
6273 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
6274 is not empty.
6275
92f03fcb
CC
62762008-10-02 Cary Coutant <ccoutant@google.com>
6277
6278 * plugin.cc (make_sized_plugin_object): Fix conditional
6279 compilation to work when not all targets are enabled.
6280
fbd8a257
CC
62812008-09-29 Cary Coutant <ccoutant@google.com>
6282
6283 * archive.cc (Archive::get_file_and_offset): Use filename instead
6284 of name to get library path.
6285 (Archive::include_member): Unlock external member of a thin archive.
6286
6287 * testsuite/Makefile.am (TEST_AR): New variable.
6288 (thin_archive_test_1): New test.
6289 (thin_archive_test_2): New test.
81636b3f
CC
6290 * testsuite/Makefile.in: Regenerate.
6291 * testsuite/thin_archive_main.cc: New file.
6292 * testsuite/thin_archive_test_1.cc: New file.
6293 * testsuite/thin_archive_test_2.cc: New file.
6294 * testsuite/thin_archive_test_3.cc: New file.
6295 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 6296
eff45813
CC
62972008-09-29 Cary Coutant <ccoutant@google.com>
6298
6299 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
6300 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
6301 instead of -1U.
6302 (Sized_relobj::do_finalize_local_symbols): Likewise.
6303 (Sized_relobj::map_to_kept_section): Likewise.
6304 * object.h (Sized_relobj::invalid_address): New constant.
6305 (Sized_relobj::do_output_section_offset): Check for invalid_address
6306 and return -1ULL.
6307 * output.cc (Output_reloc::local_section_offset): Use constant
6308 invalid_address instead of -1U.
6309 (Output_reloc::get_address): Likewise.
6310 (Output_section::output_address): Change -1U to -1ULL.
6311 * output.h (Output_reloc::invalid_address): New constant.
6312 * reloc.cc (Sized_relobj::write_sections): Use constant
6313 invalid_address instead of -1U.
6314 (Sized_relobj::relocate_sections): Likewise.
6315 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
6316 values for merge sections.
6317 * target-reloc.h (relocate_for_relocatable): Use constant
6318 invalid_address instead of -1U.
6319
89fc3421
CC
63202008-09-19 Cary Coutant <ccoutant@google.com>
6321
6322 Add plugin functionality for link-time optimization (LTO).
6323 * configure.ac (plugins): Add --enable-plugins option.
6324 * configure: Regenerate.
6325 * config.in: Regenerate.
6326 * Makefile.am (LIBDL): New variable.
6327 (CCFILES): Add plugin.cc.
6328 (HFILES): Add plugin.h.
6329 (ldadd_var): Add LIBDL.
6330 * Makefile.in: Regenerate.
6331
6332 * archive.cc: Include "plugin.h".
6333 (Archive::setup): Don't preread archive symbols when using a plugin.
6334 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
6335 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
6336 files.
6337 (Archive::include_member): Add symbols from plugin objects.
6338 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
6339 * descriptors.cc (Descriptors::open): Check for file descriptors
6340 abandoned by plugins.
6341 (Descriptors::claim_for_plugin): New function.
6342 * descriptors.h (Descriptors::claim_for_plugin): New function.
6343 (Open_descriptor::is_claimed): New field.
6344 (claim_descriptor_for_plugin): New function.
6345 * fileread.cc (File_read::claim_for_plugin): New function.
6346 * fileread.h (File_read::claim_for_plugin): New function.
6347 (File_read::descriptor): New function.
6348 * gold.cc: Include "plugin.h".
6349 (queue_initial_tasks): Add task to call plugin hooks for generating
6350 new object files.
6351 * main.cc: Include "plugin.h".
6352 (main): Load plugin libraries.
6353 * object.h (Pluginobj): Declare.
6354 (Object::pluginobj): New function.
6355 (Object::do_pluginobj): New function.
6356 (Object::set_target): New function.
6357 * options.cc: Include "plugin.h".
6358 (General_options::parse_plugin): New function.
6359 (General_options::General_options): Initialize plugins_ field.
6360 (General_options::add_plugin): New function.
6361 * options.h (Plugin_manager): Declare.
6362 (General_options): Add --plugin option.
6363 (General_options::has_plugins): New function.
6364 (General_options::plugins): New function.
6365 (General_options::add_plugin): New function.
6366 (General_options::plugins_): New field.
6367 * plugin.cc: New file.
6368 * plugin.h: New file.
6369 * readsyms.cc: Include "plugin.h".
6370 (Read_symbols::do_read_symbols): Check for archive before checking
6371 for ELF file. Call plugin hooks to claim files.
6372 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
6373 from a real object file; force override when processing replacement
6374 files.
6375 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
6376 (Symbol::init_base_object): Likewise.
6377 (Symbol::init_base_output_data): Likewise.
6378 (Symbol::init_base_output_segment): Likewise.
6379 (Symbol::init_base_constant): Likewise.
6380 (Symbol::init_base_undefined): Likewise.
6381 (Symbol::output_section): Assert that object is not a plugin.
6382 (Symbol_table::add_from_pluginobj): New function.
6383 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
6384 undefined.
6385 (Symbol_table::sized_write_globals): Likewise.
6386 (Symbol_table::add_from_pluginobj): Instantiate template.
6387 * symtab.h (Sized_pluginobj): Declare.
6388 (Symbol::in_real_elf): New function.
6389 (Symbol::set_in_real_elf): New function.
6390 (Symbol::in_real_elf_): New field.
6391 (Symbol_table::add_from_pluginobj): New function.
6392
6393 * testsuite/Makefile.am (AM_CFLAGS): New variable.
6394 (LIBDL): New variable.
6395 (LDADD): Add LIBDL.
6396 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
6397 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
6398 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
6399 (MOSTLYCLEANFILES): Likewise.
6400 * testsuite/Makefile.in: Regenerate.
6401 * testsuite/plugin_test.c: New file.
6402 * testsuite/plugin_test_1.sh: New file.
6403 * testsuite/plugin_test_2.sh: New file.
6404
de31bda5
ILT
64052008-09-16 Ian Lance Taylor <iant@google.com>
6406
9c2d0ef9
ILT
6407 * target-reloc.h (relocate_section): Check whether a symbol is
6408 defined by the ABI before reporting an undefined symbol error.
6409 * target.h (Target::is_defined_by_abi): Make parameter const.
6410 (Target::do_is_defined_by_abi): Likewise.
6411 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
6412 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
6413 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
6414 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
6415 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
6416 * testsuite/Makefile.in: Rebuild.
6417
de31bda5
ILT
6418 * fileread.cc (make_view): Add casts to avoid warning.
6419
9fa33bee
AO
64202008-09-16 Alexandre Oliva <aoliva@redhat.com>
6421
6422 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
6423 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
6424
183fd0e3
AO
64252008-09-16 Alexandre Oliva <aoliva@redhat.com>
6426
6427 * options.h (General_options::output_is_executable): New.
6428 (General_options::output_is_pie): New.
6429 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
6430 for shared libraries.
6431 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
6432
7be8330a
CD
64332008-09-11 Chris Demetriou <cgd@google.com>
6434
6435 * options.h (origin): New -z option.
6436 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
6437 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
6438 in DT_FLAGS_1.
6439
a9caad02
CC
64402008-09-05 Cary Coutant <ccoutant@google.com>
6441
6442 * fileread.cc (File_read::make_view): Add check for attempt to map
6443 beyond end of file.
6444
ae6dce4d
CC
64452008-09-05 Cary Coutant <ccoutant@google.com>
6446
6447 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
6448 explicit instantiations.
6449
d7ab2a47
KVH
64502008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
6451
6452 PR gold/6858
6453 * options.cc (General_options::finalize): Allow undefined symbols
6454 in shlibs if linking -shared.
6455
6456 PR gold/6859
6457 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
6458 symbols as not needing a dynsym entry.
6459
1e52a9c1
CS
64602008-08-20 Craig Silverstein <csilvers@google.com>
6461
6462 * fileread.cc (File_read::open): Do not lock the file unless it
6463 was successfully opened.
6464
d85c80a3
CC
64652008-08-14 Cary Coutant <ccoutant@google.com>
6466
6467 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
6468 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
6469 * testsuite/tls_test.cc (struct int128): 128-bit struct
6470 for testing TLS relocs with non-zero addend.
6471 (v12): New TLS variable.
6472 (t12): New test.
6473 (t_last): Add check for v12.
6474 * testsuite/tls_test.h (t12): New function.
6475 * testsuite/tls_test_main.cc (thread_routine): Call new test.
6476
2d924fd9
ILT
64772008-08-13 Ian Lance Taylor <iant@google.com>
6478
6479 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
6480 set tls_segment_ or relro_segment_.
6481 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
6482 when appropriate.
6483 * output.h (Output_section::clear_is_relro): New function.
6484 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
6485 sections specially even when output_data_ is empty.
6486 (Output_segment::maximum_alignment): When first section is relro,
6487 only force alignment for PT_LOAD segments.
6488 * script.cc (script_data_segment_align): New function.
6489 (script_data_segment_relro_end): New function.
6490 * script-c.h (script_data_segment_align): Declare.
6491 (script_data_segment_relro_end): Declare.
6492 * script-sections.h (class Script_sections): Declare
6493 data_segment_align and data_segment_relro_end. Add fields
6494 segment_align_index_ and saw_relro_end_.
6495 * script-sections.cc (class Sections_element): Add set_is_relro
6496 virtual function. Add new bool* parameter to place_orphan_here.
6497 Add get_output_section virtual function.
6498 (class Output_section_definition): Add set_is_relro. Add new
6499 bool* parameter to place_orphan_here. Add get_output_section.
6500 Add is_relro_ field.
6501 (Output_section_definition::Output_section_definition): Initialize
6502 evaluated_address_, evaluated_load_address, evaluated_addralign_,
6503 and is_relro_ fields.
6504 (Output_section_definition::place_orphan_here): Add is_relro
6505 parameter.
6506 (Output_section_definition::set_section_addresses): Set relro for
6507 output section.
6508 (Output_section_definition::alternate_constraint): Likewise.
6509 (class Orphan_output_section): Add new bool* parameter to
6510 place_orphan_here. Add get_output_section.
6511 (Orphan_output_section::place_orphan_here): Add is_relro
6512 parameter.
6513 (Script_sections::Script_sections): Initialize
6514 data_segment_align_index_ and saw_relro_end_.
6515 (Script_sections::data_segment_align): New function.
6516 (Script_sections::data_segment_relro_end): New function.
6517 (Script_sections::place_orphan): Set or clear is_relro.
6518 (Script_sections::set_section_addresses): Force alignment of first
6519 TLS section.
6520 * yyscript.y (exp): Call script_data_segment_align and
6521 script_data_segment_relro_end.
6522 * testsuite/relro_script_test.t: New file.
6523 * testsuite/relro_test.cc (using_script): Declare.
6524 (t1, t2): Test using_script.
6525 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
6526 (relro_script_test_SOURCES): Define.
6527 (relro_script_test_DEPENDENCIES): Define.
6528 (relro_script_test_LDFLAGS): Define.
6529 (relro_script_test_LDADD): Define.
6530 (relro_script_test.so): New target.
6531 * testsuite/Makefile.in: Rebuild.
6532
f827c9a9
CC
65332008-08-06 Cary Coutant <ccoutant@google.com>
6534
6535 * archive.cc (Archive::total_archives, Archive::total_members)
6536 (Archive::total_members_loaded): New variables.
6537 (Archive::setup): Add parameter. Add option to preread
6538 archive symbols.
6539 (Archive::read_armap): Add counter.
6540 (Archive::get_file_and_offset): New function.
6541 (Archive::get_elf_object_for_member): New function.
6542 (Archive::read_all_symbols): New function.
6543 (Archive::read_symbols): New function.
6544 (Archive::add_symbols): Add counters.
6545 (Archive::include_all_members): Use armap to find members if it's
6546 already built.
6547 (Archive::include_member): Skip reading symbols if already read.
6548 Factored code into Archive::get_file_and_offset and
6549 Archive::get_elf_object_for_member. Changed call to
6550 Mapfile::report_include_archive_member.
6551 (Archive::print_stats): New function.
6552 * archive.h: Declare Object and Read_symbols_data classes.
6553 (Archive::Archive): Add initializers for new members.
6554 (Archive::setup): Add parameter.
6555 (Archive::print_stats): New function.
6556 (Archive::total_archives, Archive::total_members)
6557 (Archive::total_members_loaded): New variables.
6558 (Archive::get_file_and_offset): New function.
6559 (Archive::get_elf_object_for_member): New function.
6560 (Archive::read_all_symbols): New function.
6561 (Archive::read_symbols): New function.
6562 (Archive::Archive_member): New class.
6563 (Archive::members_): New member.
6564 (Archive::num_members_): New member.
6565 * main.cc: Include archive.h.
6566 (main): Call Archive::print_stats.
6567 * mapfile.cc (Mapfile::report_include_archive_member): Delete
6568 archive parameter; member_name is now the fully-decorated name.
6569 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
6570 * options.h: (General_options): Add --preread-archive-symbols option.
6571 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
6572 Archive::setup.
6573
de4c45bd
ILT
65742008-08-04 Ian Lance Taylor <iant@google.com>
6575
6576 * symtab.h (Symbol::use_plt_offset): New function.
6577 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
6578 * powerpc.cc (Relocate::relocate): Likewise.
6579 * sparc.cc (Relocate::relocate): Likewise.
6580 * x86_64.cc (Relocate::relocate): Likewise.
6581 * testsuite/weak_plt.sh: New test.
6582 * testsuite/weak_plt_main.cc: New test.
6583 * testsuite/weak_plt_shared.cc: New test.
6584 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
6585 (check_PROGRAMS): Add weak_plt.
6586 (check_DATA): Add weak_plt_shared.so.
6587 (weak_plt_main_pic.o, weak_plt): New targets.
6588 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
6589 * testsuite/Makefile.in: Rebuild.
6590
6591 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
6592 gcctestdir/ld.
6593 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
6594 * testsuite/Makefile.in: Rebuild.
6595
323ee3f4
AM
65962008-08-04 Alan Modra <amodra@bigpond.net.au>
6597
6598 * Makefile.am (POTFILES.in): Set LC_ALL=C.
6599 * Makefile.in: Regenerate.
6600 * po/POTFILES.in: Regenerate.
6601
7c07ecec
ILT
66022008-07-29 Ian Lance Taylor <iant@google.com>
6603
6604 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
6605 symbols before other symbols.
6606 * testsuite/script_test_2.cc (test_addr): Declare.
6607 (test_addr_alias): Declare.
6608 (main): Check that test_addr and test_addr_alias have the right
cd536b21 6609 values.
7c07ecec
ILT
6610 * testsuite/script_test_2.t: Define test_addr_alias and
6611 test_addr.
6612
5778530e
ILT
66132008-07-24 Ian Lance Taylor <iant@google.com>
6614
2a00e4fb
ILT
6615 PR 5990
6616 * descriptors.cc: New file.
6617 * descriptors.h: New file.
6618 * gold-threads.h (class Hold_optional_lock): New class.
6619 * fileread.cc: Include "descriptors.h".
6620 (File_read::~File_read): Release descriptor rather than closing
6621 it.
6622 (File_read::open) [file]: Call open_descriptor rather than open.
6623 Set is_descriptor_opened_.
6624 (File_read::open) [memory]: Assert that descriptor is not open.
6625 (File_read::reopen_descriptor): New function.
6626 (File_read::release): Release descriptor.
6627 (File_read::do_read): Make non-const. Reopen descriptor.
6628 (File_read::read): Make non-const.
6629 (File_read::make_view): Reopen descriptor.
6630 (File_read::do_readv): Likewise.
6631 * fileread.h (class File_read): Add is_descriptor_opened_ field.
6632 Update declarations.
6633 * layout.cc: Include "descriptors.h".
6634 (Layout::create_build_id): Use open_descriptor rather than open.
6635 * output.cc: Include "descriptors.h".
6636 (Output_file::open): Use open_descriptor rather than open.
6637 * archive.cc (Archive::const_iterator): Change Archive to be
6638 non-const.
6639 (Archive::begin, Archive::end): Make non-const.
6640 (Archive::count_members): Likewise.
6641 * archive.h (class Archive): Update declarations.
6642 * object.h (Object::read): Make non-const.
6643 * Makefile.am (CCFILES): Add descriptors.cc.
6644 (HFILES): Add descriptors.h.
6645 * Makefile.in: Rebuild.
6646
801647d1
ILT
6647 PR 6716
6648 * gold.h: Always include <clocale>. Add Solaris workarounds
6649 following code in binutils/sysdep.h.
6650
5edd166e
ILT
6651 PR 6048
6652 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
6653 this->eh_frame_hdr_ is NULL before using it.
6654
c89ad728
ILT
6655 * dynobj.cc (Versions::Versions): Update comment.
6656
aa86f06b
ILT
6657 * dynobj.cc (Versions::Versions): If there is an soname, use it as
6658 the base version name.
6659
5778530e
ILT
6660 * stringpool.cc (Stringpool_template::add_with_length): Set key to
6661 array size plus one.
6662 (Stringpool_template::set_string_offsets): Subtract one from key
6663 before using it as an array index.
6664 (Stringpool_template::get_offset_with_length): Likewise.
6665 (Stringpool_template::write_to_buffer): Likewise.
6666 * stringpool.h (Stringpool_template::get_offset_from_key):
6667 Likewise.
6668
057ead22
ILT
66692008-07-23 Ian Lance Taylor <iant@google.com>
6670
7f649c59
ILT
6671 PR 6658
6672 * object.h (Merged_symbol_value::value): Do our best to handle a
6673 negative addend.
6674
057ead22
ILT
6675 PR 6647
6676 * script.cc (Version_script_info::get_versions): Don't add empty
6677 version tag to return value.
6678 (Version_script_info::get_symbol_version_helper): Change return
6679 type to bool. Add pversion parameter. Change all callers.
6680 (script_register_vers_node): Don't require a non-NULL tag.
6681 * script.h (class Version_script_info): Update declarations.
6682 (Version_script_info::get_symbol_version): Change return type to
6683 bool. Add version parameter. Change all callers.
6684 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
6685 handling. Handle an empty version from a version script.
6686 (Symbol_table::define_special_symbol): Likewise.
6687 * testsuite/ver_test_10.script: New file.
6688 * testsuite/ver_test_10.sh: New file.
6689 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
6690 (check_DATA): Add ver_test_10.syms.
6691 (ver_test_10.syms, ver_test_10.so): New target.
6692 * testsuite/Makefile.in: Rebuild.
6693
58e54ac2
CD
66942008-07-23 Simon Baldwin <simonb@google.com>
6695
6696 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
6697 to zero for undefined symbols from dynamic libraries.
6698
95d14cd3
ILT
66992008-07-23 Ian Lance Taylor <iant@google.com>
6700
6701 * symtab.cc (Symbol_table::resolve): Remove version parameter.
6702 Change all callers.
6703 * symtab.h (class Symbol_table): Update declaration.
6704 * testsuite/ver_test_9.cc: New file.
6705 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
6706 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
6707 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
6708 (ver_test_9.so, ver_test_9.o): New targets.
6709 * testsuite/Makefile.in: Rebuild.
6710
92de84a6
ILT
67112008-07-22 Ian Lance Taylor <iant@google.com>
6712
34810851
ILT
6713 * options.h (class General_options): Define --check-sections.
6714 * layout.cc (Layout::set_segment_offsets): Handle
6715 --check-sections.
6716
af6156ef
ILT
6717 * options.h (class General_options): Define -n/--nmagic and
6718 -N/--omagic.
6719 * options.cc (General_options::finalize): For -n/--nmagic or
6720 -N/--omagic, set -static.
6721 * layout.cc (Layout::attach_allocated_section_to_segment): If
6722 -N/--omagic, don't put read-only and read-write sections in
6723 different segments.
6724 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
6725 finding a read-only segment.
6726 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
6727 don't set the minimum segment alignment to the common page size,
6728 and don't set the file offset to the address modulo the page size.
6729 * script-sections.cc (Script_sections::create_segments): If
6730 -n/--omagic, don't put read-only and read-write sections in
6731 different segments.
6732
92de84a6
ILT
6733 * cref.cc: New file.
6734 * cref.h: New file.
6735 * options.h (class General_options): Add --print-symbol-counts.
6736 * main.cc (main): Issue defined symbol report if requested.
6737 * archive.cc (Archive::interpret_header): Make into a const member
6738 function.
6739 (Archive::add_symbols): Call Input_objects::archive_start and
6740 archive_stop.
6741 (Archive::const_iterator): Define new class.
6742 (Archive::begin, Archive::end): New functions.
6743 (Archive::include_all_members): Rewrite to use iterator.
6744 (Archive::count_members): New function.
6745 * archive.h (class Archive): Update declarations.
6746 (Archive::filename): New function.
6747 * object.cc: Include "cref.h".
6748 (Sized_relobj::Sized_relobj): Initialize defined_count_.
6749 (Sized_relobj::do_get_global_symbol_counts): New function.
6750 (Input_objects::add_object): Add object to cross-referencer.
6751 (Input_objects::archive_start): New function.
6752 (Input_objects::archive_stop): New function.
6753 (Input_objects::print_symbol_counts): New function.
6754 * object.h: Declare Cref and Archive.
6755 (Object::get_global_symbol_counts): New function.
6756 (Object::do_get_global_symbol_counts): New pure virtual function.
6757 (class Sized_relobj): Add defined_count_ field. Update
6758 declarations.
6759 (class Input_objects): Add cref_ field. Update constructor.
6760 Update declarations.
6761 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
6762 defined_count_.
6763 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
6764 symbol counts.
6765 (Sized_dynobj::do_get_global_symbol_counts): New function.
6766 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
6767 defined_count_. Update declarations. Define Symbols typedef.
6768 * symtab.cc (Symbol_table::add_from_relobj): Add defined
6769 parameter. Change all callers.
6770 (Symbol_table::add_from_dynobj): Add sympointers and defined
6771 parameters. Change all callers.
6772 * symtab.h (class Symbol_table): Update declarations.
6773 * Makefile.am (CCFILES): Add cref.cc.
6774 (HFILES): Add cref.h.
6775 * Makefile.in: Rebuild.
6776
3f7c5e1d
CD
67772008-07-22 Simon Baldwin <simonb@google.com>
6778
6779 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
6780 to zero when writing undefined symbols.
6781
e0b64032
ILT
67822008-07-22 Ian Lance Taylor <iant@google.com>
6783
6784 * output.cc (Output_section::add_input_section): Don't try to
6785 merge empty merge sections.
6786
096b02cf
CS
67872008-07-21 Craig Silverstein <csilvers@google.com>
6788
6789 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
6790 Include symbol version in error message.
cd536b21 6791
1d1f116d
CD
67922008-07-20 Chris Demetriou <cgd@google.com>
6793
cd536b21 6794 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
6795 (RANDOM_SEED_CFLAGS): New substituted variable.
6796 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
6797 * configure: Rebuild.
6798 * Makefile.in: Likewise.
6799 * testsuite/Makefile.in: Likewise.
6800
a18f591e
ILT
68012008-07-18 Ian Lance Taylor <iant@google.com>
6802
6803 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
6804 where we see NAME/NULL and NAME/VERSION as separate symbols.
6805 * testsuite/ver_test_main.cc (main): Call t4.
6806 (t4, t4_2a): Define.
6807 * testsuite/ver_test_2.cc (t4_2): Define.
6808 * testsuite/ver_test_2.script: Put t4_2a in VER2.
6809 * testsuite/ver_test_4.cc (t4_2a): Define.
6810 * testsuite/ver_test_4.script: Put t4_2a in VER2.
6811 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
6812
c6e3f6ed
ILT
68132008-07-17 Ian Lance Taylor <iant@google.com>
6814
6815 * dynobj.cc (Versions::add_def): If we give an error about a
6816 missing version, go ahead and create the version anyhow.
6817
ef9beddf
ILT
68182008-07-10 Ian Lance Taylor <iant@google.com>
6819
6820 Handle output sections with more than 0x7fffffff bytes.
6821 * object.h (class Relobj): Change map_to_output_ to
6822 output_sections_, and just keep a section pointer. Change all
6823 uses. Move comdat group support to Sized_relobj.
6824 (Relobj::is_section_specially_mapped): Remove.
6825 (Relobj::output_section): Remove poff parameter. Change all
6826 callers.
6827 (Relobj::output_section_offset): New function.
6828 (Relobj::set_section_offset): Rewrite.
6829 (Relobj::map_to_output): Remove.
6830 (Relobj::output_sections): New function.
6831 (Relobj::do_output_section_offset): New pure virtual function.
6832 (Relobj::do_set_section_offset): Likewise.
6833 (class Sized_relobj): Add section_offsets_ field. Add comdat
6834 group support from Relobj. Update declarations.
6835 (Sized_relobj::get_output_section_offset): New function.
6836 (Sized_relobj::do_output_section_offset): New function.
6837 (Sized_relobj::do_set_section_offset): New function.
6838 * object.cc (Relobj::output_section_address): Remove.
6839 (Sized_relobj::Sized_relobj): Initialize new fields.
6840 (Sized_relobj::include_section_group): Cast find_kept_object to
6841 Sized_relobj.
6842 (Sized_relobj::include_linkonce_section): Likewise.
6843 (Sized_relobj::do_layout): Use separate arrays for output section
6844 and output offset.
6845 (Sized_relobj::do_count_local_symbols): Change map_to_output to
6846 output_sections.
6847 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
6848 output_sections and section_offsets.
6849 (Sized_relobj::write_local_symbols): Likewise.
6850 (map_to_kept_section): Compute output address directly.
6851 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
6852 output_sections and section_offsets.
6853 (Sized_relobj::write_sections): Likewise.
6854 (Sized_relobj::relocate_sections): Likewise.
6855 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
6856 * output.h (class Output_reloc): Update declarations. Change
6857 u2_.relobj to Sized_relobj*.
6858 (class Output_data_reloc): Change add functions to use
6859 Sized_relobj*.
6860 * output.cc (Output_reloc::Output_reloc): Change relobj to
6861 Sized_relobj*.
6862 (Output_reloc::local_section_offset): Change return type to
6863 Elf_Addr. Use get_output_section_offset.
6864 (Output_reloc::get_address): Likewise.
6865 (Output_section::is_input_address_mapped): Don't call
6866 is_section_specially_mapped.
6867 (Output_section::output_offset): Likewise.
6868 (Output_section::output_address): Likewise.
6869 (Output_section::starting_output_address): Likewise.
6870 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
6871 parameter to Sized_relobj*.
6872 (Copy_relocs::need_copy_reloc): Likewise.
6873 (Copy_relocs::save): Likewise.
6874 * copy-relocs.h (class Copy_relocs): Update declarations.
6875 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
6876 Sized_relobj*. Change relobj_ field to Sized_relobj*.
6877 * target-reloc.h (relocate_for_relocatable): Change
6878 offset_in_output_section type to Elf_Addr. Change code that uses
6879 it as well.
6880 * layout.cc (Layout::layout): Always set *off.
6881 * mapfile.cc (Mapfile::print_input_section): Use
6882 output_section_offset.
6883 * i386.cc (Target_i386::copy_reloc): Change object parameter to
6884 Sized_relobj*.
6885 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
6886 * sparc.cc (Target_sparc::copy_reloc): Likewise.
6887 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
6888
5cb66f97
ILT
68892008-07-03 Ian Lance Taylor <iant@google.com>
6890
6891 * layout.cc (Layout::include_section): Do not discard unrecognized
6892 SHT_STRTAB sections.
6893
afe47622
CS
68942008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
6895
6896 * script.cc (Lex::can_continue_name): Make '?' allowable in
6897 version-script names.
6898 * testsuite/version_script.map: Change glob pattern to use '?'
6899
5adf9721
ILT
69002008-06-30 Manish Singh <yosh@gimp.org>
6901
6902 PR 6585
6903 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
6904 Correct typo.
6905
e6fde208
ILT
69062008-06-30 Ian Lance Taylor <iant@google.com>
6907
6908 PR 6660
6909 PR 6682
6910 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
6911 versions]: Don't try to read the value in the contents, since we
6912 don't use it. Use the template endianness when writing.
6913
3f2e6a2d
CC
69142008-06-25 Cary Coutant <ccoutant@google.com>
6915
6916 * fileread.cc (File_read::make_view): Assert on zero-length view.
6917 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
6918 symbol table when there are no symbols to read.
6919
c43d3a48
CS
69202008-06-23 Craig Silverstein <csilvers@google.com>
6921
6922 * version.cc (version_string): Bump to 1.7
6923
5f494ea0
CS
69242008-06-18 Craig Silverstein <csilvers@google.com>
6925
6926 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
6927 constant 0xFFFF to type Valtype.
6928 (Powerpc_relocate_functions::rel16_ha): Likewise.
6929
c42e122e
ILT
69302008-06-17 Ian Lance Taylor <iant@google.com>
6931
f34787f8
ILT
6932 * output.h (Output_section::Input_section): Initialize p2align_ to
6933 zero for Output_section_data constructors.
6934 (Output_section::Input_section::addralign): If not an input
6935 section, return the alignment of the Output_section_data.
6936 * testsuite/copy_test.cc: New file.
6937 * testsuite/copy_test_1.cc: New file.
6938 * testsuite/copy_test_2.cc: New file.
6939 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
6940 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
6941 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
6942 (copy_test_1_pic.o, copy_test_1.so): New targets.
6943 (copy_test_2_pic.o, copy_test_2.so): New targets.
6944 * testsuite/Makefile.in: Rebuild.
6945
c42e122e
ILT
6946 * script-sections.cc (Script_sections::place_orphan): Initialize
6947 local variable exact.
6948
ce3ac18a
DE
69492008-06-13 David Edelsohn <edelsohn@gnu.org>
6950
6951 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
6952
42cacb20
DE
69532008-06-12 David Edelsohn <edelsohn@gnu.org>
6954 David S. Miller <davem@davemloft.net>
6955
6956 * powerpc.cc: New file.
6957 * Makefile.am (TARGETSOURCES): Add powerpc.cc
6958 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
6959 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
6960 * Makefile.in: Rebuild.
6961
7b308235
ILT
69622008-06-09 Ian Lance Taylor <iant@google.com>
6963
6964 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
6965 <exception>.
6966 (throwing, orig_terminate): New static variables.
6967 (terminate_handler): New static function.
6968 (t2): Set terminate handler.
6969
f0b886e3
ILT
69702008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
6971
6972 PR 6584
cd536b21 6973 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
6974 alignment.
6975
3e90f135
CC
69762008-05-30 Cary Coutant <ccoutant@google.com>
6977
6978 * archive.cc (Archive::include_all_members) Correct to step
6979 over symbol table and extended name table in thin archives.
6980
e09ad04a
ILT
69812008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
6982
6983 PR 6407
6984 * target-reloc.h (relocate_for_relocatable): Fix new_offset
6985 calculation.
6986
62b01cb5
ILT
69872008-05-28 Caleb Howe <cshowe@google.com>
6988
6989 * reduced_debug_output.cc: New file.
6990 * reduced_debug_output.h: New file.
92de84a6 6991 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
6992 * options.cc (General_options::finalize): Add strip_debug_non_line
6993 to the strip heirarchy.
6994 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
6995 fields.
6996 * layout.cc: Include "reduced_debug_output.h".
6997 (Layout::Layout): Initialize new fields.
6998 (line_only_debug_sections): New static array.
6999 (is_lines_only_debug_sections): New static inline function.
7000 (Layout::include_section): Handle --strip-debug-non-line.
7001 (Layout::make_output_section): If --strip-debug-non-line, build
7002 new output sections for .debug_abbrev and .debug_info.
7003 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
7004 gold. Warn about possible overflow.
7005 (read_signed_LEB_128): Likewise.
7006 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
7007 (read_signed_LEB_128): Declare.
7008 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
7009 (HFILES): Add reduced_debug_output.h.
7010 * Makefile.in: Rebuild.
7011
7d9e3d98
ILT
70122008-05-21 Ian Lance Taylor <iant@google.com>
7013
7014 * mapfile.cc: New file.
7015 * mapfile.h: New file.
7016 * options.h (class General_options): Add -M/--print-map and -Map.
7017 * options.cc (General_options::finalize): Make -M equivalent to
7018 -Map -.
7019 * main.cc: Include <cstdio> and "mapfile.h".
7020 (main): Open mapfile if requested.
7021 * gold.cc (class Middle_runner): Add mapfile_ field. Update
7022 constructor. Change caller.
7023 (queue_initial_tasks): Add mapfile parameter. Change caller.
7024 (queue_middle_tasks): Likewise.
7025 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
7026 declarations.
7027 * archive.cc: Include "mapfile.h".
7028 (Archive::add_symbols): Add mapfile parameter. Change all
7029 callers. Pass mapfile, symbol, and reason to include_member.
7030 (Archive::include_all_members): Add mapfile parameter. Change all
7031 callers.
7032 (Archive::include_member): Add mapfile, sym, and why parameters.
7033 Change all callers. Report inclusion to map file.
7034 * archive.h: Include "fileread.h".
7035 (class Archive): Update declarations.
7036 (Archive::file): New const method.
7037 (class Add_archive_symbols): Add mapfile_ field. Update
7038 constructor. Change all callers.
7039 * readsyms.h (class Read_symbols): Likewise.
7040 (class Finish_group): Likewise.
7041 (class Read_script): Likewise.
7042 * common.cc: Include "mapfile.h".
7043 (Symbol_table::allocate_commons): Add mapfile parameter. Change
7044 all callers.
7045 (Symbol_table::do_allocate_commons): Likewise.
7046 (Symbol_table::do_allocate_commons_list): Likewise. Report common
7047 symbol allocation to mapfile.
7048 * common.h (class Allocate_commons_task): Add mapfile_ field.
7049 Update constructor. Change all callers.
7050 * symtab.h (class Symbol_table): Update declarations.
7051 * layout.cc: Include "mapfile.h".
7052 (Layout_task_runner::run): Print information to mapfile.
7053 (Layout::create_gold_note): Change Output_data_fixed_space to
7054 Output_data_zero_fill.
7055 (Layout::create_build_id): Likewise.
7056 (Layout::print_to_mapfile): New function.
7057 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
7058 constructor. Change caller.
7059 (class Layout): Declare print_to_mapfile.
7060 * output.cc (Output_section::Input_section::print_to_mapfile): New
7061 function.
7062 (Output_section::add_input_section): If producing a map, always
7063 add to input_sections_ list.
7064 (Output_section::do_print_to_mapfile): New function.
7065 (Output_segment::print_sections_to_mapfile): New function.
7066 (Output_segment::print_section_list_to_mapfile): New function.
7067 * output.h: Include "mapfile.h".
7068 (Output_data::print_to_mapfile): New function.
7069 (Output_data::do_print_to_mapfile): New virtual function.
7070 (Output_segment_headers::do_print_to_mapfile): New function.
7071 (Output_file_header::do_print_to_mapfile): New function.
7072 (Output_data_const::do_print_to_mapfile): New function.
7073 (class Output_data_const_buffer): Add map_name_ field. Update
7074 constructor. Change all callers. Add do_print_to_mapfile
7075 function.
7076 (class Output_data_fixed_space): Likewise.
7077 (class Output_data_space): Likewise.
7078 (class Output_data_zero_fill): New class.
7079 (Output_data_strtab::do_print_to_mapfile): New function.
7080 (Output_data_reloc_base::do_print_to_mapfile): New function.
7081 (Output_relocatable_relocs::do_print_to_mapfile): New function.
7082 (Output_data_group::do_print_to_mapfile): New function.
7083 (Output_data_got::do_print_to_mapfile): New function.
7084 (Output_data_dynamic::do_print_to_mapfile): New function.
7085 (Output_symtab_xindex::do_print_to_mapfile): New function.
7086 (class Output_section): Declare do_print_to_mapflie. Declare
7087 print_to_mapfile in Input_section.
7088 (class Output_segment): Declare new functions.
7089 * object.h (Sized_relobj::symbol_count): New function.
7090 * script-sections.cc
7091 (Output_section_element_dot_assignment::set_section_addresses):
7092 Change Output_data_fixed_space to Output_data_zero_fill.
7093 (Output_data_expression::do_print_to_mapfile): New function.
7094 * script.cc (read_input_script): Add mapfile parameter. Change
7095 all callers.
7096 * script.h (read_input_script): Update declaration.
7097 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
7098 (Eh_frame::do_print_to_mapfile): New function.
7099 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
7100 (Output_merge_string::do_print_to_mapfile): New function.
7101 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
7102 function.
7103 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
7104 function.
7105 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
7106 function.
7107 * Makefile.am (CCFILES): Add mapfile.cc.
7108 (HFILES): Add mapfile.h.
7109 * Makefile.in: Rebuild.
7110
9f1d377b
ILT
71112008-05-19 Ian Lance Taylor <iant@google.com>
7112
7113 * options.h (class General_options): Add -z relro.
7114 * layout.cc (Layout::Layout): Initialize relro_segment_.
7115 (Layout::add_output_section_data): Return the output section.
7116 (Layout::make_output_section): Rcognize relro sections and mark
7117 them appropriately.
7118 (Layout::attach_allocated_section_to_segment): Put relro sections
7119 in a PT_GNU_RELRO segment.
7120 (Layout::create_initial_dynamic_sections): Mark the .dynamic
7121 section as relro.
7122 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
7123 PT_TLS segments.
7124 (Layout::linkonce_mapping): Map d.rel.ro.local to
7125 .data.rel.ro.local.
7126 (Layout::output_section_name): Us .data.rel.ro.local for any
7127 section which begins with that.
7128 * layout.h (class Layout): Update add_output_section_data
7129 declaration. Add relro_segment_ field.
7130 * output.cc (Output_section::Output_section): Initialize is_relro_
7131 and is_relro_local_ fields.
7132 (Output_segment::add_output_section): Group relro sections.
7133 (Output_segment::is_first_section_relro): New function.
7134 (Output_segment::maximum_alignment): If there is a relro section,
7135 align the segment to the common page size.
7136 (Output_segment::set_section_addresses): Track whether we are
7137 looking at relro sections. If the last section is a relro
7138 section, align to the common page size.
7139 (Output_segment::set_section_list_addresses): Add in_relro
7140 parameter. Change all callers. Align to the page size when
7141 moving from relro to non-relro section.
7142 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
7143 segment.
7144 * output.h (class Output_section): Add is_relro_ and
7145 is_relro_local_ fields.
7146 (Output_section::is_relro): New function.
7147 (Output_section::set_is_relro): New function.
7148 (Output_section::is_relro_local): New function.
7149 (Output_section::set_is_relro_local): New function.
7150 (class Output_segment): Update declarations.
7151 * i386.cc (Target_i386::got_section): Mark .got section as relro.
7152 * sparc.cc (Target_sparc::got_section): Likewise.
7153 * x86_64.cc (Target_x86_64::got_section): Likewise.
7154 * testsuite/relro_test_main.cc: New file.
7155 * testsuite/relro_test.cc: New file.
7156 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
7157 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
7158 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
7159 (relro_test.so, relro_test_pic.o): New targets.
7160 * testsuite/Makefile.in: Rebuild.
7161
a984ee1d
ILT
71622008-05-16 Ian Lance Taylor <iant@google.com>
7163
01676dcd
ILT
7164 * output.cc (Output_segment::add_output_section): Remove front
7165 parameter.
7166 * output.h (class Output_segment): Remove
7167 add_initial_output_section and overloaded add_output_section.
7168 Update declaration of remaining add_output_section.
7169 * layout.cc (Layout::create_interp): Call add_output_section
7170 rather than add_initial_output_section.
7171 (Layout::finish_dynamic_section): Likewise.
7172
497897f9
ILT
7173 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
7174 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
7175 know the dynamic type.
7176 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
7177 field. Initialize it in constructor.
7178 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
7179 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
7180 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
7181 reloc.
7182
a984ee1d
ILT
7183 * output.cc (Output_reloc::get_address): Change return type to
7184 Elf_Addr.
7185 * output.h (class Output_reloc): Update get_address declaration.
7186 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
7187 for section addresses.
7188
55ba0940
ILT
71892008-05-09 Ian Lance Taylor <iant@google.com>
7190
7191 PR 6493
7192 * gold.cc (gold_nomem): Use return value of write.
7193
75517b77
ILT
71942008-05-08 Ian Lance Taylor <iant@google.com>
7195
7196 * symtab.c (Symbol::init_base_output_data): Add version
7197 parameter. Change all callers.
7198 (Symbol::init_base_output_segment): Likewise.
7199 (Symbol::init_base_constant): Likewise.
7200 (Symbol::init_base_undefined): Likewise.
7201 (Sized_symbol::init_output_data): Likewise.
7202 (Sized_symbol::init_output_segment): Likewise.
7203 (Sized_symbol::init_constant): Likewise.
7204 (Sized_symbol::init_undefined): Likewise.
7205 (Symbol_table::do_define_in_output_data): If the new symbol has a
7206 version, mark it as the default.
7207 (Symbol_table::do_define_in_output_segment): Likewise.
7208 (Symbol_table::do_define_as_constant): Likewise.
7209 * symtab.h (class Symbol): Update declarations.
7210 (class Sized_symbol): Likewise.
7211 * resolve.cc (Symbol::override_version): New function.
c42e122e 7212 (Symbol::override_base): Call override_version.
75517b77
ILT
7213 (Symbol::override_base_with_special): Likewise.
7214 * testsuite/ver_script_8.script: New file.
7215 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
7216 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
7217 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
7218 (ver_test_8_1.so, ver_test_8_2.so): New targets.
7219
f1f70eae
ILT
72202008-05-06 Ian Lance Taylor <iant@google.com>
7221
f3e9c5c5
ILT
7222 PR 6049
7223 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
7224 functions.
7225 (class General_options): Remove existing --undefined, and add
7226 --no-undefined instead. Add new --undefined as synonym for -u.
7227 * archive.cc (Archive::add_symbols): Check whether symbol was
7228 named with -u.
7229 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
7230 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
7231 all uses. Add IS_UNDEFINED. Update declarations to split
7232 different versions of init_base. Declare init_base_undefined.
7233 (Symbol::is_defined): Handle IS_UNDEFINED.
7234 (Symbol::is_undefined): Likewise.
7235 (Symbol::is_weak_undefined): Call is_undefined.
7236 (Symbol::is_absolute): Handle IS_CONSTANT.
7237 (class Sized_symbol): Update declarations to split different
7238 versions of init. Declare init_undefined.
7239 (class Symbol_table): Declare new functions.
7240 * symtab.cc (Symbol::init_base_object): Rename from init_base.
7241 Change all callers.
7242 (Symbol::init_base_output_data): Likewise.
7243 (Symbol::init_base_output_segment): Likewise.
7244 (Symbol::init_base_constant): Likewise.
7245 (Symbol::init_base_undefined): New function.
7246 (Sized_symbol::init_object): Rename from init. Change all
7247 callers.
7248 (Sized_symbol::init_output_data): Likewise.
7249 (Sized_symbol::init_output_segment): Likewise.
7250 (Sized_symbol::init_constant): Likewise.
7251 (Sized_symbol::init_undefined): New function.
7252 (Symbol_table::add_undefined_symbols_from_command_line): New
7253 function.
7254 (Symbol_table::do_add_undefined_symbols_from_command_line): New
7255 function.
7256 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
7257 (Symbol::output_section): Likewise.
7258 (Symbol::set_output_section): Likewise.
7259 (Symbol_table::sized_finalize_symbol): Likewise.
7260 (Symbol_table::sized_write_globals): Likewise.
7261 * resolve.cc (Symbol_table::should_override): Likewise.
7262 (Symbol::override_base_with_special): Likewise.
7263
8bdcdf2c
ILT
7264 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
7265 symbol, change it to have default visibility.
7266 * testsuite/protected_1.cc: New file.
7267 * testsuite/protected_2.cc: New file.
7268 * testsuite/protected_3.cc: New file.
7269 * testsuite/protected_main_1.cc: New file.
7270 * testsuite/protected_main_2.cc: New file.
7271 * testsuite/protected_main_3.cc: New file.
7272 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
7273 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
7274 (protected_1_LDFLAGS, protected_1_LDADD): Define.
7275 (protected_1.so): New target.
7276 (protected_1_pic.o, protected_2_pic.o): New targets.
7277 (protected_3_pic.o): New target.
7278 (check_PROGRAMS): Add protected_2.
7279 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
7280 (protected_2_LDFLAGS, protected_2_LDADD): Define.
7281 * testsuite/Makefile.in: Rebuild.
7282
2b706932
ILT
7283 * options.h (DEFINE_var): Add set_user_set_##varname__.
7284 (DEFINE_bool_alias): New macro.
7285 (class General_options): Define -Bstatic using DEFINE_bool_alias
7286 rather than DEFINE_special. Add --undefined as an alias for -z
7287 defs.
7288 * options.cc (General_options::parse_Bstatic): Remove.
7289
d82a5bcc
ILT
7290 * options.h (class General_options): Add --fatal-warnings.
7291 * main.cc (main): Implement --fatal-warnings.
7292 * errors.h (Errors::warning_count): New function.
7293
f1f70eae
ILT
7294 * options.h (class General_options): Add -Bsymbolic-functions.
7295 * symtab.h (Symbol::is_preemptible): Check for
7296 -Bsymbolic-functions.
7297
8825ac63
ILT
72982008-05-05 Ian Lance Taylor <iant@google.com>
7299
d98bc257
ILT
7300 * options.h (DEFINE_bool): For DASH_Z, create the negative option
7301 as noVARNAME rather than no-VARNAME.
7302 (class General_options): Add option -z combreloc.
7303 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
7304 get_address.
7305 (Output_reloc::sort_before) [SHT_REL]: New function.
7306 (Output_reloc::sort_before) [SHT_RELA]: New function.
7307 (class Output_data_reloc_base): Add sort_relocs_ field. Define
7308 Sort_relocs_comparison.
7309 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
7310 parameter. Change all callers.
7311 (Output_data_reloc::Output_data_reloc) [both versions]: Add
7312 sort_relocs parameter. Change all callers.
7313 * output.cc (Output_reloc::get_address): New function, broken out
7314 of write_rel.
7315 (Output_reloc::write_rel): Call it.
7316 (Output_reloc::compare): New function.
7317 (Output_data_reloc_base::do_write): Optionally sort relocs.
7318
60b2b4e7
ILT
7319 * configure.ac: If targ_extra_obj is set, link it in.
7320 * configure.tgt: Initialize all variables.
7321 (x86_64*): Set targ_extra_obj and targ_extra_size.
7322 * configure: Rebuild.
7323
8825ac63
ILT
7324 * object.cc (Sized_relobj::include_section_group): Adjust section
7325 indexes read from group data. Build vector to pass to
7326 layout_group.
7327 * layout.cc (Layout::layout_group): Add flags and shndxes
7328 parameters. Remove contents parameter. Change caller. Update
7329 explicit instantiations.
7330 * layout.h (class Layout): Update layout_group declaration.
7331 * output.cc (Output_data_group::Output_data_group): Add flags and
7332 input_shndxes parameters. Remove contents parameter. Change
7333 caller.
7334 (Output_data_group::do_write): Change input_sections_ to
7335 input_shndxes_.
7336 * output.h (class Output_data_group): Update constructor
7337 declaration. Rename input_sections_ to input_shndxes_.
7338 * testsuite/many_sections_test.cc: Add template.
7339
e94cf127
CC
73402008-04-30 Cary Coutant <ccoutant@google.com>
7341
4418b2d5
CC
7342 * target-reloc.h (relocate_section): Fix dead-pointer bug.
7343
e94cf127
CC
7344 * layout.cc (Layout::include_section): Refactored check for debug
7345 info section.
7346 (Layout::add_comdat): Add new parameters. Change type
7347 of signature parameter. Add object and shndx to signatures table.
7348 (Layout::find_kept_object): New function.
7349 * layout.h: Include <cstring>.
7350 (Layout::is_debug_info_section): New function.
7351 (Layout::add_comdat): Add new parameters.
7352 (Layout::find_kept_object): New function.
7353 (Layout::Kept_section): New struct.
7354 (Layout::Signatures): Change type of map range.
7355 * object.cc (Relobj::output_section_address): New function.
7356 (Sized_relobj::include_section_group): Add new parameters. Change
7357 calls to Layout::add_comdat. Change to build table of kept comdat
7358 groups and table mapping discarded sections to kept sections.
7359 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
7360 (Sized_relobj::do_layout): Change calls to include_section_group and
7361 include_linkonce_section.
7362 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
7363 value to zero when section is discarded.
7364 (Sized_relobj::map_to_kept_section): New function.
7365 * object.h (Relobj::output_section_address): New function.
7366 (Relobj::Comdat_group): New type.
7367 (Relobj::find_comdat_group): New function.
7368 (Relobj::Comdat_group_table): New type.
7369 (Relobj::Kept_comdat_section): New type.
7370 (Relobj::Kept_comdat_section_table): New type.
7371 (Relobj::add_comdat_group): New function.
7372 (Relobj::set_kept_comdat_section): New function.
7373 (Relobj::get_kept_comdat_section): New function.
7374 (Relobj::comdat_groups_): New field.
7375 (Relobj::kept_comdat_sections_): New field.
7376 (Symbol_value::input_value): Update comment.
7377 (Sized_relobj::map_to_kept_section) New function.
7378 (Sized_relobj::include_linkonce_section): Add new parameter.
7379 * target-reloc.h (Comdat_behavior): New type.
7380 (get_comdat_behavior): New function.
7381 (relocate_section): Add code to map a discarded section to the
7382 corresponding kept section when applying a relocation.
7383
e4e5049b
CS
73842008-04-30 Craig Silverstein <csilvers@google.com>
7385
7386 * dwarf_reader.cc (next_generation_count): New static var.
7387 (Addr2line_cache_entry): New struct.
7388 (addr2line_cache): New static var.
7389 (Dwarf_line_info::one_addr2line): Added caching.
7390 (Dwarf_line_info::clear_addr2line_cache): New function.
7391 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
7392 cache-size parameter.
7393 (Dwarf_line_info::one_addr2line_cache): New function.
7394 * symtab.cc (Symbol_table::detect_odr_violations): Pass
7395 new cache-size argument to one_addr2line(), and clear cache.
7396
d09e9154
CC
73972008-04-28 Cary Coutant <ccoutant@google.com>
7398
7399 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
7400 R_386_PC8 relocations.
7401
7ef73768
ILT
74022008-04-23 Ian Lance Taylor <iant@google.com>
7403
55438702
ILT
7404 * object.cc (Sized_relobj::include_section_group): Check for
7405 invalid section group.
7406
c165fb93
ILT
7407 * object.cc (make_elf_object): Correct test for 64-bit ELF file
7408 header size.
7409
7ef73768
ILT
7410 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
7411 than read for file header.
7412 * archive.cc (Archive::include_member): Likewise.
7413
6194aaab
L
74142008-04-23 Paolo Bonzini <bonzini@gnu.org>
7415
7416 * aclocal.m4: Regenerate.
7417 * configure: Regenerate.
7418
d491d34e
ILT
74192008-04-19 Ian Lance Taylor <iant@google.com>
7420
5ea2bac6
ILT
7421 * version.cc (version_string): Bump to 1.6.
7422
7bc3e21a
ILT
7423 * testsuite/Makefile.am (many_sections_r_test): New target.
7424 (many_sections_r_test_SOURCES): Remove.
7425 (many_sections_r_test_DEPENDENCIES): Remove.
7426 (many_sections_r_test_LDFLAGS): Remove.
7427 (many_sections_r_test_LDADD): Remove.
7428
7fcd3aa9
ILT
7429 * object.cc (Sized_relobj::do_add_symbols): Always pass
7430 local_symbol_count_ to add_from_relobj.
7431
4c94d6ae
ILT
7432 * testsuite/Makefile.am (many_sections_check.h): Only check one in
7433 every thousand variables.
7434 * testsuite/Makefile.in: Rebuild.
7435
d491d34e
ILT
7436 * object.cc (Xindex::initialize_symtab_xindex): New function.
7437 (Xindex::read_symtab_xindex): New function.
7438 (Xindex::sym_xindex_to_shndx): New function.
7439 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
7440 available.
7441 (Sized_relobj::do_initialize_xindex): New function.
7442 (Sized_relobj::do_read_symbols): Adjust section links.
7443 (Sized_relobj::symbol_section_and_value): Add is_ordinary
7444 parameter. Change all callers.
7445 (Sized_relobj::include_section_group): Adjust section links and
7446 symbol section indexes.
7447 (Sized_relobj::do_layout): Adjust section links.
7448 (Sized_relobj::do_count_local_symbols): Adjust section links and
7449 symbol section indexes.
7450 (Sized_relobj::do_finalize_local_symbols): Distinguish between
7451 ordinary and special symbols.
7452 (Sized_relobj::write_local_symbols): Add symtab_xindex and
7453 dynsym_xindex parameters. Change all callers. Adjust section
7454 links. Use SHN_XINDEX when needed.
7455 (Sized_relobj::get_symbol_location_info): Adjust section links.
7456 Don't get fooled by special symbols.
7457 * object.h (class Xindex): Define.
7458 (class Object): Add xindex_ parameter. Declare virtual functoin
7459 do_initialize_xindex.
7460 (Object::adjust_sym_shndx): New function.
7461 (Object::set_xindex): New protected function.
7462 (class Symbol_value): Add is_ordinary_shndx_ field.
7463 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
7464 (Symbol_value::value): Assert ordinary section.
7465 (Symbol_value::initialize_input_to_output_map): Likewise.
7466 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
7467 Change all callers.
7468 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
7469 all callers.
7470 (class Sized_relobj): Update declarations.
7471 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
7472 parameter. Change all callers.
7473 (Sized_relobj::adjust_shndx): New function.
7474 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
7475 field.
7476 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
7477 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
7478 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
7479 (Sized_dynobj::read_dynsym_section): Adjust section links.
7480 (Sized_dynobj::read_dynamic): Likewise.
7481 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
7482 section links.
7483 (Sized_dynobj::do_initialize_xindex): New function.
7484 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
7485 do_initialize_xindex.
7486 (Sized_dynobj::adjust_shndx): New function.
7487 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
7488 dynsym_xindex_ fields.
7489 (Layout::finalize): Add a call to set_section_indexes before
7490 creating the symtab sections.
7491 (Layout::set_section_indexes): Don't do anything if the section
7492 already has a section index.
7493 (Layout::create_symtab_sections): Add shnum parameter. Change
7494 caller. Create .symtab_shndx section if needed.
7495 (Layout::create_shdrs): Add shstrtab_section parameter. Change
7496 caller.
7497 (Layout::allocated_output_section_count): New function.
7498 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
7499 needed.
7500 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
7501 fields. Update declarations.
7502 (Layout::symtab_xindex): New function.
7503 (Layout::dynsym_xindex): New function.
7504 (class Write_symbols_task): Add layout_ field.
7505 (Write_symbols_task::Write_symbols_task): Add layout parameter.
7506 Change caller.
7507 * output.cc (Output_section_headers::Output_section_headers): Add
7508 shstrtab_section parameter. Change all callers.
7509 (Output_section_headers::do_sized_write): Store overflow values
7510 for section count and section string table section index in
7511 section header zero.
7512 (Output_file_header::do_sized_write): Check for overflow of
7513 section count and section string table section index.
7514 (Output_symtab_xindex::do_write): New function.
7515 (Output_symtab_xindex::endian_do_write): New function.
7516 * output.h (class Output_section_headers): Add shstrtab_section_.
7517 Update declarations.
7518 (class Output_symtab_xindex): Define.
7519 (Output_section::has_out_shndx): New function.
7520 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
7521 field.
7522 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
7523 Change all callers.
7524 (Sized_symbol::init): Likewise.
7525 (Symbol::output_section): Check for ordinary symbol.
7526 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
7527 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
7528 callers.
7529 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
7530 Change all callers. Simplify handling of symbols from sections
7531 not included in the link.
7532 (Symbol_table::add_from_dynobj): Handle ordinary symbol
7533 distinction.
7534 (Weak_alias_sorter::operator()): Assert that symbols are
7535 ordinary.
7536 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
7537 distinction.
7538 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
7539 parameters. Change all callers.
7540 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
7541 symbol distinction. Use SHN_XINDEX when needed.
7542 (Symbol_table::write_section_symbol): Add symtab_xindex
7543 parameter. Change all callers.
7544 (Symbol_table::sized_write_section_symbol): Likewise. Use
7545 SHN_XINDEX when needed.
7546 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
7547 declarations.
7548 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
7549 (Symbol::is_defined): Check is_ordinary.
7550 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
7551 (Symbol::is_absolute, Symbol::is_common): Likewise.
7552 (class Sized_symbol): Update declarations.
7553 (class Symbol_table): Update declarations.
7554 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
7555 parameters. Change all callers.
7556 (Sized_symbol::override): Likewise.
7557 (Symbol_table::override): Likewise.
7558 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
7559 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
7560 is_ordinary, and orig_st_shndx parameters. Change all callers.
7561 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
7562 to be in an ordinary section.
7563 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
7564 object and is_ordinary parameters. Change all callers.
7565 (Sized_dwarf_line_info::read_relocs): Add object parameter.
7566 Change all callers. Don't add undefined or non-ordinary symbols
7567 to reloc_map_.
7568 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
7569 Change all callers.
7570 * dwarf_reader.h (class Sized_dwarf_line_info): Update
7571 declarations.
7572 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
7573 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
7574 (Sized_relobj::relocate_sections): Likewise.
7575 * target-reloc.h (scan_relocs): Adjust section symbol index.
7576 (scan_relocatable_relocs): Likewise.
7577 * i386.cc (Scan::local): Check for ordinary symbols.
7578 * sparc.cc (Scan::local): Likewise.
7579 * x86_64.cc (Scan::local): Likewise.
7580 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
7581 to symbol_section_and_value.
7582 * testsuite/many_sections_test.cc: New file.
7583 * testsuite/Makefile.am (BUILT_SOURCES): Define.
7584 (check_PROGRAMS): Add many_sections_test.
7585 (many_sections_test_SOURCES): Define.
7586 (many_sections_test_DEPENDENCIES): Define.
7587 (many_sections_test_LDFLAGS): Define.
7588 (BUILT_SOURCES): Add many_sections_define.h.
7589 (many_sections_define.h): New target.
7590 (BUILT_SOURCES): Add many_sections_check.h.
7591 (many_sections_check.h): New target.
7592 (check_PROGRAMS): Add many_sections_r_test.
7593 (many_sections_r_test_SOURCES): Define.
7594 (many_sections_r_test_DEPENDENCIES): Define.
7595 (many_sections_r_test_LDFLAGS): Define.
7596 (many_sections_r_test_LDADD): Define.
7597 (many_sections_r_test.o): New target.
7598 * testsuite/Makefile.in: Rebuild.
7599
c5818ff1
CC
76002008-04-17 Cary Coutant <ccoutant@google.com>
7601
7602 * errors.cc (Errors::info): New function.
7603 (gold_info): New function.
7604 * errors.h (Errors::info): New function.
7605 * gold.h (gold_info): New function.
7606 * object.cc (Input_objects::add_object): Print trace output.
7607 * options.cc (options::parse_set): New function.
7608 (General_options::parse_wrap): Deleted.
7609 (General_options::General_options): Deleted initializer.
7610 * options.h (options::String_set): New typedef.
7611 (options::parse_set): New function.
7612 (DEFINE_set): New macro.
7613 (General_options::wrap): Changed to use DEFINE_set. Changed
7614 callers of any_wrap_symbols and is_wrap_symbol.
7615 (General_options::trace, General_options::trace_symbol):
7616 New options.
7617 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
7618 (General_options::wrap_symbols_): Deleted.
7619 * symtab.cc (Symbol_table::add_from_object): Print trace output.
7620
b5be4a7c
DM
76212008-04-17 David S. Miller <davem@davemloft.net>
7622
7623 * options.cc (General_options::parse_V): New function.
7624 * options.h: Add entries for -V and -Qy.
7625
155a0dd7
ILT
76262008-04-17 Ian Lance Taylor <iant@google.com>
7627
7628 * common.cc (Symbol_table::allocate_commons): Remove options
7629 parameter. Change caller.
7630 (Symbol_table::do_allocate_commons): Remove options parameter.
7631 Change caller. Just call do_allocate_commons_list twice.
7632 (Symbol_table::do_allocate_commons_list): New function, broken out
7633 of do_allocate_commons.
7634 * common.h (class Allocate_commons_task): Remove options_ field.
7635 Update constructor.
7636 * symtab.cc (Symbol_table::Symbol_table): Initialize
7637 tls_commons_.
7638 (Symbol_table::add_from_object): Put TLS common symbols on
7639 tls_commons_ list.
7640 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
7641 which are IN_OUTPUT_DATA.
7642 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
7643 allocate_commons and do_allocate_commons declarations. Declare
7644 do_allocate_commons_list.
7645 * gold.cc (queue_middle_tasks): Update creation of
7646 Allocate_commons_task to not pass options.
7647 * testsuite/Makefile.am (INCLUDES): Add -I.. .
7648 (TLS_TEST_C_FLAGS): New variable.
7649 (tls_test_c_pic.o): New target.
7650 (tls_test_shared.so): Link in tls_test_c_pic.o.
7651 (tls_test_c_pic_ie.o): New target.
7652 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
7653 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
7654 (tls_test_c.o): New target.
7655 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
7656 (tls_pic_test_LDADD): Likewise.
7657 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
7658 (tls_shared_gd_to_ie_test_LDADD): Likewise.
7659 (tls_test_c_gnu2.o): New target.
7660 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
7661 tls_test_c_gnu2.o.
7662 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
7663 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
7664 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
7665 * testsuite/tls_test.cc: Include "config.h".
7666 (t_last): Call t11_last.
7667 * testsuite/tls_test.h (t11, t11_last): Declare.
7668 * testsuite/tls_test_c.c: New file.
7669 * testsuite/tls_test_main.cc (thread_routine): Call t11.
7670 * configure.ac: Check for OpenMP support.
7671 * configure, config.in, Makefile.in: Rebuild.
7672 * testsuite/Makefile.in: Rebuild.
7673
edfbb029
CC
76742008-04-16 Cary Coutant <ccoutant@google.com>
7675
7676 * i386.cc (Target_i386::define_tls_base_symbol): New function.
7677 (Target_i386::tls_base_symbol_defined_): New field.
7678 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
7679 (Target_i386::Scan::global): Likewise.
7680 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
7681 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
7682 (Target_x86_64::tls_base_symbol_defined_): New field.
7683 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
7684 (Target_x86_64::Scan::global): Likewise.
7685
f3c69fca
CC
76862008-04-16 Cary Coutant <ccoutant@google.com>
7687
7688 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
7689 (Symbol::needs_plt_entry): Allow weak undefined symbols.
7690 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
7691 building shared libraries.
7692 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
7693 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
7694 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
7695 * testsuite/Makefile.in: Rebuild.
7696 * testsuite/weak_undef.h: New file.
7697 * testsuite/weak_undef_file1.cc: Add extra test cases.
7698 * testsuite/weak_undef_file2.cc: Likewise.
7699 * testsuite/weak_undef_test.cc: Likewise.
7700
7c414435
DM
77012008-04-16 David S. Miller <davem@davemloft.net>
7702
32b769e1
DM
7703 * sparc.cc (Target_sparc::Scan): Change from struct to class.
7704 Add issued_non_pic_error_ field. Declare check_non_pic.
7705 (Target_sparc::Scan::check_non_pic): New function.
7706 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
7707 (Target_sparc::Scan::global): Likewise.
7708
11936fb1
DM
7709 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
7710 * configure: Rebuild.
7711
7c414435
DM
7712 * options.h (DEFINE_enable): New macro.
7713 (new_dtags): New enable option.
7714 (initfirst, interpose, loadfltr, nodefaultlib,
7715 nodelete, nodlopen, nodump): New -z options.
7716 * layout.cc (Layout:finish_dynamic_section): If new
7717 dtags enabled, emit DT_RUNPATH. Also, emit a
7718 DT_FLAGS_1 containing any specified -z flags.
7719
85c7bf8b
ILT
77202008-04-16 Ian Lance Taylor <iant@google.com>
7721
12c0daef
ILT
7722 * copy-relocs.cc: New file.
7723 * copy-relocs.h: New file.
7724 * reloc.cc: Remove Copy_relocs code.
7725 * reloc.h: Likewise.
7726 * reloc-types.h (struct Reloc_types) [both versions]: Add
7727 get_reloc_addend_noerror.
7728 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
7729 variants of add_global which take an addend which must be zero.
7730 * i386.cc: Include "copy-relocs.h".
7731 (class Target_i386): Change type of copy_relocs_ to variable,
7732 update initializer.
7733 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
7734 Change all callers.
7735 (Target_i386::do_finalize_sections): Change handling of
7736 copy_relocs_.
7737 * sparc.cc: Include "copy-relocs.h".
7738 (class Target_sparc): Change type of copy_relocs_ to variable,
7739 update initializer.
7740 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
7741 Change all callers.
7742 (Target_sparc::do_finalize_sections): Change handling of
7743 copy_relocs_.
7744 * x86_64.cc: Include "copy-relocs.h".
7745 (class Target_x86_64): Change type of copy_relocs_ to variable,
7746 update initializer.
7747 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
7748 class. Change all callers.
7749 (Target_x86_64::do_finalize_sections): Change handling of
7750 copy_relocs_.
7751 * Makefile.am (CCFILES): Add copy-relocs.cc.
7752 (HFILES): Add copy-relocs.h.
7753
4f4995b6
ILT
7754 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
7755
85c7bf8b
ILT
7756 * testsuite/script_test_4.sh: Permit leading zeroes.
7757
4f2a9edd
ILT
77582008-04-15 Ian Lance Taylor <iant@google.com>
7759
e6188289
ILT
7760 * script-sections.cc (Script_sections::create_segments): Use
7761 header_size_adjustment even when there is enough room for the
7762 headers.
7763 * testsuite/script_test_4.sh: New file.
7764 * testsuite/script_test_4.t: New file.
7765 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
7766 (check_DATA): Add script_test_4.stdout.
7767 (MOSTLYCLEANFILES): Likewise.
7768 (script_test_4): New target.
7769 (script_test_4.stdout): New target.
7770 * testsuite/Makefile.in: Rebuild.
7771
4f2a9edd
ILT
7772 * sparc.cc: Add definitions for Output_data_plt_sparc class
7773 constants.
7774
f5314dd5
DM
77752008-04-14 David S. Miller <davem@davemloft.net>
7776
7777 * sparc.cc: New file.
7778 * Makefile.am (TARGETSOURCES): Add sparc.cc
7779 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
7780 * configure.tgt: Document targ_extra_size and
7781 targ_extra_big_endian. Add entries for sparc-* and
7782 sparc64-*.
7783 * configure.ac: Handle targ_extra_size and
7784 targ_extra_big_endian.
7785 * Makefile.in: Rebuild.
7786 * configure: Likewise.
7787 * po/POTFILES.in: Likewise.
7788 * po/gold.pot: Likewise.
7789
154e0e9a
ILT
77902008-04-14 Ian Lance Taylor <iant@google.com>
7791
7792 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
7793 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
7794 in the name/type/flags to section mapping. Don't call
7795 allocate_output_section.
7796 (Layout::choose_output_section): Change parameter from adjust_name
7797 to is_input_section. Don't permit input sections after sections
7798 are attached to segments. Don't call allocate_output_section.
7799 (Layout::layout_eh_frame): Call update_flags_for_input_section,
7800 not write_enable_output_section.
7801 (Layout::make_output_section): Don't push to
7802 unattached_section_list_ nor call attach_to_segment. Call
7803 attach_section_to_segment if sections are attached.
7804 (Layout::attach_sections_to_segments): New function.
7805 (Layout::attach_section_to_segment): New function.
7806 (Layout::attach_allocated_section_to_segment): Rename from
7807 attach_to_segment. Remove flags parameter.
7808 (Layout::allocate_output_section): Remove function.
7809 (Layout::write_enable_output_section): Remove function.
7810 * layout.h (class Layout): Update for above changes. Add new
7811 field sections_are_attached_.
7812 * output.h (Output_section::update_flags_for_input_section): New
7813 function.
7814 * output.cc (Output_section::add_input_section): Call
7815 update_flags_for_input_section.
7816 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
7817
009a67a2
CC
78182008-04-11 Cary Coutant <ccoutant@google.com>
7819
7820 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
7821 thought unnecessary.
7822 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
7823
759b1a24
ILT
78242008-04-11 Ian Lance Taylor <iant@google.com>
7825
7826 * output.h (class Output_section_data): Remove inline definition
7827 of set_addralign.
7828 * output.cc (Output_section_data::set_addralign): New function.
7829
c2b45e22
CC
78302008-04-11 Cary Coutant <ccoutant@google.com>
7831
7832 Add support for TLS descriptors for i386 and x86_64.
7833 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
7834 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
7835 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
7836 GOT_TYPE_TLS_DESC.
7837 (Target_i386::got_mod_index_entry): Remove unnecessary code.
7838 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
7839 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
7840 relocations.
7841 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
7842 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
7843 Fix problem with initial-exec relocations.
7844 (Target_i386::Relocate::relocate_tls): Likewise.
7845 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
7846 relaxation.
7847 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
7848 support for section-plus-offset dynamic table entries.
7849 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
7850 (Output_data_dynamic::Dynamic_entry): Add support for
7851 section-plus-offset dynamic table entries.
7852 (Output_data_dynamic::Classification): Likewise.
7853 (Output_data_dynamic::classification_): Renamed offset_.
7854 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
7855 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
7856 (Target_x86_64::make_plt_section): New function.
7857 (Target_x86_64::reserve_tlsdesc_entries): New function.
7858 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
7859 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
7860 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
7861 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
7862 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
7863 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
7864 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
7865 add extra PLT entry for TLS descriptors.
7866 (Output_data_plt_x86_64::got_): New field.
7867 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
7868 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
7869 fields.
7870 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
7871 descriptors.
7872 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
7873 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
7874 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
7875 R_386_TLS_DESC_CALL relocations.
7876 (Target_x86_64::Scan::global): Likewise.
7877 (Target_x86_64::do_finalize_sections): Add dynamic table entries
7878 for TLS descriptors.
7879 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
7880 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
7881 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
7882 GD-to-IE relaxation.
7883 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
7884 and TLS_DESCRIPTORS.
7885 * Makefile.in: Rebuild.
7886 * configure: Rebuild.
7887 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
7888 (tls_test_shared2.so): New target.
7889 (tls_shared_gd_to_ie_test_SOURCES): New variable.
7890 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
7891 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
7892 (tls_shared_gd_to_ie_test_LDADD): New variable.
7893 (tls_shared_gnu2_gd_to_ie_test): New target.
7894 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
7895 New targets.
7896 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
7897 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
7898 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
7899 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
7900 (tls_shared_gnu2_test): New target.
7901 (tls_test_gnu2_shared.so): New target.
7902 (tls_shared_gnu2_test_SOURCES): New variable.
7903 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
7904 (tls_shared_gnu2_test_LDFLAGS): New variable.
7905 (tls_shared_gnu2_test_LDADD): New variable.
7906 * testsuite/Makefile.in: Rebuild.
7907 * testsuite/Makefile.
7908
83bfb6b7
ILT
79092008-04-11 Ian Lance Taylor <iant@google.com>
7910
7911 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
7912 justsyms.t.
7913 * testsuite/Makefile.in: Rebuild.
7914
7915 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
7916 long.
7917 * testsuite/script_test_2.cc (main): Adjust test.
7918
706e1f5e
ILT
79192008-04-11 David S. Miller <davem@davemloft.net>
7920 Ian Lance Taylor <iant@google.com>
7921
7922 * options.h (General_options): Add entries for '-Y' and
7923 '-relax'.
7924 * options.cc (General_options:finalize): If -Y was used, add those
7925 entries to the library path instead of the default "/lib" and
7926 "/usr/lib".
7927
7c98e6bb
DM
79282008-04-11 David S. Miller <davem@davemloft.net>
7929
7930 * testsuite/justsyms.t: Start at 0x100.
7931 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
7932 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
7933 long.
7934 * testsuite/script_test_2.cc: Adjust string and section length
7935 checks.
7c98e6bb 7936
99a37bfd
ILT
79372008-04-09 Ian Lance Taylor <iant@google.com>
7938
2cefc357
ILT
7939 PR gold/5996
7940 * script-sections.cc (Sections_element::allocate_to_segment): Add
7941 orphan parameter.
7942 (Output_section_definition::allocate_to_segment): Likewise.
7943 (Orphan_output_section::allocate_to_segment): Likewise.
7944 (Script_sections::attach_sections_using_phdrs_clause): Don't
7945 propagate non-PT_LOAD segments to orphan sections.
7946 * testsuite/Makefile.am (script_test_3.stdout): Generate using
7947 readelf rather than objdump.
7948 * testsuite/script_test_3.sh: Adjust accordingly. Test that
7949 .interp section and PT_INTERP segment are the same size.
7950 * testsuite/Makefile.in: Rebuild.
7951
99a37bfd
ILT
7952 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
7953 aliases for symbols defined in the same object.
7954 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
7955 (weak_alias_test_SOURCES): New variable.
7956 (weak_alias_test_DEPENDENCIES): New variable.
7957 (weak_alias_test_LDFLAGS): New variable.
7958 (weak_alias_test_LDADD): New variable.
7959 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
7960 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
7961 (weak_alias_test_3.o): New target.
7962 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
7963 * testsuite/weak_alias_test_main.cc: New file.
7964 * testsuite/weak_alias_test_1.cc: New file.
7965 * testsuite/weak_alias_test_2.cc: New file.
7966 * testsuite/weak_alias_test_3.cc: New file.
7967
780e49c5
ILT
79682008-04-08 Ian Lance Taylor <iant@google.com>
7969
cdb0b8f5
ILT
7970 * options.h (class General_options): Add --noinhibit-exec option.
7971 * main.cc (main): Check --noinhibit-exec.
7972
0864d551
ILT
7973 * options.h (class General_options): Define --wrap as a special
7974 option. Add wrap_symbols_ field.
7975 (General_options::any_wrap_symbols): New function.
7976 (General_options::is_wrap_symbol): New function.
7977 * options.cc (General_options::parse_wrap): New function.
7978 (General_options::General_options): Initialize wrap_symbols_.
7979 * symtab.cc (Symbol_table::wrap_symbol): New function.
7980 (Symbol_table::add_from_object): Handle --wrap.
7981 * symtab.h (class Symbol_table): Declare wrap_symbol.
7982 * target.h (Target::wrap_char): New function.
7983 (Target::Target_info): Add wrap_char field.
7984 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
7985 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7986 * testsuite/testfile.cc (Target_test::test_target_info):
7987 Likewise.
7988
789aa6de
ILT
7989 * errors.cc (Errors::undefined_symbol): Mention symbol version if
7990 there is one.
7991
2c38906f
ILT
7992 * layout.h (class Layout): Add added_eh_frame_data_ field.
7993 * layout.cc (Layout::Layout): Initialize new field.
7994 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
7995 output section until we find a section we merged successfully.
7996 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
7997 that the size be non-zero.
7998
780e49c5
ILT
7999 * merge.cc (Object_merge_map::get_output_offset): Remove inline
8000 qualifier.
8001
7fcd0256
ILT
80022008-04-08 Craig Silverstein <csilvers@google.com>
8003
8004 * configure.ac: Export new conditional variable HAVE_ZLIB.
8005 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
8006 on HAVE_ZLIB.
8007 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
8008 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8009
6835af53
ILT
80102008-04-07 Ian Lance Taylor <iant@google.com>
8011
e24f324c
ILT
8012 * version.cc (version_string): Set to "1.5".
8013
a036edd8
ILT
8014 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
8015 Add issued_non_pic_error_ field. Declare check_non_pic.
8016 (Target_x86_64::Scan::check_non_pic): New function.
8017 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
8018 (Target_x86_64::Scan::global): Likewise.
8019
624f8810
ILT
8020 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
8021 addend parameter. Change caller. Handle merge sections.
8022 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
8023 Address to Addend. Don't add in the result of
8024 local_section_offset, pass down the addend and use the returned
8025 value.
8026 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
8027 Update declarations of local_section_offset and symbol_value.
8028 * testsuite/two_file_test_1.cc (t18): New function.
8029 * testsuite/two_file_test_2.cc (f18): New function.
8030 * testsuite/two_file_test_main.cc (main): Call t18.
8031 * testsuite/two_file_test.h (t18, f18): Declare.
8032
6835af53
ILT
8033 * configure.ac: Don't test for objdump, c++filt, or readelf.
8034 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
8035 conditionals.
8036 (TEST_READELF): New variable.
8037 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
8038 (check_PROGRAMS): Add two_file_strip_test.
8039 (two_file_strip_test): New target.
8040 (check_PROGRAMS): Add two_file_same_shared_strip_test.
8041 (two_file_same_shared_strip_test_SOURCES): New variable.
8042 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
8043 (two_file_same_shared_strip_test_LDFLAGS): New variable.
8044 (two_file_same_shared_strip_test_LDADD): New variable.
8045 (two_file_shared_strip.so): New target.
8046 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
8047 (ver_test_5.syms, ver_test_7.syms): Likewise.
8048 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
8049 (strip_test_3.stdout): Use TEST_OBJDUMP.
8050 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8051
86925eef
CC
80522008-04-04 Cary Coutant <ccoutant@google.com>
8053
8054 * symtab.h (Symbol::is_weak_undefined): New function.
8055 (Symbol::is_strong_undefined): New function.
8056 (Symbol::is_absolute): New function.
8057 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
8058 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
8059 absolute symbols.
8060 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
8061 (weak_undef_test): New target.
8062 * testsuite/Makefile.in: Rebuild.
8063 * testsuite/weak_undef_file1.cc: New file.
8064 * testsuite/weak_undef_file2.cc: New file.
8065 * testsuite/weak_undef_test.cc: New file.
8066
126f3ece
ILT
80672008-04-03 Craig Silverstein <csilvers@google.com>
8068
8069 * compressed_output.h (class Output_compressed_section): Use
8070 unsigned buffer.
8071 * compressed_output.cc (zlib_compress): Use unsigned buffers,
8072 add zlib header.
8073 (zlib_compressed_suffix): Removed.
8074 (Output_compressed_section::set_final_data_size): Use unsigned
8075 buffers.
8076 * testsuite/Makefile.am (flagstest_compress_debug_sections):
8077 Fix linker invocation.
8078 (flagstest_o_specialfile_and_compress_debug_sections):
8079 Likewise.
8080 * testsuite/Makefile.in: Regenerated.
8081
deae2a14
DM
80822008-04-02 David S. Miller <davem@davemloft.net>
8083
8084 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
8085 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
8086
70752818
ILT
80872008-04-02 Craig Silverstein <csilvers@google.com>
8088
8089 * TODO: New file.
8090
39d0cb0e
ILT
80912008-04-02 Ian Lance Taylor <iant@google.com>
8092
8093 * fileread.cc (File_read::find_view): Add byteshift and vshifted
8094 parameters. Update for new key type to views_. Change all
8095 callers.
8096 (File_read::read): Adjust for byteshift in returned view.
8097 (File_read::add_view): New function, broken out of
8098 find_and_make_view.
8099 (File_read::make_view): New function, broken out of
8100 find_and_make_view.
8101 (File_read::find_or_make_view): Add offset and aligned
8102 parameters. Rewrite accordingly. Change all callers.
8103 (File_read::get_view): Add offset and aligned parameters. Adjust
8104 for byteshift in return value.
8105 (File_read::get_lasting_view): Likewise.
8106 * fileread.h (class File_read): Update declarations.
8107 (class File_read::View): Add byteshift_ field. Add byteshift to
8108 constructor. Add byteshift method.
8109 * archive.h (Archive::clear_uncached_views): New function.
8110 (Archive::get_view): Add aligned parameter. Change all callers.
8111 * object.h (Object::get_view): Add aligned parameter. Change all
8112 callers.
8113 (Object::get_lasting_view): Likewise.
8114
8115 * fileread.cc (File_read::release): Don't call clear_views if
8116 there are multiple objects.
8117 * fileread.h (File_read::clear_uncached_views): New function.
8118 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
8119 on the archive.
8120
a1207466
CC
81212008-03-31 Cary Coutant <ccoutant@google.com>
8122
8123 Add thin archive support.
8124 * archive.cc (Archive::armagt): New const.
8125 (Archive::setup): Remove task parameter and calls to unlock.
8126 (Archive::unlock_nested_archives): New function.
8127 (Archive::read_header): Add nested_off parameter. Change
8128 all callers.
8129 (Archive::interpret_header): Likewise.
8130 (Archive::include_all_members): Change to handle thin
8131 archives.
8132 (Archive::include_member): Likewise.
8133 * archive.h (Archive::Archive): Add new parameters and
8134 initializers.
8135 (Archive::armagt): New const.
8136 (Archive::setup): Remove task parameter.
8137 (Archive::unlock_nested_archives): New function.
8138 (Archive::read_header): Add nested_off parameter.
8139 (Archive::interpret_header): Likewise.
8140 (Archive::Nested_archive_table): New typedef.
8141 (Archive::is_thin_archive_): New field.
8142 (Archive::nested_archives_): New field.
8143 (Archive::options_): New field.
8144 (Archive::dirpath_): New field.
8145 (Archive::task_): New field.
8146 * readsyms.cc (Read_symbols::do_read_symbols): Add check
8147 for thin archives. Pass additional parameters to
8148 Archive::Archive. Unlock the archive file after calling
8149 Archive::setup.
cd536b21 8150
479f6503
ILT
81512008-03-29 Ian Lance Taylor <iant@google.com>
8152
686c8caf
ILT
8153 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
8154 version symbol to be local.
8155 * testsuite/ver_test_4.sh: New file.
8156 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
8157 (check_DATA): Add ver_test_4.syms.
8158 (ver_test_4.syms): New target.
8159 * testsuite/Makefile.in: Rebuild.
8160
ab794b6b
ILT
8161 * output.cc
8162 (Output_section::Input_section_sort_entry::has_priority): New
8163 function.
8164 (Output_section::Input_section_sort_entry::match_file_name): New
8165 function.
8166 (Output_section::Input_section_sort_entry::match_section_name):
8167 Remove.
8168 (Output_section::Input_section_sort_entry::match_section_name_prefix):
8169 Remove.
8170 (Output_section::Input_section_sort_entry::match_section_file):
8171 Remove.
8172 (Output_section::Input_section_sort_compare::operator()): Rewrite
8173 using new Input_section_sort_entry functions. Sort crtbegin and
8174 crtend first. Sort sections with no priority before sections with
8175 a priority.
8176 * testsuite/initpri1.c (d3): Check j != 4.
8177 (cd5): New constructor/destructor function.
8178 (main): Check j != 2.
8179
479f6503
ILT
8180 * symtab.cc (Symbol_table::add_from_object): If we don't use the
8181 new symbol when resolving, don't call set_is_default.
8182 * testsuite/ver_test_7.cc: New file.
8183 * testsuite/ver_test_7.sh: New file.
8184 * testsuite/Makefile.am (ver_test_7.so): New target.
8185 (ver_test_7.o): New target.
8186 (check_SCRIPTS): Add ver_test_7.sh.
8187 (check_DATA): Add ver_test_7.syms.
8188 (ver_test_7.syms): New target.
8189
2fd32231
ILT
81902008-03-28 Ian Lance Taylor <iant@google.com>
8191
8192 * layout.cc (Layout::layout): If we see an input section with a
8193 name that needs sorting, set the must_sort flag for the output
8194 section.
8195 (Layout::make_output_section): If the name of the output section
8196 indicates that it might require sorting, set the may_sort flag.
8197 * output.h (Output_section::may_sort_attached_input_sections): New
8198 function.
8199 (Output_section::set_may_sort_attached_input_sections): New
8200 function.
8201 (Output_section::must_sort_attached_input_sections): New
8202 function.
8203 (Output_section::set_must_sort_attached_input_sections): New
8204 function.
8205 (class Output_section): Declare Input_section_sort_entry. Define
8206 Input_section_sort_compare. Declare
8207 sort_attached_input_sections. Add new fields:
8208 may_sort_attached_input_sections_,
8209 must_sort_attached_input_sections_,
8210 attached_input_sections_are_sorted_.
8211 * output.cc (Output_section::Output_section): Initialize new
8212 fields.
8213 (Output_section::add_input_section): Add an entry to
8214 input_sections_ if may_sort or must_sort are true.
8215 (Output_section::set_final_data_size): Call
8216 sort_attached_input_sections if necessary.
8217 (Output_section::Input_section_sort_entry): Define new class.
8218 (Output_section::Input_section_sort_compare::operator()): New
8219 function.
8220 (Output_section::sort_attached_input_sections): New function.
8221 * configure.ac: Check whether the compiler supports constructor
8222 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
8223 * testsuite/initpri1.c: New file.
8224 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
8225 CONSTRUCTOR_PRIORITY.
8226 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
8227 (initpri1_LDFLAGS): New variable.
8228 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8229
18e6b24e
ILT
82302008-03-27 Ian Lance Taylor <iant@google.com>
8231
49bdd526
ILT
8232 * common.cc (Sort_commons::operator): Correct sorting algorithm.
8233 * testsuite/common_test_1.c: New file.
8234 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
8235 (common_test_1_SOURCES): New variable.
8236 (common_test_1_DEPENDENCIES): New variable.
8237 (common_test_1_LDFLAGS): New variable.
8238
18e6b24e
ILT
8239 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
8240 and commons_ correctly when NAME/VERSION does not override
8241 NAME/NULL.
8242 * testsuite/ver_test_6.c: New file.
8243 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
8244 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
8245 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
8246
04bf7072
ILT
82472008-03-26 Ian Lance Taylor <iant@google.com>
8248
5871526f
ILT
8249 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
8250 of an undefined symbol from a version script.
8251 * testsuite/Makefile.am (ver_test_5.so): New target.
8252 (ver_test_5.o): New target.
8253 (check_SCRIPTS): Add ver_test_5.sh.
8254 (check_DATA): Add ver_test_5.syms.
8255 (ver_test_5.syms): New target.
8256 * testsuite/ver_test_5.cc: New file.
8257 * testsuite/ver_test_5.script: New file.
8258 * testsuite/ver_test_5.sh: New file.
8259 * Makefile.in, testsuite/Makefile.in: Rebuild.
8260
04bf7072
ILT
8261 PR gold/5986
8262 Fix problems building gold with gcc 4.3.0.
8263 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
8264 (gold_error_at_location, gold_warning_at_location): Use it.
8265 * configure.ac: Check whether we can compile and use a template
8266 function with a printf attribute.
8267 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
8268 when jumping over bytes.
8269 * object.cc: Instantiate Object::read_section_data.
8270 * debug.h: Include <cstring>
8271 * dwarf_reader.cc: Include <algorithm>
8272 * main.cc: Include <cstring>.
8273 * options.cc: Include <cstring>.
8274 * output.cc: Include <cstring>.
8275 * script.cc: Include <cstring>.
8276 * script.h: Include <string>.
8277 * symtab.cc: Include <cstring> and <algorithm>.
8278 * target-select.cc: Include <cstring>.
8279 * version.cc: Include <string>.
8280 * testsuite/testmain.cc: Include <cstdlib>.
8281 * configure, config.in: Rebuild.
8282
874c5b28
ILT
82832008-03-25 Ian Lance Taylor <iant@google.com>
8284
819d6c3a
ILT
8285 * options.cc: Include "../bfd/bfdver.h".
8286 (options::help): Print bug reporting address.
8287
f4b2c6f5
ILT
8288 * version.cc (print_version): Adjust output for current value of
8289 BFD_VERSION_STRING.
8290
8291 * NEWS: New file.
8292
e96caa79
ILT
8293 * options.cc (options::help): Print list of supported targets.
8294 * target-select.h: Include <vector>.
8295 (class Target_selector): Make machine_, size_, and is_big_endian_
8296 fields const. Add bfd_name_ and instantiated_target_ fields.
8297 (Target_selector::Target_selector): Add bfd_name parameter.
8298 (Target_selector::recognize): Make non-virtual, call
8299 do_recognize.
8300 (Target_selector::recognize_by_name): Make non-virtual, call
8301 do_recognize_by_name.
8302 (Target_selector::supported_names): New function.
8303 (Target_selector::bfd_name): New function.
8304 (Target_selector::do_instantiate_target): New pure virtual
8305 function.
8306 (Target_selector::do_recognize): New virtual function.
8307 (Target_selector::do_recognize_by_name): New virtual function.
8308 (Target_selector::instantiate_target): New private function.
8309 (supported_target_names): Declare.
8310 * target-select.cc (Target_selector::Target_selector): Update for
8311 new parameter and fields.
8312 (select_target_by_name): Check that the name matches before
8313 calling recognize_by_name.
8314 (supported_target_names): New function.
8315 * i386.cc (class Target_selector_i386): Update Target_selector
8316 constructor call. Remove recognize and recognize_by_name. Add
8317 do_instantiate_target.
8318 * x86_64.cc (class Target_selector_x86_64): Likewise.
8319 * testsuite/testfile.cc (class Target_selector_test): Update for
8320 changes to Target_selector.
8321
874c5b28
ILT
8322 * README: Rewrite, with some notes on unsupported features.
8323
0a65a3a7
CC
83242008-03-24 Cary Coutant <ccoutant@google.com>
8325
8326 * i386.cc (Target_i386::Got_type): New enum declaration.
8327 (Target_i386::Scan::local): Updated callers of Output_data_got
8328 member functions.
8329 (Target_i386::Scan::global): Likewise.
8330 (Target_i386::Relocate::relocate): Likewise.
8331 (Target_i386::Relocate::relocate_tls): Likewise.
8332 * object.h (Got_offset_list): New class.
8333 (Sized_relobj::local_has_got_offset): Added got_type parameter.
8334 (Sized_relobj::local_got_offset): Likewise.
8335 (Sized_relobj::set_local_got_offset): Likewise.
8336 (Sized_relobj::local_has_tls_got_offset): Removed.
8337 (Sized_relobj::local_tls_got_offset): Removed.
8338 (Sized_relobj::set_local_tls_got_offset): Removed.
8339 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
8340 * output.cc (Output_data_got::add_global): Added got_type parameter.
8341 (Output_data_got::add_global_with_rel): Likewise.
8342 (Output_data_got::add_global_with_rela): Likewise.
8343 (Output_data_got::add_global_pair_with_rel): New function.
8344 (Output_data_got::add_global_pair_with_rela): New function.
8345 (Output_data_got::add_local): Added got_type parameter.
8346 (Output_data_got::add_local_with_rel): Likewise.
8347 (Output_data_got::add_local_with_rela): Likewise.
8348 (Output_data_got::add_local_pair_with_rel): New function.
8349 (Output_data_got::add_local_pair_with_rela): New function.
8350 (Output_data_got::add_global_tls): Removed.
8351 (Output_data_got::add_global_tls_with_rel): Removed.
8352 (Output_data_got::add_global_tls_with_rela): Removed.
8353 (Output_data_got::add_local_tls): Removed.
8354 (Output_data_got::add_local_tls_with_rel): Removed.
8355 (Output_data_got::add_local_tls_with_rela): Removed.
8356 * output.h (Output_data_got::add_global): Added got_type parameter.
8357 (Output_data_got::add_global_with_rel): Likewise.
8358 (Output_data_got::add_global_with_rela): Likewise.
8359 (Output_data_got::add_global_pair_with_rel): New function.
8360 (Output_data_got::add_global_pair_with_rela): New function.
8361 (Output_data_got::add_local): Added got_type parameter.
8362 (Output_data_got::add_local_with_rel): Likewise.
8363 (Output_data_got::add_local_with_rela): Likewise.
8364 (Output_data_got::add_local_pair_with_rel): New function.
8365 (Output_data_got::add_local_pair_with_rela): New function.
8366 (Output_data_got::add_global_tls): Removed.
8367 (Output_data_got::add_global_tls_with_rel): Removed.
8368 (Output_data_got::add_global_tls_with_rela): Removed.
8369 (Output_data_got::add_local_tls): Removed.
8370 (Output_data_got::add_local_tls_with_rel): Removed.
8371 (Output_data_got::add_local_tls_with_rela): Removed.
8372 * resolve.cc (Symbol::override_base_with_special): Removed
8373 reference to has_got_offset_ field.
8374 * symtab.cc (Symbol::init_fields): Replaced initialization
8375 of got_offset_ with got_offsets_. Removed initialization
8376 of has_got_offset_
53fcba31 8377 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
8378 (Symbol::got_offset): Likewise.
8379 (Symbol::set_got_offset): Likewise.
8380 (Symbol::has_tls_got_offset): Removed.
8381 (Symbol::tls_got_offset): Removed.
8382 (Symbol::set_tls_got_offset): Removed.
8383 (Symbol::got_offset_): Removed.
8384 (Symbol::tls_mod_got_offset_): Removed.
8385 (Symbol::tls_pair_got_offset_): Removed.
8386 (Symbol::got_offsets_): New field.
8387 (Symbol::has_got_offset): Removed.
8388 (Symbol::has_tls_mod_got_offset): Removed.
8389 (Symbol::has_tls_pair_got_offset): Removed.
8390 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
8391 (Target_x86_64::Scan::local): Updated callers of Output_data_got
8392 member functions.
8393 (Target_x86_64::Scan::global): Likewise.
8394 (Target_x86_64::Relocate::relocate): Likewise.
8395 (Target_x86_64::Relocate::relocate_tls): Likewise.
8396
bd52eafb
BE
83972008-03-25 Ben Elliston <bje@au.ibm.com>
8398
8399 * yyscript.y: Fix spelling error in comment.
8400
8b105e34
ILT
84012008-03-24 Ian Lance Taylor <iant@google.com>
8402
8ed814a9
ILT
8403 * options.h (class General_options): Define build_id option.
8404 * layout.h (class Layout): Declare write_build_id, create_note,
8405 create_build_id. Add build_id_note_ member.
8406 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
8407 "libiberty.h", "md5.h", "sha1.h".
8408 (Layout::Layout): Initialize eh_frame_data_,
8409 eh_frame_hdr_section_, and build_id_note_.
8410 (Layout::finalize): Call create_build_id.
8411 (Layout::create_note): New function, broken out of
8412 Layout::create_gold_note.
8413 (Layout::create_gold_note): Call create_note.
8414 (Layout::create_build_id): New function.
8415 (Layout::write_build_id): New function.
8416 (Close_task_runner::run): Call write_build_id.
8417
8b105e34
ILT
8418 * x86_64.cc: Correct license to GPLv3.
8419
086a1841
ILT
84202008-03-23 Ian Lance Taylor <iant@google.com>
8421
8422 * options.cc: Include "demangle.h".
8423 (parse_optional_string): New function.
8424 (parse_long_option): Handle takes_optional_argument.
8425 (parse_short_option): Update dash_z initializer. Handle
8426 takes_optional_argument.
8427 (General_options::General_options): Initialize do_demangle_.
8428 (General_options::finalize): Set do_demangle_. Handle demangling
8429 style.
8430 * options.h (parse_optional_string): Declare.
8431 (struct One_option): Add optional_arg field. Update constructor.
8432 Update call constructor calls. Add takes_optional_argument
8433 function.
8434 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
8435 (DEFINE_optional_string): Define.
8436 (General_options::demangle): Change from DEFINE_bool to
8437 DEFINE_optional_string.
8438 (General_options::no_demangle): New function.
8439 (General_options::do_demangle): New function.
8440 (General_options::set_do_demangle): New function.
8441 (General_options::execstack_status_): Move definition to end of
8442 class definition.
8443 (General_options::static_): Likewise.
8444 (General_options::do_demangle_): New field.
8445 * object.cc (big_endian>::get_symbol_location_info): Call
8446 Options::do_demangle, not Options::demangle.
8447 * symtab.cc (demangle): Likewise.
8448
cbb93e63
ILT
84492008-03-22 Ian Lance Taylor <iant@google.com>
8450
8451 * gold.h: Include <cstddef> and <sys/types.h>
8452 * options.h: Include <cstring>.
8453
ec531623
ILT
84542008-03-21 Ian Lance Taylor <iant@google.com>
8455
8456 * Added source code to GNU binutils.
This page took 0.54587 seconds and 4 git commands to generate.