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