elfcpp/:
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c549a694
ILT
12009-10-09 Mikolaj Zalewski <mikolajz@google.com>
2
3 * incremental.cc: Include <cstdarg> and "target-select.h".
4 (vexplain_no_incremental): New function.
5 (explain_no_incremental): New function.
6 (Incremental_binary::error): New method.
7 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8 method.
9 (make_sized_incremental_binary): New function.
10 (open_incremental_binary): New function.
11 (can_incrementally_link_file): Add checks if output is ELF and has
12 inputs section.
13 * incremental.h: Include "elfcpp_file.h" and "output.h".
14 (Incremental_binary): New class.
15 (Sized_incremental_binary): New class.
16 (open_incremental_binary): Declare.
17 * object.cc (is_elf_object): Use
18 elfcpp::Elf_recognizer::is_elf_file.
19 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
20 * output.h (Output_file::filesize): New method.
21
fd3c5f0b
ILT
222009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
23
24 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
25 New function.
26 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
27 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
28 function.
29 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
30 function.
31 (Arm_relocate_functions::movw_abs_nc): New function.
32 (Arm_relocate_functions::movt_abs): New function.
33 (Arm_relocate_functions::thm_movw_abs_nc): New function.
34 (Arm_relocate_functions::thm_movt_abs): New function.
35 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
36 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
37 (Scan::global): Likewise.
38 (Relocate::relocate): Likewise.
39 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
40
7f5309a5
ILT
412009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
42
43 * arm.cc (Arm_relocate_functions::got_prel) New function.
44 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
45 (Relocate::relocate): Likewise.
46 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
47
364c7fa5
ILT
482009-10-06 Ian Lance Taylor <iant@google.com>
49
50 * options.h (class General_options): Define
51 split_stack_adjust_size parameter.
52 * object.h (class Object): Add uses_split_stack_ and
53 has_no_split_stack_ fields. Add uses_split_stack and
54 has_no_split_stack accessor functions. Declare
55 handle_split_stack_section.
56 (class Reloc_symbol_changes): Define.
57 (class Sized_relobj): Define Function_offsets. Declare
58 split_stack_adjust, split_stack_adjust_reltype, and
59 find_functions.
60 * object.cc (Object::handle_split_stack_section): New function.
61 (Sized_relobj::do_layout): Call handle_split_stack_section.
62 * dynobj.cc (Sized_dynobj::do_layout): Call
63 handle_split_stack_section.
64 * reloc.cc (Sized_relobj::relocate_sections): Call
65 split_stack_adjust for executable sections in split_stack
66 objects. Pass reloc_map to relocate_section.
67 (Sized_relobj::split_stack_adjust): New function.
68 (Sized_relobj::split_stack_adjust_reltype): New function.
69 (Sized_relobj::find_functions): New function.
70 * target-reloc.h: Include "object.h".
71 (relocate_section): Add reloc_symbol_changes parameter. Change
72 all callers.
73 * target.h (class Target): Add calls_non_split method. Declare
74 do_calls_non_split virtual method. Declare match_view and
75 set_view_to_nop.
76 * target.cc: Include "elfcpp.h".
77 (Target::do_calls_non_split): New function.
78 (Target::match_view): New function.
79 (Target::set_view_to_nop): New function.
80 * gold.cc (queue_middle_tasks): Give an error if mixing
81 split-stack and non-split-stack objects with -r.
82 * i386.cc (Target_i386::relocate_section): Add
83 reloc_symbol_changes parameter.
84 (Target_i386::do_calls_non_split): New function.
85 * x86_64.cc (Target_x86_64::relocate_section): Add
86 reloc_symbol_changes parameter.
87 (Target_x86_64::do_calls_non_split): New function.
88 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
89 parameter.
90 * powerpc.cc (Target_powerpc::relocate_section): Add
91 reloc_symbol_changes parameter.
92 * sparc.cc (Target_sparc::relocate_section): Add
93 reloc_symbol_changes parameter.
94 * configure.ac: Call AM_CONDITIONAL for the default target.
95 * configure: Rebuild.
96 * testsuite/Makefile.am (TEST_AS): New variable.
97 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
98 (check_DATA): Add split_i386 and split_x86_64 files.
99 (SPLIT_DEFSYMS): Define.
100 (split_i386_[1234n].o): New targets.
101 (split_i386_[124]): New targets.
102 (split_i386_[1234r].stdout): New targets.
103 (split_x86_64_[1234n].o): New targets.
104 (split_x86_64_[124]): New targets.
105 (split_x86_64_[1234r].stdout): New targets.
106 (MOSTLYCLEANFILES): Add new executables.
107 * testsuite/split_i386.sh: New file.
108 * testsuite/split_x86_64.sh: New file.
109 * testsuite/split_i386_1.s: New file.
110 * testsuite/split_i386_2.s: New file.
111 * testsuite/split_i386_3.s: New file.
112 * testsuite/split_i386_4.s: New file.
113 * testsuite/split_i386_n.s: New file.
114 * testsuite/split_x86_64_1.s: New file.
115 * testsuite/split_x86_64_2.s: New file.
116 * testsuite/split_x86_64_3.s: New file.
117 * testsuite/split_x86_64_4.s: New file.
118 * testsuite/split_x86_64_n.s: New file.
119 * testsuite/testfile.cc (Target_test): Update relocation_section
120 function.
121 * testsuite/Makefile.in: Rebuild.
122
e8a9fcda
ILT
1232009-10-06 Ian Lance Taylor <iant@google.com>
124
125 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
126 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
127 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
128 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
129 the address on ldo_addrs_.
130 (Target_i386::Relocate::fix_up_ldo): New function.
131
e99daf92
ILT
1322009-10-06 Rafael Espindola <espindola@google.com>
133
134 * plugin.cc (add_input_library): New.
135 (Plugin::load): Add add_input_library to tv.
136 (Plugin_manager::add_input_file): Add the is_lib argument.
137 (add_input_file): Update call to Plugin_manager::add_input_file.
138 (add_input_library): New.
139 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
140
966d4097
DK
1412009-09-30 Doug Kwan <dougkwan@google.com>
142
143 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
144 symbol and call Symbol::may_need_copy_reloc to determine if
145 a copy reloc is needed.
146 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
147 nocopyreloc is given in command line.
148 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
149 given in command line.
150 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
151 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
152 of the removed Target_i386::may_need_copy_reloc.
153 * options.h (copyreloc): New option with default value false.
154 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
155 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
156 instead of the removed Target_powerpc::may_need_copy_reloc.
157 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
158 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
159 instead of the removed Target_sparc::may_need_copy_reloc.
160 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
161 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
162 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
163 instead of the removed Target_x86_64::may_need_copy_reloc.
164
029ba973
ILT
1652009-09-30 Ian Lance Taylor <iant@google.com>
166
167 * object.h (class Object): Remove target_ field, and target,
168 sized_target, and set_target methods.
169 (Object::sized_target): Remove.
170 (class Sized_relobj): Update declarations. Remove sized_target.
171 * object.cc (Sized_relobj::setup): Remove target parameter.
172 Change all callers.
173 (Input_objects::add_object): Don't do anything with the target.
174 (make_elf_sized_object): Add punconfigured parameter. Change all
175 callers. Set or test parameter target.
176 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
177 Change all callers.
178 * parameters.cc (Parameters::set_target): Change parameter type to
179 be non-const.
180 (Parameters::default_target): Remove.
181 (set_parameters_target): Change parameter type to be non-const.
182 (parameters_force_valid_target): New function.
183 (parameters_clear_target): New function.
184 * parameters.h (class Parameters): Update declarations. Remove
185 default_target method. Add sized_target and clear_target
186 methods. Change target_ to be non-const.
187 (set_parameters_target): Update declaration.
188 (parameters_force_valid_target): Declare.
189 (parameters_clear_target): Declare.
190 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
191 as NULL if we aren't searching.
192 (Add_symbols::run): Don't check for compatible target.
193 * fileread.cc (Input_file::open_binary): Call
194 parameters_force_valid_target.
195 * gold.cc (queue_middle_tasks): Likewise.
196 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
197 set_target on object.
198 * dynobj.h (class Sized_dynobj): Update declarations.
199 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
200 make_elf_object returns NULL.
201 (Archive::include_member): Don't check whether object target is
202 compatible.
203 * output.cc (Output_section::add_input_section): Get target from
204 parameters.
205 (Output_section::relax_input_section): Likewise.
206 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
207 parameters.
208 (Sized_relobj::do_scan_relocs): Likewise.
209 (Sized_relobj::relocate_sections): Likewise.
210 * resolve.cc (Symbol_table::resolve): Likewise.
211 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
212 parameter. Change all callers.
213 (Symbol_table::add_from_object): Get target from parameters.
214 (Symbol_table::add_from_relobj): Don't check object target.
215 (Symbol_table::add_from_dynobj): Likewise.
216 (Symbol_table::define_special_symbol): Get target from
217 parameters.
218 * symtab.h (class Symbol_table): Update declaration.
219 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
220 parameter. Change all callers. Clear parameter target.
221 (Binary_test): Test target here.
222 * testsuite/object_unittest.cc (gold_testsuite): Remove
223 target_test_pointer parameter. Change all callers.
224 (Object_test): Test target here.
225
a6a22b83
ILT
2262009-09-26 Ian Lance Taylor <iant@google.com>
227
228 * testsuite/initpri1.c: Don't try to use constructor priorities if
229 compiling with gcc before 4.3.
230
6a8f49fe
ILT
2312009-09-22 Mikolaj Zalewski <mikolajz@google.com>
232
233 * testsuite/retain_symbols_file_test.sh (check_present): Change
234 output file name to retain_symbols_file_test.stdout.
235 (check_absent): Likewise.
236
8c604651
CS
2372009-09-18 Craig Silverstein <csilvers@google.com>
238
239 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
240 * options.cc: Include <cerrno> and <fstream>.
241 (General_options::finalize): Parse -retain-symbols-file tag.
242 * options.h: New flag.
243 (General_options): New method should_retain_symbol, new
244 variable symbols_to_retain.
245 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
246 should_retain_symbol map.
247 * testsuite/Makefile.am (retain_symbols_file_test): New test.
248 * testsuite/Makefile.in: Regenerate.
249 * testsuite/retain_symbols_file_test.sh: New file.
250
ca58b19f
NC
2512009-09-18 Nick Clifton <nickc@redhat.com>
252
253 * po/es.po: Updated Spanish translation.
254
20e6d0d6
DK
2552009-09-17 Doug Kwan <dougkwan@google.com>
256
257 * debug.h (DEBUG_RELAXATION): New constant.
258 (DEBUG_ALL): Add DEBUG_RELAXATION.
259 (debug_string_to_enum): Add relaxation debug option.
260 * layout.cc
261 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
262 Layout::Relaxation_debug_check::read_sections,
263 Layout::Relaxation_debug_check::read_sections): New method definitions.
264 (Layout::Layout): Initialize data members
265 record_output_section_data_from_scrips_,
266 script_output_section_data_list_ and relaxation_debug_check_.
267 (Layout::save_segments, Layout::restore_segments,
268 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
269 Layout::relaxation_loop_body): New method definitions.
270 (Layout::finalize): Support relaxation. Move section layout code to
271 Layout::relaxation_loop_body.
272 (Layout::set_asection_address_from_script): Move code for orphan
273 section placement out.
274 (Layout::place_orphan_sections_in_script): New method definition.
275 * layout.h (Output_segment_headers, Output_file_header):
276 New forward class declarations.
277 (Layout::~Layout): Define.
278 (Layout::new_output_section_data_from_script): New method definition.
279 (Layout::place_orphan_sections_in_script): New method declaration.
280 (Layout::Segment_states): New type declaration.
281 (Layout::save_segments, Layout::restore_segments,
282 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
283 Layout::relaxation_loop_body): New method declarations.
284 (Layout::Output_section_data_list): New type declaration.
285 (Layout::Relaxation_debug_check): New class definition.
286 (Layout::record_output_section_data_from_script_,
287 Layout::script_output_section_data_list_, Layout::segment_states_,
288 Layout::relaxation_debug_check_): New data members.
289 * output.cc: (Output_section_headers::do_size): New method definition.
290 (Output_section_headers::Output_section_headers): Move size
291 computation to Output_section_headers::do_size.
292 (Output_segment_headers::do_size): New method definition.
293 (Output_file_header::Output_file_header): Move size computation to
294 Output_file_header::do_size and call it.
295 (Output_file_header::do_size): New method definition.
296 (Output_data_group::Output_data_group): Adjust call to
297 Output_section_data.
298 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
299 (Output_symtab_xindex::do_write): Add array bound check.
300 (Output_section::Input_section::print_to_mapfile): Handle
301 RELAXED_INPUT_SECTION_CODE.
302 (Output_section::Output_section): Initialize data member checkpoint_.
303 (Output_section::~Output_section): Delete checkpoint object pointed
304 by checkpoint_.
305 (Output_section::add_input_section): Always add an Input_section if
306 relaxing.
307 (Output_section::add_merge_input_section): Add assert.
308 (Output_section::relax_input_section): New method definition.
309 (Output_section::set_final_data_size): Set load address to zero for
310 an unallocated section.
311 (Output_section::do_address_and_file_offset_have_reset_values):
312 New method definition.
313 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
314 Handle relaxed input section.
315 (Output_section::sort_attached_input_sections): Checkpoint input
316 section list lazily.
317 (Output_section::get_input_sections): Change type of input_sections to
318 list of Simple_input_section pointers. Checkpoint input section list
319 lazily. Also handle relaxed input sections.
320 (Output_section::add_input_section_for_script): Take a reference to
321 a Simple_input_section object instead of Relobj pointer and section
322 index as parameter. Handle relaxed input sections.
323 (Output_section::save_states, Output_section::restore_states): New
324 method definitions.
325 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
326 (Output_data::is_data_size_fixed): New method definition.
327 (Output_data::reset_addresss_and_file_offset): Do not reset data size
328 if it is fixed.
329 (Output_data::address_and_file_offset_have_reset_values): New method
330 definition.
331 (Output_data::do_address_and_file_offset_have_reset_values): New method
332 definition.
333 (Output_data::set_data_size): Check that data size is not fixed.
334 (Output_data::fix_data_size): New method definition.
335 (Output_data::is_data_size_fixed_): New data member.
336 (Output_section_headers::set_final_data_size): New method definition.
337 (Output_section_headers::do_size): New method declaration.
338 (Output_segment_headers::set_final_data_size): New method definition.
339 (Output_segment_headers::do_size): New method declaration.
340 (Output_file_header::set_final_data_size)::New method definition.
341 (Output_file_header::do_size)::New method declaration.
342 (Output_section_data::Output_section_data): Add new parameter
343 is_data_size_fixed and use it to fix data size.
344 (Output_data_const::Output_data_const): Adjust call to base class
345 constructor and fix data size.
346 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
347 base class constructor and fix data size.
348 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
349 base class constructor and fix data size.
350 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
351 class constructor and fix data size.
352 (Output_data_group::set_final_data_size): New method definition.
353 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
354 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
355 class constructor and fix data size.
356 (Output_relaxed_input_section): New class definition.
357 (Output_section::Simple_input_section): New class definition.
358 (Output_section::get_input_sections): Adjust parameter list.
359 (Output_section::add_input_section_for_script): Same.
360 (Output_section::save_states, Output_section::restore_states,
361 Output_section::do_address_and_file_offset_have_reset_values,
362 (Output_section::Input_section::Input_section): Handle
363 RELAXED_INPUT_SECTION_CODE. Add new overload for
364 Output_relaxed_input_section.
365 (Output_section::Input_section::is_input_section,
366 Output_section::Input_section::set_output_section): Handle relaxed
367 input section.
368 (Output_section::Input_section::is_relaxed_input_section,
369 Output_section::Input_section::output_section_data,
370 Output_section::Input_section::relaxed_input_section): New method
371 definitions.
372 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
373 value.
374 (Output_section::Input_section::u1_): Update comments.
375 (Output_section::Input_section::u2_): Add new union member poris.
376 (Output_section::Checkpoint_output_section): New classs definition.
377 (Output_section::relax_input_section): New method declaration.
378 (Output_section::checkpoint_): New data member.
379 (Output_segment): Update comments.
380 (Output_segment::Output_segment): Un-privatize copy constructor.
381 (Output_segment::operator=): Un-privatize.
382 * script-sections.cc (Output_section_element::Input_section_list):
383 Change element type to Output_section::Simple_input_section.
384 (Output_section_element_dot_assignment::set_section_addresses):
385 Register output section data for relaxation clean up.
386 (Output_data_exression::Output_data_expression): Adjust call to base
387 constructor to fix data size.
388 (Output_section_element_data::set_section_addresses): Register
389 Output_data_expression object for relaxation clean up.
390 (struct Input_section_info): Replace Relobj pointer and section index
391 pair with Output_section::Simple_input_section and Convert struct to a
392 class.
393 (Input_section_sorter::operator()): Adjust access to
394 Input_section_info data member to use accessors.
395 (Output_section_element_input::set_section_addresses): Use layout
396 parameter. Adjust code to use Output_section::Simple_input_section
397 and Input_secction_info classes. Register filler for relaxation
398 clean up.
399 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
400 and section index pair with Output_section::Simple_input_section
401 class. Adjust code accordingly.
402 (Phdrs_element::release_segment): New method definition.
403 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
404 segment list.
405 (Script_sections::release_segments): New method definition.
406 * gold/script-sections.h (Script_sections::release_segments): New
407 method declaration.
408 * gold/target.h (Target::may_relax, Target::relax,
409 Target::do_may_relax, Target::do_relax): New method definitions.
410
5e445df6
ILT
4112009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
412
413 * arm.cc (has_signed_unsigned_overflow): New function.
414 (Arm_relocate_functions::abs8): New function.
415 (Target_arm::Scan::local): Handle R_ARM_ABS8.
416 (Target_arm::Scan::global): Likewise.
417 (Target_arm::relocate::relocate): Likewise.
418 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
419 Likewise.
420
8c604651 4212009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
422
423 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
424 * testsuite/Makefile.in: Regenerate.
425
1e9cc1c2
NC
4262009-09-11 Nick Clifton <nickc@redhat.com>
427
428 * po/gold.pot: Updated by the Translation project.
429
6a89f575
CC
4302009-09-08 Cary Coutant <ccoutant@google.com>
431
432 * output.cc (Output_file::open): Add execute permission to empty file.
433 * testsuite/Makefile.am (permission_test): New test.
434 * testsuite/Makefile.in: Regenerate.
435
fdcac5af
ILT
4362009-09-02 Ian Lance Taylor <iant@google.com>
437
438 * output.cc (Output_file::resize): Call map_no_anonymous rather
439 than map.
440
44453f85
ILT
4412009-09-01 Mikolaj Zalewski <mikolajz@google.com>
442
443 * gold.cc: Include "incremental.h".
444 (queue_initial_tasks): Call Incremental_checker methods.
445 * incremental.cc: Include "output.h".
446 (Incremental_checker::can_incrementally_link_output_file): New
447 method.
448 * incremental.h (Incremental_checker): New class.
449
450 * output.cc (Output_file::open_for_modification): New method.
451 (Output_file::map_anonymous): Changed return type to bool. Record
452 map in base_ field.
453 (Output_file::map_no_anonymous): New method, broken out of map.
454 (Output_file::map): Use map_no_anonymous and map_anonymous.
455 * output.h (class Output_file): Update declarations.
456
293c1386
CC
4572009-08-24 Cary Coutant <ccoutant@google.com>
458
459 * options.h (Command_line::Pre_options): New class.
460 (Command_line::pre_options): New member.
461 * options.cc (gold::options::ready_to_register): New variable.
462 (One_option::register_option): Do nothing if not registering options.
463 Assert if same short option registered twice.
464 (General_options::General_options): Turn off option registration when
465 done constructing.
466 (Command_line::Pre_options::Pre_options): New constructor.
467
f773f3d2
CC
4682009-08-24 Cary Coutant <ccoutant@google.com>
469
06a73cfe
CC
470 * options.h (General_options::no_keep_memory): Remove incorrect
471 short option.
f773f3d2 472
a15af8e2
RW
4732009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
474
475 * Makefile.am (am__skiplex, am__skipyacc): New.
476 * Makefile.in: Regenerate.
477
c462b41b
RW
4782009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
479
14ec8efd
RW
480 * Makefile.am (AM_CPPFLAGS): Renamed from ...
481 (INCLUDES): ... this.
482 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
483 (AM_CPPFLAGS): Renamed from ...
484 (INCLUDE): ... this.
485 * Makefile.in, testsuite/Makefile.in: Regenerate.
486
81ecdfbb
RW
487 * Makefile.in: Regenerate.
488 * aclocal.m4: Likewise.
489 * config.in: Likewise.
490 * configure: Likewise.
491 * testsuite/Makefile.in: Likewise.
492
c462b41b
RW
493 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
494 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
495 * Makefile.in: Regenerate.
496 * testsuite/Makefile.in: Regenerate.
497
2da73f13
CC
4982009-08-19 Cary Coutant <ccoutant@google.com>
499
500 * resolve.cc (Symbol_table::resolve): Don't complain about defined
501 symbols in shared libraries overridden by hidden or internal symbols
502 in the main program.
503
2db70501
CD
5042009-08-19 Chris Demetriou <cgd@google.com>
505
506 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
507 checking source file names in error messages.
508
f733487b
DK
5092009-08-18 Doug Kwan <dougkwan@google.com>
510
511 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
512 an elcpp::Ehdr as parameter. Adjust call to set_target.
513 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
514 an elfcpp::Ehdr as parameter.
515 * object.cc (Object::set_target): Remove the version that looks up
516 a target and sets it.
517 (Sized_relobj::setup): Take a Target object instead of
518 an elfcpp::Ehdr as parameter. Adjust call to set_target.
519 (make_elf_sized_object): Find target and ask target to
520 make an ELF object.
521 * object.h: (Object::set_target): Remove the version that looks up
522 a target and sets it.
523 (Sized_relobj::setup): Take a Target object instead of
524 an elfcpp:Ehdr as parameter.
525 * target.cc: Include dynobj.h.
526 (Target::do_make_elf_object_implementation): New.
527 (Target::do_make_elf_object): New.
528 * target.h (Target::make_elf_object): New template declaration.
529 (Target::do_make_elf_object): New method declarations.
530 (Target::do_make_elf_object_implementation): New template declaration.
531
cc70f101
ILT
5322009-08-14 Ian Lance Taylor <iant@google.com>
533
534 * gold.h (FUNCTION_NAME): Define.
535 (gold_unreachable): Use FUNCTION_NAME.
536
ef5e0cb1
ST
5372009-08-12 Sriraman Tallam <tmsriram@google.com>
538
539 * icf.cc (Icf::find_identical_sections): Issue a warning when a
540 symbol in the --keep-unique list is not found.
541
48c187ce
ST
5422009-08-12 Sriraman Tallam <tmsriram@google.com>
543
544 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
545 been maked as --keep-unique.
546 (Icf::unfold_section): New function.
547 * icf.h (Icf::unfold_section): New function.
548 * options.h (General_options::keep_unique): New option.
549 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
550 * testsuite/Makefile.in: Regenerate.
551 * testsuite/icf_keep_unique_test.sh: New file.
552 * testsuite/icf_keep_unique_test.cc: New file.
553
645afe0c
CC
5542009-08-12 Cary Coutant <ccoutant@google.com>
555
556 PR 10471
557 * resolve.cc (Symbol_table::resolve): Check for references from
558 dynamic objects to hidden and internal symbols.
559 * testsuite/Makefile.am (hidden_test.sh): New test.
560 * testsuite/Makefile.in: Regenerate.
561 * testsuite/hidden_test.sh: New script.
562 * testsuite/hidden_test_1.c: New test source.
563 * testsuite/hidden_test_main.c: New test source.
564
11af873f
DK
5652009-08-11 Doug Kwan <dougkwan@google.com>
566
567 * arm.cc: Update comments.
568 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
569 segment to locate the .ARM.exidx section if present.
570
b9f7d72d
DK
5712009-08-09 Doug Kwan <dougkwan@google.com>
572
573 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
574 patch.
575
ddd3c53c
ST
5762009-08-07 Sriraman Tallam <tmsriram@google.com>
577 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
578 compiler warnings.
579
27721062
ST
5802009-08-06 Sriraman Tallam <tmsriram@google.com>
581
582 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
583 valid tls_segment only for non-debug-section relocations.
584 * testsuite/Makefile.am: Add gc_tls_test.
585 * testsuite/Makefile.in: Regenerate.
586 * testsuite/gc_tls_test.cc: New file.
587 * testsuite/gc_tls_test.sh: New file.
588
ef15dade
ST
5892009-08-05 Sriraman Tallam <tmsriram@google.com>
590
591 * icf.cc: New file.
592 * icf.h: New file.
593 * Makefile.am (CCFILES): Add icf.cc.
594 (HFILES): Add icf.h
595 * Makefile.in: Regenerate.
596 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
597 * gc.h (gc_process_relocs): Populate lists used by icf to contain
598 section, symbol and addend information for the relocs.
599 * gold.cc (queue_middle_tasks): Call identical code folding.
600 * gold.h: Add defines for multimap.
601 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
602 to the call of finalize_local_symbols.
603 * main.cc (main): Create object of class Icf.
604 * object.cc (Sized_relobj::do_layout): Allow this function to be
605 called twice during icf.
606 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
607 to sections marked as identical by icf.
608 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
609 when available.
610 (Sized_relobj::do_section_entsize): New function.
611 * object.h (Object::section_entsize): New function.
612 (Object::do_section_entsize): New pure virtual function.
613 (Relobj::finalize_local_symbols): Add new parameter.
614 (Relobj::do_section_entsize): New function.
615 * options.h (General_options::icf): New option.
616 (General_options::icf_iterations): New option.
617 (General_options::print_icf_sections): New option.
618 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
619 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
620 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
621 icf.
622 * symtab.cc (Symbol_table::is_section_folded): New function.
623 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
624 to sections marked as identical by icf.
625 * symtab.h (Symbol_table::set_icf): New function.
626 (Symbol_table::icf): New function.
627 (Symbol_table::is_section_folded): New function.
628 (Symbol_table::icf_): New data member.
629 * target-reloc.h (relocate_section): Ignore sections folded by icf.
630 * testsuite/Makefile.am: Add commands to build icf_test.
631 * testsuite/Makefile.in: Regenerate.
632 * testsuite/icf_test.sh: New file.
633 * testsuite/icf_test.cc: New file.
634
c3b65ac4
CD
6352009-07-24 Chris Demetriou <cgd@google.com>
636
637 * layout.cc (is_compressible_debug_section): Fix incorrect
638 comment about compressed section names.
639
1caf2c51
ILT
6402009-07-20 Ian Lance Taylor <ian@airs.com>
641
642 PR 10419
643 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
644
1ef4d87f
ILT
6452009-07-16 Ian Lance Taylor <iant@google.com>
646
647 PR 10400
648 * layout.h: #include <map>.
649 (class Kept_section): Change from struct to class. Add accessors
650 and setters. Add section size to Comdat_group mapping. Change
651 Comdat_group to std::map. Add is_comdat_ field. Add
652 linkonce_size field in union.
653 (class Layout): Update declaration of find_or_add_kept_section.
654 Don't declare find_kept_object.
655 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
656 parameter. Add object, shndx, is_comdat, and is_group_name
657 parameters. Change all callers. Adjust for new Kept_section.
658 (Layout::find_kept_object): Remove.
659 * object.cc (Sized_relobj::include_section_group): Update use of
660 Kept_section. Rename secnum to shndx. Only record
661 Kept_comdat_section if sections are the same size.
662 (Sized_relobj::include_linkonce_section): Update use of
663 Kept_section. Only record Kept_comdat_section if sections are the
664 same size. Set size of linkonce section.
665 (Sized_relobj::map_to_kept_section): Update call to
666 get_kept_comdat_section.
667 * object.h (class Sized_relobj): Rename fields in
668 Kept_comdat_section to drop trailing underscores; change object
669 field to Relobj*. Change Kept_comdat_section_table to store
670 struct rather than pointer.
671 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
672 Add kept_object and kept_shndx parameters. Change all callers.
673 (Sized_relobj::get_kept_comdat_section): Change return type to
674 bool. Add kept_object and kept_shndx parameters. Change all
675 callers.
676 * plugin.cc (Pluginobj::include_comdat_group): Update call to
677 Layout::find_or_add_kept_section.
678
37c3b7b0
ILT
6792009-07-09 Ian Lance Taylor <iant@google.com>
680
681 * merge.cc (Object_merge_map::initialize_input_to_output_map):
682 Reserve space in the hash table.
683
98fa85cb
ILT
6842009-07-06 Mikolaj Zalewski <mikolajz@google.com>
685
686 * fileread.cc (File_read::get_mtime): New method.
687 * fileread.h (Timespec): New structure.
688 (File_read::get_mtime): New method.
689 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
690 Renamed from timestamp_nsec.
691 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
692 Elf_Xword.
693 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
694 timestamp_nsec.
695 (Incremental_inputs::report_archive): Save mtime; style fix.
696 (Incremental_inputs::report_obejct): Save mtime; style fix.
697 (Incremental_inputs::report_script): Save mtime; style fix.
698 (Incremental_inputs::finalize_inputs): Style fix.
699 (Incremental_inputs::finalize): Style fix.
700 (Incremental_inputs::create_input_section_data): Store inputs
701 mtime.
702 * incremental.h (Incremental_inputs::report_script): Add mtime
703 argument.
704 (Incremental_inputs::Input_info::Input_info): Intialize only one
705 union member.
706 (Incremental_inputs::Input_info::archive): Move to nameless
707 union.
708 (Incremental_inputs::Input_info::obejct): Move to nameless union.
709 (Incremental_inputs::Input_info::script): Move to nameless union.
710 (Incremental_inputs::mtime): New field.
711 * script.cc (read_input_script): Pass file mtime to
712 Incremental_input.
713 * script.h (Script_info::inputs): Style fix.
714
c9d70757
ILT
7152009-07-01 Ian Lance Taylor <ian@airs.com>
716
717 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
718 instead of 32.
719
9c547ec3
ILT
7202009-06-24 Ian Lance Taylor <iant@google.com>
721
722 PR 10156
723 * layout.cc (Layout::choose_output_section): If we find an
724 existing section, update the flags.
725 (Layout::create_notes): New function, broken out of
726 Layout::finalize.
727 (Layout::finalize): Don't create note sections.
728 (Layout::create_note): Don't crash if linker script discards
729 section.
730 (Layout::create_gold_note): Likewise.
731 (Layout::create_build_id): Likewise. Don't set
732 after_input_sections on the section.
733 (Layout::create_executable_stack_info): Remove target parameter.
734 Change caller.
735 * layout.h (class Layout): Declare create_notes. Update
736 declaration of create_executable_stack_info.
737 * gold.cc (queue_middle_tasks): Call create_notes.
738 * output.cc (Output_section::update_flags_for_input_section): Move
739 here from output.h. If SHF_ALLOC flag is newly set, mark address
740 invalid.
741 * output.h (Output_data::mark_address_invalid): New function.
742 (class Output_section): Only declare, not define,
743 update_flags_for_input_section. Remove set_flags.
744
55458500
ILT
7452009-06-24 Ian Lance Taylor <iant@google.com>
746
747 * script-sections.cc (Output_section_definition::
748 set_section_addresses): Rename shadowing local load_address to
749 laddr.
750
1307d6cd
ILT
7512009-06-24 Ian Lance Taylor <iant@google.com>
752
753 PR 10244
754 * reloc.cc (relocate_sections): Skip empty relocation sections.
755
ec3f783e
ILT
7562009-06-23 Ian Lance Taylor <iant@google.com>
757
758 PR 10156
759 * layout.cc (Layout::create_note): Use choose_output_section
760 rather than make_output_section.
761
459c9f1c
ILT
7622009-06-23 Ian Lance Taylor <iant@google.com>
763
764 PR 10237
765 * options.cc (General_options::parse_V): Set printed_version_.
766 (General_options::General_options): Initialize printed_version_.
767 * options.h (class General_options): Add printed_version_ field.
768 * gold.cc (queue_initial_tasks): If there are no input files,
769 don't give a fatal error if we printed the version information.
770 (queue_middle_tasks): If using -r with a shared object, give a
771 fatal error rather than an ordinary error.
772
1518dc8f
ILT
7732009-06-23 Ian Lance Taylor <iant@google.com>
774
775 PR 10219
776 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
777 (Layout::make_output_section): Set have_stabstr_section_ if we see
778 a .stab*str section.
779 (Layout::finalize): Call link_stabs_sections.
780 (Layout::link_stabs_sections): New file.
781 * layout.h (class Layout): Add have_stabstr_section_ field.
782 Declare link_stabs_sections.
783
3d857b98
DK
7842009-06-23 Doug Kwan <dougkwan@google.com>
785
786 * Makefile.am (libgold_a_LIBADD): New.
787 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
788 * Makefile.in: Regenerate.
789 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
790 * configure: Regenerate.
791 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
792 * fileread.cc: Include sys/state.h
793 * gold.h: Declare memmem and strndup if found missing.
794 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
795
0639a6f6
ILT
7962009-06-23 Ian Lance Taylor <iant@google.com>
797
798 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
799 * configure: Rebuild.
800
8d63875c
ILT
8012009-06-23 Ian Lance Taylor <iant@google.com>
802
803 PR 10147
804 * object.cc (Object::section_contents): Don't try to get a view if
805 the section has length zero.
806 (Object::handle_gnu_warning_section): If the section is empty, use
807 the name of the section as the warning.
808
f7c8a183
ILT
8092009-06-23 Ian Lance Taylor <iant@google.com>
810
811 PR 10133
812 * stringpool.h (class Stringpool_template): Add optimize_ field.
813 (Stringpool_template::set_optimize): New function.
814 * stringpool.cc (Stringpool_template::Stringpool_template):
815 Initialize optimize_ field.
816 (Stringpool_template::set_string_offsets): Test local optimize
817 fild rather than parameter.
818 * layout.cc (Layout::Layout): Call set_optimize on the section
819 name stringpool.
820
e6a307ba
ILT
8212009-06-22 Ian Lance Taylor <iant@google.com>
822
823 PR 10030
824 * yyscript.y: Parse TARGET.
825 * script.cc (script_set_target): New function.
826 * script-c.h (script_set_target): Declare.
827 * options.cc (General_options::string_to_object_format): Rename
828 from string_to_object_format in anonymous namespace. Change
829 callers.
830 * options.h (class General_options): Declare
831 string_to_object_format.
832
3ee173de
ILT
8332009-06-22 Ian Lance Taylor <iant@google.com>
834
835 * script-sections.cc (Script_sections::create_segments): Don't put
836 program headers in a PT_LOAD segment if -n or -N.
837
8382009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
839
840 PR 10141
841 * options.h (class General_options): Add -z lazy and -z now. Sort
842 -z options into alphabetical order.
843 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
844
cd6739a1 8452009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
846
847 * layout.cc (Layout::make_output_section): Call
848 Target::new_output_section.
849 (Layout::attach_allocated_section_to_segment): Put large section
850 sections in a separate load segment with the large segment flag
851 set.
852 (Layout::segment_precedes): Sort large data segments after other
853 load segments.
854 (align_file_offset): New static function.
855 (Layout::set_segment_offsets): Use align_file_offset.
856 * output.h (class Output_section): Add is_small_section_ and
857 is_large_section_ fields.
858 (Output_section::is_small_section): New function.
859 (Output_section::set_is_small_section): New function.
860 (Output_section::is_large_section): New function.
861 (Output_section::set_is_large_section): New function.
862 (Output_section::is_large_data_section): New function.
863 (class Output_segment): Add is_large_data_segment_ field.
864 (Output_segment::is_large_data_segment): New function.
865 (Output_segment::set_is_large_data_segment): New function.
866 * output.cc (Output_section::Output_section): Initialize new
867 fields.
868 (Output_segment::Output_segment): Likewise.
869 (Output_segment::add_output_section): Add assertion that large
870 data sections always go in large data segments. Force small data
871 sections to the end of the list of data sections. Force small BSS
872 sections to the start of the list of BSS sections. For large BSS
873 sections to the end of the list of BSS sections.
874 * symtab.h (class Symbol): Declare is_common_shndx.
875 (Symbol::is_defined): Check Symbol::is_common_shndx.
876 (Symbol::is_common): Likewise.
877 (class Symbol_table): Define enum Commons_section_type. Update
878 declarations. Add small_commons_ and large_commons_ fields.
879 * symtab.cc (Symbol::is_common_shndx): New function.
880 (Symbol_table::Symbol_table): Initialize new fields.
881 (Symbol_table::add_from_object): Put small and large common
882 symbols in the right list.
883 (Symbol_table::sized_finalized_symbol): Check
884 Symbol::is_common_shndx.
885 (Symbol_table::sized_write_globals): Likewise.
886 * common.cc (Symbol_table::do_allocate_commons): Allocate new
887 common symbol lists. Don't call do_allocate_commons_list if the
888 list is empty.
889 (Symbol_table::do_allocate_commons_list): Remove is_tls
890 parameter. Add comons_section_type parameter. Change all
891 callers. Handle small and large common symbols.
892 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
893 Symbol::is_common_shndx.
894 * resolve.cc (symbol_to_bits): Likewise.
895 * target.h (Target::small_common_shndx): New function.
896 (Target::small_common_section_flags): New function.
897 (Target::large_common_shndx): New function.
898 (Target::large_common_section_flags): New function.
899 (Target::new_output_section): New function.
900 (Target::Target_info): Add small_common_shndx, large_common_shndx,
901 small_common_section_flags, and large_common_section_flags
902 fields.
903 (Target::do_new_output_section): New virtual function.
904 * arm.cc (Target_arm::arm_info): Initialize new fields.
905 * i386.cc (Target_i386::i386_info): Likewise.
906 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
907 Likewise.
908 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
909 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
910 (Target_x86_64::do_new_output_section): New function.
911 * configure.ac: Define conditional MCMODEL_MEDIUM.
912 * testsuite/Makefile.am (check_PROGRAMS): Add large.
913 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
914 (large_LDFLAGS): Define.
915 * testsuite/large.c: New file.
916 * testsuite/testfile.cc (Target_test::test_target_info):
917 Initialize new fields.
918 * configure, testsuite/Makefile.in: Rebuild.
919
bb04269c
DK
9202009-06-05 Doug Kwan <dougkwan@google.com>
921
922 * Makefile.am (CCFILES): Add target.cc.
923 * Makefile.in: Regenerate.
924 * i386.cc (class Target_i386): Define new virtual method to
925 override do_is_local_label_name in parent.
926 * object.cc (Sized_relobj::do_count_local_symbols): Discard
927 local symbols if --discard-locals or -X is given.
928 * options.h (class General_options): Declare new options
929 '--discard-locals' and '-X' for discarding locals.
930 * target.h (class Target): Define new methods is_local_label_name.
931 Declare new virtual method do_is_local_label_name.
932 * target.cc: New file.
933 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
934 (check_SCRIPTS): Add discard_locals_test.sh.
935 (check_DATA): Add discard_local_tests.syms.
936 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
937 (discard_local_tests.syms, discard_locals_test.o): New make rules.
938 * testsuite/Makefile.in: Regenerate.
939 * testsuite/discard_locals_test.c: New file.
940 * testsuite/discard_locals_test.sh: Same.
941
805bb01c
DK
9422009-06-05 Doug Kwan <dougkwan@google.com>
943
944 * object.cc (Sized_relobj::Sized_relobj): Initialize
945 discarded_eh_frame_shndx_ to -1U.
946 (Sized_relobj::do_layout): Record index of a discard .eh_frame
947 section.
948 (Sized_relobj::do_count_local_symbols): Skip local symbols in
949 a discarded .eh_frame section.
950 (Sized_relobj::do_finalize_local_symbols): Ditto.
951 * object.h (class Sized_relobj): Declare new member
952 discarded_eh_frame_shndx_.
953 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
954 (local_labels_test.o, local_labels_test): New rules.
955 * testsuite/Makefile.in: Regenerate.
956
1dcd334d
DK
9572009-06-04 Doug Kwan <dougkwan@google.com>
958
959 * layout.cc (Layout::section_name_mapping): Add mapping for
960 special ARM sections.
961
96d49306
DK
9622009-06-03 Doug Kwan <dougkwan@google.com>
963
964 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
965 (utils::has_overflow): Same.
966
dff16297
ILT
9672009-06-03 Ian Lance Taylor <iant@google.com>
968
969 * layout.cc (Layout::section_name_mapping): New array, replacing
970 Layout::linkonce_mapping.
971 (Layout::section_name_mapping_count): New variable, replacing
972 Layout::linkonce_mapping_count.
973 (Layout::linkonce_output_name): Remove.
974 (Layout::output_section_name): Rewrite.
975 * layout.h (class Layout): Rename Linkonce_mapping to
976 Section_name_mapping, linkonce_mapping to section_name_mapping,
977 linkonce_mapping_count to section_name_mapping_count. Don't
978 declare linkonce_output_name.
979
c121c671
DK
9802009-06-03 Doug Kwan <dougkwan@google.com>
981
982 * gold/arm.cc (namespace utils): New.
983 (Target_arm::reloc_is_non_pic): Define new method.
984 (class Arm_relocate_functions): New.
985 (Target_arm::Relocate::relocate): Handle relocation types used by
986 Android.
987
07800fab
ILT
9882009-06-03 Ian Lance Taylor <iant@google.com>
989
990 * arm.cc (Target_arm::scan::global): Use || instead of |.
991
c121c671
DK
9922009-06-02 Doug Kwan <dougkwan@google.com>
993
994 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
995 issued_non_pic_error_.
996 (class Target_arm::Scan): Declare new method check_non_pic.
997 Define new method symbol_needs_plt_entry.
998 Declare new data member issued_non_pic_error_.
999 (class Target_arm::Relocate): Declare new method
1000 should_apply_static_reloc.
1001 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
1002 (Target_arm::Scan::check_non_pic): Define new method.
1003 (Target_arm::Scan::local): Handle a small subset of reloc types used
1004 by Android.
1005 (Target_arm::Scan::local): Same.
1006 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
1007
b19b0c6d
ILT
10082009-05-31 Mikolaj Zalewski <mikolajz@google.com>
1009
1010 * incremental.cc (Incremental_inputs::report_command_line): Filter
1011 out --incremental-* options.
1012
94cdfcff
DK
10132009-05-29 Doug Kwan <dougkwan@google.com>
1014
1015 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
1016 template class.
1017 (class Target_arm): Update comment.
1018 (Target_arm::Target_arm): Initialize new data members GOT_,
1019 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
1020 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
1021 and Target_arm::rel_dyn_section.
1022 Declare new_enum Target_arm::Got_type.
1023 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
1024 and DYNBSS_.
1025 Update commments for member do_dynsym_value.
1026 (Target_arm::got_size, Target_arm::plt_section,
1027 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
1028 new methods inside class defintion.
1029 (Target_arm::got_section): Define new method.
1030 (Target_arm::rel_dyn_section): Same.
1031 (Output_data_plt_arm): New template class.
1032 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
1033 (Output_data_plt_arm:do_adjust_output_section): Define new method.
1034 (Output_data_plt_arm::add_entry): Same.
1035 (Output_data_plt_arm::first_plt_entry): Define new
1036 static data member for PLT instruction template.
1037 (Output_data_plt_arm::plt_entry): Same.
1038 (Output_data_plt_arm::do_write): Define new method.
1039 (Target_arm::make_plt_entry): Same.
1040 (Target_arm::do_finalize_sections): Same.
1041 (Target_arm::do_dynsym_value): Same.
1042
4a657b0d
DK
10432009-05-28 Doug Kwan <dougkwan@google.com>
1044
1045 * Makefile.am (TARGETSOURCES): Add arm.cc.
1046 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
1047 * Makefile.in: Regenerate.
1048 * arm.cc: New file.
1049 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
1050
e7ae8c36
DK
10512009-05-26 Doug Kwan <dougkwan@google.com>
1052
1053 * options.cc (General_options::parse_exclude_libs). Fix a comment.
1054 (General_options::check_excluded_libs): Strip off directories in
1055 archive name before matching like GNU ld does.
1056 * testsuite/Makefile.am (MOSTLYCLEANFILES,
1057 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
1058 (exclude_libs_test_LDFLAGS): Add linker option
1059 -Wl,--exclude-libs,libexclude_libs_test_3
1060 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
1061 an explicit archive without using -l.
1062 (alt/libexclude_libs_test_3.a): New make rule.
1063 * testsuite/Makefile.in: Regenerate.
1064 * testsuite/exclude_libs_test.c : Declare lib3_default().
1065 (main): Call it.
1066 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
1067 * exclude_libs_test_3.c: New file.
1068
f12e7348
NC
10692009-05-26 Nick Clifton <nickc@redhat.com>
1070
1071 * po/id.po: New Indonesian translation.
1072 * po/gold.pot: Updated template file.
1073
4daadc0d
ST
10742009-05-22 Sriraman Tallam <tmsriram@google.com>
1075
1076 * testsuite/Makefile.am: Add -ffunction-sections to compile
1077 gc_comdat_test files. Add -Wl,--gc-sections to build
1078 gc_comdat_test.
1079 * testsuite/Makefile.in: Regenerate.
1080 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
1081
531813ad
ST
10822009-05-21 Sriraman Tallam <tmsriram@google.com>
1083
1084 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
1085 kept comdat section was garbage collected.
1086 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
1087 * testsuite/Makefile.in: Regenerate.
1088 * testsuite/gc_comdat_test.sh: New file.
1089 * testsuite/gc_comdat_test_1.cc: New file.
1090 * testsuite/gc_comdat_test_2.cc: New file.
1091
65514900
CC
10922009-05-19 Doug Kwan <dougkwan@google.com>
1093
1094 * archive.cc (Archive::Archive): Move constructor from archive.h
1095 to here. Initialize no_export_.
1096 (Archive::get_elf_object_for_member): Set no_export flag of object.
1097 * archive.h (Archive::Archive): Move constructor body to
1098 archive.cc.
1099 (Archive::no_export): New method.
1100 (Archive::no_export_): New field.
1101 * object.h (Object::Object): Initialize no_export_ to false.
1102 (Object::no_export, Object::set_no_export): New methods.
1103 (Object::no_export_): New field.
1104 * options.cc (General_options::parse_exclude_libs): New method.
1105 (General_options::check_excluded_libs) Same.
1106 * options.h (exclude_libs): New option.
1107 (General_options::check_excluded_libs): New method declaration.
1108 (General_options::excluded_libs_): New field.
1109 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
1110 default or protected visibility if an object has no-export flag set.
1111 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
1112 (check_SCRIPTS): Add exclude_libs_test.sh.
1113 (check_DATA): Add exclude_libs_test.syms.
1114 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
1115 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
1116 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
1117 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
1118 (exclude_libs_test.syms, libexclude_libs_test_1.a,
1119 libexclude_libs_test_2.a): New rules.
1120 * testsuite/Makefile.in: Regenerate.
1121 * testsuite/exclude_libs_test.c: New file.
1122 * testsuite/exclude_libs_test.sh: Ditto.
1123 * testsuite/exclude_libs_test_1.c: Ditto.
1124 * testsuite/exclude_libs_test_2.c: Ditto.
1125
1b77ea50
ILT
11262009-05-15 Ian Lance Taylor <iant@google.com>
1127
1128 * configure.ac: Check for declarations for cases where libiberty.h
1129 checks HAVE_DECL_xxx.
1130 * configure, config.in: Rebuild.
1131
072fe7ce
ILT
11322009-05-15 Mikolaj Zalewski <mikolajz@google.com>
1133
1134 * gold.h (Incremental_argument_list): Remove (invalid) forward
1135 declaration.
1136 * incremental.cc (Incremental_inputs::report_achive): New method.
1137 (Incremental_inputs::report_object): New method.
1138 (Incremental_inputs::report_script): New method.
1139 (Incremental_inputs::finalize_inputs): New method.
1140 (Incremental_inputs::finalize): Call finalize_inputs().
1141 (Incremental_inputs::sized_create_incremental_inputs_section_data):
1142 Create inputs entries.
1143 * incremental.h (Incremental_input_type): New enum.
1144 (Incremental_inputs::Incremental_input): Initialize new fields.
1145 (Incremental_inputs::report_inputs): New method.
1146 (Incremental_inputs::report_achive): New method.
1147 (Incremental_inputs::report_object): New method.
1148 (Incremental_inputs::report_script): New method.
1149 (Incremental_inputs::finalize_inputs): New method.
1150 (Incremental_inputs::Input_info): New struct.
1151 (Incremental_inputs::Input_info_map): New typedef.
1152 (Incremental_inputs::lock_): New field.
1153 (Incremental_inputs::Inputs_): New field.
1154 (Incremental_inputs::Inputs_map): New field.
1155 * main.cc (main): Call Incremental_input::report_inputs.
1156 * options.h (Input_argument_list): Typedef moved from
1157 Input_arguments.
1158 (Input_file_group::Files): Remove, use ::Input_argument_list.
1159 (Input_file_group::Input_argument_list): Remove, use
1160 ::Input_argument_list.
1161 * plugin.cc (Plugin_manager::add_input_file): Add error in
1162 incremental build.
1163 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
1164 functions.
1165 * script.cc (read_input_script): Call
1166 Incremental_input::report_script.
1167 * script.h (Script_info): New class.
1168
b0481b0b
ILT
11692009-04-27 Ian Lance Taylor <iant@google.com>
1170
1171 * x86_64.cc (do_adjust_output_section): Set entsize to
1172 plt_entry_size.
1173
b22a5a41 11742009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
1175
1176 * output.cc (Output_file::close): After short writes, continue
1177 writing from the correct offset in the buffer being written.
1178
40fde488
CD
11792009-04-23 Chris Demetriou <cgd@google.com>
1180
1181 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
1182 * configure: Regenerate.
1183 * config.in: Regenerate.
1184 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
1185 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
1186
3ce2c28e
ILT
11872009-04-21 Mikolaj Zalewski <mikolajz@google.com>
1188
1189 * incremental.cc (Incremental_inputs_header_data): Renamed from
1190 Incremental_input_header_data.
1191 (Incremental_inputs_header_data::data_size): New field.
1192 (Incremental_inputs_header_data::put_input_file_count): Renamed
1193 from input_file_count.
1194 (Incremental_inputs_header_data::put_command_line_offset): Renamed
1195 from command_line_offset.
1196 (Incremental_inputs_header_data::put_reserved): Renamed from
1197 put_reserved.
1198 (Incremental_inputs_entry_data): Renamed from
1199 Incremental_input_entry_data.
1200 (Incremental_inputs_entry_data::data_size): New field.
1201 (Incremental_inputs::report_command_line): New method.
1202 (Incremental_inputs::finalize): New method.
1203 (Incremental_inputs::create_incremental_inputs_data): New method.
1204 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
1205 * incremental.h: New file.
1206 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
1207 (Layout::finalize): Create incremental inputs section in
1208 incremental builds.
1209 (Layout::create_incremental_info_sections): New method.
1210 * layout.h (Layout::incremental_inputs): New method.
1211 (Layout::create_incremental_info_sections): New method.
1212 (Layout::incremental_inputs_): New field.
1213 * main.cc (main): Notify Incremental_input of the command line.
1214
e55bde5e
ILT
12152009-04-01 Ian Lance Taylor <iant@google.com>
1216 Mikolaj Zalewski <mikolajz@google.com>
1217
1218 * gold.h (reserve_unordered_map): Define, three versions, one for
1219 each version of Unordered_map.
1220 * layout.cc (Layout::Layout): Remove options parameter. Add
1221 number_of_input_files parameter. Don't initialize options_.
1222 Initialize number_of_input_files_ and resized_signatures_. Move
1223 sections_are_attached_.
1224 (Layout::layout_group): Reserve space for group_signatures_.
1225 (Layout::find_or_add_kept_section): Change name parameter to be a
1226 reference. Resize signatures_ map when it gets large enough.
1227 (Layout::layout_eh_frame): Use parameters->options() instead of
1228 this->options_.
1229 (Layout::make_output_section): Likewise.
1230 (Layout::attach_allocated_section_to_segment): Likewise.
1231 (Layout::finalize, Layout::create_executable_stack): Likewise.
1232 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
1233 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
1234 * layout.h (class Layout): Update declarations. Remove options_
1235 field. Add number_of_input_files_ and resized_signatures_
1236 fields. Move sections_are_attached_ field.
1237 * main.cc (main): Pass number of input files to Layout
1238 constructor. Don't pass options.
1239
154b857c
ILT
12402009-03-30 Ian Lance Taylor <iant@google.com>
1241
1242 * ffsll.c (ffsll): Correct implementation.
1243
2f35ab9b
ILT
12442009-03-27 Ian Lance Taylor <iant@google.com>
1245
fd03461a
ILT
1246 * ffsll.c: New file.
1247 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
1248 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
1249 * ftruncate.c (ftruncate): Declare before definition.
1250 * mremap.c (mremap): Likewise.
1251 * pread.c (pread): Likewise.
1252 * configure, Makefile.in, config.in: Rebuild.
1253
2f35ab9b
ILT
1254 * mremap.c: New file.
1255 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
1256 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
1257 (mremap): Declare if HAVE_MREMAP is not defined.
1258 * configure, Makefile.in, config.in: Rebuild.
1259
33aea2fd
CC
12602009-03-27 Cary Coutant <ccoutant@google.com>
1261
1262 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
1263 position independent.
1264 * sparc.cc (Target_sparc::check_non_pic): Likewise.
1265 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
1266
6d479619
CC
12672009-03-24 Cary Coutant <ccoutant@google.com>
1268
1269 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
1270 an executable.
1271 (needs_dynamic_reloc): Likewise.
1272
afc06bb8
ILT
12732009-03-24 Ian Lance Taylor <iant@google.com>
1274
1275 * yyscript.y (file_cmd): Recognize EXTERN.
1276 (extern_name_list, extern_name_list_body): New nonterminals.
1277 * script.cc (script_add_extern): Define.
1278 * script-c.h (script_add_extern): Declare.
1279
f6060a4d
ILT
12802009-03-24 Rafael Avila de Espindola <espindola@google.com>
1281
1282 * object.cc (is_elf_object): Define.
1283 * object.h (is_elf_object): Declare.
1284 * archive.cc (Archive::get_elf_object_for_member): Call
1285 is_elf_object.
33aea2fd 1286 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 1287
26736d8e
ILT
12882009-03-24 Elliott Hughes <enh@google.com>
1289
1290 * output.cc (Output_file::map_anonymous): Define.
1291 (Output_file::map): Use map_anonymous. If the regular mmap fails,
1292 try an anonymous one. Report the size if the mmap fails.
1293 * output.h (class Output_file): Declare map_anonymous.
1294
22fd9730
ILT
12952009-03-24 Ian Lance Taylor <iant@google.com>
1296
1297 * target-select.cc (instantiate_target): Don't acquire the lock if
1298 the instantiated_target_ field has already been set.
1299
cb010894
ILT
13002009-03-23 Ian Lance Taylor <iant@google.com>
1301
7f055c20
ILT
1302 * gold-threads.h (class Initialize_lock): Define.
1303 * gold-threads.cc (class Initialize_lock_once): Define.
1304 (initialize_lock_control): New static variable.
1305 (initialize_lock_pointer): New static variable.
1306 (initialize_lock_once): New static function.
1307 (Initialize_lock::Initialize_lock): Define.
1308 (Initialize_lock::initialize): Define.
1309 * target-select.h: Include "gold-threads.h".
1310 (class Target_selector): Add lock_ and initialize_lock_ fields.
1311 Don't define instantiate_target, just declare it.
1312 * target-select.cc (Target_selector::Target_selector): Initialize
1313 new fields.
1314 (Target_selector::instantiate_target): Define.
1315 * descriptors.h: Include "gold-threads.h".
1316 (class Descriptors): Add initialize_lock_ field.
1317 * descriptors.cc (Descriptors::Descriptors): Initialize new
1318 field.
1319 (Descriptors::open): Use initialize_lock_ field
1320 * errors.h (class Errors): Add initialize_lock_ field.
1321 * errors.cc (Errors::Errors): Initialize new field.
1322 (Errors::initialize_lock): Use initialize_lock_ field.
1323 * powerpc.cc (class Target_selector_powerpc): Remove
1324 instantiated_target_ field. In do_recognize call
1325 instantiate_target rather than do_instantiate_target. In
1326 do_instantiate_target just allocate a new target.
1327 * sparc.cc (class Target_selector_sparc): Likewise.
1328
36959681
ILT
1329 * freebsd.h: New file.
1330 * i386.cc: Include "freebsd.h".
1331 (Target_i386): Derive from Target_freebsd rather than
1332 Sized_target.
1333 (Target_selector_i386): Derive from Target_selector_freebsd rather
1334 than Target_selector.
1335 * x86_64.cc: Include "freebsd.h".
1336 (Target_x86_64): Derive from Target_freebsd rather than
1337 Sized_target.
1338 (Target_selector_x86_64): Derive from Target_selector_freebsd
1339 rather than Target_selector.
1340 * target.h (class Target): Add adjust_elf_header and
1341 do_adjust_elf_header.
1342 * output.cc (Output_file_header:: do_sized_write): Call target
1343 adjust_elf_header routine.
1344 * configure.tgt: Set targ_osabi.
1345 * configure.ac: Define GOLD_DEFAULT_OSABI.
1346 * parameters.cc (Parameters::default_target): Pass
1347 GOLD_DEFAULT_OSABI to select_target.
1348 * target-select.h (class Target_selector): Make instantiate_target
1349 protected rather than private.
1350 * Makefile.am (HFILES): Add freebsd.h.
1351 * configure, Makefile.in, config.in: Rebuild.
1352
cb010894
ILT
1353 * merge.cc (do_add_input_section): Correct pend value. Change
1354 message about last entry not being null terminated from error to
1355 warning.
1356
0e879927
ILT
13572009-03-20 Mikolaj Zalewski <mikolajz@google.com>
1358
1359 * incremental.cc: New file.
1360 * Makefile.am (CCFILES): Add incremental.cc.
1361 * Makefile.in: Rebuild.
1362
41105937
PP
13632009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
1364
1365 * layout.cc (Layout::output_section_name): Preserve names
1366 of '.note.' sections.
1367
60439920
ILT
13682009-03-19 Ian Lance Taylor <iant@google.com>
1369
1370 * descriptors.cc (Descriptors::open): Check that the options are
1371 valid before using them.
1372
0d371ad3
ILT
13732009-03-18 Ian Lance Taylor <iant@google.com>
1374
1375 * script-sections.h: Include <list>.
1376 (class Script_sections): Change Sections_elements from std::vector
1377 to std::list. Typedef public Elements_iterator. Add
1378 orphan_section_placement_, data_segment_align_start_, and
1379 saw_data_segment_align_ fields. Remove data_segment_align_index_
1380 field.
1381 * script-sections.cc (class Orphan_section_placement): New class.
1382 (class Sections_element): Add virtual functions is_relro and
1383 orphan_section_init. Remove virtual function place_orphan_here.
1384 (class Output_section_definition): Add is_relro and
1385 orphan_section_init. Remove place_orphan_here.
1386 (class Orphan_output_section): Likewise.
1387 (Script_sections::Script_sections): Update for field changes.
1388 (Script_sections::data_segment_align): Set saw_data_segment_align_
1389 and data_segment_align_start_, not data_segment_align_index.
1390 (Script_sections::data_segment_relro_end): Check
1391 saw_data_segment_align_. Use data_segment_align_start_ rather
1392 than data_segment_align_index_.
1393 (Script_sections::place_orphan): Rewrite to use
1394 Orphan_section_placement.
1395
9201d894
ILT
13962009-03-17 Ian Lance Taylor <iant@google.com>
1397
9c5b8369
ILT
1398 * archive.cc (Archive::add_symbols): Check for a version attached
1399 to the symbol name in the archive map.
1400 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
1401 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
1402 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
1403 (ver_test_11.a): New target.
1404 * testsuite/Makefile.in: Rebuild.
1405
9201d894
ILT
1406 * configure.ac: Check for chsize and posix_fallocate. Replace
1407 ftruncate.
1408 * ftruncate.c: New file, from gnulib.
1409 * output.cc (posix_fallocate): Define dummy version if not
1410 HAVE_POSIX_FALLOCATE.
1411 (Output_file::map): Call posix_fallocate rather than lseek and
1412 write.
1413 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
1414 * configure, Makefile.in, config.in: Rebuild.
1415
ef4ab7a8
PP
14162009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
1417
1418 * layout.h (Layout::create_note): Add section_name parameter.
1419 * layout.cc (Layout::create_note): Likewise.
1420 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
1421
8c500701
ILT
14222009-03-17 Ian Lance Taylor <iant@google.com>
1423
e85b18e1
ILT
1424 * descriptors.cc: Include "options.h".
1425 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
1426 (Descriptors::open): Always use O_CLOEXEC when opening a new
1427 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
1428 then set FD_CLOEXEC.
1429
9efe6174
ILT
1430 * sparc.cc (class Target_sparc): Add has_got_section.
1431 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
1432 make sure we have a GOT section.
1433
1434 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
1435 (Target_sparc::Scan::local): Likewise.
1436 (Target_sparc::Scan::global): Likewise.
1437 (Target_sparc::Relocate::relocate): Likewise.
1438 (Target_sparc::Relocate::relocate_tls): Likewise.
1439
8c500701
ILT
1440 * symtab.cc (Symbol_table::define_default_version): New function,
1441 broken out of add_from_object.
1442 (Symbol_table::add_from_object): Call define_default_version.
1443 (Symbol_table::define_special_symbol): Add resolve_oldsym
1444 parameter. Change all callers. If the version for a symbol comes
1445 from a version script, resolve it with the symbol with the same
1446 name with no version. Also add the symbol without a version if
1447 appropriate.
1448 (do_define_in_output_data): If resolving with oldsym, don't delete
1449 sym.
1450 (do_define_in_output_segment): Likewise.
1451 (do_define_as_constant): Likewise.
1452 * symtab.h (class Symbol_table): Update declarations.
1453
f1ed28fb
ILT
14542009-03-13 Ian Lance Taylor <iant@google.com>
1455
15f8229b
ILT
1456 * readsyms.cc (Read_symbols::incompatible_warning): New function.
1457 (Read_symbols::requeue): New function.
1458 (Read_symbols::do_read_symbols): If make_elf_object fails because
1459 the target type is not configured, and the file was searched for,
1460 issue a warning and retry with the next directory.
1461 (Add_symbols::run): If the file has an incompatible format, and
1462 it was searched for, requeue the Read_symbols task. On error,
1463 release the object.
1464 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
1465 dirindex parameter to constructor. Change all callers. Declare
1466 incompatible_warning and requeue.
1467 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
1468 input_argument_ and input_group_ fields. Add them to
1469 constructor. Change all callers.
1470 (class Read_script): Add dirindex_ field. Add it to constructor.
1471 Change all callers.
1472 * archive.cc (Archive::setup): Remove input_objects parameter.
1473 Change all callers.
1474 (Archive::get_file_and_offset): Likewise.
1475 (Archive::read_all_symbols): Likewise.
1476 (Archive::read_symbols): Likewise.
1477 (Archive::get_elf_object_for_member): Remove input_objects
1478 parameter. Add punconfigured parameter. Change all callers.
1479 (Archive::add_symbols): Change return type to bool. Check return
1480 value of include_member.
1481 (Archive::include_all_members): Likewise.
1482 (Archive::include_member): Change return type to bool. Return
1483 false if first included object has incompatible target. Set
1484 included_member_ field.
1485 (Add_archive_symbols::run): If add_symbols returns false, requeue
1486 Read_symbols task.
1487 * archive.h (class Archive): Add included_member_ field.
1488 Initialize it in constructor. Add input_file and searched_for
1489 methods. Update declarations.
1490 (class Add_archive_symbols): Add dirpath_, dirindex_, and
1491 input_argument_ fields. Add them to constructor. Change all
1492 callers.
1493 * script.cc: Include "target-select.h".
1494 (class Parser_closure): Add skip_on_incompatible_target_ and
1495 found_incompatible_target_ fields. Add
1496 skip_on_incompatible_target parameter to constructor. Change all
1497 callers. Add methods skip_on_incompatible_target,
1498 clear_skip_on_incompatible_target, found_incompatible_target, and
1499 set_found_incompatible_target.
1500 (read_input_script): Add dirindex parameter. Change all callers.
1501 If parser finds an incompatible target, requeue Read_symbols
1502 task.
1503 (script_set_symbol): Clear skip_on_incompatible_target in
1504 closure.
1505 (script_add_assertion, script_parse_option): Likewise.
1506 (script_start_sections, script_add_phdr): Likewise.
1507 (script_check_output_format): New function.
1508 * script.h (read_input_script): Update declaration.
1509 * script-c.h (script_check_output_format): Declare.
1510 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
1511 (ignore_cmd): Remove OUTPUT_FORMAT.
1512 * fileread.cc (Input_file::Input_file): Add explicit this.
1513 (Input_file::will_search_for): New function.
1514 (Input_file::open): Add pindex parameter. Change all callers.
1515 * fileread.h (class Input_file): Add input_file_argument method.
1516 Declare will_search_for. Update declarations.
1517 * object.cc (make_elf_object): Add punconfigured parameter.
1518 Change all callers.
1519 * object.h (class Object): Make input_file public. Add
1520 searched_for method.
1521 (make_elf_object): Update declaration.
1522 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
1523 restart search.
1524 * dirsearch.h (class Dirsearch): Update declaration.
1525 * options.h (class General_options): Add --warn-search-mismatch.
1526 * parameters.cc (Parameters::is_compatible_target): New function.
1527 * parameters.h (class Parameters): Declare is_compatible_target.
1528 * workqueue.cc (Workqueue::add_blocker): New function.
1529 * workqueue.h (class Workqueue): Declare add_blocker.
1530
f1ed28fb
ILT
1531 * fileread.cc (Input_file::open): Remove options parameter.
1532 Change all callers.
1533 (Input_file::open_binary): Likewise.
1534 * script.cc (read_input_script): Likewise.
1535 * readsyms.h (class Read_symbols): Remove options_ field. Remove
1536 options parameter from constructor. Change all callers.
1537 (class Read_script): Likewise.
1538 * fileread.h (class Input_file): Update declarations.
1539 * script.h (read_input_script): Update declaration.
1540
34dd024a
NC
15412009-03-10 Nick Clifton <nickc@redhat.com>
1542
1543 * po/es.po: New Spanish translation.
1544
6d71b17c
CC
15452009-03-06 Cary Coutant <ccoutant@google.com>
1546
1547 * options.cc (parse_short_option): Keep dash_z from registering itself.
1548
031cdbed
ILT
15492009-03-03 Ian Lance Taylor <iant@google.com>
1550
1551 PR 9918
1552 * target-reloc.h (relocate_section): Pass output_section to
1553 relocate.
1554 * i386.cc (Target_i386::should_apply_static_reloc): Add
1555 output_section parameter. Change all callers.
1556 (Target_i386::Relocate::relocate): Add output_section parameter.
1557 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1558 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1559 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1560 * testsuite/two_file_shared.sh: New script.
1561 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
1562 (check_DATA): Add two_file_shared.dbg.
1563 (two_file_shared.dbg): New target.
1564 * testsuite/Makefile.in: Rebuild.
1565
15d5fa16
ILT
15662009-03-01 Ian Lance Taylor <iant@google.com>
1567
1568 * configure.ac: Check for byteswap.h.
1569 * configure: Rebuild.
1570 * config.in: Rebuild.
1571
8a4c0b0d
ILT
15722009-03-01 Mikolaj Zalewski <mikolajz@google.com>
1573
1574 * layout.cc (Layout::find_or_add_kept_section): New function.
1575 (Layout::add_comdat): Removed.
1576 * layout.h (struct Kept_section): Move out of class Layout.
1577 Remove trailing underscores from field names. Add group_sections
1578 field. Rename group_ field to is_group. Change all uses.
1579 (class Layout): Declare find_or_add_kept_section, not add_comdat.
1580 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
1581 comdat_groups_ field.
1582 (Sized_relobj::include_section_group): Use
1583 find_or_add_kept_section and Kept_section::group_sections.
1584 (Sized_relobj::include_linkonce_section): Likewise.
1585 * object.cc (class Sized_relobj): Don't define Comdat_group or
1586 Comdat_group_table. Remove find_comdat_group and
1587 add_comdat_group. Remove comdat_groups_ field.
1588 * plugin.cc (include_comdat_group): Use
1589 Layout::find_or_add_kept_section.
1590
b4ecf66b
ILT
15912009-02-28 Ian Lance Taylor <iant@google.com>
1592
14359ca0
ILT
1593 * README: --gc-sections and map files are now supported. Document
1594 some build requirements.
1595
b4ecf66b
ILT
1596 PR 6992
1597 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
1598 relocatable link set the value of the section symbol to zero.
1599 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
1600 relocatable link don't include the section address in the local
1601 symbol value.
1602
0602e05a
ILT
16032009-02-27 Ian Lance Taylor <iant@google.com>
1604
fd9d194f
ILT
1605 PR 6811
1606 * options.h (class Search_directory): Add is_system_directory.
1607 (class General_options): Declare is_in_system_directory.
1608 * options.cc (get_relative_sysroot): Make static.
1609 (get_default_sysroot): Make static.
1610 (General_optoins::is_in_system_directory): New function.
1611 * fileread.cc (Input_file::is_in_system_directory): New function.
1612 * fileread.h (class Input_file): Declare is_in_system_directory.
1613 * object.h (class Object): Add is_in_system_directory.
1614 (class Input_objects): Remove system_library_directory_ field.
1615 * object.cc (Input_objects::add_object): Don't set
1616 system_library_directory_.
1617 (input_objects::found_in_system_library_directory): Remove.
1618 * symtab.cc (Symbol_table::write_globals): Remove input_objects
1619 parameter. Change all callers.
1620 (Symbol_table::sized_write_globals): Likewise.
1621 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
1622 Call Object::is_in_system_directory.
1623 * symtab.h (class Symbol_table): Update declarations.
1624
61edd21f
ILT
1625 PR 5990
1626 * descriptors.h (Open_descriptor): Add is_on_stack field.
1627 * descriptors.cc (Descriptors::open): If the descriptor is on the
1628 top of the stack, remove it. Initialize is_on_stack field.
1629 (Descriptors::release): Only add pod to stack if it is not on the
1630 stack already.
1631 (Descriptors::close_some_descriptor): Clear stack_next and
1632 is_on_stack fields.
1633
e29e076a
ILT
1634 PR 7091
1635 * output.cc (Output_section::find_starting_output_address): Rename
1636 from starting_output_address; add PADDR parameter; change return
1637 type.
1638 * output.h (class Output_section): Declare
1639 find_starting_output_address instead of starting_output_address.
1640 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
1641 section symbol for which we can't find a merge section.
1642
0602e05a
ILT
1643 PR 9836
1644 * symtab.cc (Symbol_table::add_from_object): If the visibility is
1645 hidden or internal, force the symbol to be local.
1646 * resolve.cc (Symbol::override_visibility): Define.
1647 (Symbol::override_base): Use override_visibility.
1648 (Symbol_table::resolve): Likewise.
1649 (Symbol::override_base_with_special): Likewise.
1650 (Symbol_table::override_with_special): If the visibility is hidden
1651 or internal, force the symbol to be local.
1652 * symtab.h (class Symbol): Add set_visibility and
1653 override_visibility.
1654 * testsuite/ver_test_1.sh: New file.
1655 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
1656 (check_DATA): Add ver_test_1.syms.
1657 (ver_test_1.syms): New target.
1658 * testsuite/Makefile.in: Rebuild.
1659
401a9a73
CC
16602009-02-25 Cary Coutant <ccoutant@google.com>
1661
1662 * layout.cc (Layout::choose_output_section): Don't rename sections
1663 when using a linker script that has a SECTIONS clause.
1664 * Makefile.in: Regenerate.
1665
1666 * testsuite/Makefile.am (script_test_5.sh): New test case.
1667 * testsuite/Makefile.in: Regenerate.
1668 * testsuite/script_test_5.cc: New file.
1669 * testsuite/script_test_5.sh: New file.
1670 * testsuite/script_test_5.t: New file.
1671
f488e4b0
CC
16722009-02-13 Rafael Avila de Espindola <espindola@google.com>
1673
1674 * archive.cc (Archive::include_member): Update calls to add_symbols.
1675 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
1676 the Layout argument.
1677 * dynobj.h (do_add_symbols): Add the Layout argument.
1678 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
1679 Layout argument.
1680 * object.h (Object::add_symbols): Add the Layout argument.
1681 (Object::do_add_symbols): Add the Layout argument.
1682 (Sized_relobj::do_add_symbols): Add the Layout argument.
1683 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
1684 Unify the two versions.
1685 (Add_plugin_symbols): Remove.
1686 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
1687 (Sized_pluginobj::do_add_symbols): Unify the two versions.
1688 (Add_plugin_symbols): Remove.
1689 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
1690 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
1691 (Add_symbols::run): Make it work with Pulginobj.
1692
89dd1680
ILT
16932009-02-06 Ian Lance Taylor <iant@google.com>
1694
1695 * object.cc (Sized_relobj::do_layout): Make info message start
1696 with lower case letter.
1697
266d0a74
ILT
16982009-02-06 Mikolaj Zalewski <mikolajz@google.com>
1699
602b464e
ILT
1700 * binary.cc: Fix file comment.
1701
266d0a74
ILT
1702 * options.h (enum Incremental_disposition): Define.
1703 (class General_options): Add new options: --incremental,
1704 --incremental_changed, --incremental_unchanged,
1705 --incremental_unknown. Add incremental_disposition_ and
1706 implicit_incremental_ fields.
1707 (General_options::incremental_disposition): New function.
1708 (class Position_dependent_options): Add incremental_disposition
1709 option.
1710 (Position_dependent_options::copy_from_options): Set incremental
1711 dispositions.
1712 * options.cc (General_options::parse_incremental_changed): New
1713 function.
1714 (General_options::parse_incremental_unchanged): New function.
1715 (General_options::parse_incremental_unknown): New function.
1716 (General_options::General_options): Initialize new fields
1717 incremental_disposition_ and implicit_incremental_.
1718 (General_options::finalize): Check for uasge of --incremental-*
1719 without --incremental.
1720
f073bbf7
CD
17212009-02-06 Chris Demetriou <cgd@google.com>
1722
1723 * gold.h (gold_undefined_symbol): Change to take only a Symbol
1724 pointer and to report location as the file name associated with
1725 the symbol.
1726 (gold_undefined_symbol_at_location): New function to replace the
1727 old gold_undefined_symbol functionality.
1728 * target-reloc.h (relocate_section): Update to use
1729 gold_undefined_symbol_at_location.
1730 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
1731 Call gold_undefined_symbol function rather than gold_error.
1732 * errors.h (Errors::undefined_symbol): Take location as a
1733 string, rather than calculating it from a relocation.
1734 * errors.cc (Errors::fatal): Print "fatal error:" before the
1735 formatted message.
1736 (Errors::error, Errors::error_at_location): Print "error: "
1737 before the formatted message.
1738 (Errors::undefined_symbol): Take location as a string, rather
1739 than calculating it from a relocation.
1740 (gold_undefined_symbol_at_location): New function akin to
1741 old gold_undefined_symbol, calculates location from relocation.
1742 (gold_undefined_symbol): Change to take only a Symbol pointer
1743 and to report location as the file name associated with the symbol.
1744 * testsuite/debug_msg.sh: Update for changed error messages.
1745 * testsuite/undef_symbol.sh: Likewise.
1746
8e94a90c
ILT
17472009-02-04 Duncan Sands <baldrick@free.fr>
1748
1749 PR 9812
1750 * reduced_debug_output.h
1751 (Output_reduced_debug_abbrev_section::failed): Use format for
1752 gold_warning.
1753 (Output_reduced_debug_info_section::faild): Likewise.
1754
88a0e15b
ILT
17552009-01-31 Mikolaj Zalewski <mikolajz@google.com>
1756
1757 * script.cc (Lazy_demangler): New class.
1758 (Version_script_info::get_symbol_version_helper): Demangle a
1759 symbol only once.
1760
5efc7cd2
CC
17612009-01-29 Cary Coutant <ccoutant@google.com>
1762
1763 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
1764 to __tls_get_addr.
1765 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1766
e0ebcf42
ILT
17672009-01-28 Ian Lance Taylor <iant@google.com>
1768
5efc7cd2 1769 * version.cc (version_string): Bump to 1.9.
75fe7426 1770
e0ebcf42
ILT
1771 * gold.h: Include <cstring> and <stdint.h>.
1772 * version.cc: Include <cstdio>.
1773 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
1774 warning.
1775 * reduced_debug_output.cc (insert_into_vector): Rename from
1776 Insert_into_vector; change all callers. Use Swap_unaligned to
1777 avoid aliasing issue; remove union since it is unnecessary.
1778
8e2813be 17792009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
1780
1781 * Makefile.am (CCFILES): Add gc.cc.
1782 (HFILES): Add gc.h.
1783 * Makefile.in: Regenerate.
1784 * gold.cc (Gc_runner): New class.
1785 (queue_initial_tasks): Call garbage collection related tasks
1786 when corresponding options are invoked.
1787 (queue_middle_gc_tasks): New function.
1788 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
1789 processed early before laying out sections during garbage collection.
1790 * gold.h (queue_middle_gc_tasks): New function.
1791 (is_prefix_of): Move from "layout.cc".
1792 * i386.cc (Target_i386::gc_process_relocs): New function.
1793 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
1794 * main.cc (main): Create object of class "Garbage_collection".
1795 * object.cc (Relobj::copy_symbols_data): New function.
1796 (Relobj::is_section_name_included): New function.
1797 (Sized_relobj::do_layout): Allow this function to be called twice
1798 during garbage collection and defer layout of section during the
1799 first call.
1800 * object.h (Relobj::get_symbols_data): New function.
1801 (Relobj::is_section_name_included): New function.
1802 (Relobj::copy_symbols_data): New function.
1803 (Relobj::set_symbols_data): New function.
1804 (Relobj::get_relocs_data): New function.
1805 (Relobj::set_relocs_data): New function.
1806 (Relobj::is_output_section_offset_invalid): New pure virtual function.
1807 (Relobj::gc_process_relocs): New function.
1808 (Relobj::do_gc_process_relocs): New pure virtual function.
1809 (Relobj::sd_): New data member.
1810 (Sized_relobj::is_output_section_offset_invalid): New function.
1811 (Sized_relobj::do_gc_process_relocs): New function.
1812 * options.h (General_options::gc_sections): Modify to not be a no-op.
1813 (General_options::print_gc_sections): New option.
1814 * plugin.cc (Plugin_finish::run): Remove function call to
1815 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
1816 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
1817 * reloc.cc (Read_relocs::run): Add task to process relocs and
1818 determine unreferenced sections when doing garbage collection.
1819 (Gc_process_relocs): New class.
1820 (Sized_relobj::do_gc_process_relocs): New function.
1821 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
1822 sections that are garbage collected.
1823 * reloc.h (Gc_process_relocs): New class.
1824 * sparc.cc (Target_sparc::gc_process_relocs): New function.
1825 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
1826 symbols whose corresponding sections are garbage collected.
1827 (Symbol_table::Symbol_table): Add new parameter for the garbage
1828 collection object.
1829 (Symbol_table::gc_mark_undef_symbols): New function.
1830 (Symbol_table::gc_mark_symbol_for_shlib): New function.
1831 (Symbol_table::gc_mark_dyn_syms): New function.
1832 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
1833 as garbage.
1834 (Symbol_table::add_from_object): Likewise.
1835 (Symbol_table::add_from_relobj): When building shared objects, do not
1836 treat externally visible symbols as garbage.
1837 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
1838 table information for static and relocatable links.
1839 * symtab.h (Symbol_table::set_gc): New function.
1840 (Symbol_table::gc): New function.
1841 (Symbol_table::gc_mark_undef_symbols): New function.
1842 (Symbol_table::gc_mark_symbol_for_shlib): New function.
1843 (Symbol_table::gc_mark_dyn_syms): New function.
1844 (Symbol_table::gc_): New data member.
1845 * target.h (Sized_target::gc_process_relocs): New pure virtual
1846 function.
1847 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
1848 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
1849
3b293544
CF
18502009-01-20 Chris Faylor <me.sourceware@sourceware.org>
1851
1852 * options.h (General_options::gc_sections): Define as a no-op for now.
1853 (General_options::no_keep_memory): Ditto.
1854 (General_options::Bshareable): Define.
1855 * options.cc (General_options::finalize): Honor -Bshareable.
1856
83d22aa8
AS
18572009-01-20 Andreas Schwab <schwab@suse.de>
1858
1859 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
1860 read the value in the contents, since we don't use it. Use the
1861 template endianness when writing.
1862 (Relocate::relocate): Use it for R_PPC_REL16_HA.
1863
cd536b21
AS
18642009-01-19 Andreas Schwab <schwab@suse.de>
1865
1866 * configure.tgt (powerpc64-*): Fix targ_obj.
1867
99e9a495
ILT
18682009-01-15 Ian Lance Taylor <iant@google.com>
1869
1870 * object.cc (Sized_relobj::write_local_symbols): Don't write out
1871 local symbols when stripping all symbols.
1872
bbbfea06
CC
18732009-01-14 Cary Coutant <ccoutant@google.com>
1874
99e9a495 1875 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 1876
0f7c0701
CC
18772009-01-14 Cary Coutant <ccoutant@google.com>
1878
1879 * archive.cc (Archive::get_elf_object_for_member): Remove call
1880 to File_read::claim_for_plugin.
1881 * descriptors.cc (Descriptors::open): Remove reference to
1882 is_claimed.
1883 (Descriptors::claim_for_plugin): Remove.
1884 * descriptors.h (Descriptors::claim_for_plugin): Remove.
1885 (Descriptors::is_claimed): Remove.
1886 (claim_descriptor_for_plugin): Remove.
1887 * fileread.cc (File_read::claim_for_plugin): Remove.
1888 * fileread.h (File_read::claim_for_plugin): Remove.
1889 (File_read::descriptor): Reopen descriptor if necessary.
1890 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
1891 (Plugin_manager::all_symbols_read): Add task parameter. Change
1892 all callers.
1893 (Plugin_manager::get_input_file): New function.
1894 (Plugin_manager::release_input_file): New function.
1895 (Pluginobj::Pluginobj): Add filesize parameter and initialize
1896 corresponding data member.
1897 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
1898 and pass to base constructor. Change all callers.
1899 (get_input_file, release_input_file): New functions.
1900 (make_sized_plugin_object): Add filesize parameter. Change all callers.
1901 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
1902 (Plugin_manager::all_symbols_read): Add task parameter.
1903 (Plugin_manager::get_input_file): New function.
1904 (Plugin_manager::release_input_file): New function.
1905 (Plugin_manager::task_): New data member.
1906 (Pluginobj::Pluginobj): Add filesize parameter.
1907 (Pluginobj::filename): New function.
1908 (Pluginobj::descriptor): New function.
1909 (Pluginobj::filesize): New function.
1910 (Pluginobj::filesize_): New data member.
1911 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
1912 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
1913 File_read::claim_for_plugin; use Object::unlock to unlock the file.
1914
1915 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
1916 with archive libraries.
1917 * testsuite/Makefile.in: Regenerate.
1918 * testsuite/plugin_test.c (struct sym_info): New type.
1919 (get_input_file, release_input_file): New static variables.
1920 (onload): Capture new transfer vector entries.
1921 (claim_file_hook): Stop reading at end of file according to filesize.
1922 Factor out parsing of readelf output into separate function.
1923 (all_symbols_read_hook): Exercise get_input_file and release_input_file
1924 APIs and get the source file name from the symbol table. Convert
1925 source file name to corresponding object file name. Print info
1926 message when adding new input files.
1927 (parse_readelf_line): New function.
1928 * testsuite/plugin_test_1.sh: Add checks for new info messages.
1929 * testsuite/plugin_test_2.sh: Likewise.
1930 * testsuite/plugin_test_3.sh: Likewise.
1931 * testsuite/plugin_test_4.sh: New test case.
1932
62a6d109
ILT
19332009-01-07 Ian Lance Taylor <iant@google.com>
1934
1935 * version.cc (version_string): Bump to 1.8.
1936
483620e8
CC
19372008-12-23 Cary Coutant <ccoutant@google.com>
1938
1939 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
1940 * plugin.cc (Plugin_manager::finish): Rename as
1941 layout_deferred_objects. Move cleanup to separate function.
1942 (Plugin_manager::cleanup): New function.
1943 (Plugin_finish::run): Call layout_deferred_objects and cleanup
1944 separately.
1945 * plugin.h (Plugin_manager::finish): Rename as
1946 layout_deferred_objects.
1947 (Plugin_manager::cleanup): New function.
1948 (Plugin_manager::cleanup_done): New field.
1949
d66a9eb3
CC
19502008-12-23 Cary Coutant <ccoutant@google.com>
1951
1952 * plugin.cc (is_visible_from_outside): New function.
1953 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
1954 so we don't return "IR only" status for exported symbols or -r links.
1955
1956 * testsuite/Makefile.am (plugin_test_3): New test case.
1957 * testsuite/Makefile.in: Regenerate.
1958 * testsuite/plugin_test_3.sh: New file.
1959
5995b570
CC
19602008-12-22 Cary Coutant <ccoutant@google.com>
1961
1962 * object.cc (Sized_relobj::layout_section): New function.
1963 (Sized_relobj::do_layout): Defer layout of input sections until after
1964 plugin has provided replacement files.
1965 (Sized_relobj::do_layout_deferred_sections): New function.
1966 * object.h (Relobj::set_section_offset): Remove virtual keyword.
1967 (Relobj::layout_deferred_sections): New function.
1968 (Relobj::do_layout_deferred_sections): New function.
1969 (Sized_relobj::do_layout_deferred_sections): New function.
1970 (Sized_relobj::layout_section): New function.
1971 (Sized_relobj::Deferred_layout): New structure.
1972 (Sized_relobj::deferred_layout_): New field.
1973 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
1974 Change all callers. Layout deferred sections.
1975 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
1976 references.
1977 (Plugin_hook::run): Move code from do_plugin_hook inline.
1978 (Plugin_hook::do_plugin_hook): Remove.
1979 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
1980 (Plugin_manager::finish): Renamed, was cleanup.
1981 (Plugin_manager::should_defer_layout): New function.
1982 (Plugin_manager::add_deferred_layout_object): New function.
1983 (Plugin_manager::Deferred_layout_list): New type.
1984 (Plugin_manager::deferred_layout_objects_): New field.
1985 (Plugin_hook::do_plugin_hook): Remove.
1986
ee769c88
ILT
19872008-12-17 Ian Lance Taylor <iant@google.com>
1988
1989 * options.h (class General_options): Add --no case for
1990 --export-dynamic.
1991
abc8dcba
CC
19922008-12-16 Cary Coutant <ccoutant@google.com>
1993
1994 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
1995 vector.
1996 (Plugin_manager::claim_file): Create plugin object even if
1997 plugin did not call the add_symbols callback.
1998 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
1999 asking for more symbols than were added.
2000 * testsuite/Makefile.am (plugin_test_1): Add test case with
2001 no global symbols.
2002 (empty.syms): New target.
2003 * testsuite/Makefile.in: Regenerate.
2004 * testsuite/plugin_test.c (claim_file_hook): Add new debug
2005 message. Don't call add_symbols if no globals.
2006 (all_symbols_read_hook): Don't provide replacement for empty
2007 claimed file.
2008
b0074644
ILT
20092008-12-12 Ian Lance Taylor <iant@google.com>
2010
68943102
ILT
2011 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
2012 r_type == 0 for a local symbol with r_sym == 0.
2013 (scan_relocatable_relocs): Pass r_sym to
2014 local_non_section_strategy.
2015 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
2016 r_sym parameter.
2017
b0074644
ILT
2018 * configure.ac: Update test for TLS descriptors: they are
2019 supported as of glibc 2.9.
2020 * configure: Rebuild.
2021
c2508178
ILT
20222008-12-11 Ian Lance Taylor <iant@google.com>
2023
2024 PR 7091
2025 * target-reloc.h (Default_scan_relocatable_relocs): For each
2026 function, map r_type == 0 to RELOC_DISCARD.
2027
2756a258
CC
20282008-12-10 Cary Coutant <ccoutant@google.com>
2029
2030 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
2031 object to override a kept COMDAT group from a plugin object.
2032
bb6f53d3
ILT
20332008-12-09 Ian Lance Taylor <iant@google.com>
2034
fbc558e1
ILT
2035 PR 7088
2036 * yyscript.y (file_cmd): Handle INPUT.
2037
bb6f53d3
ILT
2038 * testsuite/initpri1.c: Change all declarations to be full
2039 prototypes by adding void, to avoid compiler warnings.
2040
4674ecfc
CC
20412008-12-05 Rafael Avila de Espindola <espindola@google.com>
2042
2043 * options.cc (General_options::parse_plugin_opt): New.
2044 (General_options::add_plugin): The argument now is just the filename.
2045 (General_options::add_plugin_option): New.
2046 * options.h (plugin_opt): New.
2047 (add_plugin): Change argument name.
2048 (add_plugin_option): New.
2049 * plugin.cc (Plugin::load): Don't parse the plugin option.
2050 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
2051 (Plugin::add_option): New.
2052 (Plugin::args_): Change type.
2053 (Plugin::filename_): New.
2054 (Plugin_manager::add_plugin_option): New.
2055 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
2056 * testsuite/Makefile.in: Regenerate.
2057
fd06b4aa
CC
20582008-12-05 Cary Coutant <ccoutant@google.com>
2059
2060 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
2061 Handle --strip-lto-sections option.
2062 * options.h (strip_lto_sections): New option.
2063
6c52134c
CC
20642008-12-01 Cary Coutant <ccoutant@google.com>
2065
2066 * plugin.cc (ld_plugin_message): Change format parameter to const.
2067 Fix mismatch between new[] and delete.
2068
a45248e0
CC
20692008-11-14 Cary Coutant <ccoutant@google.com>
2070
2071 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
2072 instead of -1U.
2073
c82fbeee
CS
20742008-11-05 Craig Silverstein <csilvers@google.com>
2075
2076 * options.cc (General_options::parse_dynamic_list): New function.
2077 * options.h (General_options): New flags dynamic_list,
2078 dynamic_list_data, dynamic_list_cpp_new, and
2079 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
2080 (General_options::in_dynamic_list): New function.
2081 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
2082 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
2083 (Lex::can_continue_name): Likewise.
2084 (yylex): Likewise.
2085 (read_script_file): New parameter script_options.
2086 (read_dynamic_list): New function.
2087 (Script_options::define_dynamic_list): New function.
2088 (dynamic_list_keyword_parsecodes): New variable.
2089 (dynamic_list_keywords): New variable.
2090 * script.h (Script_options::define_dynamic_list): New function
2091 prototype.
2092 (read_dynamic_list): New function prototype.
2093 * symtab.cc (strprefix): New macro.
2094 (Symbol::should_add_dynsym_entry): Support dynamic_list,
2095 dynamic_list_data, dynamic_list_cpp_new, and
2096 dynamic_list_cpp_typeinfo.
2097 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
2098 (dynamic_list_expr): New rule.
2099 (dynamic_list_nodes): Likewise.
2100 (dynamic_list_node): Likewise.
2101 * testsuite/Makefile.am (dynamic_list): New test.
2102 * testsuite/Makefile.in: Regenerated.
2103 * testsuite/dynamic_list.t: New file.
2104 * testsuite/dynamic_list.sh: New file.
2105
e0bb29a5
CS
21062008-11-05 Craig Silverstein <csilvers@google.com>
2107
2108 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
2109 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
2110 (t11_last): Likewise.
2111 * testsuite/ver_test_6.c (main): Likewise.
2112
4e1e25e0
CC
21132008-10-07 Cary Coutant <ccoutant@google.com>
2114
2115 * options.c (General_options::finalize): Add check for -static and
2116 -shared.
2117 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
2118 is not empty.
2119
92f03fcb
CC
21202008-10-02 Cary Coutant <ccoutant@google.com>
2121
2122 * plugin.cc (make_sized_plugin_object): Fix conditional
2123 compilation to work when not all targets are enabled.
2124
fbd8a257
CC
21252008-09-29 Cary Coutant <ccoutant@google.com>
2126
2127 * archive.cc (Archive::get_file_and_offset): Use filename instead
2128 of name to get library path.
2129 (Archive::include_member): Unlock external member of a thin archive.
2130
2131 * testsuite/Makefile.am (TEST_AR): New variable.
2132 (thin_archive_test_1): New test.
2133 (thin_archive_test_2): New test.
81636b3f
CC
2134 * testsuite/Makefile.in: Regenerate.
2135 * testsuite/thin_archive_main.cc: New file.
2136 * testsuite/thin_archive_test_1.cc: New file.
2137 * testsuite/thin_archive_test_2.cc: New file.
2138 * testsuite/thin_archive_test_3.cc: New file.
2139 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 2140
eff45813
CC
21412008-09-29 Cary Coutant <ccoutant@google.com>
2142
2143 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
2144 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
2145 instead of -1U.
2146 (Sized_relobj::do_finalize_local_symbols): Likewise.
2147 (Sized_relobj::map_to_kept_section): Likewise.
2148 * object.h (Sized_relobj::invalid_address): New constant.
2149 (Sized_relobj::do_output_section_offset): Check for invalid_address
2150 and return -1ULL.
2151 * output.cc (Output_reloc::local_section_offset): Use constant
2152 invalid_address instead of -1U.
2153 (Output_reloc::get_address): Likewise.
2154 (Output_section::output_address): Change -1U to -1ULL.
2155 * output.h (Output_reloc::invalid_address): New constant.
2156 * reloc.cc (Sized_relobj::write_sections): Use constant
2157 invalid_address instead of -1U.
2158 (Sized_relobj::relocate_sections): Likewise.
2159 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
2160 values for merge sections.
2161 * target-reloc.h (relocate_for_relocatable): Use constant
2162 invalid_address instead of -1U.
2163
89fc3421
CC
21642008-09-19 Cary Coutant <ccoutant@google.com>
2165
2166 Add plugin functionality for link-time optimization (LTO).
2167 * configure.ac (plugins): Add --enable-plugins option.
2168 * configure: Regenerate.
2169 * config.in: Regenerate.
2170 * Makefile.am (LIBDL): New variable.
2171 (CCFILES): Add plugin.cc.
2172 (HFILES): Add plugin.h.
2173 (ldadd_var): Add LIBDL.
2174 * Makefile.in: Regenerate.
2175
2176 * archive.cc: Include "plugin.h".
2177 (Archive::setup): Don't preread archive symbols when using a plugin.
2178 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
2179 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
2180 files.
2181 (Archive::include_member): Add symbols from plugin objects.
2182 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
2183 * descriptors.cc (Descriptors::open): Check for file descriptors
2184 abandoned by plugins.
2185 (Descriptors::claim_for_plugin): New function.
2186 * descriptors.h (Descriptors::claim_for_plugin): New function.
2187 (Open_descriptor::is_claimed): New field.
2188 (claim_descriptor_for_plugin): New function.
2189 * fileread.cc (File_read::claim_for_plugin): New function.
2190 * fileread.h (File_read::claim_for_plugin): New function.
2191 (File_read::descriptor): New function.
2192 * gold.cc: Include "plugin.h".
2193 (queue_initial_tasks): Add task to call plugin hooks for generating
2194 new object files.
2195 * main.cc: Include "plugin.h".
2196 (main): Load plugin libraries.
2197 * object.h (Pluginobj): Declare.
2198 (Object::pluginobj): New function.
2199 (Object::do_pluginobj): New function.
2200 (Object::set_target): New function.
2201 * options.cc: Include "plugin.h".
2202 (General_options::parse_plugin): New function.
2203 (General_options::General_options): Initialize plugins_ field.
2204 (General_options::add_plugin): New function.
2205 * options.h (Plugin_manager): Declare.
2206 (General_options): Add --plugin option.
2207 (General_options::has_plugins): New function.
2208 (General_options::plugins): New function.
2209 (General_options::add_plugin): New function.
2210 (General_options::plugins_): New field.
2211 * plugin.cc: New file.
2212 * plugin.h: New file.
2213 * readsyms.cc: Include "plugin.h".
2214 (Read_symbols::do_read_symbols): Check for archive before checking
2215 for ELF file. Call plugin hooks to claim files.
2216 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
2217 from a real object file; force override when processing replacement
2218 files.
2219 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
2220 (Symbol::init_base_object): Likewise.
2221 (Symbol::init_base_output_data): Likewise.
2222 (Symbol::init_base_output_segment): Likewise.
2223 (Symbol::init_base_constant): Likewise.
2224 (Symbol::init_base_undefined): Likewise.
2225 (Symbol::output_section): Assert that object is not a plugin.
2226 (Symbol_table::add_from_pluginobj): New function.
2227 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
2228 undefined.
2229 (Symbol_table::sized_write_globals): Likewise.
2230 (Symbol_table::add_from_pluginobj): Instantiate template.
2231 * symtab.h (Sized_pluginobj): Declare.
2232 (Symbol::in_real_elf): New function.
2233 (Symbol::set_in_real_elf): New function.
2234 (Symbol::in_real_elf_): New field.
2235 (Symbol_table::add_from_pluginobj): New function.
2236
2237 * testsuite/Makefile.am (AM_CFLAGS): New variable.
2238 (LIBDL): New variable.
2239 (LDADD): Add LIBDL.
2240 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
2241 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
2242 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
2243 (MOSTLYCLEANFILES): Likewise.
2244 * testsuite/Makefile.in: Regenerate.
2245 * testsuite/plugin_test.c: New file.
2246 * testsuite/plugin_test_1.sh: New file.
2247 * testsuite/plugin_test_2.sh: New file.
2248
de31bda5
ILT
22492008-09-16 Ian Lance Taylor <iant@google.com>
2250
9c2d0ef9
ILT
2251 * target-reloc.h (relocate_section): Check whether a symbol is
2252 defined by the ABI before reporting an undefined symbol error.
2253 * target.h (Target::is_defined_by_abi): Make parameter const.
2254 (Target::do_is_defined_by_abi): Likewise.
2255 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
2256 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
2257 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
2258 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
2259 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
2260 * testsuite/Makefile.in: Rebuild.
2261
de31bda5
ILT
2262 * fileread.cc (make_view): Add casts to avoid warning.
2263
9fa33bee
AO
22642008-09-16 Alexandre Oliva <aoliva@redhat.com>
2265
2266 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
2267 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
2268
183fd0e3
AO
22692008-09-16 Alexandre Oliva <aoliva@redhat.com>
2270
2271 * options.h (General_options::output_is_executable): New.
2272 (General_options::output_is_pie): New.
2273 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
2274 for shared libraries.
2275 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
2276
7be8330a
CD
22772008-09-11 Chris Demetriou <cgd@google.com>
2278
2279 * options.h (origin): New -z option.
2280 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
2281 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
2282 in DT_FLAGS_1.
2283
a9caad02
CC
22842008-09-05 Cary Coutant <ccoutant@google.com>
2285
2286 * fileread.cc (File_read::make_view): Add check for attempt to map
2287 beyond end of file.
2288
ae6dce4d
CC
22892008-09-05 Cary Coutant <ccoutant@google.com>
2290
2291 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
2292 explicit instantiations.
2293
d7ab2a47
KVH
22942008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
2295
2296 PR gold/6858
2297 * options.cc (General_options::finalize): Allow undefined symbols
2298 in shlibs if linking -shared.
2299
2300 PR gold/6859
2301 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
2302 symbols as not needing a dynsym entry.
2303
1e52a9c1
CS
23042008-08-20 Craig Silverstein <csilvers@google.com>
2305
2306 * fileread.cc (File_read::open): Do not lock the file unless it
2307 was successfully opened.
2308
d85c80a3
CC
23092008-08-14 Cary Coutant <ccoutant@google.com>
2310
2311 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
2312 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
2313 * testsuite/tls_test.cc (struct int128): 128-bit struct
2314 for testing TLS relocs with non-zero addend.
2315 (v12): New TLS variable.
2316 (t12): New test.
2317 (t_last): Add check for v12.
2318 * testsuite/tls_test.h (t12): New function.
2319 * testsuite/tls_test_main.cc (thread_routine): Call new test.
2320
2d924fd9
ILT
23212008-08-13 Ian Lance Taylor <iant@google.com>
2322
2323 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
2324 set tls_segment_ or relro_segment_.
2325 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
2326 when appropriate.
2327 * output.h (Output_section::clear_is_relro): New function.
2328 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
2329 sections specially even when output_data_ is empty.
2330 (Output_segment::maximum_alignment): When first section is relro,
2331 only force alignment for PT_LOAD segments.
2332 * script.cc (script_data_segment_align): New function.
2333 (script_data_segment_relro_end): New function.
2334 * script-c.h (script_data_segment_align): Declare.
2335 (script_data_segment_relro_end): Declare.
2336 * script-sections.h (class Script_sections): Declare
2337 data_segment_align and data_segment_relro_end. Add fields
2338 segment_align_index_ and saw_relro_end_.
2339 * script-sections.cc (class Sections_element): Add set_is_relro
2340 virtual function. Add new bool* parameter to place_orphan_here.
2341 Add get_output_section virtual function.
2342 (class Output_section_definition): Add set_is_relro. Add new
2343 bool* parameter to place_orphan_here. Add get_output_section.
2344 Add is_relro_ field.
2345 (Output_section_definition::Output_section_definition): Initialize
2346 evaluated_address_, evaluated_load_address, evaluated_addralign_,
2347 and is_relro_ fields.
2348 (Output_section_definition::place_orphan_here): Add is_relro
2349 parameter.
2350 (Output_section_definition::set_section_addresses): Set relro for
2351 output section.
2352 (Output_section_definition::alternate_constraint): Likewise.
2353 (class Orphan_output_section): Add new bool* parameter to
2354 place_orphan_here. Add get_output_section.
2355 (Orphan_output_section::place_orphan_here): Add is_relro
2356 parameter.
2357 (Script_sections::Script_sections): Initialize
2358 data_segment_align_index_ and saw_relro_end_.
2359 (Script_sections::data_segment_align): New function.
2360 (Script_sections::data_segment_relro_end): New function.
2361 (Script_sections::place_orphan): Set or clear is_relro.
2362 (Script_sections::set_section_addresses): Force alignment of first
2363 TLS section.
2364 * yyscript.y (exp): Call script_data_segment_align and
2365 script_data_segment_relro_end.
2366 * testsuite/relro_script_test.t: New file.
2367 * testsuite/relro_test.cc (using_script): Declare.
2368 (t1, t2): Test using_script.
2369 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
2370 (relro_script_test_SOURCES): Define.
2371 (relro_script_test_DEPENDENCIES): Define.
2372 (relro_script_test_LDFLAGS): Define.
2373 (relro_script_test_LDADD): Define.
2374 (relro_script_test.so): New target.
2375 * testsuite/Makefile.in: Rebuild.
2376
f827c9a9
CC
23772008-08-06 Cary Coutant <ccoutant@google.com>
2378
2379 * archive.cc (Archive::total_archives, Archive::total_members)
2380 (Archive::total_members_loaded): New variables.
2381 (Archive::setup): Add parameter. Add option to preread
2382 archive symbols.
2383 (Archive::read_armap): Add counter.
2384 (Archive::get_file_and_offset): New function.
2385 (Archive::get_elf_object_for_member): New function.
2386 (Archive::read_all_symbols): New function.
2387 (Archive::read_symbols): New function.
2388 (Archive::add_symbols): Add counters.
2389 (Archive::include_all_members): Use armap to find members if it's
2390 already built.
2391 (Archive::include_member): Skip reading symbols if already read.
2392 Factored code into Archive::get_file_and_offset and
2393 Archive::get_elf_object_for_member. Changed call to
2394 Mapfile::report_include_archive_member.
2395 (Archive::print_stats): New function.
2396 * archive.h: Declare Object and Read_symbols_data classes.
2397 (Archive::Archive): Add initializers for new members.
2398 (Archive::setup): Add parameter.
2399 (Archive::print_stats): New function.
2400 (Archive::total_archives, Archive::total_members)
2401 (Archive::total_members_loaded): New variables.
2402 (Archive::get_file_and_offset): New function.
2403 (Archive::get_elf_object_for_member): New function.
2404 (Archive::read_all_symbols): New function.
2405 (Archive::read_symbols): New function.
2406 (Archive::Archive_member): New class.
2407 (Archive::members_): New member.
2408 (Archive::num_members_): New member.
2409 * main.cc: Include archive.h.
2410 (main): Call Archive::print_stats.
2411 * mapfile.cc (Mapfile::report_include_archive_member): Delete
2412 archive parameter; member_name is now the fully-decorated name.
2413 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
2414 * options.h: (General_options): Add --preread-archive-symbols option.
2415 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
2416 Archive::setup.
2417
de4c45bd
ILT
24182008-08-04 Ian Lance Taylor <iant@google.com>
2419
2420 * symtab.h (Symbol::use_plt_offset): New function.
2421 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
2422 * powerpc.cc (Relocate::relocate): Likewise.
2423 * sparc.cc (Relocate::relocate): Likewise.
2424 * x86_64.cc (Relocate::relocate): Likewise.
2425 * testsuite/weak_plt.sh: New test.
2426 * testsuite/weak_plt_main.cc: New test.
2427 * testsuite/weak_plt_shared.cc: New test.
2428 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
2429 (check_PROGRAMS): Add weak_plt.
2430 (check_DATA): Add weak_plt_shared.so.
2431 (weak_plt_main_pic.o, weak_plt): New targets.
2432 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
2433 * testsuite/Makefile.in: Rebuild.
2434
2435 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
2436 gcctestdir/ld.
2437 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
2438 * testsuite/Makefile.in: Rebuild.
2439
323ee3f4
AM
24402008-08-04 Alan Modra <amodra@bigpond.net.au>
2441
2442 * Makefile.am (POTFILES.in): Set LC_ALL=C.
2443 * Makefile.in: Regenerate.
2444 * po/POTFILES.in: Regenerate.
2445
7c07ecec
ILT
24462008-07-29 Ian Lance Taylor <iant@google.com>
2447
2448 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
2449 symbols before other symbols.
2450 * testsuite/script_test_2.cc (test_addr): Declare.
2451 (test_addr_alias): Declare.
2452 (main): Check that test_addr and test_addr_alias have the right
cd536b21 2453 values.
7c07ecec
ILT
2454 * testsuite/script_test_2.t: Define test_addr_alias and
2455 test_addr.
2456
5778530e
ILT
24572008-07-24 Ian Lance Taylor <iant@google.com>
2458
2a00e4fb
ILT
2459 PR 5990
2460 * descriptors.cc: New file.
2461 * descriptors.h: New file.
2462 * gold-threads.h (class Hold_optional_lock): New class.
2463 * fileread.cc: Include "descriptors.h".
2464 (File_read::~File_read): Release descriptor rather than closing
2465 it.
2466 (File_read::open) [file]: Call open_descriptor rather than open.
2467 Set is_descriptor_opened_.
2468 (File_read::open) [memory]: Assert that descriptor is not open.
2469 (File_read::reopen_descriptor): New function.
2470 (File_read::release): Release descriptor.
2471 (File_read::do_read): Make non-const. Reopen descriptor.
2472 (File_read::read): Make non-const.
2473 (File_read::make_view): Reopen descriptor.
2474 (File_read::do_readv): Likewise.
2475 * fileread.h (class File_read): Add is_descriptor_opened_ field.
2476 Update declarations.
2477 * layout.cc: Include "descriptors.h".
2478 (Layout::create_build_id): Use open_descriptor rather than open.
2479 * output.cc: Include "descriptors.h".
2480 (Output_file::open): Use open_descriptor rather than open.
2481 * archive.cc (Archive::const_iterator): Change Archive to be
2482 non-const.
2483 (Archive::begin, Archive::end): Make non-const.
2484 (Archive::count_members): Likewise.
2485 * archive.h (class Archive): Update declarations.
2486 * object.h (Object::read): Make non-const.
2487 * Makefile.am (CCFILES): Add descriptors.cc.
2488 (HFILES): Add descriptors.h.
2489 * Makefile.in: Rebuild.
2490
801647d1
ILT
2491 PR 6716
2492 * gold.h: Always include <clocale>. Add Solaris workarounds
2493 following code in binutils/sysdep.h.
2494
5edd166e
ILT
2495 PR 6048
2496 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
2497 this->eh_frame_hdr_ is NULL before using it.
2498
c89ad728
ILT
2499 * dynobj.cc (Versions::Versions): Update comment.
2500
aa86f06b
ILT
2501 * dynobj.cc (Versions::Versions): If there is an soname, use it as
2502 the base version name.
2503
5778530e
ILT
2504 * stringpool.cc (Stringpool_template::add_with_length): Set key to
2505 array size plus one.
2506 (Stringpool_template::set_string_offsets): Subtract one from key
2507 before using it as an array index.
2508 (Stringpool_template::get_offset_with_length): Likewise.
2509 (Stringpool_template::write_to_buffer): Likewise.
2510 * stringpool.h (Stringpool_template::get_offset_from_key):
2511 Likewise.
2512
057ead22
ILT
25132008-07-23 Ian Lance Taylor <iant@google.com>
2514
7f649c59
ILT
2515 PR 6658
2516 * object.h (Merged_symbol_value::value): Do our best to handle a
2517 negative addend.
2518
057ead22
ILT
2519 PR 6647
2520 * script.cc (Version_script_info::get_versions): Don't add empty
2521 version tag to return value.
2522 (Version_script_info::get_symbol_version_helper): Change return
2523 type to bool. Add pversion parameter. Change all callers.
2524 (script_register_vers_node): Don't require a non-NULL tag.
2525 * script.h (class Version_script_info): Update declarations.
2526 (Version_script_info::get_symbol_version): Change return type to
2527 bool. Add version parameter. Change all callers.
2528 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
2529 handling. Handle an empty version from a version script.
2530 (Symbol_table::define_special_symbol): Likewise.
2531 * testsuite/ver_test_10.script: New file.
2532 * testsuite/ver_test_10.sh: New file.
2533 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
2534 (check_DATA): Add ver_test_10.syms.
2535 (ver_test_10.syms, ver_test_10.so): New target.
2536 * testsuite/Makefile.in: Rebuild.
2537
58e54ac2
CD
25382008-07-23 Simon Baldwin <simonb@google.com>
2539
2540 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
2541 to zero for undefined symbols from dynamic libraries.
2542
95d14cd3
ILT
25432008-07-23 Ian Lance Taylor <iant@google.com>
2544
2545 * symtab.cc (Symbol_table::resolve): Remove version parameter.
2546 Change all callers.
2547 * symtab.h (class Symbol_table): Update declaration.
2548 * testsuite/ver_test_9.cc: New file.
2549 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
2550 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
2551 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
2552 (ver_test_9.so, ver_test_9.o): New targets.
2553 * testsuite/Makefile.in: Rebuild.
2554
92de84a6
ILT
25552008-07-22 Ian Lance Taylor <iant@google.com>
2556
34810851
ILT
2557 * options.h (class General_options): Define --check-sections.
2558 * layout.cc (Layout::set_segment_offsets): Handle
2559 --check-sections.
2560
af6156ef
ILT
2561 * options.h (class General_options): Define -n/--nmagic and
2562 -N/--omagic.
2563 * options.cc (General_options::finalize): For -n/--nmagic or
2564 -N/--omagic, set -static.
2565 * layout.cc (Layout::attach_allocated_section_to_segment): If
2566 -N/--omagic, don't put read-only and read-write sections in
2567 different segments.
2568 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
2569 finding a read-only segment.
2570 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
2571 don't set the minimum segment alignment to the common page size,
2572 and don't set the file offset to the address modulo the page size.
2573 * script-sections.cc (Script_sections::create_segments): If
2574 -n/--omagic, don't put read-only and read-write sections in
2575 different segments.
2576
92de84a6
ILT
2577 * cref.cc: New file.
2578 * cref.h: New file.
2579 * options.h (class General_options): Add --print-symbol-counts.
2580 * main.cc (main): Issue defined symbol report if requested.
2581 * archive.cc (Archive::interpret_header): Make into a const member
2582 function.
2583 (Archive::add_symbols): Call Input_objects::archive_start and
2584 archive_stop.
2585 (Archive::const_iterator): Define new class.
2586 (Archive::begin, Archive::end): New functions.
2587 (Archive::include_all_members): Rewrite to use iterator.
2588 (Archive::count_members): New function.
2589 * archive.h (class Archive): Update declarations.
2590 (Archive::filename): New function.
2591 * object.cc: Include "cref.h".
2592 (Sized_relobj::Sized_relobj): Initialize defined_count_.
2593 (Sized_relobj::do_get_global_symbol_counts): New function.
2594 (Input_objects::add_object): Add object to cross-referencer.
2595 (Input_objects::archive_start): New function.
2596 (Input_objects::archive_stop): New function.
2597 (Input_objects::print_symbol_counts): New function.
2598 * object.h: Declare Cref and Archive.
2599 (Object::get_global_symbol_counts): New function.
2600 (Object::do_get_global_symbol_counts): New pure virtual function.
2601 (class Sized_relobj): Add defined_count_ field. Update
2602 declarations.
2603 (class Input_objects): Add cref_ field. Update constructor.
2604 Update declarations.
2605 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
2606 defined_count_.
2607 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
2608 symbol counts.
2609 (Sized_dynobj::do_get_global_symbol_counts): New function.
2610 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
2611 defined_count_. Update declarations. Define Symbols typedef.
2612 * symtab.cc (Symbol_table::add_from_relobj): Add defined
2613 parameter. Change all callers.
2614 (Symbol_table::add_from_dynobj): Add sympointers and defined
2615 parameters. Change all callers.
2616 * symtab.h (class Symbol_table): Update declarations.
2617 * Makefile.am (CCFILES): Add cref.cc.
2618 (HFILES): Add cref.h.
2619 * Makefile.in: Rebuild.
2620
3f7c5e1d
CD
26212008-07-22 Simon Baldwin <simonb@google.com>
2622
2623 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
2624 to zero when writing undefined symbols.
2625
e0b64032
ILT
26262008-07-22 Ian Lance Taylor <iant@google.com>
2627
2628 * output.cc (Output_section::add_input_section): Don't try to
2629 merge empty merge sections.
2630
096b02cf
CS
26312008-07-21 Craig Silverstein <csilvers@google.com>
2632
2633 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
2634 Include symbol version in error message.
cd536b21 2635
1d1f116d
CD
26362008-07-20 Chris Demetriou <cgd@google.com>
2637
cd536b21 2638 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
2639 (RANDOM_SEED_CFLAGS): New substituted variable.
2640 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
2641 * configure: Rebuild.
2642 * Makefile.in: Likewise.
2643 * testsuite/Makefile.in: Likewise.
2644
a18f591e
ILT
26452008-07-18 Ian Lance Taylor <iant@google.com>
2646
2647 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
2648 where we see NAME/NULL and NAME/VERSION as separate symbols.
2649 * testsuite/ver_test_main.cc (main): Call t4.
2650 (t4, t4_2a): Define.
2651 * testsuite/ver_test_2.cc (t4_2): Define.
2652 * testsuite/ver_test_2.script: Put t4_2a in VER2.
2653 * testsuite/ver_test_4.cc (t4_2a): Define.
2654 * testsuite/ver_test_4.script: Put t4_2a in VER2.
2655 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
2656
c6e3f6ed
ILT
26572008-07-17 Ian Lance Taylor <iant@google.com>
2658
2659 * dynobj.cc (Versions::add_def): If we give an error about a
2660 missing version, go ahead and create the version anyhow.
2661
ef9beddf
ILT
26622008-07-10 Ian Lance Taylor <iant@google.com>
2663
2664 Handle output sections with more than 0x7fffffff bytes.
2665 * object.h (class Relobj): Change map_to_output_ to
2666 output_sections_, and just keep a section pointer. Change all
2667 uses. Move comdat group support to Sized_relobj.
2668 (Relobj::is_section_specially_mapped): Remove.
2669 (Relobj::output_section): Remove poff parameter. Change all
2670 callers.
2671 (Relobj::output_section_offset): New function.
2672 (Relobj::set_section_offset): Rewrite.
2673 (Relobj::map_to_output): Remove.
2674 (Relobj::output_sections): New function.
2675 (Relobj::do_output_section_offset): New pure virtual function.
2676 (Relobj::do_set_section_offset): Likewise.
2677 (class Sized_relobj): Add section_offsets_ field. Add comdat
2678 group support from Relobj. Update declarations.
2679 (Sized_relobj::get_output_section_offset): New function.
2680 (Sized_relobj::do_output_section_offset): New function.
2681 (Sized_relobj::do_set_section_offset): New function.
2682 * object.cc (Relobj::output_section_address): Remove.
2683 (Sized_relobj::Sized_relobj): Initialize new fields.
2684 (Sized_relobj::include_section_group): Cast find_kept_object to
2685 Sized_relobj.
2686 (Sized_relobj::include_linkonce_section): Likewise.
2687 (Sized_relobj::do_layout): Use separate arrays for output section
2688 and output offset.
2689 (Sized_relobj::do_count_local_symbols): Change map_to_output to
2690 output_sections.
2691 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
2692 output_sections and section_offsets.
2693 (Sized_relobj::write_local_symbols): Likewise.
2694 (map_to_kept_section): Compute output address directly.
2695 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
2696 output_sections and section_offsets.
2697 (Sized_relobj::write_sections): Likewise.
2698 (Sized_relobj::relocate_sections): Likewise.
2699 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
2700 * output.h (class Output_reloc): Update declarations. Change
2701 u2_.relobj to Sized_relobj*.
2702 (class Output_data_reloc): Change add functions to use
2703 Sized_relobj*.
2704 * output.cc (Output_reloc::Output_reloc): Change relobj to
2705 Sized_relobj*.
2706 (Output_reloc::local_section_offset): Change return type to
2707 Elf_Addr. Use get_output_section_offset.
2708 (Output_reloc::get_address): Likewise.
2709 (Output_section::is_input_address_mapped): Don't call
2710 is_section_specially_mapped.
2711 (Output_section::output_offset): Likewise.
2712 (Output_section::output_address): Likewise.
2713 (Output_section::starting_output_address): Likewise.
2714 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
2715 parameter to Sized_relobj*.
2716 (Copy_relocs::need_copy_reloc): Likewise.
2717 (Copy_relocs::save): Likewise.
2718 * copy-relocs.h (class Copy_relocs): Update declarations.
2719 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
2720 Sized_relobj*. Change relobj_ field to Sized_relobj*.
2721 * target-reloc.h (relocate_for_relocatable): Change
2722 offset_in_output_section type to Elf_Addr. Change code that uses
2723 it as well.
2724 * layout.cc (Layout::layout): Always set *off.
2725 * mapfile.cc (Mapfile::print_input_section): Use
2726 output_section_offset.
2727 * i386.cc (Target_i386::copy_reloc): Change object parameter to
2728 Sized_relobj*.
2729 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
2730 * sparc.cc (Target_sparc::copy_reloc): Likewise.
2731 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
2732
5cb66f97
ILT
27332008-07-03 Ian Lance Taylor <iant@google.com>
2734
2735 * layout.cc (Layout::include_section): Do not discard unrecognized
2736 SHT_STRTAB sections.
2737
afe47622
CS
27382008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
2739
2740 * script.cc (Lex::can_continue_name): Make '?' allowable in
2741 version-script names.
2742 * testsuite/version_script.map: Change glob pattern to use '?'
2743
5adf9721
ILT
27442008-06-30 Manish Singh <yosh@gimp.org>
2745
2746 PR 6585
2747 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
2748 Correct typo.
2749
e6fde208
ILT
27502008-06-30 Ian Lance Taylor <iant@google.com>
2751
2752 PR 6660
2753 PR 6682
2754 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
2755 versions]: Don't try to read the value in the contents, since we
2756 don't use it. Use the template endianness when writing.
2757
3f2e6a2d
CC
27582008-06-25 Cary Coutant <ccoutant@google.com>
2759
2760 * fileread.cc (File_read::make_view): Assert on zero-length view.
2761 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
2762 symbol table when there are no symbols to read.
2763
c43d3a48
CS
27642008-06-23 Craig Silverstein <csilvers@google.com>
2765
2766 * version.cc (version_string): Bump to 1.7
2767
5f494ea0
CS
27682008-06-18 Craig Silverstein <csilvers@google.com>
2769
2770 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
2771 constant 0xFFFF to type Valtype.
2772 (Powerpc_relocate_functions::rel16_ha): Likewise.
2773
c42e122e
ILT
27742008-06-17 Ian Lance Taylor <iant@google.com>
2775
f34787f8
ILT
2776 * output.h (Output_section::Input_section): Initialize p2align_ to
2777 zero for Output_section_data constructors.
2778 (Output_section::Input_section::addralign): If not an input
2779 section, return the alignment of the Output_section_data.
2780 * testsuite/copy_test.cc: New file.
2781 * testsuite/copy_test_1.cc: New file.
2782 * testsuite/copy_test_2.cc: New file.
2783 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
2784 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
2785 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
2786 (copy_test_1_pic.o, copy_test_1.so): New targets.
2787 (copy_test_2_pic.o, copy_test_2.so): New targets.
2788 * testsuite/Makefile.in: Rebuild.
2789
c42e122e
ILT
2790 * script-sections.cc (Script_sections::place_orphan): Initialize
2791 local variable exact.
2792
ce3ac18a
DE
27932008-06-13 David Edelsohn <edelsohn@gnu.org>
2794
2795 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
2796
42cacb20
DE
27972008-06-12 David Edelsohn <edelsohn@gnu.org>
2798 David S. Miller <davem@davemloft.net>
2799
2800 * powerpc.cc: New file.
2801 * Makefile.am (TARGETSOURCES): Add powerpc.cc
2802 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
2803 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
2804 * Makefile.in: Rebuild.
2805
7b308235
ILT
28062008-06-09 Ian Lance Taylor <iant@google.com>
2807
2808 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
2809 <exception>.
2810 (throwing, orig_terminate): New static variables.
2811 (terminate_handler): New static function.
2812 (t2): Set terminate handler.
2813
f0b886e3
ILT
28142008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
2815
2816 PR 6584
cd536b21 2817 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
2818 alignment.
2819
3e90f135
CC
28202008-05-30 Cary Coutant <ccoutant@google.com>
2821
2822 * archive.cc (Archive::include_all_members) Correct to step
2823 over symbol table and extended name table in thin archives.
2824
e09ad04a
ILT
28252008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
2826
2827 PR 6407
2828 * target-reloc.h (relocate_for_relocatable): Fix new_offset
2829 calculation.
2830
62b01cb5
ILT
28312008-05-28 Caleb Howe <cshowe@google.com>
2832
2833 * reduced_debug_output.cc: New file.
2834 * reduced_debug_output.h: New file.
92de84a6 2835 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
2836 * options.cc (General_options::finalize): Add strip_debug_non_line
2837 to the strip heirarchy.
2838 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
2839 fields.
2840 * layout.cc: Include "reduced_debug_output.h".
2841 (Layout::Layout): Initialize new fields.
2842 (line_only_debug_sections): New static array.
2843 (is_lines_only_debug_sections): New static inline function.
2844 (Layout::include_section): Handle --strip-debug-non-line.
2845 (Layout::make_output_section): If --strip-debug-non-line, build
2846 new output sections for .debug_abbrev and .debug_info.
2847 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
2848 gold. Warn about possible overflow.
2849 (read_signed_LEB_128): Likewise.
2850 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
2851 (read_signed_LEB_128): Declare.
2852 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
2853 (HFILES): Add reduced_debug_output.h.
2854 * Makefile.in: Rebuild.
2855
7d9e3d98
ILT
28562008-05-21 Ian Lance Taylor <iant@google.com>
2857
2858 * mapfile.cc: New file.
2859 * mapfile.h: New file.
2860 * options.h (class General_options): Add -M/--print-map and -Map.
2861 * options.cc (General_options::finalize): Make -M equivalent to
2862 -Map -.
2863 * main.cc: Include <cstdio> and "mapfile.h".
2864 (main): Open mapfile if requested.
2865 * gold.cc (class Middle_runner): Add mapfile_ field. Update
2866 constructor. Change caller.
2867 (queue_initial_tasks): Add mapfile parameter. Change caller.
2868 (queue_middle_tasks): Likewise.
2869 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
2870 declarations.
2871 * archive.cc: Include "mapfile.h".
2872 (Archive::add_symbols): Add mapfile parameter. Change all
2873 callers. Pass mapfile, symbol, and reason to include_member.
2874 (Archive::include_all_members): Add mapfile parameter. Change all
2875 callers.
2876 (Archive::include_member): Add mapfile, sym, and why parameters.
2877 Change all callers. Report inclusion to map file.
2878 * archive.h: Include "fileread.h".
2879 (class Archive): Update declarations.
2880 (Archive::file): New const method.
2881 (class Add_archive_symbols): Add mapfile_ field. Update
2882 constructor. Change all callers.
2883 * readsyms.h (class Read_symbols): Likewise.
2884 (class Finish_group): Likewise.
2885 (class Read_script): Likewise.
2886 * common.cc: Include "mapfile.h".
2887 (Symbol_table::allocate_commons): Add mapfile parameter. Change
2888 all callers.
2889 (Symbol_table::do_allocate_commons): Likewise.
2890 (Symbol_table::do_allocate_commons_list): Likewise. Report common
2891 symbol allocation to mapfile.
2892 * common.h (class Allocate_commons_task): Add mapfile_ field.
2893 Update constructor. Change all callers.
2894 * symtab.h (class Symbol_table): Update declarations.
2895 * layout.cc: Include "mapfile.h".
2896 (Layout_task_runner::run): Print information to mapfile.
2897 (Layout::create_gold_note): Change Output_data_fixed_space to
2898 Output_data_zero_fill.
2899 (Layout::create_build_id): Likewise.
2900 (Layout::print_to_mapfile): New function.
2901 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
2902 constructor. Change caller.
2903 (class Layout): Declare print_to_mapfile.
2904 * output.cc (Output_section::Input_section::print_to_mapfile): New
2905 function.
2906 (Output_section::add_input_section): If producing a map, always
2907 add to input_sections_ list.
2908 (Output_section::do_print_to_mapfile): New function.
2909 (Output_segment::print_sections_to_mapfile): New function.
2910 (Output_segment::print_section_list_to_mapfile): New function.
2911 * output.h: Include "mapfile.h".
2912 (Output_data::print_to_mapfile): New function.
2913 (Output_data::do_print_to_mapfile): New virtual function.
2914 (Output_segment_headers::do_print_to_mapfile): New function.
2915 (Output_file_header::do_print_to_mapfile): New function.
2916 (Output_data_const::do_print_to_mapfile): New function.
2917 (class Output_data_const_buffer): Add map_name_ field. Update
2918 constructor. Change all callers. Add do_print_to_mapfile
2919 function.
2920 (class Output_data_fixed_space): Likewise.
2921 (class Output_data_space): Likewise.
2922 (class Output_data_zero_fill): New class.
2923 (Output_data_strtab::do_print_to_mapfile): New function.
2924 (Output_data_reloc_base::do_print_to_mapfile): New function.
2925 (Output_relocatable_relocs::do_print_to_mapfile): New function.
2926 (Output_data_group::do_print_to_mapfile): New function.
2927 (Output_data_got::do_print_to_mapfile): New function.
2928 (Output_data_dynamic::do_print_to_mapfile): New function.
2929 (Output_symtab_xindex::do_print_to_mapfile): New function.
2930 (class Output_section): Declare do_print_to_mapflie. Declare
2931 print_to_mapfile in Input_section.
2932 (class Output_segment): Declare new functions.
2933 * object.h (Sized_relobj::symbol_count): New function.
2934 * script-sections.cc
2935 (Output_section_element_dot_assignment::set_section_addresses):
2936 Change Output_data_fixed_space to Output_data_zero_fill.
2937 (Output_data_expression::do_print_to_mapfile): New function.
2938 * script.cc (read_input_script): Add mapfile parameter. Change
2939 all callers.
2940 * script.h (read_input_script): Update declaration.
2941 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
2942 (Eh_frame::do_print_to_mapfile): New function.
2943 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
2944 (Output_merge_string::do_print_to_mapfile): New function.
2945 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
2946 function.
2947 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
2948 function.
2949 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
2950 function.
2951 * Makefile.am (CCFILES): Add mapfile.cc.
2952 (HFILES): Add mapfile.h.
2953 * Makefile.in: Rebuild.
2954
9f1d377b
ILT
29552008-05-19 Ian Lance Taylor <iant@google.com>
2956
2957 * options.h (class General_options): Add -z relro.
2958 * layout.cc (Layout::Layout): Initialize relro_segment_.
2959 (Layout::add_output_section_data): Return the output section.
2960 (Layout::make_output_section): Rcognize relro sections and mark
2961 them appropriately.
2962 (Layout::attach_allocated_section_to_segment): Put relro sections
2963 in a PT_GNU_RELRO segment.
2964 (Layout::create_initial_dynamic_sections): Mark the .dynamic
2965 section as relro.
2966 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
2967 PT_TLS segments.
2968 (Layout::linkonce_mapping): Map d.rel.ro.local to
2969 .data.rel.ro.local.
2970 (Layout::output_section_name): Us .data.rel.ro.local for any
2971 section which begins with that.
2972 * layout.h (class Layout): Update add_output_section_data
2973 declaration. Add relro_segment_ field.
2974 * output.cc (Output_section::Output_section): Initialize is_relro_
2975 and is_relro_local_ fields.
2976 (Output_segment::add_output_section): Group relro sections.
2977 (Output_segment::is_first_section_relro): New function.
2978 (Output_segment::maximum_alignment): If there is a relro section,
2979 align the segment to the common page size.
2980 (Output_segment::set_section_addresses): Track whether we are
2981 looking at relro sections. If the last section is a relro
2982 section, align to the common page size.
2983 (Output_segment::set_section_list_addresses): Add in_relro
2984 parameter. Change all callers. Align to the page size when
2985 moving from relro to non-relro section.
2986 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
2987 segment.
2988 * output.h (class Output_section): Add is_relro_ and
2989 is_relro_local_ fields.
2990 (Output_section::is_relro): New function.
2991 (Output_section::set_is_relro): New function.
2992 (Output_section::is_relro_local): New function.
2993 (Output_section::set_is_relro_local): New function.
2994 (class Output_segment): Update declarations.
2995 * i386.cc (Target_i386::got_section): Mark .got section as relro.
2996 * sparc.cc (Target_sparc::got_section): Likewise.
2997 * x86_64.cc (Target_x86_64::got_section): Likewise.
2998 * testsuite/relro_test_main.cc: New file.
2999 * testsuite/relro_test.cc: New file.
3000 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
3001 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
3002 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
3003 (relro_test.so, relro_test_pic.o): New targets.
3004 * testsuite/Makefile.in: Rebuild.
3005
a984ee1d
ILT
30062008-05-16 Ian Lance Taylor <iant@google.com>
3007
01676dcd
ILT
3008 * output.cc (Output_segment::add_output_section): Remove front
3009 parameter.
3010 * output.h (class Output_segment): Remove
3011 add_initial_output_section and overloaded add_output_section.
3012 Update declaration of remaining add_output_section.
3013 * layout.cc (Layout::create_interp): Call add_output_section
3014 rather than add_initial_output_section.
3015 (Layout::finish_dynamic_section): Likewise.
3016
497897f9
ILT
3017 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
3018 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
3019 know the dynamic type.
3020 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
3021 field. Initialize it in constructor.
3022 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
3023 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
3024 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
3025 reloc.
3026
a984ee1d
ILT
3027 * output.cc (Output_reloc::get_address): Change return type to
3028 Elf_Addr.
3029 * output.h (class Output_reloc): Update get_address declaration.
3030 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
3031 for section addresses.
3032
55ba0940
ILT
30332008-05-09 Ian Lance Taylor <iant@google.com>
3034
3035 PR 6493
3036 * gold.cc (gold_nomem): Use return value of write.
3037
75517b77
ILT
30382008-05-08 Ian Lance Taylor <iant@google.com>
3039
3040 * symtab.c (Symbol::init_base_output_data): Add version
3041 parameter. Change all callers.
3042 (Symbol::init_base_output_segment): Likewise.
3043 (Symbol::init_base_constant): Likewise.
3044 (Symbol::init_base_undefined): Likewise.
3045 (Sized_symbol::init_output_data): Likewise.
3046 (Sized_symbol::init_output_segment): Likewise.
3047 (Sized_symbol::init_constant): Likewise.
3048 (Sized_symbol::init_undefined): Likewise.
3049 (Symbol_table::do_define_in_output_data): If the new symbol has a
3050 version, mark it as the default.
3051 (Symbol_table::do_define_in_output_segment): Likewise.
3052 (Symbol_table::do_define_as_constant): Likewise.
3053 * symtab.h (class Symbol): Update declarations.
3054 (class Sized_symbol): Likewise.
3055 * resolve.cc (Symbol::override_version): New function.
c42e122e 3056 (Symbol::override_base): Call override_version.
75517b77
ILT
3057 (Symbol::override_base_with_special): Likewise.
3058 * testsuite/ver_script_8.script: New file.
3059 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
3060 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
3061 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
3062 (ver_test_8_1.so, ver_test_8_2.so): New targets.
3063
f1f70eae
ILT
30642008-05-06 Ian Lance Taylor <iant@google.com>
3065
f3e9c5c5
ILT
3066 PR 6049
3067 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
3068 functions.
3069 (class General_options): Remove existing --undefined, and add
3070 --no-undefined instead. Add new --undefined as synonym for -u.
3071 * archive.cc (Archive::add_symbols): Check whether symbol was
3072 named with -u.
3073 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
3074 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
3075 all uses. Add IS_UNDEFINED. Update declarations to split
3076 different versions of init_base. Declare init_base_undefined.
3077 (Symbol::is_defined): Handle IS_UNDEFINED.
3078 (Symbol::is_undefined): Likewise.
3079 (Symbol::is_weak_undefined): Call is_undefined.
3080 (Symbol::is_absolute): Handle IS_CONSTANT.
3081 (class Sized_symbol): Update declarations to split different
3082 versions of init. Declare init_undefined.
3083 (class Symbol_table): Declare new functions.
3084 * symtab.cc (Symbol::init_base_object): Rename from init_base.
3085 Change all callers.
3086 (Symbol::init_base_output_data): Likewise.
3087 (Symbol::init_base_output_segment): Likewise.
3088 (Symbol::init_base_constant): Likewise.
3089 (Symbol::init_base_undefined): New function.
3090 (Sized_symbol::init_object): Rename from init. Change all
3091 callers.
3092 (Sized_symbol::init_output_data): Likewise.
3093 (Sized_symbol::init_output_segment): Likewise.
3094 (Sized_symbol::init_constant): Likewise.
3095 (Sized_symbol::init_undefined): New function.
3096 (Symbol_table::add_undefined_symbols_from_command_line): New
3097 function.
3098 (Symbol_table::do_add_undefined_symbols_from_command_line): New
3099 function.
3100 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
3101 (Symbol::output_section): Likewise.
3102 (Symbol::set_output_section): Likewise.
3103 (Symbol_table::sized_finalize_symbol): Likewise.
3104 (Symbol_table::sized_write_globals): Likewise.
3105 * resolve.cc (Symbol_table::should_override): Likewise.
3106 (Symbol::override_base_with_special): Likewise.
3107
8bdcdf2c
ILT
3108 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
3109 symbol, change it to have default visibility.
3110 * testsuite/protected_1.cc: New file.
3111 * testsuite/protected_2.cc: New file.
3112 * testsuite/protected_3.cc: New file.
3113 * testsuite/protected_main_1.cc: New file.
3114 * testsuite/protected_main_2.cc: New file.
3115 * testsuite/protected_main_3.cc: New file.
3116 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
3117 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
3118 (protected_1_LDFLAGS, protected_1_LDADD): Define.
3119 (protected_1.so): New target.
3120 (protected_1_pic.o, protected_2_pic.o): New targets.
3121 (protected_3_pic.o): New target.
3122 (check_PROGRAMS): Add protected_2.
3123 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
3124 (protected_2_LDFLAGS, protected_2_LDADD): Define.
3125 * testsuite/Makefile.in: Rebuild.
3126
2b706932
ILT
3127 * options.h (DEFINE_var): Add set_user_set_##varname__.
3128 (DEFINE_bool_alias): New macro.
3129 (class General_options): Define -Bstatic using DEFINE_bool_alias
3130 rather than DEFINE_special. Add --undefined as an alias for -z
3131 defs.
3132 * options.cc (General_options::parse_Bstatic): Remove.
3133
d82a5bcc
ILT
3134 * options.h (class General_options): Add --fatal-warnings.
3135 * main.cc (main): Implement --fatal-warnings.
3136 * errors.h (Errors::warning_count): New function.
3137
f1f70eae
ILT
3138 * options.h (class General_options): Add -Bsymbolic-functions.
3139 * symtab.h (Symbol::is_preemptible): Check for
3140 -Bsymbolic-functions.
3141
8825ac63
ILT
31422008-05-05 Ian Lance Taylor <iant@google.com>
3143
d98bc257
ILT
3144 * options.h (DEFINE_bool): For DASH_Z, create the negative option
3145 as noVARNAME rather than no-VARNAME.
3146 (class General_options): Add option -z combreloc.
3147 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
3148 get_address.
3149 (Output_reloc::sort_before) [SHT_REL]: New function.
3150 (Output_reloc::sort_before) [SHT_RELA]: New function.
3151 (class Output_data_reloc_base): Add sort_relocs_ field. Define
3152 Sort_relocs_comparison.
3153 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
3154 parameter. Change all callers.
3155 (Output_data_reloc::Output_data_reloc) [both versions]: Add
3156 sort_relocs parameter. Change all callers.
3157 * output.cc (Output_reloc::get_address): New function, broken out
3158 of write_rel.
3159 (Output_reloc::write_rel): Call it.
3160 (Output_reloc::compare): New function.
3161 (Output_data_reloc_base::do_write): Optionally sort relocs.
3162
60b2b4e7
ILT
3163 * configure.ac: If targ_extra_obj is set, link it in.
3164 * configure.tgt: Initialize all variables.
3165 (x86_64*): Set targ_extra_obj and targ_extra_size.
3166 * configure: Rebuild.
3167
8825ac63
ILT
3168 * object.cc (Sized_relobj::include_section_group): Adjust section
3169 indexes read from group data. Build vector to pass to
3170 layout_group.
3171 * layout.cc (Layout::layout_group): Add flags and shndxes
3172 parameters. Remove contents parameter. Change caller. Update
3173 explicit instantiations.
3174 * layout.h (class Layout): Update layout_group declaration.
3175 * output.cc (Output_data_group::Output_data_group): Add flags and
3176 input_shndxes parameters. Remove contents parameter. Change
3177 caller.
3178 (Output_data_group::do_write): Change input_sections_ to
3179 input_shndxes_.
3180 * output.h (class Output_data_group): Update constructor
3181 declaration. Rename input_sections_ to input_shndxes_.
3182 * testsuite/many_sections_test.cc: Add template.
3183
e94cf127
CC
31842008-04-30 Cary Coutant <ccoutant@google.com>
3185
4418b2d5
CC
3186 * target-reloc.h (relocate_section): Fix dead-pointer bug.
3187
e94cf127
CC
3188 * layout.cc (Layout::include_section): Refactored check for debug
3189 info section.
3190 (Layout::add_comdat): Add new parameters. Change type
3191 of signature parameter. Add object and shndx to signatures table.
3192 (Layout::find_kept_object): New function.
3193 * layout.h: Include <cstring>.
3194 (Layout::is_debug_info_section): New function.
3195 (Layout::add_comdat): Add new parameters.
3196 (Layout::find_kept_object): New function.
3197 (Layout::Kept_section): New struct.
3198 (Layout::Signatures): Change type of map range.
3199 * object.cc (Relobj::output_section_address): New function.
3200 (Sized_relobj::include_section_group): Add new parameters. Change
3201 calls to Layout::add_comdat. Change to build table of kept comdat
3202 groups and table mapping discarded sections to kept sections.
3203 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
3204 (Sized_relobj::do_layout): Change calls to include_section_group and
3205 include_linkonce_section.
3206 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
3207 value to zero when section is discarded.
3208 (Sized_relobj::map_to_kept_section): New function.
3209 * object.h (Relobj::output_section_address): New function.
3210 (Relobj::Comdat_group): New type.
3211 (Relobj::find_comdat_group): New function.
3212 (Relobj::Comdat_group_table): New type.
3213 (Relobj::Kept_comdat_section): New type.
3214 (Relobj::Kept_comdat_section_table): New type.
3215 (Relobj::add_comdat_group): New function.
3216 (Relobj::set_kept_comdat_section): New function.
3217 (Relobj::get_kept_comdat_section): New function.
3218 (Relobj::comdat_groups_): New field.
3219 (Relobj::kept_comdat_sections_): New field.
3220 (Symbol_value::input_value): Update comment.
3221 (Sized_relobj::map_to_kept_section) New function.
3222 (Sized_relobj::include_linkonce_section): Add new parameter.
3223 * target-reloc.h (Comdat_behavior): New type.
3224 (get_comdat_behavior): New function.
3225 (relocate_section): Add code to map a discarded section to the
3226 corresponding kept section when applying a relocation.
3227
e4e5049b
CS
32282008-04-30 Craig Silverstein <csilvers@google.com>
3229
3230 * dwarf_reader.cc (next_generation_count): New static var.
3231 (Addr2line_cache_entry): New struct.
3232 (addr2line_cache): New static var.
3233 (Dwarf_line_info::one_addr2line): Added caching.
3234 (Dwarf_line_info::clear_addr2line_cache): New function.
3235 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
3236 cache-size parameter.
3237 (Dwarf_line_info::one_addr2line_cache): New function.
3238 * symtab.cc (Symbol_table::detect_odr_violations): Pass
3239 new cache-size argument to one_addr2line(), and clear cache.
3240
d09e9154
CC
32412008-04-28 Cary Coutant <ccoutant@google.com>
3242
3243 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
3244 R_386_PC8 relocations.
3245
7ef73768
ILT
32462008-04-23 Ian Lance Taylor <iant@google.com>
3247
55438702
ILT
3248 * object.cc (Sized_relobj::include_section_group): Check for
3249 invalid section group.
3250
c165fb93
ILT
3251 * object.cc (make_elf_object): Correct test for 64-bit ELF file
3252 header size.
3253
7ef73768
ILT
3254 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
3255 than read for file header.
3256 * archive.cc (Archive::include_member): Likewise.
3257
6194aaab
L
32582008-04-23 Paolo Bonzini <bonzini@gnu.org>
3259
3260 * aclocal.m4: Regenerate.
3261 * configure: Regenerate.
3262
d491d34e
ILT
32632008-04-19 Ian Lance Taylor <iant@google.com>
3264
5ea2bac6
ILT
3265 * version.cc (version_string): Bump to 1.6.
3266
7bc3e21a
ILT
3267 * testsuite/Makefile.am (many_sections_r_test): New target.
3268 (many_sections_r_test_SOURCES): Remove.
3269 (many_sections_r_test_DEPENDENCIES): Remove.
3270 (many_sections_r_test_LDFLAGS): Remove.
3271 (many_sections_r_test_LDADD): Remove.
3272
7fcd3aa9
ILT
3273 * object.cc (Sized_relobj::do_add_symbols): Always pass
3274 local_symbol_count_ to add_from_relobj.
3275
4c94d6ae
ILT
3276 * testsuite/Makefile.am (many_sections_check.h): Only check one in
3277 every thousand variables.
3278 * testsuite/Makefile.in: Rebuild.
3279
d491d34e
ILT
3280 * object.cc (Xindex::initialize_symtab_xindex): New function.
3281 (Xindex::read_symtab_xindex): New function.
3282 (Xindex::sym_xindex_to_shndx): New function.
3283 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
3284 available.
3285 (Sized_relobj::do_initialize_xindex): New function.
3286 (Sized_relobj::do_read_symbols): Adjust section links.
3287 (Sized_relobj::symbol_section_and_value): Add is_ordinary
3288 parameter. Change all callers.
3289 (Sized_relobj::include_section_group): Adjust section links and
3290 symbol section indexes.
3291 (Sized_relobj::do_layout): Adjust section links.
3292 (Sized_relobj::do_count_local_symbols): Adjust section links and
3293 symbol section indexes.
3294 (Sized_relobj::do_finalize_local_symbols): Distinguish between
3295 ordinary and special symbols.
3296 (Sized_relobj::write_local_symbols): Add symtab_xindex and
3297 dynsym_xindex parameters. Change all callers. Adjust section
3298 links. Use SHN_XINDEX when needed.
3299 (Sized_relobj::get_symbol_location_info): Adjust section links.
3300 Don't get fooled by special symbols.
3301 * object.h (class Xindex): Define.
3302 (class Object): Add xindex_ parameter. Declare virtual functoin
3303 do_initialize_xindex.
3304 (Object::adjust_sym_shndx): New function.
3305 (Object::set_xindex): New protected function.
3306 (class Symbol_value): Add is_ordinary_shndx_ field.
3307 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
3308 (Symbol_value::value): Assert ordinary section.
3309 (Symbol_value::initialize_input_to_output_map): Likewise.
3310 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
3311 Change all callers.
3312 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
3313 all callers.
3314 (class Sized_relobj): Update declarations.
3315 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
3316 parameter. Change all callers.
3317 (Sized_relobj::adjust_shndx): New function.
3318 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
3319 field.
3320 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
3321 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
3322 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
3323 (Sized_dynobj::read_dynsym_section): Adjust section links.
3324 (Sized_dynobj::read_dynamic): Likewise.
3325 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
3326 section links.
3327 (Sized_dynobj::do_initialize_xindex): New function.
3328 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
3329 do_initialize_xindex.
3330 (Sized_dynobj::adjust_shndx): New function.
3331 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
3332 dynsym_xindex_ fields.
3333 (Layout::finalize): Add a call to set_section_indexes before
3334 creating the symtab sections.
3335 (Layout::set_section_indexes): Don't do anything if the section
3336 already has a section index.
3337 (Layout::create_symtab_sections): Add shnum parameter. Change
3338 caller. Create .symtab_shndx section if needed.
3339 (Layout::create_shdrs): Add shstrtab_section parameter. Change
3340 caller.
3341 (Layout::allocated_output_section_count): New function.
3342 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
3343 needed.
3344 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
3345 fields. Update declarations.
3346 (Layout::symtab_xindex): New function.
3347 (Layout::dynsym_xindex): New function.
3348 (class Write_symbols_task): Add layout_ field.
3349 (Write_symbols_task::Write_symbols_task): Add layout parameter.
3350 Change caller.
3351 * output.cc (Output_section_headers::Output_section_headers): Add
3352 shstrtab_section parameter. Change all callers.
3353 (Output_section_headers::do_sized_write): Store overflow values
3354 for section count and section string table section index in
3355 section header zero.
3356 (Output_file_header::do_sized_write): Check for overflow of
3357 section count and section string table section index.
3358 (Output_symtab_xindex::do_write): New function.
3359 (Output_symtab_xindex::endian_do_write): New function.
3360 * output.h (class Output_section_headers): Add shstrtab_section_.
3361 Update declarations.
3362 (class Output_symtab_xindex): Define.
3363 (Output_section::has_out_shndx): New function.
3364 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
3365 field.
3366 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
3367 Change all callers.
3368 (Sized_symbol::init): Likewise.
3369 (Symbol::output_section): Check for ordinary symbol.
3370 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
3371 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
3372 callers.
3373 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
3374 Change all callers. Simplify handling of symbols from sections
3375 not included in the link.
3376 (Symbol_table::add_from_dynobj): Handle ordinary symbol
3377 distinction.
3378 (Weak_alias_sorter::operator()): Assert that symbols are
3379 ordinary.
3380 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
3381 distinction.
3382 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
3383 parameters. Change all callers.
3384 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
3385 symbol distinction. Use SHN_XINDEX when needed.
3386 (Symbol_table::write_section_symbol): Add symtab_xindex
3387 parameter. Change all callers.
3388 (Symbol_table::sized_write_section_symbol): Likewise. Use
3389 SHN_XINDEX when needed.
3390 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
3391 declarations.
3392 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
3393 (Symbol::is_defined): Check is_ordinary.
3394 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
3395 (Symbol::is_absolute, Symbol::is_common): Likewise.
3396 (class Sized_symbol): Update declarations.
3397 (class Symbol_table): Update declarations.
3398 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
3399 parameters. Change all callers.
3400 (Sized_symbol::override): Likewise.
3401 (Symbol_table::override): Likewise.
3402 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
3403 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
3404 is_ordinary, and orig_st_shndx parameters. Change all callers.
3405 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
3406 to be in an ordinary section.
3407 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
3408 object and is_ordinary parameters. Change all callers.
3409 (Sized_dwarf_line_info::read_relocs): Add object parameter.
3410 Change all callers. Don't add undefined or non-ordinary symbols
3411 to reloc_map_.
3412 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
3413 Change all callers.
3414 * dwarf_reader.h (class Sized_dwarf_line_info): Update
3415 declarations.
3416 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
3417 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
3418 (Sized_relobj::relocate_sections): Likewise.
3419 * target-reloc.h (scan_relocs): Adjust section symbol index.
3420 (scan_relocatable_relocs): Likewise.
3421 * i386.cc (Scan::local): Check for ordinary symbols.
3422 * sparc.cc (Scan::local): Likewise.
3423 * x86_64.cc (Scan::local): Likewise.
3424 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
3425 to symbol_section_and_value.
3426 * testsuite/many_sections_test.cc: New file.
3427 * testsuite/Makefile.am (BUILT_SOURCES): Define.
3428 (check_PROGRAMS): Add many_sections_test.
3429 (many_sections_test_SOURCES): Define.
3430 (many_sections_test_DEPENDENCIES): Define.
3431 (many_sections_test_LDFLAGS): Define.
3432 (BUILT_SOURCES): Add many_sections_define.h.
3433 (many_sections_define.h): New target.
3434 (BUILT_SOURCES): Add many_sections_check.h.
3435 (many_sections_check.h): New target.
3436 (check_PROGRAMS): Add many_sections_r_test.
3437 (many_sections_r_test_SOURCES): Define.
3438 (many_sections_r_test_DEPENDENCIES): Define.
3439 (many_sections_r_test_LDFLAGS): Define.
3440 (many_sections_r_test_LDADD): Define.
3441 (many_sections_r_test.o): New target.
3442 * testsuite/Makefile.in: Rebuild.
3443
c5818ff1
CC
34442008-04-17 Cary Coutant <ccoutant@google.com>
3445
3446 * errors.cc (Errors::info): New function.
3447 (gold_info): New function.
3448 * errors.h (Errors::info): New function.
3449 * gold.h (gold_info): New function.
3450 * object.cc (Input_objects::add_object): Print trace output.
3451 * options.cc (options::parse_set): New function.
3452 (General_options::parse_wrap): Deleted.
3453 (General_options::General_options): Deleted initializer.
3454 * options.h (options::String_set): New typedef.
3455 (options::parse_set): New function.
3456 (DEFINE_set): New macro.
3457 (General_options::wrap): Changed to use DEFINE_set. Changed
3458 callers of any_wrap_symbols and is_wrap_symbol.
3459 (General_options::trace, General_options::trace_symbol):
3460 New options.
3461 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
3462 (General_options::wrap_symbols_): Deleted.
3463 * symtab.cc (Symbol_table::add_from_object): Print trace output.
3464
b5be4a7c
DM
34652008-04-17 David S. Miller <davem@davemloft.net>
3466
3467 * options.cc (General_options::parse_V): New function.
3468 * options.h: Add entries for -V and -Qy.
3469
155a0dd7
ILT
34702008-04-17 Ian Lance Taylor <iant@google.com>
3471
3472 * common.cc (Symbol_table::allocate_commons): Remove options
3473 parameter. Change caller.
3474 (Symbol_table::do_allocate_commons): Remove options parameter.
3475 Change caller. Just call do_allocate_commons_list twice.
3476 (Symbol_table::do_allocate_commons_list): New function, broken out
3477 of do_allocate_commons.
3478 * common.h (class Allocate_commons_task): Remove options_ field.
3479 Update constructor.
3480 * symtab.cc (Symbol_table::Symbol_table): Initialize
3481 tls_commons_.
3482 (Symbol_table::add_from_object): Put TLS common symbols on
3483 tls_commons_ list.
3484 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
3485 which are IN_OUTPUT_DATA.
3486 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
3487 allocate_commons and do_allocate_commons declarations. Declare
3488 do_allocate_commons_list.
3489 * gold.cc (queue_middle_tasks): Update creation of
3490 Allocate_commons_task to not pass options.
3491 * testsuite/Makefile.am (INCLUDES): Add -I.. .
3492 (TLS_TEST_C_FLAGS): New variable.
3493 (tls_test_c_pic.o): New target.
3494 (tls_test_shared.so): Link in tls_test_c_pic.o.
3495 (tls_test_c_pic_ie.o): New target.
3496 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
3497 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
3498 (tls_test_c.o): New target.
3499 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
3500 (tls_pic_test_LDADD): Likewise.
3501 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
3502 (tls_shared_gd_to_ie_test_LDADD): Likewise.
3503 (tls_test_c_gnu2.o): New target.
3504 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
3505 tls_test_c_gnu2.o.
3506 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
3507 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
3508 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
3509 * testsuite/tls_test.cc: Include "config.h".
3510 (t_last): Call t11_last.
3511 * testsuite/tls_test.h (t11, t11_last): Declare.
3512 * testsuite/tls_test_c.c: New file.
3513 * testsuite/tls_test_main.cc (thread_routine): Call t11.
3514 * configure.ac: Check for OpenMP support.
3515 * configure, config.in, Makefile.in: Rebuild.
3516 * testsuite/Makefile.in: Rebuild.
3517
edfbb029
CC
35182008-04-16 Cary Coutant <ccoutant@google.com>
3519
3520 * i386.cc (Target_i386::define_tls_base_symbol): New function.
3521 (Target_i386::tls_base_symbol_defined_): New field.
3522 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
3523 (Target_i386::Scan::global): Likewise.
3524 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
3525 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
3526 (Target_x86_64::tls_base_symbol_defined_): New field.
3527 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
3528 (Target_x86_64::Scan::global): Likewise.
3529
f3c69fca
CC
35302008-04-16 Cary Coutant <ccoutant@google.com>
3531
3532 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
3533 (Symbol::needs_plt_entry): Allow weak undefined symbols.
3534 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
3535 building shared libraries.
3536 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
3537 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
3538 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
3539 * testsuite/Makefile.in: Rebuild.
3540 * testsuite/weak_undef.h: New file.
3541 * testsuite/weak_undef_file1.cc: Add extra test cases.
3542 * testsuite/weak_undef_file2.cc: Likewise.
3543 * testsuite/weak_undef_test.cc: Likewise.
3544
7c414435
DM
35452008-04-16 David S. Miller <davem@davemloft.net>
3546
32b769e1
DM
3547 * sparc.cc (Target_sparc::Scan): Change from struct to class.
3548 Add issued_non_pic_error_ field. Declare check_non_pic.
3549 (Target_sparc::Scan::check_non_pic): New function.
3550 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
3551 (Target_sparc::Scan::global): Likewise.
3552
11936fb1
DM
3553 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
3554 * configure: Rebuild.
3555
7c414435
DM
3556 * options.h (DEFINE_enable): New macro.
3557 (new_dtags): New enable option.
3558 (initfirst, interpose, loadfltr, nodefaultlib,
3559 nodelete, nodlopen, nodump): New -z options.
3560 * layout.cc (Layout:finish_dynamic_section): If new
3561 dtags enabled, emit DT_RUNPATH. Also, emit a
3562 DT_FLAGS_1 containing any specified -z flags.
3563
85c7bf8b
ILT
35642008-04-16 Ian Lance Taylor <iant@google.com>
3565
12c0daef
ILT
3566 * copy-relocs.cc: New file.
3567 * copy-relocs.h: New file.
3568 * reloc.cc: Remove Copy_relocs code.
3569 * reloc.h: Likewise.
3570 * reloc-types.h (struct Reloc_types) [both versions]: Add
3571 get_reloc_addend_noerror.
3572 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
3573 variants of add_global which take an addend which must be zero.
3574 * i386.cc: Include "copy-relocs.h".
3575 (class Target_i386): Change type of copy_relocs_ to variable,
3576 update initializer.
3577 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
3578 Change all callers.
3579 (Target_i386::do_finalize_sections): Change handling of
3580 copy_relocs_.
3581 * sparc.cc: Include "copy-relocs.h".
3582 (class Target_sparc): Change type of copy_relocs_ to variable,
3583 update initializer.
3584 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
3585 Change all callers.
3586 (Target_sparc::do_finalize_sections): Change handling of
3587 copy_relocs_.
3588 * x86_64.cc: Include "copy-relocs.h".
3589 (class Target_x86_64): Change type of copy_relocs_ to variable,
3590 update initializer.
3591 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
3592 class. Change all callers.
3593 (Target_x86_64::do_finalize_sections): Change handling of
3594 copy_relocs_.
3595 * Makefile.am (CCFILES): Add copy-relocs.cc.
3596 (HFILES): Add copy-relocs.h.
3597
4f4995b6
ILT
3598 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
3599
85c7bf8b
ILT
3600 * testsuite/script_test_4.sh: Permit leading zeroes.
3601
4f2a9edd
ILT
36022008-04-15 Ian Lance Taylor <iant@google.com>
3603
e6188289
ILT
3604 * script-sections.cc (Script_sections::create_segments): Use
3605 header_size_adjustment even when there is enough room for the
3606 headers.
3607 * testsuite/script_test_4.sh: New file.
3608 * testsuite/script_test_4.t: New file.
3609 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
3610 (check_DATA): Add script_test_4.stdout.
3611 (MOSTLYCLEANFILES): Likewise.
3612 (script_test_4): New target.
3613 (script_test_4.stdout): New target.
3614 * testsuite/Makefile.in: Rebuild.
3615
4f2a9edd
ILT
3616 * sparc.cc: Add definitions for Output_data_plt_sparc class
3617 constants.
3618
f5314dd5
DM
36192008-04-14 David S. Miller <davem@davemloft.net>
3620
3621 * sparc.cc: New file.
3622 * Makefile.am (TARGETSOURCES): Add sparc.cc
3623 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
3624 * configure.tgt: Document targ_extra_size and
3625 targ_extra_big_endian. Add entries for sparc-* and
3626 sparc64-*.
3627 * configure.ac: Handle targ_extra_size and
3628 targ_extra_big_endian.
3629 * Makefile.in: Rebuild.
3630 * configure: Likewise.
3631 * po/POTFILES.in: Likewise.
3632 * po/gold.pot: Likewise.
3633
154e0e9a
ILT
36342008-04-14 Ian Lance Taylor <iant@google.com>
3635
3636 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
3637 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
3638 in the name/type/flags to section mapping. Don't call
3639 allocate_output_section.
3640 (Layout::choose_output_section): Change parameter from adjust_name
3641 to is_input_section. Don't permit input sections after sections
3642 are attached to segments. Don't call allocate_output_section.
3643 (Layout::layout_eh_frame): Call update_flags_for_input_section,
3644 not write_enable_output_section.
3645 (Layout::make_output_section): Don't push to
3646 unattached_section_list_ nor call attach_to_segment. Call
3647 attach_section_to_segment if sections are attached.
3648 (Layout::attach_sections_to_segments): New function.
3649 (Layout::attach_section_to_segment): New function.
3650 (Layout::attach_allocated_section_to_segment): Rename from
3651 attach_to_segment. Remove flags parameter.
3652 (Layout::allocate_output_section): Remove function.
3653 (Layout::write_enable_output_section): Remove function.
3654 * layout.h (class Layout): Update for above changes. Add new
3655 field sections_are_attached_.
3656 * output.h (Output_section::update_flags_for_input_section): New
3657 function.
3658 * output.cc (Output_section::add_input_section): Call
3659 update_flags_for_input_section.
3660 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
3661
009a67a2
CC
36622008-04-11 Cary Coutant <ccoutant@google.com>
3663
3664 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
3665 thought unnecessary.
3666 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
3667
759b1a24
ILT
36682008-04-11 Ian Lance Taylor <iant@google.com>
3669
3670 * output.h (class Output_section_data): Remove inline definition
3671 of set_addralign.
3672 * output.cc (Output_section_data::set_addralign): New function.
3673
c2b45e22
CC
36742008-04-11 Cary Coutant <ccoutant@google.com>
3675
3676 Add support for TLS descriptors for i386 and x86_64.
3677 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
3678 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
3679 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
3680 GOT_TYPE_TLS_DESC.
3681 (Target_i386::got_mod_index_entry): Remove unnecessary code.
3682 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
3683 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
3684 relocations.
3685 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
3686 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
3687 Fix problem with initial-exec relocations.
3688 (Target_i386::Relocate::relocate_tls): Likewise.
3689 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
3690 relaxation.
3691 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
3692 support for section-plus-offset dynamic table entries.
3693 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
3694 (Output_data_dynamic::Dynamic_entry): Add support for
3695 section-plus-offset dynamic table entries.
3696 (Output_data_dynamic::Classification): Likewise.
3697 (Output_data_dynamic::classification_): Renamed offset_.
3698 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
3699 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
3700 (Target_x86_64::make_plt_section): New function.
3701 (Target_x86_64::reserve_tlsdesc_entries): New function.
3702 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
3703 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
3704 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
3705 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
3706 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
3707 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
3708 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
3709 add extra PLT entry for TLS descriptors.
3710 (Output_data_plt_x86_64::got_): New field.
3711 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
3712 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
3713 fields.
3714 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
3715 descriptors.
3716 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
3717 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
3718 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
3719 R_386_TLS_DESC_CALL relocations.
3720 (Target_x86_64::Scan::global): Likewise.
3721 (Target_x86_64::do_finalize_sections): Add dynamic table entries
3722 for TLS descriptors.
3723 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
3724 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
3725 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
3726 GD-to-IE relaxation.
3727 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
3728 and TLS_DESCRIPTORS.
3729 * Makefile.in: Rebuild.
3730 * configure: Rebuild.
3731 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
3732 (tls_test_shared2.so): New target.
3733 (tls_shared_gd_to_ie_test_SOURCES): New variable.
3734 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
3735 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
3736 (tls_shared_gd_to_ie_test_LDADD): New variable.
3737 (tls_shared_gnu2_gd_to_ie_test): New target.
3738 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
3739 New targets.
3740 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
3741 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
3742 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
3743 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
3744 (tls_shared_gnu2_test): New target.
3745 (tls_test_gnu2_shared.so): New target.
3746 (tls_shared_gnu2_test_SOURCES): New variable.
3747 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
3748 (tls_shared_gnu2_test_LDFLAGS): New variable.
3749 (tls_shared_gnu2_test_LDADD): New variable.
3750 * testsuite/Makefile.in: Rebuild.
3751 * testsuite/Makefile.
3752
83bfb6b7
ILT
37532008-04-11 Ian Lance Taylor <iant@google.com>
3754
3755 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
3756 justsyms.t.
3757 * testsuite/Makefile.in: Rebuild.
3758
3759 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
3760 long.
3761 * testsuite/script_test_2.cc (main): Adjust test.
3762
706e1f5e
ILT
37632008-04-11 David S. Miller <davem@davemloft.net>
3764 Ian Lance Taylor <iant@google.com>
3765
3766 * options.h (General_options): Add entries for '-Y' and
3767 '-relax'.
3768 * options.cc (General_options:finalize): If -Y was used, add those
3769 entries to the library path instead of the default "/lib" and
3770 "/usr/lib".
3771
7c98e6bb
DM
37722008-04-11 David S. Miller <davem@davemloft.net>
3773
3774 * testsuite/justsyms.t: Start at 0x100.
3775 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
3776 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
3777 long.
3778 * testsuite/script_test_2.cc: Adjust string and section length
3779 checks.
7c98e6bb 3780
99a37bfd
ILT
37812008-04-09 Ian Lance Taylor <iant@google.com>
3782
2cefc357
ILT
3783 PR gold/5996
3784 * script-sections.cc (Sections_element::allocate_to_segment): Add
3785 orphan parameter.
3786 (Output_section_definition::allocate_to_segment): Likewise.
3787 (Orphan_output_section::allocate_to_segment): Likewise.
3788 (Script_sections::attach_sections_using_phdrs_clause): Don't
3789 propagate non-PT_LOAD segments to orphan sections.
3790 * testsuite/Makefile.am (script_test_3.stdout): Generate using
3791 readelf rather than objdump.
3792 * testsuite/script_test_3.sh: Adjust accordingly. Test that
3793 .interp section and PT_INTERP segment are the same size.
3794 * testsuite/Makefile.in: Rebuild.
3795
99a37bfd
ILT
3796 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
3797 aliases for symbols defined in the same object.
3798 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
3799 (weak_alias_test_SOURCES): New variable.
3800 (weak_alias_test_DEPENDENCIES): New variable.
3801 (weak_alias_test_LDFLAGS): New variable.
3802 (weak_alias_test_LDADD): New variable.
3803 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
3804 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
3805 (weak_alias_test_3.o): New target.
3806 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
3807 * testsuite/weak_alias_test_main.cc: New file.
3808 * testsuite/weak_alias_test_1.cc: New file.
3809 * testsuite/weak_alias_test_2.cc: New file.
3810 * testsuite/weak_alias_test_3.cc: New file.
3811
780e49c5
ILT
38122008-04-08 Ian Lance Taylor <iant@google.com>
3813
cdb0b8f5
ILT
3814 * options.h (class General_options): Add --noinhibit-exec option.
3815 * main.cc (main): Check --noinhibit-exec.
3816
0864d551
ILT
3817 * options.h (class General_options): Define --wrap as a special
3818 option. Add wrap_symbols_ field.
3819 (General_options::any_wrap_symbols): New function.
3820 (General_options::is_wrap_symbol): New function.
3821 * options.cc (General_options::parse_wrap): New function.
3822 (General_options::General_options): Initialize wrap_symbols_.
3823 * symtab.cc (Symbol_table::wrap_symbol): New function.
3824 (Symbol_table::add_from_object): Handle --wrap.
3825 * symtab.h (class Symbol_table): Declare wrap_symbol.
3826 * target.h (Target::wrap_char): New function.
3827 (Target::Target_info): Add wrap_char field.
3828 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
3829 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3830 * testsuite/testfile.cc (Target_test::test_target_info):
3831 Likewise.
3832
789aa6de
ILT
3833 * errors.cc (Errors::undefined_symbol): Mention symbol version if
3834 there is one.
3835
2c38906f
ILT
3836 * layout.h (class Layout): Add added_eh_frame_data_ field.
3837 * layout.cc (Layout::Layout): Initialize new field.
3838 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
3839 output section until we find a section we merged successfully.
3840 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
3841 that the size be non-zero.
3842
780e49c5
ILT
3843 * merge.cc (Object_merge_map::get_output_offset): Remove inline
3844 qualifier.
3845
7fcd0256
ILT
38462008-04-08 Craig Silverstein <csilvers@google.com>
3847
3848 * configure.ac: Export new conditional variable HAVE_ZLIB.
3849 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
3850 on HAVE_ZLIB.
3851 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
3852 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
3853
6835af53
ILT
38542008-04-07 Ian Lance Taylor <iant@google.com>
3855
e24f324c
ILT
3856 * version.cc (version_string): Set to "1.5".
3857
a036edd8
ILT
3858 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
3859 Add issued_non_pic_error_ field. Declare check_non_pic.
3860 (Target_x86_64::Scan::check_non_pic): New function.
3861 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
3862 (Target_x86_64::Scan::global): Likewise.
3863
624f8810
ILT
3864 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
3865 addend parameter. Change caller. Handle merge sections.
3866 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
3867 Address to Addend. Don't add in the result of
3868 local_section_offset, pass down the addend and use the returned
3869 value.
3870 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
3871 Update declarations of local_section_offset and symbol_value.
3872 * testsuite/two_file_test_1.cc (t18): New function.
3873 * testsuite/two_file_test_2.cc (f18): New function.
3874 * testsuite/two_file_test_main.cc (main): Call t18.
3875 * testsuite/two_file_test.h (t18, f18): Declare.
3876
6835af53
ILT
3877 * configure.ac: Don't test for objdump, c++filt, or readelf.
3878 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
3879 conditionals.
3880 (TEST_READELF): New variable.
3881 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
3882 (check_PROGRAMS): Add two_file_strip_test.
3883 (two_file_strip_test): New target.
3884 (check_PROGRAMS): Add two_file_same_shared_strip_test.
3885 (two_file_same_shared_strip_test_SOURCES): New variable.
3886 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
3887 (two_file_same_shared_strip_test_LDFLAGS): New variable.
3888 (two_file_same_shared_strip_test_LDADD): New variable.
3889 (two_file_shared_strip.so): New target.
3890 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
3891 (ver_test_5.syms, ver_test_7.syms): Likewise.
3892 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
3893 (strip_test_3.stdout): Use TEST_OBJDUMP.
3894 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
3895
86925eef
CC
38962008-04-04 Cary Coutant <ccoutant@google.com>
3897
3898 * symtab.h (Symbol::is_weak_undefined): New function.
3899 (Symbol::is_strong_undefined): New function.
3900 (Symbol::is_absolute): New function.
3901 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
3902 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
3903 absolute symbols.
3904 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
3905 (weak_undef_test): New target.
3906 * testsuite/Makefile.in: Rebuild.
3907 * testsuite/weak_undef_file1.cc: New file.
3908 * testsuite/weak_undef_file2.cc: New file.
3909 * testsuite/weak_undef_test.cc: New file.
3910
126f3ece
ILT
39112008-04-03 Craig Silverstein <csilvers@google.com>
3912
3913 * compressed_output.h (class Output_compressed_section): Use
3914 unsigned buffer.
3915 * compressed_output.cc (zlib_compress): Use unsigned buffers,
3916 add zlib header.
3917 (zlib_compressed_suffix): Removed.
3918 (Output_compressed_section::set_final_data_size): Use unsigned
3919 buffers.
3920 * testsuite/Makefile.am (flagstest_compress_debug_sections):
3921 Fix linker invocation.
3922 (flagstest_o_specialfile_and_compress_debug_sections):
3923 Likewise.
3924 * testsuite/Makefile.in: Regenerated.
3925
deae2a14
DM
39262008-04-02 David S. Miller <davem@davemloft.net>
3927
3928 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
3929 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
3930
70752818
ILT
39312008-04-02 Craig Silverstein <csilvers@google.com>
3932
3933 * TODO: New file.
3934
39d0cb0e
ILT
39352008-04-02 Ian Lance Taylor <iant@google.com>
3936
3937 * fileread.cc (File_read::find_view): Add byteshift and vshifted
3938 parameters. Update for new key type to views_. Change all
3939 callers.
3940 (File_read::read): Adjust for byteshift in returned view.
3941 (File_read::add_view): New function, broken out of
3942 find_and_make_view.
3943 (File_read::make_view): New function, broken out of
3944 find_and_make_view.
3945 (File_read::find_or_make_view): Add offset and aligned
3946 parameters. Rewrite accordingly. Change all callers.
3947 (File_read::get_view): Add offset and aligned parameters. Adjust
3948 for byteshift in return value.
3949 (File_read::get_lasting_view): Likewise.
3950 * fileread.h (class File_read): Update declarations.
3951 (class File_read::View): Add byteshift_ field. Add byteshift to
3952 constructor. Add byteshift method.
3953 * archive.h (Archive::clear_uncached_views): New function.
3954 (Archive::get_view): Add aligned parameter. Change all callers.
3955 * object.h (Object::get_view): Add aligned parameter. Change all
3956 callers.
3957 (Object::get_lasting_view): Likewise.
3958
3959 * fileread.cc (File_read::release): Don't call clear_views if
3960 there are multiple objects.
3961 * fileread.h (File_read::clear_uncached_views): New function.
3962 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
3963 on the archive.
3964
a1207466
CC
39652008-03-31 Cary Coutant <ccoutant@google.com>
3966
3967 Add thin archive support.
3968 * archive.cc (Archive::armagt): New const.
3969 (Archive::setup): Remove task parameter and calls to unlock.
3970 (Archive::unlock_nested_archives): New function.
3971 (Archive::read_header): Add nested_off parameter. Change
3972 all callers.
3973 (Archive::interpret_header): Likewise.
3974 (Archive::include_all_members): Change to handle thin
3975 archives.
3976 (Archive::include_member): Likewise.
3977 * archive.h (Archive::Archive): Add new parameters and
3978 initializers.
3979 (Archive::armagt): New const.
3980 (Archive::setup): Remove task parameter.
3981 (Archive::unlock_nested_archives): New function.
3982 (Archive::read_header): Add nested_off parameter.
3983 (Archive::interpret_header): Likewise.
3984 (Archive::Nested_archive_table): New typedef.
3985 (Archive::is_thin_archive_): New field.
3986 (Archive::nested_archives_): New field.
3987 (Archive::options_): New field.
3988 (Archive::dirpath_): New field.
3989 (Archive::task_): New field.
3990 * readsyms.cc (Read_symbols::do_read_symbols): Add check
3991 for thin archives. Pass additional parameters to
3992 Archive::Archive. Unlock the archive file after calling
3993 Archive::setup.
cd536b21 3994
479f6503
ILT
39952008-03-29 Ian Lance Taylor <iant@google.com>
3996
686c8caf
ILT
3997 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
3998 version symbol to be local.
3999 * testsuite/ver_test_4.sh: New file.
4000 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
4001 (check_DATA): Add ver_test_4.syms.
4002 (ver_test_4.syms): New target.
4003 * testsuite/Makefile.in: Rebuild.
4004
ab794b6b
ILT
4005 * output.cc
4006 (Output_section::Input_section_sort_entry::has_priority): New
4007 function.
4008 (Output_section::Input_section_sort_entry::match_file_name): New
4009 function.
4010 (Output_section::Input_section_sort_entry::match_section_name):
4011 Remove.
4012 (Output_section::Input_section_sort_entry::match_section_name_prefix):
4013 Remove.
4014 (Output_section::Input_section_sort_entry::match_section_file):
4015 Remove.
4016 (Output_section::Input_section_sort_compare::operator()): Rewrite
4017 using new Input_section_sort_entry functions. Sort crtbegin and
4018 crtend first. Sort sections with no priority before sections with
4019 a priority.
4020 * testsuite/initpri1.c (d3): Check j != 4.
4021 (cd5): New constructor/destructor function.
4022 (main): Check j != 2.
4023
479f6503
ILT
4024 * symtab.cc (Symbol_table::add_from_object): If we don't use the
4025 new symbol when resolving, don't call set_is_default.
4026 * testsuite/ver_test_7.cc: New file.
4027 * testsuite/ver_test_7.sh: New file.
4028 * testsuite/Makefile.am (ver_test_7.so): New target.
4029 (ver_test_7.o): New target.
4030 (check_SCRIPTS): Add ver_test_7.sh.
4031 (check_DATA): Add ver_test_7.syms.
4032 (ver_test_7.syms): New target.
4033
2fd32231
ILT
40342008-03-28 Ian Lance Taylor <iant@google.com>
4035
4036 * layout.cc (Layout::layout): If we see an input section with a
4037 name that needs sorting, set the must_sort flag for the output
4038 section.
4039 (Layout::make_output_section): If the name of the output section
4040 indicates that it might require sorting, set the may_sort flag.
4041 * output.h (Output_section::may_sort_attached_input_sections): New
4042 function.
4043 (Output_section::set_may_sort_attached_input_sections): New
4044 function.
4045 (Output_section::must_sort_attached_input_sections): New
4046 function.
4047 (Output_section::set_must_sort_attached_input_sections): New
4048 function.
4049 (class Output_section): Declare Input_section_sort_entry. Define
4050 Input_section_sort_compare. Declare
4051 sort_attached_input_sections. Add new fields:
4052 may_sort_attached_input_sections_,
4053 must_sort_attached_input_sections_,
4054 attached_input_sections_are_sorted_.
4055 * output.cc (Output_section::Output_section): Initialize new
4056 fields.
4057 (Output_section::add_input_section): Add an entry to
4058 input_sections_ if may_sort or must_sort are true.
4059 (Output_section::set_final_data_size): Call
4060 sort_attached_input_sections if necessary.
4061 (Output_section::Input_section_sort_entry): Define new class.
4062 (Output_section::Input_section_sort_compare::operator()): New
4063 function.
4064 (Output_section::sort_attached_input_sections): New function.
4065 * configure.ac: Check whether the compiler supports constructor
4066 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
4067 * testsuite/initpri1.c: New file.
4068 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
4069 CONSTRUCTOR_PRIORITY.
4070 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
4071 (initpri1_LDFLAGS): New variable.
4072 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
4073
18e6b24e
ILT
40742008-03-27 Ian Lance Taylor <iant@google.com>
4075
49bdd526
ILT
4076 * common.cc (Sort_commons::operator): Correct sorting algorithm.
4077 * testsuite/common_test_1.c: New file.
4078 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
4079 (common_test_1_SOURCES): New variable.
4080 (common_test_1_DEPENDENCIES): New variable.
4081 (common_test_1_LDFLAGS): New variable.
4082
18e6b24e
ILT
4083 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
4084 and commons_ correctly when NAME/VERSION does not override
4085 NAME/NULL.
4086 * testsuite/ver_test_6.c: New file.
4087 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
4088 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
4089 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
4090
04bf7072
ILT
40912008-03-26 Ian Lance Taylor <iant@google.com>
4092
5871526f
ILT
4093 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
4094 of an undefined symbol from a version script.
4095 * testsuite/Makefile.am (ver_test_5.so): New target.
4096 (ver_test_5.o): New target.
4097 (check_SCRIPTS): Add ver_test_5.sh.
4098 (check_DATA): Add ver_test_5.syms.
4099 (ver_test_5.syms): New target.
4100 * testsuite/ver_test_5.cc: New file.
4101 * testsuite/ver_test_5.script: New file.
4102 * testsuite/ver_test_5.sh: New file.
4103 * Makefile.in, testsuite/Makefile.in: Rebuild.
4104
04bf7072
ILT
4105 PR gold/5986
4106 Fix problems building gold with gcc 4.3.0.
4107 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
4108 (gold_error_at_location, gold_warning_at_location): Use it.
4109 * configure.ac: Check whether we can compile and use a template
4110 function with a printf attribute.
4111 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
4112 when jumping over bytes.
4113 * object.cc: Instantiate Object::read_section_data.
4114 * debug.h: Include <cstring>
4115 * dwarf_reader.cc: Include <algorithm>
4116 * main.cc: Include <cstring>.
4117 * options.cc: Include <cstring>.
4118 * output.cc: Include <cstring>.
4119 * script.cc: Include <cstring>.
4120 * script.h: Include <string>.
4121 * symtab.cc: Include <cstring> and <algorithm>.
4122 * target-select.cc: Include <cstring>.
4123 * version.cc: Include <string>.
4124 * testsuite/testmain.cc: Include <cstdlib>.
4125 * configure, config.in: Rebuild.
4126
874c5b28
ILT
41272008-03-25 Ian Lance Taylor <iant@google.com>
4128
819d6c3a
ILT
4129 * options.cc: Include "../bfd/bfdver.h".
4130 (options::help): Print bug reporting address.
4131
f4b2c6f5
ILT
4132 * version.cc (print_version): Adjust output for current value of
4133 BFD_VERSION_STRING.
4134
4135 * NEWS: New file.
4136
e96caa79
ILT
4137 * options.cc (options::help): Print list of supported targets.
4138 * target-select.h: Include <vector>.
4139 (class Target_selector): Make machine_, size_, and is_big_endian_
4140 fields const. Add bfd_name_ and instantiated_target_ fields.
4141 (Target_selector::Target_selector): Add bfd_name parameter.
4142 (Target_selector::recognize): Make non-virtual, call
4143 do_recognize.
4144 (Target_selector::recognize_by_name): Make non-virtual, call
4145 do_recognize_by_name.
4146 (Target_selector::supported_names): New function.
4147 (Target_selector::bfd_name): New function.
4148 (Target_selector::do_instantiate_target): New pure virtual
4149 function.
4150 (Target_selector::do_recognize): New virtual function.
4151 (Target_selector::do_recognize_by_name): New virtual function.
4152 (Target_selector::instantiate_target): New private function.
4153 (supported_target_names): Declare.
4154 * target-select.cc (Target_selector::Target_selector): Update for
4155 new parameter and fields.
4156 (select_target_by_name): Check that the name matches before
4157 calling recognize_by_name.
4158 (supported_target_names): New function.
4159 * i386.cc (class Target_selector_i386): Update Target_selector
4160 constructor call. Remove recognize and recognize_by_name. Add
4161 do_instantiate_target.
4162 * x86_64.cc (class Target_selector_x86_64): Likewise.
4163 * testsuite/testfile.cc (class Target_selector_test): Update for
4164 changes to Target_selector.
4165
874c5b28
ILT
4166 * README: Rewrite, with some notes on unsupported features.
4167
0a65a3a7
CC
41682008-03-24 Cary Coutant <ccoutant@google.com>
4169
4170 * i386.cc (Target_i386::Got_type): New enum declaration.
4171 (Target_i386::Scan::local): Updated callers of Output_data_got
4172 member functions.
4173 (Target_i386::Scan::global): Likewise.
4174 (Target_i386::Relocate::relocate): Likewise.
4175 (Target_i386::Relocate::relocate_tls): Likewise.
4176 * object.h (Got_offset_list): New class.
4177 (Sized_relobj::local_has_got_offset): Added got_type parameter.
4178 (Sized_relobj::local_got_offset): Likewise.
4179 (Sized_relobj::set_local_got_offset): Likewise.
4180 (Sized_relobj::local_has_tls_got_offset): Removed.
4181 (Sized_relobj::local_tls_got_offset): Removed.
4182 (Sized_relobj::set_local_tls_got_offset): Removed.
4183 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
4184 * output.cc (Output_data_got::add_global): Added got_type parameter.
4185 (Output_data_got::add_global_with_rel): Likewise.
4186 (Output_data_got::add_global_with_rela): Likewise.
4187 (Output_data_got::add_global_pair_with_rel): New function.
4188 (Output_data_got::add_global_pair_with_rela): New function.
4189 (Output_data_got::add_local): Added got_type parameter.
4190 (Output_data_got::add_local_with_rel): Likewise.
4191 (Output_data_got::add_local_with_rela): Likewise.
4192 (Output_data_got::add_local_pair_with_rel): New function.
4193 (Output_data_got::add_local_pair_with_rela): New function.
4194 (Output_data_got::add_global_tls): Removed.
4195 (Output_data_got::add_global_tls_with_rel): Removed.
4196 (Output_data_got::add_global_tls_with_rela): Removed.
4197 (Output_data_got::add_local_tls): Removed.
4198 (Output_data_got::add_local_tls_with_rel): Removed.
4199 (Output_data_got::add_local_tls_with_rela): Removed.
4200 * output.h (Output_data_got::add_global): Added got_type parameter.
4201 (Output_data_got::add_global_with_rel): Likewise.
4202 (Output_data_got::add_global_with_rela): Likewise.
4203 (Output_data_got::add_global_pair_with_rel): New function.
4204 (Output_data_got::add_global_pair_with_rela): New function.
4205 (Output_data_got::add_local): Added got_type parameter.
4206 (Output_data_got::add_local_with_rel): Likewise.
4207 (Output_data_got::add_local_with_rela): Likewise.
4208 (Output_data_got::add_local_pair_with_rel): New function.
4209 (Output_data_got::add_local_pair_with_rela): New function.
4210 (Output_data_got::add_global_tls): Removed.
4211 (Output_data_got::add_global_tls_with_rel): Removed.
4212 (Output_data_got::add_global_tls_with_rela): Removed.
4213 (Output_data_got::add_local_tls): Removed.
4214 (Output_data_got::add_local_tls_with_rel): Removed.
4215 (Output_data_got::add_local_tls_with_rela): Removed.
4216 * resolve.cc (Symbol::override_base_with_special): Removed
4217 reference to has_got_offset_ field.
4218 * symtab.cc (Symbol::init_fields): Replaced initialization
4219 of got_offset_ with got_offsets_. Removed initialization
4220 of has_got_offset_
53fcba31 4221 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
4222 (Symbol::got_offset): Likewise.
4223 (Symbol::set_got_offset): Likewise.
4224 (Symbol::has_tls_got_offset): Removed.
4225 (Symbol::tls_got_offset): Removed.
4226 (Symbol::set_tls_got_offset): Removed.
4227 (Symbol::got_offset_): Removed.
4228 (Symbol::tls_mod_got_offset_): Removed.
4229 (Symbol::tls_pair_got_offset_): Removed.
4230 (Symbol::got_offsets_): New field.
4231 (Symbol::has_got_offset): Removed.
4232 (Symbol::has_tls_mod_got_offset): Removed.
4233 (Symbol::has_tls_pair_got_offset): Removed.
4234 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
4235 (Target_x86_64::Scan::local): Updated callers of Output_data_got
4236 member functions.
4237 (Target_x86_64::Scan::global): Likewise.
4238 (Target_x86_64::Relocate::relocate): Likewise.
4239 (Target_x86_64::Relocate::relocate_tls): Likewise.
4240
bd52eafb
BE
42412008-03-25 Ben Elliston <bje@au.ibm.com>
4242
4243 * yyscript.y: Fix spelling error in comment.
4244
8b105e34
ILT
42452008-03-24 Ian Lance Taylor <iant@google.com>
4246
8ed814a9
ILT
4247 * options.h (class General_options): Define build_id option.
4248 * layout.h (class Layout): Declare write_build_id, create_note,
4249 create_build_id. Add build_id_note_ member.
4250 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
4251 "libiberty.h", "md5.h", "sha1.h".
4252 (Layout::Layout): Initialize eh_frame_data_,
4253 eh_frame_hdr_section_, and build_id_note_.
4254 (Layout::finalize): Call create_build_id.
4255 (Layout::create_note): New function, broken out of
4256 Layout::create_gold_note.
4257 (Layout::create_gold_note): Call create_note.
4258 (Layout::create_build_id): New function.
4259 (Layout::write_build_id): New function.
4260 (Close_task_runner::run): Call write_build_id.
4261
8b105e34
ILT
4262 * x86_64.cc: Correct license to GPLv3.
4263
086a1841
ILT
42642008-03-23 Ian Lance Taylor <iant@google.com>
4265
4266 * options.cc: Include "demangle.h".
4267 (parse_optional_string): New function.
4268 (parse_long_option): Handle takes_optional_argument.
4269 (parse_short_option): Update dash_z initializer. Handle
4270 takes_optional_argument.
4271 (General_options::General_options): Initialize do_demangle_.
4272 (General_options::finalize): Set do_demangle_. Handle demangling
4273 style.
4274 * options.h (parse_optional_string): Declare.
4275 (struct One_option): Add optional_arg field. Update constructor.
4276 Update call constructor calls. Add takes_optional_argument
4277 function.
4278 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
4279 (DEFINE_optional_string): Define.
4280 (General_options::demangle): Change from DEFINE_bool to
4281 DEFINE_optional_string.
4282 (General_options::no_demangle): New function.
4283 (General_options::do_demangle): New function.
4284 (General_options::set_do_demangle): New function.
4285 (General_options::execstack_status_): Move definition to end of
4286 class definition.
4287 (General_options::static_): Likewise.
4288 (General_options::do_demangle_): New field.
4289 * object.cc (big_endian>::get_symbol_location_info): Call
4290 Options::do_demangle, not Options::demangle.
4291 * symtab.cc (demangle): Likewise.
4292
cbb93e63
ILT
42932008-03-22 Ian Lance Taylor <iant@google.com>
4294
4295 * gold.h: Include <cstddef> and <sys/types.h>
4296 * options.h: Include <cstring>.
4297
ec531623
ILT
42982008-03-21 Ian Lance Taylor <iant@google.com>
4299
4300 * Added source code to GNU binutils.
This page took 0.266388 seconds and 4 git commands to generate.