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