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