* configure.in (AC_CHECK_FUNCS): Add setlocale.
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2012-04-05 Nick Clifton <nickc@redhat.com>
2
3 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4 (AM_LC_MESSAGES): Add.
5 * aclocal.m4: Regenerate.
6 * config.in: Regenerate.
7 * configure: Regenerate.
8
9 2012-03-21 Cary Coutant <ccoutant@google.com>
10
11 * Makefile.am: Add gdb-index.cc, gdb-index.h.
12 * Makefile.in: Regenerate.
13 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
14 (Sized_elf_reloc_mapper::symbol_section): New function.
15 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
16 (make_elf_reloc_mapper): New function.
17 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
18 (Dwarf_abbrev_table::do_read_abbrevs): New function.
19 (Dwarf_abbrev_table::do_get_abbrev): New function.
20 (Dwarf_ranges_table::read_ranges_table): New function.
21 (Dwarf_ranges_table::read_range_list): New function.
22 (Dwarf_pubnames_table::read_section): New function.
23 (Dwarf_pubnames_table::read_header): New function.
24 (Dwarf_pubnames_table::next_name): New function.
25 (Dwarf_die::Dwarf_die): New function.
26 (Dwarf_die::read_attributes): New function.
27 (Dwarf_die::skip_attributes): New function.
28 (Dwarf_die::set_name): New function.
29 (Dwarf_die::set_linkage_name): New function.
30 (Dwarf_die::attribute): New function.
31 (Dwarf_die::string_attribute): New function.
32 (Dwarf_die::int_attribute): New function.
33 (Dwarf_die::uint_attribute): New function.
34 (Dwarf_die::ref_attribute): New function.
35 (Dwarf_die::child_offset): New function.
36 (Dwarf_die::sibling_offset): New function.
37 (Dwarf_info_reader::check_buffer): New function.
38 (Dwarf_info_reader::parse): New function.
39 (Dwarf_info_reader::do_parse): New function.
40 (Dwarf_info_reader::do_read_string_table): New function.
41 (Dwarf_info_reader::lookup_reloc): New function.
42 (Dwarf_info_reader::get_string): New function.
43 (Dwarf_info_reader::visit_compilation_unit): New function.
44 (Dwarf_info_reader::visit_type_unit): New function.
45 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
46 Sized_elf_reloc_mapper.
47 (Sized_dwarf_line_info::symbol_section): Remove function.
48 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
49 (Sized_dwarf_line_info::read_line_mappings): Remove object
50 parameter, adjust callers.
51 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
52 * dwarf_reader.h: Include <sys/types.h>.
53 (class Track_relocs): Remove forward declaration.
54 (class Elf_reloc_mapper): New class.
55 (class Sized_elf_reloc_mapper): New class.
56 (class Dwarf_abbrev_table): New class.
57 (class Dwarf_range_list): New class.
58 (class Dwarf_ranges_table): New class.
59 (class Dwarf_pubnames_table): New class.
60 (class Dwarf_die): New class.
61 (class Dwarf_info_reader): New class.
62 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
63 (Sized_dwarf_line_info::symbol_section): Remove member function.
64 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
65 base class.
66 * gdb-index.cc: New source file.
67 * gdb-index.h: New source file.
68 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
69 and .debug_types sections, call Layout::add_to_gdb_index.
70 (Sized_relobj_incr::do_section_name): Implement.
71 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
72 return type; Implement.
73 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
74 return type.
75 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
76 parameter list and return type.
77 (Sized_incr_dynobj::do_section_contents): Likewise.
78 * layout.cc: Include gdb-index.h.
79 (Layout::Layout): Initialize gdb_index_data_.
80 (Layout::init_fixed_output_section): Check for .gdb_index section.
81 (Layout::add_to_gdb_index): New function. Instantiate.
82 * layout.h: Add forward declaration for class Gdb_index.
83 (Layout::add_to_gdb_index): New member function.
84 (Layout::gdb_index_data_): New data member.
85 * main.cc: Include gdb-index.h.
86 (main): Print statistics for gdb index.
87 * object.cc (Object::section_contents): Move code into
88 do_section_contents.
89 (need_decompressed_section): Check for sections needed when building
90 gdb index.
91 (build_compressed_section_map): Likewise.
92 (Sized_relobj_file::do_read_symbols): Need local symbols when building
93 gdb index.
94 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
95 sections; call Layout::add_to_gdb_index.
96 (Sized_relobj_file::do_decompressed_section_contents): Call
97 do_section_contents directly.
98 * object.h (Object::do_section_contents): Adjust parameter list and
99 return type.
100 (Object::do_decompressed_section_contents): Call do_section_contents
101 directly.
102 (Sized_relobj_file::do_section_contents): Adjust parameter list and
103 return type.
104 * options.h (class General_options): Add --gdb-index option.
105 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
106 list and return type.
107 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
108 * reloc.h (Track_relocs::checkpoint): New function.
109 (Track_relocs::reset): New function.
110
111 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
112 New test cases.
113 * testsuite/Makefile.in: Regenerate.
114 * testsuite/gdb_index_test.cc: New test source file.
115 * testsuite/gdb_index_test_1.sh: New test source file.
116 * testsuite/gdb_index_test_2.sh: New test source file.
117
118 2012-03-19 Doug Kwan <dougkwan@google.com>
119
120 * arm.cc (Target_arm::do_define_standard_symbols): New method.
121 (Target_arm::do_finalize_sections): Remove code which defines
122 __exidx_start and __exidx_end. Make symbol table parameter
123 anonymous as it is not used.
124 * gold.cc (queue_middle_tasks): Call target hook to define any
125 target-specific symbols.
126 * target.h (Target::define_standard_symbols): New method.
127 (Target::do_define_standard_symbols): Same.
128 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
129 * testsuite/Makefile.in: Regenerate.
130 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
131 and __exidx_end.
132 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
133 relocations are generated for __exidx_start and __exidx_end.
134
135 2012-03-16 Doug Kwan <dougkwan@google.com>
136
137 * testsuite/Makefile.am: Disable test initpri3b.
138 * testsuite/Makefile.in: Regenerate.
139
140 2012-03-15 Doug Kwan <dougkwan@google.com>
141
142 * arm.cc (Target_arm::got_section): Make .got section read-only
143 if -z now is given.
144
145 2012-03-15 Ian Lance Taylor <iant@google.com>
146
147 PR gold/13850
148 * layout.cc (Layout::make_output_section): Correctly mark
149 SHT_INIT_ARRAY, et. al., as relro.
150
151 2012-03-14 Doug Kwan <dougkwan@google.com>
152
153 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
154 dynamic relocations for protected symbols in shared objects.
155
156 2012-03-13 Ian Lance Taylor <iant@google.com>
157
158 * resolve.cc (Symbol_table::resolve): When merging common symbols,
159 keep the larger alignment.
160
161 2012-03-12 Cary Coutant <ccoutant@google.com>
162
163 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
164 handling of DW_LNE_define_file.
165
166 2012-03-12 Cary Coutant <ccoutant@google.com>
167
168 * reduced_debug_output.cc
169 (Output_reduced_debug_info_section::get_die_end): Add new FORM
170 codes to switch.
171
172 2012-02-29 Cary Coutant <ccoutant@google.com>
173
174 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
175
176 2012-02-29 Cary Coutant <ccoutant@google.com>
177
178 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
179 Call Object::decompressed_section_contents.
180 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
181 New dtor.
182 (Sized_dwarf_line_info::buffer_start_): New data member.
183 * merge.cc (Output_merge_data::do_add_input_section): Call
184 Object::decompressed_section_contents.
185 (Output_merge_string::do_add_input_section): Likewise.
186 * object.cc (need_decompressed_section): New function.
187 (build_compressed_section_map): Decompress sections needed later.
188 (Sized_relobj_file::do_decompressed_section_contents): New function.
189 (Sized_relobj_file::do_discard_decompressed_sections): New function.
190 * object.h (Object::decompressed_section_contents): New function.
191 (Object::discard_decompressed_sections): New function.
192 (Object::do_decompressed_section_contents): New function.
193 (Object::do_discard_decompressed_sections): New function.
194 (Compressed_section_info): New type.
195 (Compressed_section_map): Include decompressed section contents.
196 (Sized_relobj_file::do_decompressed_section_contents): New function.
197 (Sized_relobj_file::do_discard_decompressed_sections): New function.
198
199 2012-02-16 Cary Coutant <ccoutant@google.com>
200
201 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
202 * testsuite/Makefile.in: Regenerate.
203
204 2012-02-14 Cary Coutant <ccoutant@google.com>
205
206 * options.cc (General_options::finalize): Disallow -pie and -static.
207
208 2012-02-03 Doug Kwan <dougkwan@google.com>
209
210 * arm.cc (Arm_relocate_functions::abs8,
211 Arm_relocate_functions::abs16): Use
212 Bits::has_signed_unsigned_overflow32.
213 (Arm_relocate_functions::thm_abs8): Correct range of
214 overflow check.
215 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
216 in assertions.
217
218 2012-02-02 Doug Kwan <dougkwan@google.com>
219
220 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
221 position independent outputs, not just shared objects.
222
223 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
224
225 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
226 * configure: Regenerated.
227
228 2012-01-27 Ian Lance Taylor <iant@google.com>
229
230 * reloc.h (Bits): New class with static functions, copied from
231 namespace utils in arm.cc.
232 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
233 instead.
234
235 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
236
237 * incremental.cc (write_info_blocks): Correct relocation offset.
238
239 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
240
241 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
242 (Relocate::tls_gd_to_le): Likewise.
243
244 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
245
246 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
247
248 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
249
250 * configure.ac: Check if -mcmodel=medium works.
251 * configure: Regenerated.
252
253 2012-01-24 Cary Coutant <ccoutant@google.com>
254
255 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
256 definition and ...
257 (read_unsigned_LEB_128_x): ... this new function.
258 (read_signed_LEB_128): Replaced with inline definition and ...
259 (read_signed_LEB_128_x): ... this new function.
260 * int_encoding.h (read_unsigned_LEB_128_x): New function.
261 (read_unsigned_LEB_128): Add inline definition.
262 (read_signed_LEB_128_x): New function.
263 (read_signed_LEB_128): Add inline definition.
264 * testsuite/Makefile.am (leb128_unittest): New unit test.
265 * testsuite/Makefile.in: Regenerate.
266 * testsuite/leb128_unittest.cc: New unit test.
267
268 2012-01-23 Ian Lance Taylor <iant@google.com>
269
270 PR gold/13617
271 * i386.cc (Target_i386::do_code_fill): When using a jmp
272 instruction, pad with nop instructions.
273 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
274
275 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
276
277 * x86_64.cc (gc_process_relocs): Add typename on types used in
278 template.
279 (scan_relocs): Likewise.
280 (relocate_section): Likewise.
281 (apply_relocation): Likewise.
282
283 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
284
285 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
286 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
287 under x32.
288
289 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
290
291 * x86_64.cc: Initial support for x32.
292
293 2012-01-03 Cary Coutant <ccoutant@google.com>
294
295 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
296 Use abstract base class for GOT.
297 * gold/output.h (class Output_data_got_base): New abstract base class.
298 (class Output_data_got): Derive from new base class, adjust ctors.
299 (Output_data_got::reserve_slot): Make virtual; rename to
300 do_reserve_slot; Adjust callers.
301 * gold/target.h (Sized_target::init_got_plt_for_update): Return
302 pointer to abstract base class.
303 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
304
305 2011-12-18 Ian Lance Taylor <iant@google.com>
306
307 * object.h (Relobj::local_symbol_value): New function.
308 (Relobj::local_plt_offset): New function.
309 (Relobj::local_has_got_offset): New function.
310 (Relobj::local_got_offset): New function.
311 (Relobj::set_local_got_offset): New function.
312 (Relobj::do_local_symbol_value): New pure virtual function.
313 (Relobj::do_local_plt_offset): Likewise.
314 (Relobj::do_local_has_got_offset): Likewise.
315 (Relobj::do_local_got_offset): Likewise.
316 (Relobj::do_set_local_got_offset): Likewise.
317 (Sized_relobj::do_local_has_got_offset): Rename from
318 local_has_got_offset.
319 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
320 (Sized_relobj::do_set_local_got_offset): Rename from
321 set_local_got_offset.
322 (Sized_relobj_file::do_local_plt_offset): Rename from
323 local_plt_offset.
324 (Sized_relobj_file::do_local_symbol_value): New function.
325 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
326 local_plt_offset.
327 * output.cc (Output_data_got::Got_entry::write): Change object to
328 Relobj. Use local_symbol_value.
329 (Output_data_got::add_global_with_rel): Change rel_dyn to
330 Output_data_reloc_generic*. Use add_global_generic.
331 (Output_data_got::add_global_with_rela): Remove. Change all
332 callers to use add_global_with_rel.
333 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
334 Output_data_reloc_generic*. Use add_global_generic.
335 (Output_data_got::add_global_pair_with_rela): Remove. Change all
336 callers to use add_global_pair_with_rel.
337 (Output_data_got::add_local): Change object to Relobj*.
338 (Output_data_got::add_local_plt): Likewise.
339 (Output_data_got::add_local_with_rel): Change object to Relobj*,
340 change rel_dyn to Output_data_reloc_generic*. Use
341 add_local_generic.
342 (Output_data_got::add_local_with_rela): Remove. Change all
343 callers to use all_local_with_rel.
344 (Output_data_got::add_local_pair_with_rel): Change object to
345 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
346 add_output_section_generic.
347 (Output_data_got::add_local_pair_with_rela): Remove. Change all
348 callers to use add_local_pair_with_rel.
349 (Output_data_got::reserve_local): Change object to Relobj*.
350 * output.h: (class Output_data_reloc_generic): Add pure virtual
351 declarations for add_global_generic, add_local_generic,
352 add_output_section_generic.
353 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
354 functions for Output_data_reloc_generic. Update declarations for
355 changes listed in output.cc.
356 (class Output_data_got): Change template parameter to got_size.
357 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
358 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
359 function.
360 (Sized_relobj_incr::do_local_plt_offset): New function.
361 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
362 add_global_generic.
363
364 2011-12-17 Cary Coutant <ccoutant@google.com>
365
366 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
367 * resolve.cc (Symbol_table::resolve): Likewise.
368 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
369 arrays.
370 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
371
372 2011-12-16 Ian Lance Taylor <iant@google.com>
373
374 * output.h (Output_data_reloc_generic::add): Only call
375 add_dynamic_reloc if this is a dynamic reloc section.
376
377 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
378
379 PR gold/13505
380 * target-reloc.h (apply_relocation): Replace <64, false> with
381 <size, big_endian>.
382
383 2011-11-25 Nick Clifton <nickc@redhat.com>
384
385 * po/it.po: New Italian translation.
386
387 2011-11-17 Sterling Augustine <saugustine@google.com>
388
389 * script.cc (script_include_directive): Implement.
390 (read_script_file): New local variables name and search_path. Update
391 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
392 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
393 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
394
395 2011-11-11 Sterling Augustine <saugustine@google.com>
396
397 * yyscript.y (section_cmd): Add support for INCLUDE directive.
398 (file_or_sections_cmd): Likewise.
399
400 2011-11-11 Doug Kwan <dougkwan@google.com>
401
402 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
403 if --just-symbols is given.
404
405 2011-11-10 Doug Kwan <dougkwan@google.com>
406
407 PR gold/13362
408 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
409 when processing data relocs.
410 * reloc.h (Relocate_functions::rel_unaligned): New method.
411 (Relocate_functions::pcrel_unaligned): Ditto.
412 (Relocate_functions::rel32_unaligned): Ditto.
413 (Relocate_functions::pcrel32_unaligned): Ditto.
414
415 2011-11-09 Doug Kwan <dougkwan@google.com>
416
417 PR gold/13362
418 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
419 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
420 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
421 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
422 (Relocate_functions::rel_unaligned): New.
423 (Relocate_functions::rel32_unaligned): New.
424 * target-reloc.h (relocate_for_relocatable): Add code to handle
425 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
426 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
427 arm_unaligned_reloc_r): New targets.
428 * testsuite/Makefile.in: Regenerate.
429 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
430 linking.
431
432 2011-11-02 Ian Lance Taylor <iant@google.com>
433
434 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
435 NATIVE_LINKER.
436 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
437 * options.cc (General_options::finalize): Use library search path
438 from configure script if specified. If not native and no sysroot,
439 only search TOOLLIBDIR.
440 * options.h (Search_directory::Search_directory): Change name to
441 const std::string&.
442 (General_options::add_to_library_path_with_sysroot): Change arg to
443 const std::string&.
444 * configure, Makefile.in, config.in: Rebuild.
445
446 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
447
448 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
449 we are working around the ARM1176 Erratum.
450 * options.h (General_options::fix_arm1176): Add option.
451 * testsuite/Makefile.am: Add testcases, and keep current ones
452 working.
453 * testsuite/Makefile.in: Regenerate.
454 * testsuite/arm_fix_1176.s: New file.
455 * testsuite/arm_fix_1176.sh: Likewise.
456
457 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
458
459 * arm.cc (Target_arm::Target_arm): Remove initialisation of
460 may_use_blx_.
461 (Target_arm::may_use_blx): Remove method.
462 (Target_arm::set_may_use_blx): Likewise.
463 (Target_arm::may_use_v4t_interworking): New method.
464 (Target_arm::may_use_v5t_interworking): Likewise.
465 (Target_arm::may_use_blx_): Remove member variable.
466 (Arm_relocate_functions::arm_branch_common): Check for v5T
467 interworking.
468 (Arm_relocate_functions::thumb_branch_common): Likewise.
469 (Reloc_stub::stub_type_for_reloc): Likewise.
470 (Target_arm::do_finalize_sections): Correct interworking checks.
471 * testsuite/Makefile.am: Add new tests.
472 * testsuite/Makefile.in: Regenerate.
473 * testsuite/arm_farcall_arm_arm.s: New test.
474 * testsuite/arm_farcall_arm_arm.sh: Likewise.
475 * testsuite/arm_farcall_arm_thumb.s: Likewise.
476 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
477 * testsuite/arm_farcall_thumb_arm.s: Likewise.
478 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
479 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
480 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
481
482 2011-10-31 Cary Coutant <ccoutant@google.com>
483
484 PR gold/13023
485 * expression.cc (Expression::eval_with_dot): Add
486 is_section_dot_assignment parameter.
487 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
488 absolute and assigning to dot within a section.
489 * script-sections.cc
490 (Output_section_element_assignment::set_section_addresses): Pass
491 dot_section to set_if_absolute.
492 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
493 as is_section_dot_assignment flag to eval_with_dot.
494 (Output_section_element_dot_assignment::set_section_addresses):
495 Likewise.
496 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
497 parameter. Also set value if relative to dot_section; set the
498 symbol's output_section.
499 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
500 parameter. Adjust all callers.
501 (Expression::eval_maybe_dot): Likewise.
502 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
503 Adjust all callers.
504 * testsuite/script_test_2.t: Test assignment of an absolute value
505 to dot within an output section element.
506
507 2011-10-31 Cary Coutant <ccoutant@google.com>
508
509 * options.h (class General_options): Add --[no-]gnu-unique options.
510 * symtab.cc (Symbol_table::sized_write_globals): Convert
511 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
512
513 2011-10-31 Cary Coutant <ccoutant@google.com>
514
515 PR gold/13359
516 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
517 unnecessary assertion.
518 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
519
520 2011-10-31 Sriraman Tallam <tmsriram@google.com>
521
522 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
523 gc_mark_symbol.
524 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
525 gc_mark_symbol.
526 Change to just keep the section associated with symbol.
527 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
528 they are externally visible and --export-dynamic is turned on.
529 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
530
531 2011-10-19 Ian Lance Taylor <iant@google.com>
532
533 PR gold/13163
534 * script-sections.cc
535 (Output_section_element_dot_assignment::needs_output_section): New
536 function.
537
538 2011-10-19 Ian Lance Taylor <iant@google.com>
539
540 PR gold/13204
541 * layout.cc (Layout::segment_precedes): Don't assert failure if a
542 --section-start option was seen.
543 * options.h (General_options::any_section_start): New function.
544
545 2011-10-18 David S. Miller <davem@davemloft.net>
546
547 PR binutils/13301
548 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
549 member to track relocation locations that have moved during TLS
550 reloc optimizations.
551 (Target_sparc::Relocate::Relocate): Initialize to NULL.
552 (Target_sparc::Relocate::relocate): Adjust view down by 4
553 bytes if it matches reloc_adjust_addr_.
554 (Target_sparc::Relocate::relocate_tls): Always move the
555 __tls_get_addr call delay slot instruction forward 4 bytes when
556 performing relaxation.
557
558 2011-10-18 Cary Coutant <ccoutant@google.com>
559
560 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
561 (Output_file::map_no_anonymous): Check for non-zero
562 return code from posix_fallocate.
563
564 2011-10-17 Cary Coutant <ccoutant@google.com>
565
566 PR gold/13245
567 * plugin.cc (is_visible_from_outside): Check for symbols
568 referenced from dynamic objects.
569 * resolve.cc (Symbol_table::resolve): Don't count references
570 from dynamic objects as references from real ELF files.
571 * testsuite/plugin_test_2.sh: Adjust expected result.
572
573 2011-10-17 Cary Coutant <ccoutant@google.com>
574
575 * gold.cc: Include timer.h.
576 (queue_middle_tasks): Stamp time.
577 (queue_final_tasks): Likewise.
578 * main.cc (main): Store timer in parameters. Print timers
579 for each pass.
580 * parameters.cc (Parameters::Parameters): Initialize timer_.
581 (Parameters::set_timer): New function.
582 (set_parameters_timer): New function.
583 * parameters.h (Parameters::set_timer): New function.
584 (Parameters::timer): New function.
585 (Parameters::timer_): New data member.
586 (set_parameters_timer): New function.
587 * timer.cc (Timer::stamp): New function.
588 (Timer::get_pass_time): New function.
589 * timer.h (Timer::stamp): New function.
590 (Timer::get_pass_time): New function.
591 (Timer::pass_times_): New data member.
592
593 2011-10-17 Cary Coutant <ccoutant@google.com>
594
595 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
596 task for members of lib groups.
597
598 2011-10-17 Cary Coutant <ccoutant@google.com>
599
600 PR gold/13288
601 * fileread.cc (File_read::find_view): Add assert.
602 (File_read::make_view): Move bounds check (replace with assert)...
603 (File_read::find_or_make_view): ... to here.
604
605 2011-10-12 Cary Coutant <ccoutant@google.com>
606
607 * output.cc (Output_file::open_base_file): Handle case where
608 ::read returns less than requested size.
609
610 2011-10-10 Cary Coutant <ccoutant@google.com>
611
612 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
613 Initialize defined_count_.
614 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
615 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
616 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
617 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
618 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
619 * incremental.h (Sized_relobj_incr::defined_count_): New data
620 member.
621 (Sized_incr_dynobj::defined_count_): New data member.
622 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
623 Return zeroes instead of internal error.
624
625 2011-10-10 Cary Coutant <ccoutant@google.com>
626
627 PR gold/13249
628 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
629 (Output_reloc::symbol_value): Return PLT offset if flag is set.
630 * output.h (class Output_reloc): Add use_plt_offset flag.
631 (Output_reloc::type_): Adjust size of bit field.
632 (Output_reloc::use_plt_offset_): New bit field.
633 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
634 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
635 flag. Adjust all callers.
636 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
637 creating RELATIVE relocations.
638
639 2011-10-10 Nick Clifton <nickc@redhat.com>
640
641 * po/es.po: Updated Spanish translation.
642 * po/fi.po: Updated Finnish translation.
643
644 2011-10-03 Diego Novillo <dnovillo@google.com>
645
646 * options.cc (parse_uint): Fix dereference of RETVAL.
647
648 2011-09-29 Sriraman Tallam <tmsriram@google.com>
649
650 * layout.h (section_order_map_): New member.
651 (get_section_order_map): New member function.
652 * output.cc (Output_section::add_input_section): Check for patterns
653 only when --section-ordering-file is specified.
654 * gold.cc (queue_middle_tasks): Delay updating order of sections till
655 output_sections have been formed.
656 * layout.cc (Layout_Layout): Initialize section_order_map_.
657 * plugin.cc (update_section_order): Store order in order_map. Do not
658 update the order.
659 * testsuite/Makefile.am: Add test case for plugin_final_layout.
660 * testsuite/Makefile.in: Regenerate.
661 * testsuite/plugin_section_order.c: New file.
662 * testsuite/plugin_final_layout.cc: New file.
663 * testsuite/plugin_final_layout.sh: New file.
664
665 2011-09-29 Cary Coutant <ccoutant@google.com>
666
667 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
668 Check for NULL.
669 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
670 symbols during incremental update.
671 (Symbol_table::add_from_dynobj): Likewise.
672
673 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
674 Ian Lance Taylor <iant@google.com>
675
676 * symtab.cc (Symbol_table::define_special_symbol): Always
677 canonicalize version string.
678
679 2011-09-26 Cary Coutant <ccoutant@google.com>
680
681 * gold.cc (queue_initial_tasks): Move option checks ...
682 * options.cc (General_options::finalize): ... to here. Disable
683 some options; make others fatal.
684
685 2011-09-26 Cary Coutant <ccoutant@google.com>
686
687 gcc PR lto/47247
688 * plugin.cc (get_symbols_v2): New function.
689 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
690 (is_referenced_from_outside): New function.
691 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
692 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
693 (get_symbols): Pass version parameter.
694 (get_symbols_v2): New function.
695 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
696 parameter.
697 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
698 (onload): Add LDPT_GET_SYMBOLS_V2.
699 (all_symbols_read_hook): Use get_symbols_v2; check for
700 LDPR_PREVAILING_DEF_IRONLY_EXP.
701 * testsuite/plugin_test_3.sh: Update expected results.
702
703 2011-09-23 Simon Baldwin <simonb@google.com>
704
705 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
706 configuration options.
707 * configure: Regenerate.
708 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
709 * Makefile.in: Regenerate.
710 * testsuite/Makefile.in: Regenerate.
711
712 2011-09-19 Sriraman Tallam <tmsriram@google.com>
713
714 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
715
716 2011-09-19 Cary Coutant <ccoutant@google.com>
717
718 * incremental.cc (can_incremental_update): Fix typo in comment.
719 * incremental.h (can_incremental_update): Likewise.
720
721 2011-09-18 Cary Coutant <ccoutant@google.com>
722
723 * incremental.cc (can_incremental_update): New function.
724 * incremental.h (can_incremental_update): New function.
725 * layout.cc (Layout::init_fixed_output_section): Call it.
726 (Layout::make_output_section): Don't allow patch space in .eh_frame.
727 * object.cc (Sized_relobj_file::do_layout): Call
728 can_incremental_update.
729
730 2011-09-13 Cary Coutant <ccoutant@google.com>
731
732 * configure.ac: Check for glibc support for gnu_indirect_function
733 support with static linking, setting automake conditional
734 IFUNC_STATIC.
735 * Makefile.in: Regenerate.
736 * configure: Regenerate.
737
738 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
739 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
740 for IFUNC_STATIC.
741 * testsuite/Makefile.in: Regenerate.
742
743 2011-09-13 Cary Coutant <ccoutant@google.com>
744
745 * incremental.cc (Sized_relobj_incr::do_layout): Call
746 report_comdat_group for kept comdat sections.
747 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
748 * testsuite/Makefile.in: Regenerate.
749 * testsuite/incr_comdat_test_1.cc: New source file.
750 * testsuite/incr_comdat_test_2_v1.cc: New source file.
751 * testsuite/incr_comdat_test_2_v2.cc: New source file.
752 * testsuite/incr_comdat_test_2_v3.cc: New source file.
753
754 2011-09-13 Ian Lance Taylor <iant@google.com>
755
756 * object.cc (Sized_relobj_file::do_layout): Remove unused local
757 variable external_symbols_offset.
758
759 2011-09-12 Ian Lance Taylor <iant@google.com>
760
761 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
762 triggered if object has no symbols.
763
764 2011-09-09 David S. Miller <davem@davemloft.net>
765
766 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
767 (Output_fill_debug_line::do_write): Likewise.
768
769 2011-08-29 Cary Coutant <ccoutant@google.com>
770
771 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
772 casts to match formatting specs.
773 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
774
775 2011-08-26 Cary Coutant <ccoutant@google.com>
776
777 * layout.cc (Free_list::allocate): Provide guarantee of minimum
778 remaining hole size when allocating.
779 (Layout::make_output_section): Set fill methods for debug sections.
780 * layout.h (Free_list::Free_list_node): Move from private to
781 public.
782 (Free_list::set_min_hole_size): New function.
783 (Free_list::begin, Free_list::end): New functions.
784 (Free_list::min_hole_): New data member.
785 * output.cc: Include dwarf.h.
786 (Output_fill_debug_info::do_minimum_hole_size): New function.
787 (Output_fill_debug_info::do_write): New function.
788 (Output_fill_debug_line::do_minimum_hole_size): New function.
789 (Output_fill_debug_line::do_write): New function.
790 (Output_section::Output_section): Initialize new data member.
791 (Output_section::set_final_data_size): Ensure patch space is larger
792 than minimum hole size.
793 (Output_section::do_write): Fill holes in debug sections.
794 * output.h (Output_fill): New class.
795 (Output_fill_debug_info): New class.
796 (Output_fill_debug_line): New class.
797 (Output_section::set_free_space_fill): New function.
798 (Output_section::free_space_fill_): New data member.
799 * testsuite/Makefile.am (incremental_test_3): Add
800 --incremental-patch option.
801 (incremental_test_4): Likewise.
802 (incremental_test_5): Likewise.
803 (incremental_test_6): Likewise.
804 (incremental_copy_test): Likewise.
805 (incremental_common_test_1): Likewise.
806 * testsuite/Makefile.in: Regenerate.
807
808 2011-08-26 Nick Clifton <nickc@redhat.com>
809
810 * po/es.po: Updated Spanish translation.
811
812 2011-08-01 Cary Coutant <ccoutant@google.com>
813
814 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
815 * gold/testsuite/Makefile.in: Regenerate.
816 * gold/testsuite/justsyms_exec.c: New source file.
817 * gold/testsuite/justsyms_lib.c: New source file.
818
819 2011-08-01 Cary Coutant <ccoutant@google.com>
820
821 * layout.cc (Layout::set_segment_offsets): Don't realign text
822 segment if -Ttext was specified.
823 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
824 file type.
825 * object.h (Sized_relobj_file::e_type): New function.
826 (Sized_relobj_file::e_type_): New data member.
827 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
828 base address for ET_EXEC files.
829 * target.cc (Target::do_make_elf_object_implementation): Allow
830 ET_EXEC files with --just-symbols option.
831
832 2011-07-28 Cary Coutant <ccoutant@google.com>
833
834 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
835 Add thread_number parameter.
836 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
837 * workqueue-threads.cc
838 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
839 current thread if its thread number is greater than desired thread
840 count.
841 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
842 Add thread_number parameter.
843 (Workqueue::should_cancel_thread): Likewise.
844 (Workqueue::find_runnable_or_wait): Pass thread_number to
845 should_cancel_thread.
846 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
847 parameter.
848
849 2011-07-22 Sriraman Tallam <tmsriram@google.com>
850
851 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
852 only after checking if it cannot be forced local.
853 * symtab.h (is_externally_visible): Check if the symbol is not forced
854 local.
855
856 2011-07-15 Ian Lance Taylor <iant@google.com>
857
858 * options.h (class General_options): Add --print-output-format.
859 Move -EL next to -EB, for better --help output.
860 * target-select.cc: Include <cstdio>, "options.h", and
861 "parameters.h".
862 (Target_selector::do_target_bfd_name): New function.
863 (print_output_format): New function.
864 * target-select.h (class Target_selector): Update declarations.
865 (Target_selector::target_bfd_name): New function.
866 (print_output_format): Declare.
867 * main.cc: Include "target-select.h".
868 (main): Handle --print-output-format.
869 * gold.cc: Include "target-select.h".
870 (queue_initial_tasks): Handle --print-output-format when there are
871 no input files.
872 * parameters.cc (parameters_force_valid_target): Give a better
873 error message if -EB/-EL does not match target.
874 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
875 function.
876
877 2011-07-15 Ian Lance Taylor <iant@google.com>
878
879 * i386.cc (class Output_data_plt_i386): Add layout_ field.
880 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
881 (Output_data_plt_i386::do_write): Write address of .dynamic
882 section to first entry in .got.plt section.
883 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
884 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
885 Initialize layout_.
886 (Output_data_plt_x86_64::do_write): Write address of .dynamic
887 section to first entry in .got.plt section.
888 * layout.h (Layout::dynamic_section): New function.
889
890 2011-07-13 Sriraman Tallam <tmsriram@google.com>
891
892 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
893 to claim_file call.
894 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
895 input_section_position_, and input_section_glob_.
896 (read_layout_from_file): Call function section_ordering_specified.
897 * layout.h (is_section_ordering_specified): New function.
898 (section_ordering_specified): New function.
899 (section_ordering_specified_): New boolean member.
900 * main.cc(main): Call load_plugins after layout object is defined.
901 * output.cc (Output_section::add_input_section): Use
902 function section_ordering_specified to check if section ordering is
903 needed.
904 * output.cc (Output_section::add_relaxed_input_section): Use
905 function section_ordering_specified to check if section ordering is
906 needed.
907 (Output_section::update_section_layout): New function.
908 (Output_section::sort_attached_input_sections): Check if input section
909 must be reordered.
910 * output.h (Output_section::update_section_layout): New function.
911 * plugin.cc (get_section_count): New function.
912 (get_section_type): New function.
913 (get_section_name): New function.
914 (get_section_contents): New function.
915 (update_section_order): New function.
916 (allow_section_ordering): New function.
917 (Plugin::load): Add the new interfaces to the transfer vector.
918 (Plugin_manager::load_plugins): New parameter.
919 (Plugin_manager::all_symbols_read): New parameter.
920 (Plugin_manager::claim_file): New parameter. Save the elf object for
921 unclaimed objects.
922 (Plugin_manager::get_elf_object): New function.
923 (Plugin_manager::get_view): Change to directly use the bool to check
924 if get_view is called from claim_file_hook.
925 * plugin.h (input_objects): New function
926 (Plugin__manager::load_plugins): New parameter.
927 (Plugin_manager::claim_file): New parameter.
928 (Plugin_manager::get_elf_object): New function.
929 (Plugin_manager::in_claim_file_handler): New function.
930 (Plugin_manager::in_claim_file_handler_): New member.
931 (layout): New function.
932 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
933 handler with an extra parameter. Make the elf object before calling
934 claim_file handler.
935 * testsuite/plugin_test.c (get_section_count): New function pointer.
936 (get_section_type): New function pointer.
937 (get_section_name): New function pointer.
938 (get_section_contents): New function pointer.
939 (update_section_order): New function pointer.
940 (allow_section_ordering): New function pointer.
941 (onload): Check if the new interfaces exist.
942
943 2011-07-13 Ian Lance Taylor <iant@google.com>
944
945 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
946 relro section.
947 * x86_64.cc (Target_x86_64::got_section): Likewise.
948 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
949 (relro_now_test_SOURCES): New variable.
950 (relro_now_test_DEPENDENCIES): New variable.
951 (relro_now_test_LDFLAGS): New variable.
952 (relro_now_test_LDADD): New variable.
953 (relro_now_test.so): New target.
954 * testsuite/Makefile.in: Rebuild.
955
956 2011-07-12 Ian Lance Taylor <iant@google.com>
957
958 PR gold/12980
959 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
960 GLOB_DAT relocation rather than a RELATIVE relocation for a
961 protected symbol when creating a shared library.
962 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
963 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
964 * testsuite/protected_main_1.cc (main): Test that protected
965 function has same address.
966
967 2011-07-11 Ian Lance Taylor <iant@google.com>
968
969 PR gold/12979
970 * options.h (class General_options): Add -Bgroup.
971 * options.cc (General_options::finalize): If -Bgroup is set,
972 default to --unresolved-symbols=report-all.
973 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
974 * target-reloc.h (issue_undefined_symbol_error): Handle
975 --unresolved-symbols=report-all.
976
977 2011-07-08 Ian Lance Taylor <iant@google.com>
978
979 PR gold/11985
980 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
981 if linker script discards key sections.
982 (Layout::create_dynamic_symtab): Likewise.
983 (Layout::assign_local_dynsym_offsets): Likewise.
984 (Layout::sized_create_version_sections): Likewise.
985 (Layout::create_interp): Likewise.
986 (Layout::finish_dynamic_section): Likewise.
987 (Layout::set_dynamic_symbol_size): Likewise.
988
989 2011-07-08 Ian Lance Taylor <iant@google.com>
990
991 PR gold/12386
992 * options.h (class General_options): Add --unresolved-symbols.
993 * target-reloc.h (issue_undefined_symbol_error): Check
994 --unresolved-symbols. Add comments.
995
996 2011-07-08 Ian Lance Taylor <iant@google.com>
997
998 * testsuite/odr_violation2.cc (Ordering::operator()): Make
999 expression more complex.
1000
1001 2011-07-08 Ian Lance Taylor <iant@google.com>
1002
1003 PR gold/11317
1004 * target-reloc.h (issue_undefined_symbol_error): New inline
1005 function, broken out of relocate_section.
1006 (relocate_section): Call issue_undefined_symbol_error.
1007 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1008 there is no TLS segment if we are about to issue an undefined
1009 symbol error.
1010 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1011
1012 2011-07-08 Ian Lance Taylor <iant@google.com>
1013
1014 PR gold/12279
1015 * resolve.cc (Symbol_table::should_override): Add fromtype
1016 parameter. Change all callers. Give error when linking together
1017 TLS and non-TLS symbol.
1018 (Symbol_table::should_override_with_special): Add fromtype
1019 parameter. Change all callers.
1020 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1021 there is no TLS segment if we have reported some errors.
1022 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1023
1024 2011-07-08 Ian Lance Taylor <iant@google.com>
1025
1026 PR gold/12372
1027 * target.h (Target::plt_address_for_global): New function.
1028 (Target::plt_address_for_local): New function.
1029 (Target::plt_section_for_global): Remove.
1030 (Target::plt_section_for_local): Remove.
1031 (Target::do_plt_address_for_global): New virtual function.
1032 (Target::do_plt_address_for_local): New virtual function.
1033 (Target::do_plt_section_for_global): Remove.
1034 (Target::do_plt_section_for_local): Remove.
1035 (Target::register_global_plt_entry): Add Symbol_table and Layout
1036 parameters.
1037 * output.cc (Output_data_got::Got_entry::write): Use
1038 plt_address_for_global and plt_address_for_local.
1039 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1040 address of output section.
1041 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1042 got_irelative_, and irelative_count_ fields. Update
1043 declarations.
1044 (Output_data_plt_i386::has_irelative_section): New function.
1045 (Output_data_plt_i386::entry_count): Add irelative_count_.
1046 (Output_data_plt_i386::set_final_data_size): Likewise.
1047 (class Target_i386): Add got_irelative_ and rel_irelative_
1048 fields. Update declarations.
1049 (Target_i386::Target_i386): Initialize new fields.
1050 (Target_i386::do_plt_address_for_global): New function replacing
1051 do_plt_section_for_global.
1052 (Target_i386::do_plt_address_for_local): New function replacing
1053 do_plt_section_for_local.
1054 (Target_i386::got_section): Create got_irelative_.
1055 (Target_i386::rel_irelative_section): New function.
1056 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1057 fields. Don't define __rel_iplt_{start,end}.
1058 (Output_data_plt_i386::add_entry): Add symtab and layout
1059 parameters. Change all callers. Use different PLT and GOT for
1060 IFUNC symbols.
1061 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1062 layout parameters. Change all callers. Use different PLT and
1063 GOT.
1064 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1065 (Output_data_plt_i386::rel_irelative): New function.
1066 (Output_data_plt_i386::address_for_global): New function.
1067 (Output_data_plt_i386::address_for_local): New function.
1068 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1069 IRELATIVE GOT when changing IFUNC GOT entries.
1070 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1071 reloc.
1072 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1073 if we didn't create an IRELATIVE GOT.
1074 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1075 plt_address_for_local.
1076 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1077 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1078 got_irelative_, and irelative_count_ fields. Update
1079 declarations.
1080 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1081 Initialize new fields. Remove symtab parameter. Change all
1082 callers.
1083 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1084 irelative_count_.
1085 (Output_data_plt_x86_64::has_irelative_section): New function.
1086 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1087 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1088 fields. Update declarations.
1089 (Target_x86_64::Target_x86_64): Initialize new fields.
1090 (Target_x86_64::do_plt_address_for_global): New function replacing
1091 do_plt_section_for_global.
1092 (Target_x86_64::do_plt_address_for_local): New function replacing
1093 do_plt_section_for_local.
1094 (Target_x86_64::got_section): Create got_irelative_.
1095 (Target_x86_64::rela_irelative_section): New function.
1096 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1097 all callers. Don't create __rel_iplt_{start,end}.
1098 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1099 parameters. Change all callers. Use different PLT and GOT for
1100 IFUNC symbols.
1101 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1102 layout parameters. Change all callers. Use different PLT and
1103 GOT.
1104 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1105 parameters. Change all callers. Use different PLT and GOT for
1106 IFUNC symbols.
1107 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1108 (Output_data_plt_x86_64::rela_irelative): New function.
1109 (Output_data_plt_x86_64::address_for_global): New function.
1110 (Output_data_plt_x86_64::address_for_local): New function.
1111 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1112 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1113 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1114 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1115 parameters.
1116 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1117 reloc.
1118 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1119 symbols if we didn't create an IRELATIVE GOT.
1120 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1121 plt_address_for_local.
1122 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1123 * testsuite/ifuncvar1.c: New test file.
1124 * testsuite/ifuncvar2.c: New test file.
1125 * testsuite/ifuncvar3.c: New test file.
1126 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1127 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1128 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1129 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1130 * testsuite/Makefile.in: Rebuild.
1131
1132 2011-07-07 Cary Coutant <ccoutant@google.com>
1133
1134 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1135 (two_file_test_1_ndebug.o): Likewise.
1136 (two_file_test_1b_ndebug.o): Likewise.
1137 (two_file_test_2_ndebug.o): Likewise.
1138 (two_file_test_main_ndebug.o): Likewise.
1139 (incremental_test_2): Link with no-debug versions.
1140
1141 2011-07-06 Cary Coutant <ccoutant@google.com>
1142
1143 * gold/incremental.cc
1144 (Output_section_incremental_inputs::write_info_blocks): Check for
1145 hidden and internal symbols.
1146
1147 2011-07-06 Cary Coutant <ccoutant@google.com>
1148
1149 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1150 Check disposition for startup file.
1151 (Incremental_inputs::report_command_line): Ignore
1152 --incremental-startup-unchanged option.
1153 * options.cc (General_options::parse_incremental_startup_unchanged):
1154 New function.
1155 (General_options::General_options): Initialize new data member.
1156 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1157 (General_options): Add --incremental-startup-unchanged option.
1158 (General_options::incremental_startup_disposition): New function.
1159 (General_options::incremental_startup_disposition_): New data member.
1160
1161 2011-07-06 Cary Coutant <ccoutant@google.com>
1162
1163 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1164 input file index to Script_info ctor.
1165 (Sized_incremental_binary::do_file_has_changed): Find the
1166 command-line argument for files named in scripts.
1167 * incremental.h (Script_info::Script_info): New ctor
1168 with input file index.
1169 (Script_info::input_file_index): New function.
1170 (Script_info::input_file_index_): New data member.
1171 (Incremental_binary::get_library): Add const.
1172 (Incremental_binary::get_script_info): Add const.
1173 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1174 * testsuite/Makefile.am (incremental_test_5): New test case.
1175 (incremental_test_6): New test case.
1176 * testsuite/Makefile.in: Regenerate.
1177
1178 2011-07-06 Cary Coutant <ccoutant@google.com>
1179
1180 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1181 debug output when command lines differ.
1182
1183 2011-07-06 Cary Coutant <ccoutant@google.com>
1184
1185 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1186 --incremental-patch option.
1187 * layout.cc (Free_list::allocate): Extend allocation beyond original
1188 end if enabled.
1189 (Layout::make_output_section): Mark sections that should get
1190 patch space.
1191 * options.cc (parse_percent): New function.
1192 * options.h (parse_percent): New function.
1193 (DEFINE_percent): New macro.
1194 (General_options): Add --incremental-patch option.
1195 * output.cc (Output_section::Output_section): Initialize new data
1196 members.
1197 (Output_section::add_input_section): Print section name when out
1198 of patch space.
1199 (Output_section::add_output_section_data): Likewise.
1200 (Output_section::set_final_data_size): Add patch space when
1201 doing --incremental-full.
1202 (Output_section::do_reset_address_and_file_offset): Remove patch
1203 space.
1204 (Output_segment::set_section_list_addresses): Print debug output
1205 only if --incremental-update.
1206 * output.h (Output_section::set_is_patch_space_allowed): New function.
1207 (Output_section::is_patch_space_allowed_): New data member.
1208 (Output_section::patch_space_): New data member.
1209 * parameters.cc (Parameters::incremental_full): New function.
1210 * parameters.h (Parameters::incremental_full): New function
1211 * testsuite/Makefile.am (incremental_test_2): Add test for
1212 --incremental-patch option.
1213 * testsuite/Makefile.in: Regenerate.
1214 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1215 (t18): Remove function body.
1216
1217 2011-07-05 Doug Kwan <dougkwan@google.com>
1218
1219 PR gold/12771
1220 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1221 Arm_Address type for relocation result.
1222 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1223 overflow check.
1224 (Arm_relocate_functions::abs32): Use unaligned access.
1225 (Arm_relocate_functions::rel32): Ditto.
1226 (Arm_relocate_functions::prel31): Ditto.
1227 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1228 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1229 static data relocations.
1230 * testsuite/Makefile.in: Regnerate.
1231 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1232
1233 2011-07-05 Ian Lance Taylor <iant@google.com>
1234
1235 PR gold/12392
1236 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1237 symbols if necessary.
1238 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1239
1240 2011-07-05 Ian Lance Taylor <iant@google.com>
1241
1242 PR gold/12952
1243 * resolve.cc (Symbol::override_base_with_special): Simply override
1244 version with special symbol version, ignoring previous version.
1245
1246 2011-07-05 Ian Lance Taylor <iant@google.com>
1247
1248 * object.cc (Sized_relobj_file::include_section_group): Add
1249 information to comment about signature location.
1250
1251 2011-07-02 Ian Lance Taylor <iant@google.com>
1252
1253 PR gold/12957
1254 * options.h (class General_options): Add -f and -F.
1255 * options.cc (General_options::finalize): Fatal error if -f/-F
1256 are used without -shared.
1257 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1258
1259 2011-07-02 Ian Lance Taylor <iant@google.com>
1260
1261 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1262
1263 2011-07-01 Ian Lance Taylor <iant@google.com>
1264
1265 PR gold/12525
1266 PR gold/12952
1267 * resolve.cc (Symbol::override_base_with_special): Don't override
1268 the version if the overriding symbol has a different name.
1269 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1270 all callers. If we give an error about an undefined version,
1271 define the base version if necessary.
1272 * dynobj.h (class Versions): Update declaration.
1273 * testsuite/weak_alias_test_5.cc: New file.
1274 * testsuite/weak_alias_test.script: New file.
1275 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1276 and versioned_alias have the right value, and call t2.
1277 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1278 weak_alias_test_5.so.
1279 (weak_alias_test_LDADD): Likewise.
1280 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1281 * testsuite/Makefile.in: Rebuild.
1282
1283 2011-07-01 Ian Lance Taylor <iant@google.com>
1284
1285 PR gold/12525
1286 * options.h (class General_options): Support -z notext.
1287 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1288 -Wl,-z,notext.
1289 (two_file_shared_nonpic.so): Likewise.
1290 (two_file_shared_mixed.so): Likewise.
1291 (two_file_shared_mixed_1.so): Likewise.
1292 (weak_undef_lib_nonpic.so): Likewise.
1293 (alt/weak_undef_lib_nonpic.so): Likewise.
1294 (tls_test_shared_nonpic.so): Likewise.
1295 * testsuite/Makefile.in: Rebuild.
1296
1297 2011-07-01 Ian Lance Taylor <iant@google.com>
1298
1299 PR gold/12525
1300 * configure.ac: Test whether static linking works, setting
1301 the automake conditional HAVE_STATIC.
1302 * testsuite/Makefile.am: Disable tests using -static if
1303 HAVE_STATIC is not true.
1304 * configure, testsuite/Makefile.in: Rebuild.
1305
1306 2011-07-01 Ian Lance Taylor <iant@google.com>
1307
1308 PR gold/12525
1309 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1310 Assert if we see DW_EH_PE_indirect.
1311 * target.h (Target::ehframe_datarel_base): New function.
1312 (Target::do_ehframe_datarel_base): New target function.
1313 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1314 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1315 function.
1316
1317 2011-07-01 Ian Lance Taylor <iant@google.com>
1318
1319 PR gold/12571
1320 * options.h (class General_options): Add
1321 --ld-generated-unwind-info.
1322 * ehframe.cc (Fde::write): Add address parameter. Change all
1323 callers. If associated with PLT, fill in address and size.
1324 (Cie::set_output_offset): Only add merge mapping if there is an
1325 object.
1326 (Cie::write): Add address parameter. Change all callers.
1327 (Eh_frame::add_ehframe_for_plt): New function.
1328 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1329 input_offset_ fields into union u_, with new plt field.
1330 (Fde::Fde): Adjust for new union field.
1331 (Fde::Fde) [Output_data version]: New constructor.
1332 (Fde::add_mapping): Only add merge mapping if there is an object.
1333 (class Cie): Update declarations.
1334 (class Eh_frame): Declare add_ehframe_for_plt.
1335 * layout.cc (Layout::layout_eh_frame): Break out code into
1336 make_eh_frame_section, and call it.
1337 (Layout::make_eh_frame_section): New function.
1338 (Layout::add_eh_frame_for_plt): New function.
1339 * layout.h (class Layout): Update declarations.
1340 * merge.cc (Merge_map::add_mapping): Add assertion.
1341 * i386.cc: Include "dwarf.h".
1342 (class Output_data_plt_i386): Make first_plt_entry,
1343 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1344 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1345 and plt_eh_frame_fde.
1346 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1347 boundary. Call add_eh_frame_for_plt if appropriate.
1348 * x86_64.cc: Include "dwarf.h".
1349 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1350 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1351 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1352 and plt_eh_frame_fde.
1353 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1354 appropriate.
1355
1356 2011-06-29 Ian Lance Taylor <iant@google.com>
1357
1358 PR gold/12629
1359 * object.cc (Sized_relobj_file::layout_section): Change shdr
1360 parameter to be const.
1361 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1362 out of do_layout.
1363 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1364 appropriate. Call layout_eh_frame_section.
1365 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1366 sections.
1367 * object.h (class Sized_relobj_file): Update declarations.
1368
1369 2011-06-29 Ian Lance Taylor <iant@google.com>
1370
1371 PR gold/12652
1372 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1373 modifier.
1374 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1375
1376 2011-06-29 Ian Lance Taylor <iant@google.com>
1377
1378 PR gold/12675
1379 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1380 SHT_X86_64_UNWIND.
1381 * layout.cc (Layout::layout_eh_frame): Likewise.
1382
1383 2011-06-29 Ian Lance Taylor <iant@google.com>
1384
1385 PR gold/12695
1386 * layout.cc (Layout::symtab_section_shndx): New function.
1387 * layout.h (class Layout): Declare symtab_section_shndx.
1388 * output.cc (Output_section::write_header): Call it.
1389
1390 2011-06-29 Ian Lance Taylor <iant@google.com>
1391
1392 PR gold/12818
1393 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1394 symbols which are not used in a relocation.
1395
1396 2011-06-28 Ian Lance Taylor <iant@google.com>
1397
1398 PR gold/12898
1399 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1400 script create indistinguishable segments.
1401 (Layout::set_segment_offsets): Use stable_sort when sorting
1402 segments. Pass this to Compare_segments constructor.
1403 * layout.h (class Layout): Make segment_precedes non-static.
1404 (class Compare_segments): Change from struct to class. Add
1405 layout_ field. Add constructor.
1406 * script-sections.cc
1407 (Script_sections::attach_sections_using_phdrs_clause): Rename
1408 local orphan to is_orphan. Don't report failure to put empty
1409 section in segment. On attachment failure, report name of
1410 section, and attach to first PT_LOAD segment.
1411
1412 2011-06-28 Ian Lance Taylor <iant@google.com>
1413
1414 PR gold/12934
1415 * target-select.cc (Target_selector::Target_selector): Add
1416 emulation parameter. Change all callers.
1417 (select_target_by_bfd_name): Rename from select_target_by_name.
1418 Change all callers.
1419 (select_target_by_emulation): New function.
1420 (supported_emulation_names): New function.
1421 * target-select.h (class Target_selector): Add emulation_ field.
1422 Update declarations.
1423 (Target_selector::recognize_by_bfd_name): Rename from
1424 recognize_by_name. Change all callers.
1425 (Target_selector::supported_bfd_names): Rename from
1426 supported_names. Change all callers.
1427 (Target_selector::recognize_by_emulation): New function.
1428 (Target_selector::supported_emulations): New function.
1429 (Target_selector::emulation): New function.
1430 (Target_selector::do_recognize_by_bfd_name): Rename from
1431 do_recognize_by_name. Change all callers.
1432 (Target_selector::do_supported_bfd_names): Rename from
1433 do_supported_names. Change all callers.
1434 (Target_selector::do_recognize_by_emulation): New function.
1435 (Target_selector::do_supported_emulations): New function.
1436 (select_target_by_bfd_name): Change name in declaration.
1437 (select_target_by_emulation): Declare.
1438 (supported_emulation_names): Declare.
1439 * parameters.cc (parameters_force_valid_target): Try to find
1440 target based on emulation from -m option.
1441 * options.h (class General_options): Change doc string for -m.
1442 * options.cc (help): Print emulations.
1443 (General_options::parse_V): Likewise.
1444 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1445 Add emulation parameter. Change all callers.
1446
1447 2011-06-28 Ian Lance Taylor <iant@google.com>
1448
1449 * target.h (class Target): Add osabi_ field.
1450 (Target::osabi): New function.
1451 (Target::set_osabi): New function.
1452 (Target::Target): Initialize osabi_.
1453 (Target::do_adjust_elf_header): Make pure virtual.
1454 (Sized_target::do_adjust_elf_header): Declare.
1455 * target.cc (Sized_target::do_adjust_elf_header): New function.
1456 (class Sized_target): Instantiate all versions.
1457 * freebsd.h (class Target_freebsd): Remove.
1458 (Target_selector_freebsd::do_recognize): Call set_osabi on
1459 Target.
1460 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1461 (Target_selector_freebsd::set_osabi): Remove.
1462 * i386.cc (class Target_i386): Inherit from Sized_target rather
1463 than Target_freebsd.
1464 * x86_64.cc (class Target_x86_64): Likewise.
1465
1466 2011-06-28 Ian Lance Taylor <iant@google.com>
1467
1468 * target.h (Target::can_check_for_function_pointers): Rewrite.
1469 Make non-virtual.
1470 (Target::can_icf_inline_merge_sections): Likewise.
1471 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1472 (Target::Target_info): Add can_icf_inline_merge_sections field.
1473 (Target::do_can_check_for_function_pointers): New virtual
1474 function.
1475 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1476 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1477 from can_check_for_function_pointers, move in file.
1478 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1479 section_may_have_icf_unsafe_poineters, move in file.
1480 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1481 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1482 Rename from can_check_for_function_pointers, move in file.
1483 (Target_i386::can_icf_inline_merge_sections): Remove.
1484 (Target_i386::i386_info): Initialize
1485 can_icf_inline_merge_sections.
1486 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1487 Initialize can_icf_inline_merge_sections.
1488 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1489 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1490 Rename from can_check_for_function_pointers, move in file.
1491 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1492 (Target_x86_64::x86_64_info): Initialize
1493 can_icf_inline_merge_sections.
1494 * testsuite/testfile.cc (Target_test::test_target_info):
1495 Likewise.
1496 * icf.cc (get_section_contents): Correct formatting.
1497
1498 2011-06-27 Ian Lance Taylor <iant@google.com>
1499
1500 * symtab.cc (Symbol::versioned_name): New function.
1501 (Symbol_table::add_to_final_symtab): Use versioned_name when
1502 appropriate.
1503 (Symbol_table::sized_write_symbol): Likewise.
1504 * symtab.h (class Symbol): Declare versioned_name.
1505 * stringpool.h (class Stringpool_template): Add variant of add
1506 which takes a std::basic_string.
1507 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1508 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1509 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1510 (ver_test_12.o): New target.
1511 * testsuite/Makefile.in: Rebuild.
1512
1513 2011-06-27 Doug Kwan <dougkwan@google.com>
1514
1515 * arm.cc (Arm_relocate_functions::thm_jump8,
1516 Arm_relocate_functions::thm_jump11): Use a wider signed
1517 type to compute offset.
1518 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1519 arm_thm_jump8.
1520 * testsuite/Makefile.in: Regenerate.
1521 * testsuite/arm_branch_in_range.sh: Check test results of
1522 arm_thm_jump11 and arm_thm_jump8.
1523 * testsuite/arm_thm_jump11.s: New test source file.
1524 * testsuite/arm_thm_jump11.t: New linker script.
1525 * testsuite/arm_thm_jump8.s: New test source file.
1526 * testsuite/arm_thm_jump8.t: New linker script.
1527
1528 2011-06-24 Ian Lance Taylor <iant@google.com>
1529
1530 * layout.cc: Include "object.h".
1531 (ctors_sections_in_init_array): New static variable.
1532 (Layout::is_ctors_in_init_array): New function.
1533 (Layout::layout): Add entry to ctors_sections_in_init_array if
1534 appropriate.
1535 * layout.h (class Layout): Declare is_ctors_in_init_array.
1536 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1537 is_ctors_reverse_view is set.
1538 (Sized_relobj_file::write_sections): Add layout parameter. Change
1539 all callers. Set is_ctors_reverse_view field of View_size.
1540 (Sized_relobj_file::reverse_words): New function.
1541 * object.h (Sized_relobj_file::View_size): Add
1542 is_ctors_reverse_view field.
1543 (class Sized_relobj_file): Update declarations.
1544 * testsuite/initpri3.c: New test.
1545 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1546 initpri3b.
1547 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1548 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1549 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1550 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1551 * testsuite/Makefile.in: Rebuild.
1552
1553 2011-06-24 Cary Coutant <ccoutant@google.com>
1554
1555 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1556 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1557 (debug_msg_cdebug.err): New targets.
1558 * testsuite/Makefile.in: Regenerate.
1559 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1560 Fix checks for link with shared library.
1561
1562 2011-06-24 Doug Kwan <dougkwan@google.com>
1563
1564 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1565 skip empty text sections.
1566 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1567
1568 2011-06-22 Ian Lance Taylor <iant@google.com>
1569
1570 PR gold/12910
1571 * options.h (class General_options): Add --ctors-in-init-array.
1572 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1573 friends as SHT_PROGBITS for merging sections.
1574 (Layout::layout): Remove special handling of .init_array and
1575 friends. Don't sort if doing relocatable link. Sort for .ctors
1576 and .dtors if ctors_in_init_array.
1577 (Layout::make_output_section): Force correct section types for
1578 .init_array and friends. Don't sort if doing relocatable link,
1579 Don't sort .ctors and .dtors if ctors_in_init_array.
1580 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1581 (Layout::output_section_name): Add relobj parameter. Change all
1582 callers. Handle .ctors. and .dtors. in code rather than table.
1583 Handle .ctors and .dtors if ctors_in_init_array.
1584 (Layout::match_file_name): New function, moved from output.cc.
1585 * layout.h (class Layout): Update declarations.
1586 * output.cc: Include "layout.h".
1587 (Input_section_sort_entry::get_priority): New function.
1588 (Input_section_sort_entry::match_file_name): Just call
1589 Layout::match_file_name.
1590 (Output_section::Input_section_sort_init_fini_compare::operator()):
1591 Handle .ctors and .dtors. Sort by explicit priority rather than
1592 by name.
1593 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1594 * testsuite/initpri2.c: New test.
1595 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1596 (check_PROGRAMS): Add initpri2.
1597 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1598 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1599 * configure, testsuite/Makefile.in: Rebuild.
1600
1601 2011-06-19 Ian Lance Taylor <iant@google.com>
1602
1603 PR gold/12880
1604 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1605 .interp section to a PT_INTERP segment even if we have seen a
1606 --dynamic-linker option. Don't do it if we have seen a PHDRS
1607 clause in a linker script.
1608 (Layout::finalize): Don't create a .interp section if we've
1609 already create a PT_INTERP segment.
1610 (Layout::create_interp): Always call choose_output_section (revert
1611 patch of 2011-06-17). Don't create PT_INTERP segment.
1612 * script-sections.cc
1613 (Script_sections::create_note_and_tls_segments): Add a .interp
1614 section to a PT_INTERP segment even if we have seen a
1615 --dynamic-linker option.
1616
1617 2011-06-18 Ian Lance Taylor <iant@google.com>
1618
1619 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1620 merely because a non-PT_LOAD segment has a dynamic reloc.
1621
1622 2011-06-18 Ian Lance Taylor <iant@google.com>
1623
1624 * layout.cc (Layout::finish_dynamic_section): Don't create
1625 DT_FLAGS entry if not needed.
1626
1627 2011-06-18 Ian Lance Taylor <iant@google.com>
1628
1629 PR gold/12745
1630 * layout.cc (Layout::layout_eh_frame): Correct handling of
1631 writable .eh_frame section.
1632
1633 2011-06-17 Ian Lance Taylor <iant@google.com>
1634
1635 PR gold/12893
1636 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1637 symbol is redefined with the exact same object and value.
1638
1639 2011-06-17 Ian Lance Taylor <iant@google.com>
1640
1641 PR gold/12880
1642 * layout.h (class Layout): Add interp_segment_ field.
1643 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1644 (Layout::attach_allocated_section_to_segment): If making shared
1645 library, put .interp section in PT_INTERP segment.
1646 (Layout::finalize): Also call create_interp if -dynamic-linker
1647 option was used.
1648 (Layout::create_interp): Assert that there is no PT_INTERP
1649 segment. If not using a SECTIONS clause, use make_output_section.
1650 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1651 * script-sections.cc
1652 (Script_sections::create_note_and_tls_segments): If making shared
1653 library, put .interp section in PT_INTERP segment.
1654
1655 2011-06-17 Ian Lance Taylor <iant@google.com>
1656
1657 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1658 when making a shared library.
1659
1660 2011-06-17 Ian Lance Taylor <iant@google.com>
1661
1662 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1663 parameter. Change all callers. Don't issue warning about PC32
1664 against locally defined symbol.
1665
1666 2011-06-16 Ian Lance Taylor <iant@google.com>
1667
1668 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1669 occurs in same object.
1670
1671 2011-06-14 Alan Modra <amodra@gmail.com>
1672
1673 * po/POTFILES.in: Regenerate.
1674
1675 2011-06-09 Ian Lance Taylor <iant@google.com>
1676
1677 * script-sections.cc
1678 (Orphan_output_section::set_section_addresses): For a relocatable
1679 link set address to 0.
1680
1681 2011-06-09 Cary Coutant <ccoutant@google.com>
1682
1683 PR gold/12804
1684 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1685 used with --compress-debug-sections.
1686 * gold/object.cc (Sized_relobj_file::do_layout): Report
1687 uncompressed size of compressed input sections.
1688
1689 2011-06-08 Cary Coutant <ccoutant@google.com>
1690
1691 PR gold/12804
1692 * testsuite/two_file_test_2_v1.cc: Change initialization of
1693 v2 to keep it in .data.
1694
1695 2011-06-07 Cary Coutant <ccoutant@google.com>
1696
1697 * common.cc (Symbol_table::do_allocate_commons_list): Call
1698 gold_fallback.
1699 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1700 (Errors::fallback): New function.
1701 (gold_fallback): New function.
1702 * errors.h (Errors::fallback): New function.
1703 * gold.cc (gold_exit): Change status parameter to enum; adjust
1704 all callers.
1705 (queue_initial_tasks): Call gold_fallback.
1706 * gold.h: Include cstdlib.
1707 (Exit_status): New enum type.
1708 (gold_exit): Change status parameter to enum.
1709 (gold_fallback): New function.
1710 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1711 (Layout::create_symtab_sections): Likewise.
1712 (Layout::create_shdrs): Likewise.
1713 * main.cc (main): Adjust call to gold_exit.
1714 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1715 (Output_data_got::add_got_entry_pair): Likewise.
1716 (Output_section::add_input_section): Likewise.
1717 (Output_section::add_output_section_data): Likewise.
1718 (Output_segment::set_section_list_addresses): Likewise.
1719 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1720
1721 2011-06-07 Cary Coutant <ccoutant@google.com>
1722
1723 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1724 for incremental links.
1725 * output.cc (Output_segment::set_section_list_addresses): Remove
1726 FIXME and test for TLS or BSS.
1727
1728 2011-06-07 Cary Coutant <ccoutant@google.com>
1729
1730 * testsuite/Makefile.am: Add incremental_copy_test,
1731 incremental_common_test_1.
1732 * testsuite/Makefile.in: Regenerate.
1733 * testsuite/common_test_1_v1.c: New source file.
1734 * testsuite/common_test_1_v2.c: New source file.
1735 * testsuite/copy_test_v1.cc: New source file.
1736
1737 2011-06-07 Cary Coutant <ccoutant@google.com>
1738
1739 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1740 update, allocate common from bss section's free list.
1741 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1742 linker-defined symbols.
1743 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1744 Skip GOT and PLT entries that are no longer referenced.
1745 (Output_section_incremental_inputs::write_info_blocks): Mark
1746 linker-defined symbols.
1747 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1748 * output.cc (Output_section::allocate): New function.
1749 * output.h (Output_section::allocate): New function.
1750 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1751 linker-defined symbols.
1752 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1753 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1754 (Symbol::init_base_output_data): Likewise.
1755 (Symbol::init_base_output_segment): Likewise.
1756 (Symbol::init_base_constant): Likewise.
1757 (Sized_symbol::init_output_data): Likewise.
1758 (Sized_symbol::init_output_segment): Likewise.
1759 (Sized_symbol::init_constant): Likewise.
1760 (Symbol_table::do_define_in_output_data): Likewise.
1761 (Symbol_table::do_define_in_output_segment): Likewise.
1762 (Symbol_table::do_define_as_constant): Likewise.
1763 * symtab.h (Symbol::is_predefined): New function.
1764 (Symbol::init_base_output_data): Add is_predefined parameter.
1765 (Symbol::init_base_output_segment): Likewise.
1766 (Symbol::init_base_constant): Likewise.
1767 (Symbol::is_predefined_): New data member.
1768 (Sized_symbol::init_output_data): Add is_predefined parameter.
1769 (Sized_symbol::init_output_segment): Likewise.
1770 (Sized_symbol::init_constant): Likewise.
1771 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1772
1773 2011-06-07 Cary Coutant <ccoutant@google.com>
1774
1775 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1776 instead of emit_copy_reloc.
1777 (Copy_relocs::emit_copy_reloc): Refactor.
1778 (Copy_relocs::make_copy_reloc): New function.
1779 (Copy_relocs::add_copy_reloc): Remove.
1780 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1781 section.
1782 (Copy_relocs::make_copy_reloc): New function.
1783 (Copy_relocs::add_copy_reloc): Remove.
1784 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1785 unchanged input files.
1786 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1787 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1788 Reserve BSS space for COPY relocations.
1789 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1790 (Output_section_incremental_inputs::write_info_blocks): Record
1791 whether a symbol is copied from a shared object.
1792 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1793 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1794 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1795 (Incremental_input_entry_reader::get_output_symbol_index): Add
1796 is_copy parameter.
1797 (Incremental_binary::emit_copy_relocs): New function.
1798 (Incremental_binary::do_emit_copy_relocs): New function.
1799 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1800 new data member.
1801 (Sized_incremental_binary::add_copy_reloc): New function.
1802 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1803 (Sized_incremental_binary::Copy_reloc): New struct.
1804 (Sized_incremental_binary::Copy_relocs): New typedef.
1805 (Sized_incremental_binary::copy_relocs_): New data member.
1806 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1807 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1808 * target.h (Sized_target::emit_copy_reloc): New function.
1809 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1810
1811 2011-06-02 Cary Coutant <ccoutant@google.com>
1812
1813 PR gold/12163
1814 * gold/archive.cc (Archive::Archive): Initialize new data member.
1815 (Archive::include_all_members): Return if archive has already been
1816 included.
1817 * gold/archive.h (Archive::include_all_members_): New data member.
1818
1819 2011-06-02 Nick Clifton <nickc@redhat.com>
1820
1821 * dynobj.h: Fix spelling mistake in comment.
1822 * output.cc: Likewise.
1823
1824 2011-05-31 Doug Kwan <dougkwan@google.com>
1825 Asier Llano
1826
1827 PR gold/12826
1828 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
1829 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1830 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1831 redundant arm_exidx_test.so.
1832 * testsuite/Makefile.in: Regenerate.
1833 (check_SCRIPTS): Add pr12826.sh
1834 (check_DATA): Add pr12826.stdout
1835 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1836 * testsuite/pr12826.sh: New file.
1837 * testsuite/pr12826_1.s: Ditto.
1838 * testsuite/pr12826_1.s: Ditto.
1839
1840 2011-05-30 Ian Lance Taylor <iant@google.com>
1841
1842 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1843 sections.
1844
1845 2011-05-29 Ian Lance Taylor <iant@google.com>
1846
1847 PR gold/12804
1848 * testsuite/Makefile.am: Use different file name for two_file_test
1849 temporary file for each incremental test.
1850 * testsuite/Makefile.in: Rebuild.
1851
1852 2011-05-29 Ian Lance Taylor <iant@google.com>
1853
1854 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1855 binary input file is empty.
1856
1857 2011-05-27 Ian Lance Taylor <iant@google.com>
1858
1859 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1860 (ver_test_9.so): Likewise.
1861 * testsuite/Makefile.in: Rebuild.
1862
1863 2011-05-26 Cary Coutant <ccoutant@google.com>
1864
1865 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1866 * incremental.cc (Incremental_inputs::report_input_section): Fix
1867 comment, indentation.
1868 (Incremental_inputs::report_comdat_group): New function.
1869 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1870 of data for incremental input file entry.
1871 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1872 group count, COMDAT group signatures.
1873 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1874 an unchanged input file.
1875 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1876 Initialize new data member.
1877 (Incremental_object_entry::add_comdat_group): New function.
1878 (Incremental_object_entry::get_comdat_group_count): New function.
1879 (Incremental_object_entry::get_comdat_signature_key): New function.
1880 (Incremental_object_entry::groups_): New data member.
1881 (Incremental_inputs::report_comdat_group): New function.
1882 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1883 data for incremental input file entry.
1884 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1885 (Incremental_input_entry_reader::get_input_section): Adjust size of
1886 data for incremental input file entry.
1887 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1888 (Incremental_input_entry_reader::get_comdat_group_signature): New
1889 function.
1890 * object.cc (Sized_relobj::include_section_group): Report kept
1891 COMDAT groups for incremental links.
1892
1893 2011-05-24 David Meyer <pdox@google.com>
1894
1895 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1896 with name parameter. Add found_name parameter.
1897 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1898 * dirsearch.h (class Dirsearch): Update declaration.
1899
1900 2011-05-24 Ian Lance Taylor <iant@google.com>
1901
1902 * archive.cc (Library_base::should_include_member): Pull in object
1903 from archive if it defines the entry symbol.
1904 * parameters.cc (Parameters::entry): New function.
1905 * parameters.h (class Parameters): Declare entry.
1906 * output.h (class Output_file_header): Remove entry_ field.
1907 * output.cc (Output_file_header::Output_file_header): Remove entry
1908 parameter. Change all callers.
1909 (Output_file_header::entry): Use parameters->entry.
1910 * gold.cc (queue_middle_tasks): Likewise.
1911 * plugin.cc (Plugin_hook::run): Likewise.
1912
1913 2011-05-24 Cary Coutant <ccoutant@google.com>
1914
1915 * gold.cc (queue_initial_tasks): Pass incremental base filename
1916 to Output_file::open_base_file; don't print error message.
1917 * incremental-dump.cc (main): Adjust call to
1918 Output_file::open_for_modification.
1919 * incremental-dump.cc (main): Likewise.
1920 * incremental.cc (Incremental_inputs::report_command_line):
1921 Ignore --incremental-base option when comparing command lines.
1922 Ignore parameter when given as separate argument.
1923 * options.h (class General_options): Add --incremental-base.
1924 * output.cc (Output_file::Output_file):
1925 (Output_file::open_base_file): Add base_name and writable parameters;
1926 read base file into new file; print error message here.
1927 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1928 callers.
1929 * output.h (Output_file::open_for_modification): Rename to...
1930 (Output_file::open_base_file): ...this; add base_name and
1931 writable parameters; adjust all callers.
1932 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1933 callers.
1934 * testsuite/Makefile.am (incremental_test_4): Test
1935 --incremental-base.
1936 * testsuite/Makefile.in: Regenerate.
1937
1938 2011-05-24 Cary Coutant <ccoutant@google.com>
1939
1940 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1941 incremental_test_4.
1942 * testsuite/Makefile.in: Regenerate.
1943 * testsuite/two_file_test_1_v1.cc: New test source file.
1944 * testsuite/two_file_test_1b_v1.cc: New test source file.
1945 * testsuite/two_file_test_2_v1.cc: New test source file.
1946
1947 2011-05-24 Cary Coutant <ccoutant@google.com>
1948
1949 * dynobj.h (Dynobj::do_dynobj): New function.
1950 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1951 flag and soname for shared objects.
1952 * incremental.cc (Incremental_inputs::report_object): Make
1953 either Incremental_object_entry or Incremental_dynobj_entry; add
1954 soname to string table.
1955 (Incremental_inputs::report_input_section): Add assertion.
1956 (Output_section_incremental_inputs::set_final_data_size): Adjust
1957 type of input file entry for shared libraries; adjust size of
1958 shared library info entry.
1959 (Output_section_incremental_inputs::write_input_files): Write
1960 as_needed flag for shared libraries.
1961 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1962 of input file entry for shared libraries; write soname.
1963 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1964 soname from incremental info.
1965 * incremental.h (enum Incremental_input_flags): Add
1966 INCREMENTAL_INPUT_AS_NEEDED.
1967 (Incremental_input_entry::Incremental_input_entry): Initialize new
1968 data member.
1969 (Incremental_input_entry::set_as_needed): New function.
1970 (Incremental_input_entry::as_needed): New function.
1971 (Incremental_input_entry::do_dynobj_entry): New function.
1972 (Incremental_input_entry::as_needed_): New data member.
1973 (Incremental_object_entry::Incremental_object_entry): Don't check
1974 for shared library.
1975 (Incremental_object_entry::do_type): Likewise.
1976 (class Incremental_dynobj_entry): New class.
1977 (Incremental_input_entry_reader::as_needed): New function.
1978 (Incremental_input_entry_reader::get_soname): New function.
1979 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1980 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1981 size of shared library info entry.
1982 * layout.cc (Layout::finish_dynamic_section): Don't test for
1983 incremental link when adding DT_NEEDED entries.
1984 * object.h (Object::Object): Initialize new data member.
1985 (Object::dynobj): New function.
1986 (Object::set_as_needed): New function.
1987 (Object::as_needed): New function.
1988 (Object::do_dynobj): New function.
1989 (Object::as_needed_): New data member.
1990
1991 2011-05-24 Cary Coutant <ccoutant@google.com>
1992
1993 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1994 info; adjust display of GOT entries.
1995 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1996 vector of input objects; remove file_status_.
1997 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1998 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1999 got_plt reader; call target hooks to reserve GOT entries.
2000 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2001 of input file info header and GOT info entry.
2002 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2003 relocation info.
2004 (Got_plt_view_info::got_descriptor): Remove.
2005 (Got_plt_view_info::sym_index): New data member.
2006 (Got_plt_view_info::input_index): New data member.
2007 (Local_got_offset_visitor::visit): Write input file index.
2008 (Global_got_offset_visitor::visit): Write 0 for input file index.
2009 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2010 with sym_index and input_index.
2011 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2012 incremental info GOT entry; replace got_descriptor with input_index.
2013 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2014 map from input file index to object.
2015 (Sized_relobj_incr::do_layout): Replace direct data member reference
2016 with accessor function.
2017 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2018 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2019 Adjust size of input file info header.
2020 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2021 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2022 (Incremental_input_entry_reader::get_input_section): Adjust size of
2023 input file info header.
2024 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2025 of incremental info GOT entry.
2026 (Incremental_got_plt_reader::get_got_desc): Remove.
2027 (Incremental_got_plt_reader::get_got_symndx): New function.
2028 (Incremental_got_plt_reader::get_got_input_index): New function.
2029 (Sized_incremental_binary::Sized_incremental_binary): Remove
2030 file_status_; add input_objects_.
2031 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2032 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2033 (Sized_incremental_binary::file_is_unchanged): Remove.
2034 (Sized_incremental_binary::set_input_object): New function.
2035 (Sized_incremental_binary::input_object): New function.
2036 (Sized_incremental_binary::file_status_): Remove.
2037 (Sized_incremental_binary::input_objects_): New data member.
2038 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2039 references.
2040 (Sized_relobj_incr::invalid_address): Move to base class.
2041 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2042 class.
2043 (Sized_relobj_incr::do_output_section_offset): Likewise.
2044 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2045 (Sized_relobj_incr::section_offsets_): Likewise.
2046 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2047 function.
2048 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2049 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2050 with accessor function.
2051 (Sized_relobj_file::do_layout): Likewise.
2052 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2053 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2054 (Sized_relobj_file::compute_final_local_value): Replace refs to
2055 section_offsets_ with accessor function.
2056 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2057 * object.h (Relobj::Relobj): Initialize new data members.
2058 (Relobj::add_dyn_reloc): New function.
2059 (Relobj::first_dyn_reloc): New function.
2060 (Relobj::dyn_reloc_count): New function.
2061 (Relobj::first_dyn_reloc_): New data member.
2062 (Relobj::dyn_reloc_count_): New data member.
2063 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2064 references.
2065 (Sized_relobj::Address): New typedef.
2066 (Sized_relobj::invalid_address): Move here from child class.
2067 (Sized_relobj::Sized_relobj): Initialize new data members.
2068 (Sized_relobj::sized_relobj): New function.
2069 (Sized_relobj::is_output_section_offset_invalid): Move here from
2070 child class.
2071 (Sized_relobj::get_output_section_offset): Likewise.
2072 (Sized_relobj::local_has_got_offset): Likewise.
2073 (Sized_relobj::local_got_offset): Likewise.
2074 (Sized_relobj::set_local_got_offset): Likewise.
2075 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2076 (Sized_relobj::clear_got_offsets): New function.
2077 (Sized_relobj::section_offsets): Move here from child class.
2078 (Sized_relobj::do_output_section_offset): Likewise.
2079 (Sized_relobj::do_set_section_offset): Likewise.
2080 (Sized_relobj::Local_got_offsets): Likewise.
2081 (Sized_relobj::local_got_offsets_): Likewise.
2082 (Sized_relobj::section_offsets_): Likewise.
2083 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2084 references.
2085 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2086 class.
2087 (Sized_relobj_file::sized_relobj): New function
2088 (Sized_relobj_file::local_has_got_offset): Move to base class.
2089 (Sized_relobj_file::local_got_offset): Likewise.
2090 (Sized_relobj_file::set_local_got_offset): Likewise.
2091 (Sized_relobj_file::get_output_section_offset): Likewise.
2092 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2093 (Sized_relobj_file::do_output_section_offset): Likewise.
2094 (Sized_relobj_file::do_set_section_offset): Likewise.
2095 (Sized_relobj_file::Local_got_offsets): Likewise.
2096 (Sized_relobj_file::local_got_offsets_): Likewise.
2097 (Sized_relobj_file::section_offsets_): Likewise.
2098 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2099 (all constructors).
2100 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2101 (Output_reloc::get_symbol_index): Likewise.
2102 (Output_reloc::local_section_offset): Likewise.
2103 (Output_reloc::get_address): Likewise.
2104 (Output_reloc::symbol_value): Likewise.
2105 (Output_data_got::reserve_slot): Move to class definition.
2106 (Output_data_got::reserve_local): New function.
2107 (Output_data_got::reserve_slot_for_global): Remove.
2108 (Output_data_got::reserve_global): New function.
2109 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2110 (all constructors, two instantiations).
2111 (Output_reloc::get_relobj): New function (two instantiations).
2112 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2113 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2114 (Output_data_reloc::add_global): Adjust type of relobj.
2115 (Output_data_reloc::add_global_relative): Likewise.
2116 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2117 (Output_data_reloc::add_local): Likewise.
2118 (Output_data_reloc::add_local_relative): Likewise.
2119 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2120 (Output_data_reloc::add_local_section): Likewise.
2121 (Output_data_reloc::add_output_section): Likewise.
2122 (Output_data_reloc::add_absolute): Likewise.
2123 (Output_data_reloc::add_target_specific): Likewise.
2124 (Output_data_got::reserve_slot): Move definition here.
2125 (Output_data_got::reserve_local): New function.
2126 (Output_data_got::reserve_global): New function.
2127 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2128 section_offsets_ with accessor function.
2129 (Sized_relobj_file::write_sections): Likewise.
2130 (Sized_relobj_file::do_relocate_sections): Likewise.
2131 * target.h (Sized_target::reserve_local_got_entry): New function.
2132 (Sized_target::reserve_global_got_entry): New function.
2133 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2134 (Target_x86_64::reserve_global_got_entry): New function.
2135 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2136
2137 2011-05-23 Cary Coutant <ccoutant@google.com>
2138
2139 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2140 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2141 bit when checking got_type.
2142 * incremental.cc (Sized_incremental_binary::setup_readers):
2143 Store symbol table and string table locations; initialize bit vector
2144 of file status flags.
2145 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2146 unchanged files.
2147 (Sized_incremental_binary::do_process_got_plt): New function.
2148 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2149 (Output_section_incremental_inputs::set_final_data_size): Record
2150 file index for each input file.
2151 (Output_section_incremental_inputs::write_got_plt): Store file index
2152 instead of input entry offset for each GOT entry.
2153 * incremental.h
2154 (Incremental_input_entry::Incremental_input_entry): Initialize new
2155 data member.
2156 (Incremental_input_entry::set_offset): Store file index.
2157 (Incremental_input_entry::get_file_index): New function.
2158 (Incremental_input_entry::file_index_): New data member.
2159 (Incremental_binary::process_got_plt): New function.
2160 (Incremental_binary::do_process_got_plt): New function.
2161 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2162 data members.
2163 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2164 (Sized_incremental_binary::set_file_is_unchanged): New function.
2165 (Sized_incremental_binary::file_is_unchanged): New function.
2166 (Sized_incremental_binary::do_process_got_plt): New function.
2167 (Sized_incremental_binary::file_status_): New data member.
2168 (Sized_incremental_binary::main_symtab_loc_): New data member.
2169 (Sized_incremental_binary::main_strtab_loc_): New data member.
2170 * output.cc (Output_data_got::Got_entry::write): Add case
2171 RESERVED_CODE.
2172 (Output_data_got::add_global): Call add_got_entry.
2173 (Output_data_got::add_global_plt): Likewise.
2174 (Output_data_got::add_global_with_rel): Likewise.
2175 (Output_data_got::add_global_with_rela): Likewise.
2176 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2177 (Output_data_got::add_global_pair_with_rela): Likewise.
2178 (Output_data_got::add_local): Call add_got_entry.
2179 (Output_data_got::add_local_plt): Likewise.
2180 (Output_data_got::add_local_with_rel): Likewise.
2181 (Output_data_got::add_local_with_rela): Likewise.
2182 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2183 (Output_data_got::add_local_pair_with_rela): Likewise.
2184 (Output_data_got::reserve_slot): New function.
2185 (Output_data_got::reserve_slot_for_global): New function.
2186 (Output_data_got::add_got_entry): New function.
2187 (Output_data_got::add_got_entry_pair): New function.
2188 (Output_section::add_output_section_data): Edit FIXME.
2189 * output.h
2190 (Output_section_data_build::Output_section_data_build): New
2191 constructor with size parameter.
2192 (Output_data_space::Output_data_space): Likewise.
2193 (Output_data_got::Output_data_got): Initialize new data member; new
2194 constructor with size parameter.
2195 (Output_data_got::add_constant): Call add_got_entry.
2196 (Output_data_got::reserve_slot): New function.
2197 (Output_data_got::reserve_slot_for_global): New function.
2198 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2199 (Output_data_got::add_got_entry): New function.
2200 (Output_data_got::add_got_entry_pair): New function.
2201 (Output_data_got::free_list_): New data member.
2202 * target.h (Sized_target::init_got_plt_for_update): New function.
2203 (Sized_target::register_global_plt_entry): New function.
2204 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2205 Initialize new data member; call init; add constructor with PLT count.
2206 (Output_data_plt_x86_64::init): New function.
2207 (Output_data_plt_x86_64::add_relocation): New function.
2208 (Output_data_plt_x86_64::reserve_slot): New function.
2209 (Output_data_plt_x86_64::free_list_): New data member.
2210 (Target_x86_64::init_got_plt_for_update): New function.
2211 (Target_x86_64::register_global_plt_entry): New function.
2212 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2213 incremental updates.
2214 (Output_data_plt_x86_64::add_relocation): New function.
2215 * testsuite/object_unittest.cc (Object_test): Set default options.
2216
2217 2011-05-16 Ian Lance Taylor <iant@google.com>
2218
2219 * options.h (class General_options): Make -i a synonym for -r.
2220
2221 2011-05-16 Ian Lance Taylor <iant@google.com>
2222
2223 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2224
2225 2011-05-10 Cary Coutant <ccoutant@google.com>
2226
2227 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2228 strip_all (-s).
2229
2230 2011-05-06 Ian Lance Taylor <iant@google.com>
2231
2232 * layout.cc (Layout::layout): If the output section flags change,
2233 update the ordering.
2234
2235 2011-04-25 Cary Coutant <ccoutant@google.com>
2236
2237 * incremental-dump.cc (dump_incremental_inputs): Print local
2238 symbol info for each input file.
2239 * incremental.cc
2240 (Output_section_incremental_inputs::set_final_data_size): Add local
2241 symbol info to input file entries in incremental info.
2242 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2243 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2244 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2245 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2246 implementation.
2247 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2248 (Sized_incr_relobj::do_relocate): Write the local symbols.
2249 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2250 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2251 Adjust size of input file header.
2252 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2253 (Incremental_inputs_reader::get_local_symbol_count): New function.
2254 (Incremental_inputs_reader::get_input_section): Adjust size of input
2255 file header.
2256 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2257 (Sized_incr_relobj::This): New typedef.
2258 (Sized_incr_relobj::sym_size): New const data member.
2259 (Sized_incr_relobj::Local_symbol): New struct.
2260 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2261 (Sized_incr_relobj::do_local_symbol_offset): New function.
2262 (Sized_incr_relobj::local_symbol_count_): New data member.
2263 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2264 (Sized_incr_relobj::local_symbol_index_): New data member.
2265 (Sized_incr_relobj::local_symbol_offset_): New data member.
2266 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2267 (Sized_incr_relobj::local_symbols_): New data member.
2268 * object.h (Relobj::output_local_symbol_count): New function.
2269 (Relobj::local_symbol_offset): New function.
2270 (Relobj::do_output_local_symbol_count): New function.
2271 (Relobj::do_local_symbol_offset): New function.
2272 (Sized_relobj::do_output_local_symbol_count): New function.
2273 (Sized_relobj::do_local_symbol_offset): New function.
2274
2275 2011-04-22 Vladimir Simonov <sv@sw.ru>
2276
2277 * descriptors.cc (set_close_on_exec): New function.
2278 (Descriptors::open): Use set_close_on_exec.
2279 * output.cc (S_ISLNK): Define if not defined.
2280
2281 2011-04-22 Cary Coutant <ccoutant@google.com>
2282
2283 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2284 global symbol map.
2285 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2286 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2287 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2288 relocations.
2289 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2290 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2291 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2292 * incremental.h
2293 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2294 function.
2295 (Incremental_binary::apply_incremental_relocs): New function.
2296 (Incremental_binary::do_apply_incremental_relocs): New function.
2297 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2298 data member.
2299 (Sized_incremental_binary::add_global_symbol): New function.
2300 (Sized_incremental_binary::global_symbol): New function.
2301 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2302 (Sized_incremental_binary::symbol_map_): New data member.
2303 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2304 * target.h (Sized_target::apply_relocation): New function.
2305 * target-reloc.h (apply_relocation): New function.
2306 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2307
2308 2011-04-22 Doug Kwan <dougkwan@google.com>
2309
2310 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2311 flag of a SHT_ARM_EXIDX section.
2312 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2313 * testsuite/Makefile.in: Regenerate.
2314 * testsuite/arm_exidx_test.s: New file.
2315 * testsuite/arm_exidx_test.sh: Same.
2316
2317 2011-04-20 Cary Coutant <ccoutant@google.com>
2318
2319 PR gold/12689
2320 * archive.h (Incremental_archive_entry::Archive_member):
2321 Initialize arg_serial_ (second constructor).
2322
2323 2011-04-17 Ian Lance Taylor <iant@google.com>
2324
2325 * object.cc (Relocate_info::location): Simplify location string.
2326 * errors.cc (Errors::error_at_location): Don't print program
2327 name.
2328 (Errors::warning_at_location): Likewise.
2329 (Errors::undefined_symbol): Likewise.
2330 * testsuite/debug_msg.sh: Update accordingly.
2331
2332 2011-04-14 Cary Coutant <ccoutant@google.com>
2333
2334 * gold/layout.cc (Layout::symtab_section_offset): New function.
2335 * gold/layout.h (Layout::symtab_section_offset): New function.
2336 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2337
2338 2011-04-12 Ian Lance Taylor <iant@google.com>
2339
2340 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2341 with MREMAP_MAYMOVE.
2342 * output.h (class Output_file): Add map_is_allocated_ field.
2343 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2344 not available, provide stubs. If mremap is not available, #define
2345 it to gold_mremap.
2346 (MREMAP_MAYMOVE): Define if not defined.
2347 (Output_file::Output_file): Initialize map_is_allocated_.
2348 (Output_file::resize): Check map_is_allocated_.
2349 (Output_file::map_anonymous): If mmap fails, use malloc.
2350 (Output_file::unmap): Don't do anything for an anonymous map.
2351 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2352 is not available, provide stubs.
2353 (File_read::View::~View): Use free rather than delete[].
2354 (File_read::make_view): Use malloc rather than new[]. If mmap
2355 fails, use malloc.
2356 (File_read::find_or_make_view): Use malloc rather than new[].
2357 * gold.h: Remove HAVE_REMAP code.
2358 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2359 exists. Rename mremap to gold_mremap. If mmap is not available
2360 don't do anything.
2361 * configure, config.in: Rebuild.
2362
2363 2011-04-11 Ian Lance Taylor <iant@google.com>
2364
2365 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2366 initialize local variable v.
2367
2368 2011-04-11 Cary Coutant <ccoutant@google.com>
2369
2370 * archive.cc (Archive::include_member): Adjust call to
2371 report_object.
2372 (Add_archive_symbols::run): Track argument serial numbers.
2373 (Lib_group::include_member): Likewise.
2374 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2375 * archive.h (Incremental_archive_entry::Archive_member):
2376 Initialize arg_serial_.
2377 (Archive_member::arg_serial_): New data member.
2378 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2379 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2380 incremental link.
2381 (Sized_dynobj::do_for_all_local_got_entries): New function.
2382 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2383 function.
2384 * fileread.cc (get_mtime): New function.
2385 * fileread.h (get_mtime): New function.
2386 * gold.cc (queue_initial_tasks): Check for incremental update.
2387 (process_incremental_input): New function.
2388 (queue_middle_tasks): Don't force valid target for incremental
2389 update.
2390 * incremental-dump.cc (find_input_containing_global): Adjust
2391 size of symbol info entry.
2392 (dump_incremental_inputs): Dump argument serial number and
2393 in_system_directory flag; bias shndx by 1; print symbol names
2394 when dumping per-file symbol lists; use new symbol info readers.
2395 * incremental.cc
2396 (Output_section_incremental_inputs:update_data_size): New function.
2397 (Sized_incremental_binary::setup_readers): Setup input readers
2398 for each input file; build maps for files added from libraries
2399 and scripts.
2400 (Sized_incremental_binary::check_input_args): New function.
2401 (Sized_incremental_binary::do_check_inputs): Build map of argument
2402 serial numbers to input arguments.
2403 (Sized_incremental_binary::do_file_has_changed): Rename
2404 do_file_is_unchanged to this; compare file modification times.
2405 (Sized_incremental_binary::do_init_layout): New function.
2406 (Sized_incremental_binary::do_reserve_layout): New function.
2407 (Sized_incremental_binary::do_get_input_reader): Remove.
2408 (Sized_incremental_binary::get_symtab_view): New function.
2409 (Incremental_checker::can_incrementally_link_output_file): Remove.
2410 (Incremental_inputs::report_command_line): Exclude --debug options.
2411 (Incremental_inputs::report_archive_begin): Add parameter; track
2412 argument serial numbers; don't put input file entry for archive
2413 before archive members.
2414 (Incremental_inputs::report_archive_end): Put input file entry
2415 for archive after archive members.
2416 (Incremental_inputs::report_object): Add parameter; track argument
2417 serial numbers and in_system_directory flag.
2418 (Incremental_inputs::report_script): Add parameter; track argument
2419 serial numbers.
2420 (Output_section_incremental_inputs::set_final_data_size): Adjust
2421 size of symbol info entry; check for forwarding symbols.
2422 (Output_section_incremental_inputs::write_input_files): Write
2423 in_system_directory flag and argument serial number.
2424 (Output_section_incremental_inputs::write_info_blocks): Map section
2425 indices between incremental info and original input file; store
2426 input section index for each symbol.
2427 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2428 change operator() to visit().
2429 (class Global_got_offset_visitor): Likewise.
2430 (class Global_symbol_visitor_got_plt):
2431 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2432 classes.
2433 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2434 (Sized_incr_relobj::do_read_symbols): New function.
2435 (Sized_incr_relobj::do_layout): New function.
2436 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2437 (Sized_incr_relobj::do_add_symbols): New function.
2438 (Sized_incr_relobj::do_should_include_member): New function.
2439 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2440 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2441 (Sized_incr_relobj::do_section_size): New function.
2442 (Sized_incr_relobj::do_section_name): New function.
2443 (Sized_incr_relobj::do_section_contents): New function.
2444 (Sized_incr_relobj::do_section_flags): New function.
2445 (Sized_incr_relobj::do_section_entsize): New function.
2446 (Sized_incr_relobj::do_section_address): New function.
2447 (Sized_incr_relobj::do_section_type): New function.
2448 (Sized_incr_relobj::do_section_link): New function.
2449 (Sized_incr_relobj::do_section_info): New function.
2450 (Sized_incr_relobj::do_section_addralign): New function.
2451 (Sized_incr_relobj::do_initialize_xindex): New function.
2452 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2453 (Sized_incr_relobj::do_read_relocs): New function.
2454 (Sized_incr_relobj::do_gc_process_relocs): New function.
2455 (Sized_incr_relobj::do_scan_relocs): New function.
2456 (Sized_incr_relobj::do_count_local_symbols): New function.
2457 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2458 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2459 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2460 (Sized_incr_relobj::do_relocate): New function.
2461 (Sized_incr_relobj::do_set_section_offset): New function.
2462 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2463 (Sized_incr_dynobj::do_read_symbols): New function.
2464 (Sized_incr_dynobj::do_layout): New function.
2465 (Sized_incr_dynobj::do_add_symbols): New function.
2466 (Sized_incr_dynobj::do_should_include_member): New function.
2467 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2468 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2469 (Sized_incr_dynobj::do_section_size): New function.
2470 (Sized_incr_dynobj::do_section_name): New function.
2471 (Sized_incr_dynobj::do_section_contents): New function.
2472 (Sized_incr_dynobj::do_section_flags): New function.
2473 (Sized_incr_dynobj::do_section_entsize): New function.
2474 (Sized_incr_dynobj::do_section_address): New function.
2475 (Sized_incr_dynobj::do_section_type): New function.
2476 (Sized_incr_dynobj::do_section_link): New function.
2477 (Sized_incr_dynobj::do_section_info): New function.
2478 (Sized_incr_dynobj::do_section_addralign): New function.
2479 (Sized_incr_dynobj::do_initialize_xindex): New function.
2480 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2481 (make_sized_incremental_object): New function.
2482 (Incremental_library::copy_unused_symbols): New function.
2483 (Incremental_library::do_for_all_unused_symbols): New function.
2484 * incremental.h (enum Incremental_input_flags): New type.
2485 (class Incremental_checker): Remove.
2486 (Incremental_input_entry::Incremental_input_entry): Add argument
2487 serial number.
2488 (Incremental_input_entry::arg_serial): New function.
2489 (Incremental_input_entry::set_is_in_system_directory): New function.
2490 (Incremental_input_entry::is_in_system_directory): New function.
2491 (Incremental_input_entry::arg_serial_): New data member.
2492 (Incremental_input_entry::is_in_system_directory_): New data member.
2493 (class Script_info): Move here from script.h.
2494 (Script_info::Script_info): Add filename parameter.
2495 (Script_info::filename): New function.
2496 (Script_info::filename_): New data member.
2497 (Incremental_script_entry::Incremental_script_entry): Add argument
2498 serial number.
2499 (Incremental_object_entry::Incremental_object_entry): Likewise.
2500 (Incremental_object_entry::add_input_section): Build list of input
2501 sections with map to original shndx.
2502 (Incremental_object_entry::get_input_section_index): New function.
2503 (Incremental_object_entry::shndx_): New data member.
2504 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2505 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2506 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2507 serial number.
2508 (Incremental_inputs::report_archive_begin): Likewise.
2509 (Incremental_inputs::report_object): Likewise.
2510 (Incremental_inputs::report_script): Likewise.
2511 (class Incremental_global_symbol_reader): New class.
2512 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2513 and store flags and input file type.
2514 (Incremental_input_entry_reader::arg_serial): New function.
2515 (Incremental_input_entry_reader::type): Extract type from flags.
2516 (Incremental_input_entry_reader::is_in_system_directory): New function.
2517 (Incremental_input_entry_reader::get_input_section_count): Call
2518 accessor function for type.
2519 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2520 function for type; adjust size of global symbol entry.
2521 (Incremental_input_entry_reader::get_global_symbol_count): Call
2522 accessor function for type.
2523 (Incremental_input_entry_reader::get_object_count): Likewise.
2524 (Incremental_input_entry_reader::get_object_offset): Likewise.
2525 (Incremental_input_entry_reader::get_member_count): Likewise.
2526 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2527 (Incremental_input_entry_reader::get_member_offset): Likewise.
2528 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2529 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2530 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2531 (Incremental_input_entry_reader::get_global_symbol_reader): New
2532 function.
2533 (Incremental_input_entry_reader::get_output_symbol_index): New
2534 function.
2535 (Incremental_input_entry_reader::type_): Remove.
2536 (Incremental_input_entry_reader::flags_): New data member.
2537 (Incremental_inputs_reader::input_file_offset): New function.
2538 (Incremental_inputs_reader::input_file_index): New function.
2539 (Incremental_inputs_reader::input_file): Call input_file_offset.
2540 (Incremental_inputs_reader::input_file_at_offset): New function.
2541 (Incremental_relocs_reader::get_r_type): Reformat.
2542 (Incremental_relocs_reader::get_r_shndx): Reformat.
2543 (Incremental_relocs_reader::get_r_offset): Reformat.
2544 (Incremental_relocs_reader::data): New function.
2545 (Incremental_binary::Incremental_binary): Initialize new data members.
2546 (Incremental_binary::check_inputs): Add cmdline parameter.
2547 (Incremental_binary::file_is_unchanged): Remove.
2548 (Input_reader::arg_serial): New function.
2549 (Input_reader::get_unused_symbol_count): New function.
2550 (Input_reader::get_unused_symbol): New function.
2551 (Input_reader::do_arg_serial): New function.
2552 (Input_reader::do_get_unused_symbol_count): New function.
2553 (Input_reader::do_get_unused_symbol): New function.
2554 (Incremental_binary::input_file_count): New function.
2555 (Incremental_binary::get_input_reader): Change signature to use
2556 index instead of filename.
2557 (Incremental_binary::file_has_changed): New function.
2558 (Incremental_binary::get_input_argument): New function.
2559 (Incremental_binary::get_library): New function.
2560 (Incremental_binary::get_script_info): New function.
2561 (Incremental_binary::init_layout): New function.
2562 (Incremental_binary::reserve_layout): New function.
2563 (Incremental_binary::output_file): New function.
2564 (Incremental_binary::do_check_inputs): New function.
2565 (Incremental_binary::do_file_is_unchanged): Remove.
2566 (Incremental_binary::do_file_has_changed): New function.
2567 (Incremental_binary::do_init_layout): New function.
2568 (Incremental_binary::do_reserve_layout): New function.
2569 (Incremental_binary::do_input_file_count): New function.
2570 (Incremental_binary::do_get_input_reader): Change signature.
2571 (Incremental_binary::input_args_map_): New data member.
2572 (Incremental_binary::library_map_): New data member.
2573 (Incremental_binary::script_map_): New data member.
2574 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2575 new data members.
2576 (Sized_incremental_binary::output_section): New function.
2577 (Sized_incremental_binary::inputs_reader): Add const.
2578 (Sized_incremental_binary::symtab_reader): Add const.
2579 (Sized_incremental_binary::relocs_reader): Add const.
2580 (Sized_incremental_binary::got_plt_reader): Add const.
2581 (Sized_incremental_binary::get_symtab_view): New function.
2582 (Sized_incremental_binary::Inputs_reader): New typedef.
2583 (Sized_incremental_binary::Input_entry_reader): New typedef.
2584 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2585 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2586 (Sized_incremental_binary::do_file_has_changed): New function.
2587 (Sized_incremental_binary::do_init_layout): New function.
2588 (Sized_incremental_binary::do_reserve_layout): New function.
2589 (Sized_input_reader::Inputs_reader): Remove.
2590 (Sized_input_reader::Input_entry_reader): Remove.
2591 (Sized_input_reader::do_arg_serial): New function.
2592 (Sized_input_reader::do_get_unused_symbol_count): New function.
2593 (Sized_input_reader::do_get_unused_symbol): New function.
2594 (Sized_incremental_binary::do_input_file_count): New function.
2595 (Sized_incremental_binary::do_get_input_reader): Change signature;
2596 use index instead of filename.
2597 (Sized_incremental_binary::section_map_): New data member.
2598 (Sized_incremental_binary::input_entry_readers_): New data member.
2599 (class Sized_incr_relobj): New class.
2600 (class Sized_incr_dynobj): New class.
2601 (make_sized_incremental_object): New function.
2602 (class Incremental_library): New class.
2603 * layout.cc (Free_list::num_lists): New static data member.
2604 (Free_list::num_nodes): New static data member.
2605 (Free_list::num_removes): New static data member.
2606 (Free_list::num_remove_visits): New static data member.
2607 (Free_list::num_allocates): New static data member.
2608 (Free_list::num_allocate_visits): New static data member.
2609 (Free_list::init): New function.
2610 (Free_list::remove): New function.
2611 (Free_list::allocate): New function.
2612 (Free_list::dump): New function.
2613 (Free_list::print_stats): New function.
2614 (Layout_task_runner::run): Resize output file for incremental updates.
2615 (Layout::Layout): Initialize new data members.
2616 (Layout::set_incremental_base): New function.
2617 (Layout::init_fixed_output_section): New function.
2618 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2619 incremental updates.
2620 (Layout::create_gold_note): Do not create gold note section for
2621 incremental updates.
2622 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2623 for incremental updates.
2624 (Layout::set_section_offsets): For incremental updates, allocate space
2625 from free list.
2626 (Layout::create_symtab_sections): Layout with offsets relative to
2627 start of section; for incremental updates, allocate space from free
2628 list.
2629 (Layout::create_shdrs): For incremental updates, allocate space from
2630 free list.
2631 (Layout::finish_dynamic_section): For incremental updates, do not
2632 check --as-needed (fixed in subsequent patch).
2633 * layout.h (class Free_list): New class.
2634 (Layout::set_incremental_base): New function.
2635 (Layout::incremental_base): New function.
2636 (Layout::init_fixed_output_section): New function.
2637 (Layout::allocate): New function.
2638 (Layout::incremental_base_): New data member.
2639 (Layout::free_list_): New data member.
2640 * main.cc (main): Print Free_list statistics.
2641 * object.cc (Relobj::finalize_incremental_relocs): Add
2642 clear_counts parameter; clear counts only when clear_counts is set.
2643 (Sized_relobj::Sized_relobj): Initialize new base class.
2644 (Sized_relobj::do_layout): Don't report special sections.
2645 (Sized_relobj::do_for_all_local_got_entries): New function.
2646 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2647 symtab_off to all symbol table offsets.
2648 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2649 * object.h (class Got_offset_list): Move to top of file.
2650 (Object::Object): Allow case where input_file == NULL.
2651 (Object::~Object): Likewise.
2652 (Object::input_file): Assert that input_file != NULL.
2653 (Object::lock): Allow case where input_file == NULL.
2654 (Object::unlock): Likewise.
2655 (Object::is_locked): Likewise.
2656 (Object::token): Likewise.
2657 (Object::release): Likewise.
2658 (Object::is_incremental): New function.
2659 (Object::get_mtime): New function.
2660 (Object::for_all_local_got_entries): New function.
2661 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2662 (Object::set_is_in_system_directory): New function.
2663 (Object::is_in_system_directory): New function.
2664 (Object::do_is_incremental): New function.
2665 (Object::do_get_mtime): New function.
2666 (Object::do_for_all_local_got_entries): New function.
2667 (Object::is_in_system_directory_): New data member.
2668 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2669 (class Sized_relobj_base): New class.
2670 (class Sized_relobj): Derive from Sized_relobj_base.
2671 (class Sized_relobj::Symbols): Redeclare from base class.
2672 (class Sized_relobj::local_got_offset_list): Remove.
2673 (class Sized_relobj::Output_sections): Redeclare from base class.
2674 (class Sized_relobj::do_for_all_local_got_entries): New function.
2675 (class Sized_relobj::write_local_symbols): Add offset parameter.
2676 (class Sized_relobj::local_symbol_offset_): Update comment.
2677 (class Sized_relobj::local_dynsym_offset_): Update comment.
2678 * options.cc (Input_arguments::add_file): Remove const.
2679 * options.h (Input_file_argument::Input_file_argument):
2680 Initialize arg_serial_ (all constructors).
2681 (Input_file_argument::set_arg_serial): New function.
2682 (Input_file_argument::arg_serial): New function.
2683 (Input_file_argument::arg_serial_): New data member.
2684 (Input_arguments::Input_arguments): Initialize file_count_.
2685 (Input_arguments::add_file): Remove const.
2686 (Input_arguments::number_of_input_files): New function.
2687 (Input_arguments::file_count_): New data member.
2688 (Command_line::number_of_input_files): Call
2689 Input_arguments::number_of_input_files.
2690 * output.cc (Output_segment_headers::Output_segment_headers):
2691 Set current size.
2692 (Output_section::Input_section::current_data_size): New function.
2693 (Output_section::Output_section): Initialize new data members.
2694 (Output_section::add_input_section): Don't do merge sections for
2695 an incremental link; allocate space from free list for an
2696 incremental update.
2697 (Output_section::add_output_section_data): Allocate space from
2698 free list for an incremental update.
2699 (Output_section::update_data_size): New function.
2700 (Output_section::set_fixed_layout): New function.
2701 (Output_section::reserve): New function.
2702 (Output_segment::set_section_addresses): Remove const.
2703 (Output_segment::set_section_list_addresses): Remove const; allocate
2704 space from free list for an incremental update.
2705 (Output_segment::set_offset): Adjust size of RELRO segment for an
2706 incremental update.
2707 * output.h (Output_data::current_data_size): Move here from
2708 child classes.
2709 (Output_data::pre_finalize_data_size): New function.
2710 (Output_data::update_data_size): New function.
2711 (Output_section_headers::update_data_size): new function.
2712 (Output_section_data_build::current_data_size): Move to Output_data.
2713 (Output_data_strtab::update_data_size): New function.
2714 (Output_section::current_data_size): Move to Output_data.
2715 (Output_section::set_fixed_layout): New function.
2716 (Output_section::has_fixed_layout): New function.
2717 (Output_section::reserve): New function.
2718 (Output_section::update_data_size): New function.
2719 (Output_section::has_fixed_layout_): New data member.
2720 (Output_section::free_list_): New data member.
2721 (Output_segment::set_section_addresses): Remove const.
2722 (Output_segment::set_section_list_addresses): Remove const.
2723 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2724 New function.
2725 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2726 New function.
2727 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2728 parameter when calling Add_symbols constructor; store argument
2729 serial number for members of a lib group.
2730 (Add_symbols::locks): Allow case where token == NULL.
2731 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2732 (Read_member::~Read_member): New function.
2733 (Read_member::is_runnable): New function.
2734 (Read_member::locks): New function.
2735 (Read_member::run): New function.
2736 (Check_script::~Check_script): New function.
2737 (Check_script::is_runnable): New function.
2738 (Check_script::locks): New function.
2739 (Check_script::run): New function.
2740 (Check_library::~Check_library): New function.
2741 (Check_library::is_runnable): New function.
2742 (Check_library::locks): New function.
2743 (Check_library::run): New function.
2744 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2745 (Add_symbols::library_): New data member.
2746 (class Read_member): New class.
2747 (class Check_script): New class.
2748 (class Check_library): New class.
2749 * reloc.cc (Read_relocs::is_runnable): Allow case where
2750 token == NULL.
2751 (Read_relocs::locks): Likewise.
2752 (Scan_relocs::locks): Likewise.
2753 (Relocate_task::locks): Likewise.
2754 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2755 to clear counters.
2756 (Sized_relobj::incremental_relocs_scan): Fix comment.
2757 (Sized_relobj::do_relocate): Pass output file offset to
2758 write_local_symbols.
2759 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2760 from class declaration.
2761 * script.cc (read_input_script): Allocate Script_info; pass
2762 argument serial number to report_script.
2763 * script.h (class Script_info): Move to incremental.h.
2764 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2765 * symtab.h (Symbol_table::add_from_incrobj): New function.
2766 (Symbol_table::set_file_offset): New function.
2767
2768 2011-04-05 Cary Coutant <ccoutant@google.com>
2769
2770 * incremental-dump.cc (dump_incremental_inputs): Change signature
2771 to take a Sized_incremental_binary; change caller. Use readers
2772 in Sized_incremental_binary.
2773 * incremental.cc
2774 (Sized_incremental_binary::find_incremental_inputs_sections):
2775 Rename do_find_incremental_inputs_sections to this.
2776 (Sized_incremental_binary::setup_readers): New function.
2777 (Sized_incremental_binary::do_check_inputs): Check
2778 has_incremental_info_ flag; move setup code to setup_readers;
2779 use input readers.
2780 (Sized_incremental_binary::do_file_is_unchanged): New function.
2781 (Sized_incremental_binary::do_get_input_reader): New function.
2782 * incremental.h (class Incremental_binary): Move to end of file.
2783 (Incremental_binary::file_is_unchanged): New function.
2784 (Incremental_binary::do_file_is_unchanged): New function.
2785 (Incremental_binary::Input_reader): New class.
2786 (Incremental_binary::get_input_reader): New function.
2787 (class Sized_incremental_binary): Move to end of file.
2788 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2789 input section reader classes.
2790 (Sized_incremental_binary::has_incremental_info): New function.
2791 (Sized_incremental_binary::inputs_reader): New function.
2792 (Sized_incremental_binary::symtab_reader): New function.
2793 (Sized_incremental_binary::relocs_reader): New function.
2794 (Sized_incremental_binary::got_plt_reader): New function.
2795 (Sized_incremental_binary::do_file_is_unchanged): New function.
2796 (Sized_incremental_binary::Sized_input_reader): New class.
2797 (Sized_incremental_binary::get_input_reader): New function.
2798 (Sized_incremental_binary::find_incremental_inputs_sections):
2799 Rename do_find_incremental_inputs_sections to this.
2800 (Sized_incremental_binary::setup_readers): New function.
2801 (Sized_incremental_binary::has_incremental_info_): New data member.
2802 (Sized_incremental_binary::inputs_reader_): New data member.
2803 (Sized_incremental_binary::symtab_reader_): New data member.
2804 (Sized_incremental_binary::relocs_reader_): New data member.
2805 (Sized_incremental_binary::got_plt_reader_): New data member.
2806 (Sized_incremental_binary::current_input_file_): New data member.
2807
2808 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2809
2810 PR gold/12640
2811 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2812 violation.
2813
2814 2011-03-30 Cary Coutant <ccoutant@google.com>
2815
2816 * archive.cc (Archive::include_member): Adjust call to report_object.
2817 (Add_archive_symbols::run): Add script_info to call to
2818 report_archive_begin.
2819 (Lib_group::include_member): Adjust call to report_object.
2820 (Add_lib_group_symbols::run): Adjust call to report_object.
2821 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2822 blocks. Add object count for script input files.
2823 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2824 script_info parameter; change all callers.
2825 (Incremental_inputs::report_object): Add script_info parameter;
2826 change all callers.
2827 (Incremental_inputs::report_script): Store backpointer to
2828 incremental info entry.
2829 (Output_section_incremental_inputs::set_final_data_size): Record
2830 additional information for scripts.
2831 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2832 * incremental.h (Incremental_script_entry::add_object): New function.
2833 (Incremental_script_entry::get_object_count): New function.
2834 (Incremental_script_entry::get_object): New function.
2835 (Incremental_script_entry::objects_): New data member; adjust
2836 constructor.
2837 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2838 (Incremental_inputs::report_object): Add script_info parameter.
2839 (Incremental_inputs_reader::get_object_count): New function.
2840 (Incremental_inputs_reader::get_object_offset): New function.
2841 * options.cc (Input_arguments::add_file): Return reference to
2842 new input argument.
2843 * options.h (Input_argument::set_script_info): New function.
2844 (Input_argument::script_info): New function.
2845 (Input_argument::script_info_): New data member; adjust all
2846 constructors.
2847 (Input_file_group::add_file): Return reference to new input argument.
2848 (Input_file_lib::add_file): Likewise.
2849 (Input_arguments::add_file): Likewise.
2850 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2851 * script.cc (Parser_closure::Parser_closure): Add script_info
2852 parameter; adjust all callers.
2853 (Parser_closure::script_info): New function.
2854 (Parser_closure::script_info_): New data member.
2855 (read_input_script): Report scripts earlier to incremental info.
2856 (script_add_file): Set script_info in Input_argument.
2857 (script_add_library): Likewise.
2858 * script.h (Script_options::Script_info): Rewrite class.
2859
2860 2011-03-29 Cary Coutant <ccoutant@google.com>
2861
2862 * archive.cc (Library_base::should_include_member): Move
2863 method here from class Archive.
2864 (Archive::Archive): Initialize base class.
2865 (Archive::should_include_member): Move to base class.
2866 (Archive::do_for_all_unused_symbols): New function.
2867 (Add_archive_symbols::run): Remove redundant access to
2868 incremental_inputs.
2869 (Lib_group::Lib_group): Initialize base class.
2870 (Lib_group::do_filename): New function.
2871 (Lib_group::include_member): Pass pointer to Lib_group to
2872 report_object.
2873 (Lib_group::do_for_all_unused_symbols): New function.
2874 (Add_lib_group_symbols::run): Report archive information for
2875 incremental links.
2876 * archive.h (class Library_base): New base class.
2877 (class Archive): Derive from Library_base.
2878 (Archive::filename): Move to base class.
2879 (Archive::set_incremental_info): Likewise.
2880 (Archive::incremental_info): Likewise.
2881 (Archive::Should_include): Likewise.
2882 (Archive::should_include_member): Likewise.
2883 (Archive::Armap_entry): Remove.
2884 (Archive::Unused_symbol_iterator): Remove.
2885 (Archive::unused_symbols_begin): Remove.
2886 (Archive::unused_symbols_end): Remove.
2887 (Archive::do_filename): New function.
2888 (Archive::do_get_mtime): New function.
2889 (Archive::do_for_all_unused_symbols): New function.
2890 (Archive::task_): Move to base class.
2891 (Archive::incremental_info_): Likewise.
2892 (class Lib_group): Derive from Library_base.
2893 (Lib_group::do_filename): New function.
2894 (Lib_group::do_get_mtime): New function.
2895 (Lib_group::do_for_all_unused_symbols): New function.
2896 (Lib_group::task_): Move to base class.
2897 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2898 function.
2899 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2900 function.
2901 * incremental.cc (Incremental_inputs::report_archive_begin):
2902 Use Library_base; call library's get_mtime; add incremental inputs
2903 entry before members.
2904 (class Unused_symbol_visitor): New class.
2905 (Incremental_inputs::report_archive_end): Use Library_base; use
2906 visitor class to record unused symbols; don't add incremental inputs
2907 entry after members.
2908 (Incremental_inputs::report_object): Use Library_base.
2909 * incremental.h
2910 (Incremental_archive_entry::Incremental_archive_entry): Remove
2911 unused Archive parameter.
2912 (Incremental_inputs::report_archive_begin): Use Library_base.
2913 (Incremental_inputs::report_archive_end): Likewise.
2914 (Incremental_inputs::report_object): Likewise.
2915 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2916 function.
2917 * object.h (Object::for_all_global_symbols): New function.
2918 (Object::do_for_all_global_symbols): New function.
2919 (Sized_relobj::do_for_all_global_symbols): New function.
2920 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2921 function.
2922 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2923 function.
2924
2925 2011-03-27 Ian Lance Taylor <iant@google.com>
2926
2927 * archive.cc (Archive::interpret_header): Return -1 if something
2928 goes wrong. Change callers accordingly.
2929
2930 2011-03-25 Cary Coutant <ccoutant@google.com>
2931
2932 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2933 * testsuite/Makefile.in: Regenerate.
2934
2935 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
2936
2937 * plugin.cc (get_view): New.
2938 (Plugin::load): Pass get_view to the plugin.
2939 (Plugin_manager::get_view): New.
2940
2941 2011-03-21 Ian Lance Taylor <iant@google.com>
2942
2943 * testsuite/final_layout.sh: Rewrite to not use dc.
2944 * testsuite/relro_test.sh: Fail if dc is not present.
2945
2946 2011-03-21 Sriraman Tallam <tmsriram@google.com>
2947
2948 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2949 Change == to -eq.
2950 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2951 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2952 Change == to -eq.
2953 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2954 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2955
2956 2011-03-14 Ian Lance Taylor <iant@google.com>
2957
2958 * script-sections.cc (Sort_output_sections::script_compare):
2959 Rename from is_before, change return type.
2960 (Sort_output_sections::operator()): Adjust accordingly.
2961
2962 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2963
2964 PR gold/12572
2965 * testsuite/odr_violation2.cc: Add comment to make all error line
2966 numbers double digits.
2967 * testsuite/debug_msg.sh: Adjust expected errors.
2968
2969 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2970
2971 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2972 but mark earlier ones as non-canonical
2973 (offset_to_iterator): Update search target and example
2974 (do_addr2line): Return extra lines in a vector*
2975 (format_file_lineno): Extract from do_addr2line
2976 (one_addr2line): Add vector* out-param
2977 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2978 when a lineno entry appeared last for its instruction
2979 (Dwarf_line_info): Add vector* out-param
2980 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2981 * symtab.cc (Odr_violation_compare): Include the lineno in the
2982 comparison again.
2983 (linenos_from_loc): New. Combine the canonical line for an
2984 address with its other lines.
2985 (True_if_intersect): New. Helper functor to make
2986 std::set_intersection a query.
2987 (detect_odr_violations): Compare sets of lines instead of just
2988 one line for each function. This became less deterministic, but
2989 has fewer false positives.
2990 * symtab.h: Declarations.
2991 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2992 mix an optimized and non-optimized object in the same binary
2993 (odr_violation2.so): Same.
2994 * testsuite/Makefile.in: Regenerate from Makefile.am.
2995 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2996 * testsuite/debug_msg.sh: Update line numbers and add
2997 assertions.
2998 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2999 non-optimized context.
3000 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3001 isn't inlined, and use OdrDerived in an optimized context.
3002 * testsuite/odr_header1.h: Defines OdrDerived, where
3003 optimization will change the
3004 first-instruction-in-the-destructor's file and line number.
3005 * testsuite/odr_header2.h: Defines OdrBase.
3006
3007 2011-03-09 Ian Lance Taylor <iant@google.com>
3008
3009 * fileread.cc (File_read::clear_views): Don't delete the whole
3010 file view.
3011
3012 2011-03-08 Ian Lance Taylor <iant@google.com>
3013
3014 PR gold/12525
3015 * fileread.cc: #include <climits>.
3016 (GOLD_IOV_MAX): Define.
3017 (File_read::read_multiple): Limit number of entries by iov_max.
3018 * fileread.h (class File_read): Always set max_readv_entries to
3019 128.
3020
3021 2011-03-07 Ian Lance Taylor <iant@google.com>
3022
3023 PR gold/12525
3024 * options.h (class General_options): Add -dy and -dn.
3025
3026 2011-03-02 Cary Coutant <ccoutant@google.com>
3027
3028 * testsuite/script_test_9.t: Add TLS segment.
3029
3030 2011-03-02 Simon Baldwin <simonb@google.com>
3031
3032 * configure.ac: Add check for gnu_indirect_function support in
3033 the toolchain building binutils.
3034 * configure: Rebuild.
3035
3036 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3037
3038 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3039 plugin only symbols.
3040 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3041 in plugin files as not needed in the symbol table.
3042
3043 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3044
3045 * output.cc (Output_section::add_input_section): Delay fill
3046 generation for section ordering.
3047
3048 2011-02-09 Ian Lance Taylor <iant@google.com>
3049
3050 PR gold/12316
3051 * object.h (class Sized_relobj): Remove clear_local_symbols.
3052 * reloc.cc (Sized_relobj::do_relocate): Don't call
3053 clear_local_symbols.
3054
3055 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3056
3057 * plugin.cc (is_visible_from_outside): Return true for symbols
3058 in the -u option.
3059
3060 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3061
3062 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3063 filename.
3064
3065 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3066
3067 * icf.h (is_section_foldable_candidate): Change type of parameter
3068 to std::string.
3069 * icf.cc (Icf::find_identical_sections): Change type of local variable
3070 section_name to be std::string.
3071 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3072
3073 2011-01-25 Ian Lance Taylor <iant@google.com>
3074
3075 * script.cc (script_add_extern): Rewrite to use
3076 add_symbol_reference.
3077
3078 2011-01-25 Doug Kwan <dougkwan@google.com>
3079
3080 * icf.cc (get_section_contents): Always lock section's object.
3081
3082 2011-01-24 Ian Lance Taylor <iant@google.com>
3083
3084 * options.h (class General_options): Accept
3085 --no-detect-odr-violations.
3086
3087 2011-01-24 Ian Lance Taylor <iant@google.com>
3088
3089 * version.cc (version_string): Bump to 1.11.
3090
3091 2011-01-24 Ian Lance Taylor <iant@google.com>
3092
3093 * plugin.cc (class Plugin_rescan): Define new class.
3094 (Plugin_manager::claim_file): Set any_claimed_.
3095 (Plugin_manager::save_archive): New function.
3096 (Plugin_manager::save_input_group): New function.
3097 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3098 necessary.
3099 (Plugin_manager::new_undefined_symbol): New function.
3100 (Plugin_manager::rescan): New function.
3101 (Plugin_manager::rescannable_defines): New function.
3102 (Plugin_manager::add_input_file): Set any_added_.
3103 * plugin.h (class Plugin_manager): define new fields rescannable_,
3104 undefined_symbols_, any_claimed_, and any_added_. Declare
3105 Plugin_rescan as friend. Declare new functions.
3106 (Plugin_manager::Rescannable): Define type.
3107 (Plugin_manager::Rescannable_list): Define type.
3108 (Plugin_manager::Undefined_symbol_list): Define type.
3109 (Plugin_manager::Plugin_manager): Initialize new fields.
3110 * archive.cc (Archive::defines_symbol): New function.
3111 (Add_archive_symbols::run): Pass archive to plugins if any.
3112 * archive.h (class Archive): Declare defines_symbol.
3113 * readsyms.cc (Input_group::~Input_group): New function.
3114 (Finish_group::run): Pass input_group to plugins if any.
3115 * readsyms.h (class Input_group): Declare destructor.
3116 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3117 any.
3118
3119 2011-01-10 Ian Lance Taylor <iant@google.com>
3120
3121 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3122 section as relro.
3123 (Layout::set_segment_offsets): Reset increase_relro before calling
3124 set_section_addresses a second time.
3125
3126 2011-01-04 Cary Coutant <ccoutant@google.com>
3127
3128 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3129 sections before NOBITS sections.
3130
3131 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3132
3133 * version.cc (print_version): Update copyright to 2011.
3134
3135 2010-12-23 Cary Coutant <ccoutant@google.com>
3136
3137 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3138 of OS to this->add. Add OD parameter to second form of the function.
3139
3140 2010-12-20 Ian Lance Taylor <iant@google.com>
3141
3142 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3143 second of two consecutive entries with same offset.
3144
3145 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3146
3147 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3148 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3149 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3150 to avoid unneeded links against $(LDADD).
3151 * testsuite/Makefile.in: Regenerate.
3152
3153 2010-12-15 Ian Lance Taylor <iant@google.com>
3154
3155 PR gold/12324
3156 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3157 for R_X86_64_32 and R_X86_64_PC32.
3158 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3159 ver_matching_def_pic.o.
3160 (ver_matching_def_pic.o): New target.
3161
3162 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3163
3164 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3165 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3166 Move definition before File_read::View member definitions.
3167 (File_read::View::~View): Initialize and hold lock before
3168 updating current_mapped_bytes.
3169
3170 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3171
3172 * dwarf_reader.cc: Remove outdated comment.
3173 * gold-threads.cc: Fix typo in error message.
3174 * archive.cc: Fix typos in comments.
3175 * archive.h: Likewise.
3176 * arm-reloc-property.cc: Likewise.
3177 * arm-reloc-property.h: Likewise.
3178 * arm-reloc.def: Likewise.
3179 * arm.cc: Likewise.
3180 * attributes.h: Likewise.
3181 * cref.cc: Likewise.
3182 * ehframe.cc: Likewise.
3183 * fileread.h: Likewise.
3184 * gold.h: Likewise.
3185 * i386.cc: Likewise.
3186 * icf.cc: Likewise.
3187 * incremental.h: Likewise.
3188 * int_encoding.cc: Likewise.
3189 * layout.h: Likewise.
3190 * main.cc: Likewise.
3191 * merge.h: Likewise.
3192 * object.cc: Likewise.
3193 * object.h: Likewise.
3194 * options.cc: Likewise.
3195 * readsyms.cc: Likewise.
3196 * reduced_debug_output.cc: Likewise.
3197 * reloc.cc: Likewise.
3198 * script-sections.cc: Likewise.
3199 * sparc.cc: Likewise.
3200 * symtab.h: Likewise.
3201 * target-reloc.h: Likewise.
3202 * target.cc: Likewise.
3203 * target.h: Likewise.
3204 * timer.cc: Likewise.
3205 * timer.h: Likewise.
3206 * x86_64.cc: Likewise.
3207
3208 2010-12-09 Cary Coutant <ccoutant@google.com>
3209
3210 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3211 stack.
3212 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3213 parameter; change all callers.
3214 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3215 * options.h (warn_execstack): New option.
3216
3217 2010-12-07 Doug Kwan <dougkwan@google.com>
3218
3219 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3220 like function call relocations.
3221
3222 2010-12-07 Ian Lance Taylor <iant@google.com>
3223
3224 * archive.cc (Archive::get_elf_object_for_member): Permit
3225 punconfigured to be NULL.
3226 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3227 (Archive::include_member): Pass NULL to get_elf_object_for_member
3228 if we searched for the archive and this is the first included
3229 object.
3230
3231 2010-12-01 Ian Lance Taylor <iant@google.com>
3232
3233 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3234 track_relocs_type_ field.
3235 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3236 Set track_relocs_type_.
3237 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3238 contents when using RELA relocs.
3239 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3240 reloc_map_.
3241 * reloc.cc (Track_relocs::next_addend): New function.
3242 * reloc.h (class Track_relocs): Declare next_addend.
3243
3244 2010-12-01 Ian Lance Taylor <iant@google.com>
3245
3246 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3247 virtual destructor.
3248
3249 2010-12-01 Ian Lance Taylor <iant@google.com>
3250
3251 * README: Update compilers known to work and fail.
3252
3253 2010-11-23 Matthias Klose <doko@ubuntu.com>
3254
3255 * configure.in: For --enable-gold, handle value `default' instead of
3256 `both*'. Always install ld as ld.bfd, install as ld if gold is
3257 not the default.
3258 * configure: Regenerate.
3259
3260 2010-11-18 Doug Kwan <dougkwan@google.com>
3261
3262 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3263 and right_alignment to be zero. Store result alignment only if it is
3264 greater than existing alignment.
3265
3266 2010-11-16 Cary Coutant <ccoutant@google.com>
3267
3268 PR gold/12220
3269 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3270 Check for ".zdebug_line".
3271
3272 2010-11-16 Doug Kwan <dougkwan@google.com>
3273 Cary Coutant <ccoutant@google.com>
3274
3275 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3276 by reference; adjust all callers.
3277 * output.cc (Output_segment::set_section_addresses): Adjust references
3278 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3279 list is empty.
3280 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3281 end at page boundary.
3282
3283 2010-11-16 Cary Coutant <ccoutant@google.com>
3284
3285 PR gold/12220
3286 * layout.cc (Layout::choose_output_section): Transform names of
3287 compressed sections even when using a script with a SECTIONS clause.
3288 (Layout::output_section_name): Remove code to transform
3289 compressed debug section names.
3290 * output.cc (Output_section::add_input_section): Use uncompressed
3291 section size when tracking input sections.
3292
3293 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3294
3295 * symtab.h (Symbol::NON_PIC_REF): Remove.
3296 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3297 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3298 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3299 (Symbol::use_plt_offset): Take a flags argument and pass it
3300 directly to needs_dynamic_reloc. Restrict check for undefined
3301 weak symbols to function calls.
3302 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3303 (Target_arm::Scan::global): Use it.
3304 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3305 (Target_arm::Relocate::relocate): Likewise.
3306 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3307 parameter with an r_type parameter. Use get_reference_flags
3308 to get the flags.
3309 (Target_arm::Relocate::relocate): Update accordingly.
3310 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3311 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3312 (Target_i386::Scan::global): Likewise.
3313 (Target_i386::Relocate::relocate): Likewise.
3314 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3315 parameter with an r_type parameter. Use get_reference_flags
3316 to get the flags.
3317 (Target_i386::Relocate::relocate): Update accordingly.
3318 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3319 (Target_powerpc::Scan::global): Use it.
3320 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3321 (Target_powerpc::Relocate::relocate): Likewise.
3322 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3323 (Target_sparc::Scan::global): Use it.
3324 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3325 (Target_sparc::Relocate::relocate): Likewise.
3326 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3327 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3328 (Target_x86_64::Scan::global): Likewise.
3329 (Target_x86_64::Relocate::relocate): Likewise.
3330
3331 2010-11-08 Doug Kwan <dougkwan@google.com>
3332 Cary Coutant <ccoutant@google.com>
3333
3334 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3335 (Arm_exidx_merge_section::section_contents_): New data member.
3336 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3337 (Arm_input_section::~Arm_input_section): De-allocate memory.
3338 (Arm_input_section::original_contents_): New data member.
3339 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3340 in parameters instead of calling Object::section_contents without
3341 locking.
3342 (Arm_output_section::group_section): New parameter TASK. Pass it
3343 to callees that need locking objects.
3344 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3345 to lock EXIDX input sections. Fix a formatting issue. Call
3346 Arm_exidx_merged_section::build_contents to create merged section
3347 contents.
3348 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3349 to lock object of stub table owner.
3350 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3351 TEXT_SIZE to initialize data member TEXT_SIZE_.
3352 (Arm_exidx_input_section::addralign): Fix typo in comment.
3353 (Arm_exidx_input_section::text_size): New method.
3354 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3355 that require locking objects. Lock objects before scanning for stubs
3356 and updating local symbols.
3357 (Arm_input_section<big_endian>::init): Copy contents of original
3358 input section.
3359 (Arm_input_section<big_endian>::do_write): Use saved contents of
3360 original input section instead of calling Object::section_contents
3361 without locking.
3362 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3363 size without calling Object::section_size().
3364 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3365 for size. Allocate a buffer for merged EXIDX entries.
3366 (Arm_exidx_merged_section::build_contents): New method.
3367 (Arm_exidx_merged_section::do_write): Move merge section contents
3368 building code to Arm_exidx_merged_section::build_contetns. Write
3369 out contetns in buffer instead of building it on the fly.
3370 (Arm_relobj::make_exidx_input_section): Also pass text section size
3371 to Arm_exidx_input_section constructor.
3372 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3373 (Arm_dynobj::do_read_symbols): Fix memory leak.
3374 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3375 * target.h: (class Task): Add forward declaration.
3376 (Target::relax): Add new parameter TASK and pass it to
3377 Target::do_relax().
3378 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3379
3380 2010-11-05 Cary Coutant <ccoutant@google.com>
3381
3382 PR gold/10708
3383 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3384 object when reading from the file.
3385 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3386 second layout pass.
3387 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3388 when reading section contents.
3389 (get_section_contents): Likewise.
3390 (icf::find_identical_sections): Likewise.
3391 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3392 object when reading from the file.
3393 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3394 the object when doing deferred section layout.
3395
3396 2010-11-03 Nick Clifton <nickc@redhat.com>
3397
3398 PR gold/12001
3399 * script.h (class Symbol_assignment: name): New member. Returns
3400 the name of the symbol.
3401 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3402 Returns true if the given symbol name is on the list of
3403 assignments wating to be processed.
3404 * archive.cc (should_incldue_member): If the symbol is undefined,
3405 check to see if it is on the list of symbols pending assignment.
3406
3407 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3408
3409 * script-sections.cc (Script_sections::find_memory_region): Check
3410 for a NULL output section pointer.
3411
3412 2010-10-29 Doug Kwan <dougkwan@google.com>
3413
3414 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3415 Output_section::add_relaxed_input_section.
3416 * output.cc (Output_section::add_relaxed_input_section): Add new
3417 arguments LAYOUT and NAME. Set section order index.
3418 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3419 Copy section order index.
3420 * output.h (Output_section::add_relaxed_input_section): Add new
3421 arguments LAYOUT and NAME.
3422
3423 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3424
3425 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3426 NATIVE_OR_CROSS_LINKER.
3427 * testsuite/Makefile.in: Regenerate.
3428
3429 2010-10-20 Doug Kwan <dougkwan@google.com>
3430
3431 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3432 without SHF_LINK_ORDER flags.
3433 * layout.cc (Layout::choose_output_section): Do not filter
3434 SHF_LINK_ORDER flag in a relocatable link.
3435
3436 2010-10-17 Cary Coutant <ccoutant@google.com>
3437
3438 * output.h (Output_segment::set_section_addresses): Change function
3439 signature. Update all callers.
3440 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3441 sections.
3442 (Output_segment::set_section_addresses): Align after last TLS
3443 section. Add padding before last relro section instead of after.
3444
3445 2010-10-17 Doug Kwan <dougkwan@google.com>
3446
3447 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3448 GOT output section to be writable.
3449
3450 2010-10-14 Cary Coutant <ccoutant@google.com>
3451
3452 * debug.h (DEBUG_INCREMENTAL): New flag.
3453 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3454 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3455 mode.
3456 * incremental.cc (report_command_line): Ignore all forms of
3457 --incremental.
3458 * layout.cc (Layout::Layout): Check parameters for incremental link
3459 mode.
3460 * options.cc (General_options::parse_incremental): New function.
3461 (General_options::parse_no_incremental): New function.
3462 (General_options::parse_incremental_full): New function.
3463 (General_options::parse_incremental_update): New function.
3464 (General_options::incremental_mode_): New data member.
3465 (General_options::finalize): Check incremental_mode_.
3466 * options.h (General_options): Update help text for --incremental.
3467 Add --no-incremental, --incremental-full, --incremental-update.
3468 (General_options::Incremental_mode): New enum type.
3469 (General_options::incremental_mode): New function.
3470 (General_options::incremental_mode_): New data member.
3471 * parameters.cc (Parameters::incremental_mode_): New data member.
3472 (Parameters::set_options): Set incremental_mode_.
3473 (Parameters::set_incremental_full): New function.
3474 (Parameters::incremental): New function.
3475 (Parameters::incremental_update): New function.
3476 (set_parameters_incremental_full): New function.
3477 * parameters.h (Parameters::set_incremental_full): New function.
3478 (Parameters::incremental): New function.
3479 (Parameters::incremental_update): New function.
3480 (Parameters::incremental_mode_): New data member.
3481 (set_parameters_incremental_full): New function.
3482 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3483 incremental link mode.
3484 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3485 (Sized_relobj::do_relocate_sections): Likewise.
3486 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3487 option.
3488 * testsuite/Makefile.in: Regenerate.
3489 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3490
3491 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3492
3493 * script-sections.h (class Script_sections): Make
3494 Sections_elements typedef public.
3495 * script-sections.cc (class Sort_output_sections): Add elements_
3496 field. Add constructor which sets it; change all callers.
3497 (Sort_output_sections::is_before): New function.
3498 (Sort_output_sections::operator()): Call is_before.
3499 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3500 conditional.
3501 * testsuite/script_test_10.sh: New test. Test script section
3502 order.
3503 * testsuite/script_test_10.t: Likewise.
3504 * testsuite/script_test_10.s: Likewise.
3505 * testsuite/Makefile.am: Wrap the cross linker tests and the
3506 common tests into NATIVE_OR_CROSS_LINKER.
3507 (check_SCRIPTS): Add script_test_10.sh.
3508 (check_DATA): Add script_test_10.stdout.
3509 (script_test_10.o, script_test_10): New targets.
3510 (script_test_10.stdout): New target.
3511 * configure, testsuite/Makefile.in: Regenerate.
3512
3513 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3514
3515 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3516 error for the deprecated relocations.
3517 (Target_arm::Scan::global): Likewise.
3518 (Target_arm::Relocate::relocate): Likewise.
3519
3520 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3521
3522 * fileread.cc (Input_file::find_file): Initialize *found_name
3523 and *namep when using the fallback search for case 4.
3524
3525 2010-10-11 Cary Coutant <ccoutant@google.com>
3526
3527 * options.h (class General_options): Redefine -z lazy as an alias for
3528 the negation of -z now.
3529
3530 2010-10-11 Ian Lance Taylor <iant@google.com>
3531
3532 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3533 binding.
3534
3535 2010-10-06 Nick Clifton <nickc@redhat.com>
3536
3537 * script-sections.cc(class Memory_region): Remove
3538 current_lma_offset_ field. Rename current_vma_offset_ to
3539 current_offset_. Add last_section_ field.
3540 (Memory_region::get_current_vma_address): Rename to
3541 get_current_address.
3542 (Memory_region::get_current_lma_address): Delete.
3543 (Memory_region::increment_vma_offset): Rename to
3544 increment_offset.
3545 (Memory_region::increment_lma_offset): Delete.
3546 (Memory_region::attributes_compatible): New method. Returns
3547 true if the provided section is compatible with the region.
3548 (Memory_region::get_last_section): New method. Returns the last
3549 section to use the region.
3550 (Memory_region::set_last_section): New method. Stores the last
3551 section to use the region.
3552 (Script_sections::block_in_region): New method. Returns true if
3553 a block of memory is contained within a region.
3554 (Script_sections::find_memory_region): New method. Locates a
3555 memory region to be used to set a VMA or LMA address.
3556 (Output_section_definition::set_section_addresses): Add code to
3557 check for addresses set by memory regions.
3558 (Output_segment::set_section_addresses): Remove memory region
3559 walking code.
3560 (Script_sections::create_segment): Add a warning if a header
3561 segment is created outside of any region.
3562 * script-sections.h (class Script_sections): Add prototypes for
3563 find_memory_region and block_in_region methods.
3564 * testsuite/memory_test.s: Use .long instead of .word.
3565 * testsuite/memory_test.t: Add some more output sections.
3566 * testsuite/memory_test.sh: Update expected output.
3567
3568 2010-10-02 Doug Kwan <dougkwan@google.com>
3569
3570 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3571 defintion to symtab.h
3572 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3573 declaration to defintion.
3574
3575 2010-10-01 Nick Clifton <nickc@redhat.com>
3576
3577 * expression.cc (eval): Replace dummy argument with NULL.
3578 (eval_maybe_dot): Check for a NULL result section pointer.
3579 (Symbol_expression::value): Likewise.
3580 (Dot_expression::value): Likewise.
3581 (BINARY_EXPRESSION): Likewise.
3582 (Max_expression::value): Likewise.
3583 (Min_expression::value): Likewise.
3584 (Absolute_expression::value): Likewise.
3585 (Addr_expression::value_from_output_section): Likewise.
3586 (Loaddddr_expression::value_from_output_section): Likewise.
3587 (Segment_start_expression::value): Likewise.
3588 * script-sections.cc
3589 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3590 argument with NULL.
3591 (Sections_elememt_dot_assignment::set_section_addresses):
3592 Likewise.
3593 (Output_data_expression::do_write_to_buffer): Likewise.
3594 (Output_section_definition::finalize_symbols): Likewise.
3595 (Output_section_definition::set_section_addresses): Likewise.
3596
3597 2010-09-30 Doug Kwan <dougkwan@google.com>
3598
3599 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3600
3601 2010-09-28 Sriraman Tallam <tmsriram@google.com>
3602
3603 * target.h (Target::can_icf_inline_merge_sections): New virtual
3604 function.
3605 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3606 virtual function.
3607 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3608 virtual function.
3609 * icf.cc (get_section_contents): Inline merge sections only when
3610 target allows it.
3611
3612 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3613
3614 * configure: Regenerate.
3615
3616 2010-09-17 Ian Lance Taylor <iant@google.com>
3617
3618 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
3619 * testsuite/Makefile.am (memory_test.o): New target.
3620 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3621 memory_test.t.
3622 * testsuite/Makefile.in: Rebuild.
3623
3624 2010-09-17 Doug Kwan <dougkwan@google.com>
3625
3626 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3627 defintion if relocation uses GOT entries of the symbol.
3628 * testsuite/icf_safe_test.sh: Fix test.
3629 * testsuite/icf_safe_so_test.sh: Fix test.
3630
3631 2010-09-16 Cary Coutant <ccoutant@google.com>
3632
3633 * script_sections.cc (class Memory_region): Remove "NULL" from
3634 vector initializations.
3635
3636 2010-09-15 Cary Coutant <ccoutant@google.com>
3637
3638 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3639 Resolve forwarding symbols.
3640
3641 2010-09-15 Doug Kwan <dougkwan@google.com>
3642
3643 * gold/testsuite/script_test_3.t: Add ARM special sections.
3644 * gold/testsuite/script_test_4.t: Same.
3645 * gold/testsuite/script_test_5.t: Same.
3646 * gold/testsuite/script_test_6.t: Same.
3647 * gold/testsuite/script_test_7.t: Same.
3648 * gold/testsuite/script_test_7.t: Same.
3649 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3650
3651 2010-09-14 Cary Coutant <ccoutant@google.com>
3652
3653 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3654 (Target_x86_64::Relocate::relocate_tls): Replace check for
3655 saw_tls_block_reloc_ with test for executable section.
3656
3657 2010-09-12 Cary Coutant <ccoutant@google.com>
3658
3659 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3660 position-independent executables to shared libraries need dynamic
3661 relocations.
3662 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3663 position-independent executables.
3664 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3665 * testsuite/Makefile.in: Regenerate.
3666
3667 2010-09-10 Nick Clifton <nickc@redhat.com>
3668
3669 PR gold/11997
3670 * testsuite/memory_test.t: Discard any sections that are not
3671 needed.
3672
3673 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3674
3675 PR gold/11996
3676 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3677 "This::" to work around a bug in gcc 4.2.
3678
3679 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3680
3681 2010-09-09 Rafael Espindola <espindola@google.com>
3682
3683 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3684 sections with different PF_X flags in the same segment.
3685 (Layout::find_first_load_seg): Search all segments to find the first
3686 one.
3687 * options.h (rosegment): New.
3688
3689 2010-09-08 Rafael Espindola <espindola@google.com>
3690
3691 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
3692
3693 2010-09-08 Doug Kwan <dougkwan@google.com>
3694
3695 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3696 (Arm_relobj::do_relocate_sections): Add new parameter for output
3697 file to match the parent.
3698 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3699 of local symbols instead of input values. Update code to track
3700 changes in gold::relocate_section.
3701 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3702 (Sized_relobj::compute_final_local_value_internal): New methods.
3703 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3704 body into private version of Sized_relobj::compute_final_local_value.
3705 Call the inline method.
3706 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3707 merged symbol value if there is one.
3708 (Symbol_value::has_output_value): New method defintiion.
3709 (Sized_relobj::Compute_final_local_value_status): New enum type.
3710 (Sized_relobj::compute_final_local_value): New methods.
3711 (Sized_relobj::compute_final_local_value_internal): New methods.
3712 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3713 and arm_cortex_a8.sh.
3714 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3715 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3716 New tests.
3717 * Makefile.in: Regenerate.
3718 * testsuite/arm_bl_out_of_range.s: Update test.
3719 * testsuite/thumb_bl_out_of_range.s: Ditto.
3720 * testsuite/thumb_blx_out_of_range.s: Ditto.
3721 * testsuite/arm_branch_out_of_range.sh: New file.
3722 * testsuite/arm_cortex_a8.sh: Ditto.
3723 * testsuite/arm_cortex_a8_b.s: Ditto.
3724 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3725 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3726 * testsuite/arm_cortex_a8_bl.s: Ditto.
3727 * testsuite/arm_cortex_a8_blx.s: Ditto.
3728 * testsuite/arm_cortex_a8_local.s: Ditto.
3729 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3730 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3731
3732 2010-09-08 Rafael Espindola <espindola@google.com>
3733
3734 * Makefile.am (memory_test.stdout): Run readelf with -W.
3735 * Makefile.in: Regenerate.
3736 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3737 64 bit output.
3738
3739 2010-09-08 Rafael Espindola <espindola@google.com>
3740
3741 * script-sections.cc (Script_sections::add_memory_region): Convert
3742 field precision to int.
3743 * script.cc (script_set_section_region, script_set_section_region):
3744 Convert field precision to int.
3745
3746 2010-09-08 Rafael Espindola <espindola@google.com>
3747
3748 * arm.cc (do_finalize_sections): Create the __exidx_start and
3749 __exdix_end symbols even when the section is missing.
3750
3751 2010-09-08 Nick Clifton <nickc@redhat.com>
3752
3753 * README: Remove claim that MEMORY is not supported.
3754 * expression.cc (script_exp_function_origin)
3755 (script_exp_function_length): Move from here to ...
3756 * script.cc: ... here.
3757 (script_set_section_region, script_add_memory)
3758 (script_parse_memory_attr, script_include_directive): New
3759 functions.
3760 * script-sections.cc
3761 (class Memory_region): New class.
3762 (class Output_section_definition): Add set_memory_region,
3763 set_section_vma, set_section_lma and get_section_name methods.
3764 (class Script_Sections): Add add_memory_region,
3765 find_memory_region, find_memory_region_origin,
3766 find_memory_region_length and set_memory_region methods.
3767 Have set_section_addresses method walk the list of set memory
3768 regions.
3769 Extend the print methos to display memory regions.
3770 * script-sections.h: Add prototypes for new methods.
3771 Add enum for MEMORY region attributes.
3772 * yyscript.y: Add support for parsing MEMORY regions.
3773 * script-c.h: Add prototypes for new functions.
3774 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3775 * testsuite/Makefile.in: Regenerate.
3776 * testsuite/memory_test.sh: New script.
3777 * testsuite/memory_test.s: New assembler source file.
3778 * testsuite/memory_test.t: New linker script.
3779
3780 2010-08-27 Doug Kwan <dougkwan@google.com>
3781
3782 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3783 reference override an existing dynamic weak reference.
3784 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3785 * testsuite/Makefile.in: Regenerate.
3786 * testsuite/dyn_weak_ref.sh: New file.
3787 * testsuite/dyn_weak_ref_1.c: Ditto.
3788 * testsuite/dyn_weak_ref_2.c: Ditto.
3789
3790 2010-08-27 Ian Lance Taylor <iant@google.com>
3791
3792 * incremental.h (class Incremental_input_entry): Add virtual
3793 destructor.
3794
3795 2010-08-27 Ian Lance Taylor <iant@google.com>
3796
3797 * testsuite/start_lib_test_3.c: Mark t3 as used.
3798
3799 2010-08-27 Nick Clifton <nickc@redhat.com>
3800
3801 * options.cc (version_script): Fix small typo in previous
3802 whitespace tidyup.
3803
3804 2010-08-25 Nick Clifton <nickc@redhat.com>
3805
3806 * archive.cc: Formatting fixes: Remove whitespace between
3807 typename and following asterisk. Remove whitespace between
3808 function name and opening parenthesis.
3809 * archive.h: Likewise.
3810 * arm.cc: Likewise.
3811 * attributes.cc: Likewise.
3812 * attributes.h: Likewise.
3813 * common.cc: Likewise.
3814 * copy-relocs.cc: Likewise.
3815 * dirsearch.h: Likewise.
3816 * dynobj.cc: Likewise.
3817 * ehframe.cc: Likewise.
3818 * ehframe.h: Likewise.
3819 * expression.cc: Likewise.
3820 * fileread.cc: Likewise.
3821 * fileread.h: Likewise.
3822 * gc.h: Likewise.
3823 * gold-threads.cc: Likewise.
3824 * gold.cc: Likewise.
3825 * i386.cc: Likewise.
3826 * icf.h: Likewise.
3827 * incremental-dump.cc: Likewise.
3828 * incremental.cc: Likewise.
3829 * layout.cc: Likewise.
3830 * layout.h: Likewise.
3831 * main.cc: Likewise.
3832 * merge.cc: Likewise.
3833 * merge.h: Likewise.
3834 * object.cc: Likewise.
3835 * object.h: Likewise.
3836 * options.cc: Likewise.
3837 * options.h: Likewise.
3838 * output.cc: Likewise.
3839 * output.h: Likewise.
3840 * plugin.cc: Likewise.
3841 * plugin.h: Likewise.
3842 * powerpc.cc: Likewise.
3843 * reloc.cc: Likewise.
3844 * script-c.h: Likewise.
3845 * script-sections.cc: Likewise.
3846 * script.cc: Likewise.
3847 * stringpool.cc: Likewise.
3848 * symtab.cc: Likewise.
3849 * symtab.h: Likewise.
3850 * target.cc: Likewise.
3851 * timer.cc: Likewise.
3852 * timer.h: Likewise.
3853 * version.cc: Likewise.
3854 * x86_64.cc: Likewise.
3855
3856 2010-08-24 Nick Clifton <nickc@redhat.com>
3857
3858 PR 11899
3859 * layout.cc (segment_precedes): Sort segments by their physical
3860 addresses, if they have been set.
3861
3862 2010-08-23 Cary Coutant <ccoutant@google.com>
3863
3864 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3865 symbols data.
3866 (Lib_group::include_member): Unlock object after deleting its
3867 symbols data.
3868 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3869 the bug fixed here.
3870
3871 2010-08-19 Neil Vachharajani <nvachhar@google.com>
3872 Cary Coutant <ccoutant@google.com>
3873
3874 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3875 constructor, and set_blocker.
3876 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3877 readsyms_blocker_.
3878 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3879 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3880 * testsuite/Makefile.am (start_lib_test): New test case.
3881 * testsuite/Makefile.in: Regenerate.
3882 * testsuite/start_lib_test_main.c: New file.
3883 * testsuite/start_lib_test_1.c: New file.
3884 * testsuite/start_lib_test_2.c: New file.
3885 * testsuite/start_lib_test_3.c: New file.
3886
3887 2010-08-19 Ian Lance Taylor <iant@google.com>
3888
3889 * Makefile.in: Rebuild with automake 1.11.1.
3890 * aclocal.m4: Likewise.
3891 * testsuite/Makefile.in: Likewise.
3892
3893 2010-08-19 Ian Lance Taylor <iant@google.com>
3894
3895 PR 10893
3896 * i386.cc (class Output_data_plt_i386): Update declarations.
3897 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3898 local_ifuncs_ fields.
3899 (Target_i386::do_plt_section_for_global): New function.
3900 (Target_i386::do_plt_section_for_local): New function.
3901 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3902 parameter; change all callers. Initialize global_ifuncs_ and
3903 local_ifuncs_. If doing a static link define __rel_iplt_start and
3904 __rel_iplt_end.
3905 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3906 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3907 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3908 symbols.
3909 (Target_i386::make_plt_section): New function, broken out of
3910 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3911 (Target_i386::make_plt_entry): Call make_plt_section.
3912 (Target_i386::make_local_ifunc_plt_entry): New function.
3913 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3914 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3915 R_386_IRELATIVE to switch.
3916 (Target_i386::Scan::global): Likewise.
3917 (Target_i386::Relocate::relocate): Likewise.
3918 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3919 switch.
3920 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3921 (Target_x86_64::do_plt_section_for_global): New function.
3922 (Target_x86_64::do_plt_section_for_local): New function.
3923 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3924 parameter; change all callers. If doing a static link define
3925 __rela_iplt_start and __rela_iplt_end.
3926 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3927 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3928 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3929 to point to .plt.
3930 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3931 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3932 switch.
3933 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3934 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3935 R_X86_64_IRELATIVE to switch.
3936 (Target_x86_64::Scan::global): Likewise.
3937 (Target_x86_64::Relocate::relocate): Likewise.
3938 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3939 switch.
3940 * target.h (class Target): Add plt_section_for_global and
3941 plt_section_for_local functions. Add do_plt_section_for_global
3942 and do_plt_section_for_local virtual functions.
3943 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3944 clarifying comments.
3945 (Symbol::use_plt_offset): Handle IFUNC symbol.
3946 * object.cc (Sized_relobj::Sized_relobj): Initialize
3947 local_plt_offsets_.
3948 (Sized_relobj::local_has_plt_offset): New function.
3949 (Sized_relobj::local_plt_offset): New function.
3950 (Sized_relobj::set_local_plt_offset): New function.
3951 (Sized_relobj::do_count): Handle IFUNC symbol.
3952 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3953 a bit away from input_shndx_ field. Add set_is_func_symbol and
3954 is_ifunc_symbol functions.
3955 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3956 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3957 local_plt_offsets_ field.
3958 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3959 * output.h (class Output_section_data): Add non-const
3960 output_section function.
3961 (class Output_data_got): Update declarations.
3962 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3963 Add use_plt_offset parameter to global and local constructors.
3964 Change all callers. Change local_sym_index_ field to 31 bits.
3965 Change GSYM_CODE and CONSTANT_CODE accordingly.
3966 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3967 doing a static link don't set sh_link field.
3968 (Output_data_got::Got_entry::write): Use PLT offset if
3969 appropriate.
3970 (Output_data_got::add_global_plt): New function.
3971 (Output_data_got::add_local_plt): New function.
3972 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3973 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3974 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3975 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3976 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3977 IFUNC conditional.
3978 * testsuite/ifunc-sel.h: New file.
3979 * testsuite/ifuncmain1.c: New file.
3980 * testsuite/ifuncmain1vis.c: New file.
3981 * testsuite/ifuncmod1.c: New file.
3982 * testsuite/ifuncdep2.c: New file.
3983 * testsuite/ifuncmain2.c: New file.
3984 * testsuite/ifuncmain3.c: New file.
3985 * testsuite/ifuncmod3.c: New file.
3986 * testsuite/ifuncmain4.c: New file.
3987 * testsuite/ifuncmain5.c: New file.
3988 * testsuite/ifuncmod5.c: New file.
3989 * testsuite/ifuncmain6pie.c: New file.
3990 * testsuite/ifuncmod6.c: New file.
3991 * testsuite/ifuncmain7.c: New file.
3992 * configure, testsuite/Makefile.in: Rebuild.
3993
3994 2010-08-18 Ian Lance Taylor <iant@google.com>
3995
3996 * incremental.cc
3997 (Output_section_incremental_inputs::write_input_files): Add cast
3998 to avoid signed/unsigned comparison warning.
3999 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4000
4001 2010-08-12 Cary Coutant <ccoutant@google.com>
4002
4003 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4004
4005 2010-08-13 Ian Lance Taylor <iant@google.com>
4006
4007 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4008
4009 2010-08-12 Cary Coutant <ccoutant@google.com>
4010 Doug Kwan <dougkwan@google.com>
4011
4012 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4013 defintion overrides non-weak undef, remember that the original undef
4014 is not weak.
4015 * symtab.cc (Symbol_table::sized_write_global): For undef without
4016 an original weak binding, set binding to global in output.
4017 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4018 * testsuite/Makefile.in: Regenerate.
4019 * testsuite/strong_ref_weak_def.sh: New file.
4020 * testsuite/strong_ref_weak_def_1.c: Ditto.
4021 * testsuite/strong_ref_weak_def_2.c: Ditto.
4022
4023 2010-08-12 Cary Coutant <ccoutant@google.com>
4024
4025 * testsuite/incremental_test.sh: Rewrite.
4026 * testsuite/incremental_test_1.c: Rewrite.
4027 * testsuite/incremental_test_2.c: Rewrite.
4028
4029 2010-08-12 Cary Coutant <ccoutant@google.com>
4030
4031 * arm.cc (Target_arm::got_size): Add const.
4032 (Target_arm::got_entry_count): New function.
4033 (Target_arm::plt_entry_count): New function.
4034 (Target_arm::first_plt_entry_offset): New function.
4035 (Target_arm::plt_entry_size): New function.
4036 (Output_data_plt_arm::entry_count): New function.
4037 (Output_data_plt_arm::first_plt_entry_offset): New function.
4038 (Output_data_plt_arm::get_plt_entry_size): New function.
4039 * i386.cc (Target_i386::got_size): Add const.
4040 (Target_i386::got_entry_count): New function.
4041 (Target_i386::plt_entry_count): New function.
4042 (Target_i386::first_plt_entry_offset): New function.
4043 (Target_i386::plt_entry_size): New function.
4044 (Output_data_plt_i386::entry_count): New function.
4045 (Output_data_plt_i386::first_plt_entry_offset): New function.
4046 (Output_data_plt_i386::get_plt_entry_size): New function.
4047 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4048 find_incremental_inputs_sections. Dump incremental_got_plt section.
4049 * incremental.cc: Include target.h.
4050 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4051 parameter. Adjust all callers. Find incremental_got_plt section.
4052 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4053 section.
4054 (Output_section_incremental_inputs::set_final_data_size): Calculate
4055 size of incremental_got_plt section.
4056 (Output_section_incremental_inputs::do_write): Write the
4057 incremental_got_plt section.
4058 (Got_plt_view_info): New struct.
4059 (Local_got_offset_visitor): New class.
4060 (Global_got_offset_visitor): New class.
4061 (Global_symbol_visitor_got_plt): New class.
4062 (Output_section_incremental_inputs::write_got_plt): New function.
4063 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4064 Add parameter. Adjust all callers.
4065 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4066 (Incremental_inputs::got_plt_section): New function.
4067 (Incremental_inputs::got_plt_section_): New data member.
4068 (Incremental_got_plt_reader): New class.
4069 * layout.cc (Layout::create_incremental_info_sections): Add the
4070 incremental_got_plt section.
4071 * object.h (Got_offset_list::get_list): New function.
4072 (Got offset_list::for_all_got_offsets): New function.
4073 (Sized_relobj::local_got_offset_list): New function.
4074 * powerpc.cc (Target_powerpc::got_size): Add const.
4075 (Target_powerpc::got_entry_count): New function.
4076 (Target_powerpc::plt_entry_count): New function.
4077 (Target_powerpc::first_plt_entry_offset): New function.
4078 (Target_powerpc::plt_entry_size): New function.
4079 (Output_data_plt_powerpc::entry_count): New function.
4080 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4081 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4082 * sparc.cc (Target_sparc::got_size): Add const.
4083 (Target_sparc::got_entry_count): New function.
4084 (Target_sparc::plt_entry_count): New function.
4085 (Target_sparc::first_plt_entry_offset): New function.
4086 (Target_sparc::plt_entry_size): New function.
4087 (Output_data_plt_sparc::entry_count): New function.
4088 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4089 (Output_data_plt_sparc::get_plt_entry_size): New function.
4090 * symtab.h (Symbol::got_offset_list): New function.
4091 (Symbol_table::for_all_symbols): New function.
4092 * target.h (Sized_target::got_entry_count): New function.
4093 (Sized_target::plt_entry_count): New function.
4094 (Sized_target::plt_entry_size): New function.
4095 * x86_64.cc (Target_x86_64::got_size): Add const.
4096 (Target_x86_64::got_entry_count): New function.
4097 (Target_x86_64::plt_entry_count): New function.
4098 (Target_x86_64::first_plt_entry_offset): New function.
4099 (Target_x86_64::plt_entry_size): New function.
4100 (Output_data_plt_x86_64::entry_count): New function.
4101 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4102 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4103
4104 2010-08-12 Cary Coutant <ccoutant@google.com>
4105
4106 * archive.cc: Include incremental.h.
4107 (Archive::Archive): Initialize incremental_info_.
4108 (Archive::include_member): Record archive members in incremental info.
4109 (Add_archive_symbols::run): Record begin and end of an archive in
4110 incremental info.
4111 (Lib_group::include_member): Record objects in incremental info.
4112 * archive.h (Incremental_archive_entry): Forward declaration.
4113 (Archive::set_incremental_info): New member function.
4114 (Archive::incremental_info): New member function.
4115 (Archive::Unused_symbol_iterator): New class.
4116 (Archive::unused_symbols_begin): New member function.
4117 (Archive::unused_symbols_end): New member function.
4118 (Archive::incremental_info_): New data member.
4119 * incremental-dump.cc (find_input_containing_global): New function.
4120 (dump_incremental_inputs): Dump new incremental info sections.
4121 * incremental.cc: Include symtab.h.
4122 (Output_section_incremental_inputs): New class.
4123 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4124 new incremental info sections.
4125 (Sized_incremental_binary::do_check_inputs): Likewise.
4126 (Incremental_inputs::report_archive): Remove.
4127 (Incremental_inputs::report_archive_begin): New function.
4128 (Incremental_inputs::report_archive_end): New function.
4129 (Incremental_inputs::report_object): New function.
4130 (Incremental_inputs::finalize_inputs): Remove.
4131 (Incremental_inputs::report_input_section): New function.
4132 (Incremental_inputs::report_script): Rewrite.
4133 (Incremental_inputs::finalize): Do nothing but finalize string table.
4134 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4135 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4136 (Incremental_inputs::create_data_sections): New function.
4137 (Incremental_inputs::relocs_entsize): New function.
4138 (Output_section_incremental_inputs::set_final_data_size): New function.
4139 (Output_section_incremental_inputs::do_write): New function.
4140 (Output_section_incremental_inputs::write_header): New function.
4141 (Output_section_incremental_inputs::write_input_files): New function.
4142 (Output_section_incremental_inputs::write_info_blocks): New function.
4143 (Output_section_incremental_inputs::write_symtab): New function.
4144 * incremental.h (Incremental_script_entry): Forward declaration.
4145 (Incremental_object_entry): Forward declaration.
4146 (Incremental_archive_entry): Forward declaration.
4147 (Incremental_inputs): Forward declaration.
4148 (Incremental_inputs_header_data): Remove.
4149 (Incremental_inputs_header): Remove.
4150 (Incremental_inputs_header_write): Remove.
4151 (Incremental_inputs_entry_data): Remove.
4152 (Incremental_inputs_entry): Remove.
4153 (Incremental_inputs_entry_write): Remove.
4154 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4155 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4156 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4157 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4158 Likewise.
4159 (Incremental_input_entry): New class.
4160 (Incremental_script_entry): New class.
4161 (Incremental_object_entry): New class.
4162 (Incremental_archive_entry): New class.
4163 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4164 (Incremental_inputs::report_inputs): Remove.
4165 (Incremental_inputs::report_archive): Remove.
4166 (Incremental_inputs::report_archive_begin): New function.
4167 (Incremental_inputs::report_archive_end): New function.
4168 (Incremental_inputs::report_object): Change prototype.
4169 (Incremental_inputs::report_input_section): New function.
4170 (Incremental_inputs::report_script): Change prototype.
4171 (Incremental_inputs::get_reloc_count): New function.
4172 (Incremental_inputs::set_reloc_count): New function.
4173 (Incremental_inputs::create_data_sections): New function.
4174 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4175 (Incremental_inputs::inputs_section): New function.
4176 (Incremental_inputs::symtab_section): New function.
4177 (Incremental_inputs::relocs_section): New function.
4178 (Incremental_inputs::get_stringpool): Add const.
4179 (Incremental_inputs::command_line): Add const.
4180 (Incremental_inputs::inputs): Remove.
4181 (Incremental_inputs::command_line_key): New function.
4182 (Incremental_inputs::input_file_count): New function.
4183 (Incremental_inputs::input_files): New function.
4184 (Incremental_inputs::relocs_entsize): New function.
4185 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4186 (Incremental_inputs::finalize_inputs): Remove.
4187 (Incremental_inputs::Input_info): Remove.
4188 (Incremental_inputs::lock_): Remove.
4189 (Incremental_inputs::inputs_): Change type.
4190 (Incremental_inputs::inputs_map_): Remove.
4191 (Incremental_inputs::current_object_entry_): New data member.
4192 (Incremental_inputs::inputs_section_): New data member.
4193 (Incremental_inputs::symtab_section_): New data member.
4194 (Incremental_inputs::relocs_section_): New data member.
4195 (Incremental_inputs::reloc_count_): New data member.
4196 (Incremental_inputs_reader): New class.
4197 (Incremental_symtab_reader): New class.
4198 (Incremental_relocs_reader): New class.
4199 * layout.cc (Layout::finalize): Move finalization of incremental info
4200 and creation of incremental info sections to follow finalization of
4201 symbol table. Set offsets for postprocessing sections.
4202 (Layout::create_incremental_info_sections): Call
4203 Incremental_inputs::create_data_sections. Add incremental symtab
4204 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4205 sections to layout after input sections.
4206 * layout.h (struct Timespec): Forward declaration.
4207 (Layout::incremental_inputs): Add const.
4208 (Layout::create_incremental_info_sections): Add parameter.
4209 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4210 * object.cc: Include incremental.h.
4211 (Relobj::finalize_incremental_relocs): New function.
4212 (Sized_relobj::do_layout): Record input sections in incremental info.
4213 * object.h (Object::output_section): New function.
4214 (Object::output_section_offset): Moved from Relobj.
4215 (Object::get_incremental_reloc_base): New function.
4216 (Object::get_incremental_reloc_count): New function.
4217 (Object::do_output_section): New function.
4218 (Object::do_output_section_offset): Moved from Relobj.
4219 (Object::do_get_incremental_reloc_base): New function.
4220 (Object::do_get_incremental_reloc_count): New function.
4221 (Object::Object): Initialize new data members.
4222 (Relobj::output_section): Renamed do_output_section and moved to
4223 protected.
4224 (Relobj::output_section_offset): Moved to Object.
4225 (Relobj::do_get_incremental_reloc_base): New function.
4226 (Relobj::do_get_incremental_reloc_count): New function.
4227 (Relobj::allocate_incremental_reloc_counts): New function.
4228 (Relobj::count_incremental_reloc): New function.
4229 (Relobj::finalize_incremental_relocs): New function.
4230 (Relobj::next_incremental_reloc_index): New function.
4231 (Relobj::reloc_counts_): New data member.
4232 (Relobj::reloc_bases_): New data member.
4233 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4234 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4235 (Sized_relobj::incremental_relocs_scan): New function.
4236 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4237 (Sized_relobj::incremental_relocs_write): New function.
4238 (Sized_relobj::incremental_relocs_write_reltype): New function.
4239 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4240 incremental link.
4241 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4242 archives and object files elsewhere.
4243 (Add_symbols::run): Report object files here.
4244 (Finish_group::run): Report end of archive at end of group.
4245 * reloc.cc: Include layout.h, incremental.h.
4246 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4247 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4248 (Sized_relobj::incremental_relocs_scan): New function.
4249 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4250 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4251 (Sized_relobj::incremental_relocs_write): New function.
4252 (Sized_relobj::incremental_relocs_write_reltype): New function.
4253 * script.cc (read_input_script): Rewrite test for incremental link.
4254 Change call to Incremental_inputs::report_script.
4255 * symtab.h (Symbol_table::first_global_index): New function.
4256 (Symbol_table::output_count): New function.
4257
4258 2010-08-12 Doug Kwan <dougkwan@google.com>
4259
4260 * arm.cc (Target_arm::merge_object_attributes): Check command line
4261 options --no-wchar-size-warning and --no-enum-size-warning.
4262 * options.h (General_options): Add ld-compatible options
4263 --no-enum-size-warning and --no-wchar-size-warning.
4264
4265 2010-08-04 Ian Lance Taylor <iant@google.com>
4266
4267 * x86_64.cc (Target_x86_64::Scan::local): Use
4268 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4269 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4270 (Target_x86_64::Scan::global): Likewise.
4271 (Target_x86_64::Relocate::relocate): Likewise.
4272 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4273 Likewise.
4274
4275 2010-08-03 Cary Coutant <ccoutant@google.com>
4276
4277 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4278 to reserve space in merged_strings vector. Keep total input size
4279 for stats.
4280 (Output_merge_string::do_print_merge_stats): Print total input size.
4281 * merge.h (Output_merge_string): Add input_size_ field.
4282 * stringpool.cc (Stringpool_template::string_length): Move
4283 implementations out of Stringpool_template class and place in
4284 stringpool.h.
4285 * stringpool.h (string_length): Move out of Stringpool_template.
4286
4287 2010-08-03 Ian Lance Taylor <iant@google.com>
4288
4289 PR 11712
4290 * layout.cc (relaxation_loop_body): If address of load segment is
4291 set, adjust address to include headers if possible.
4292
4293 2010-08-03 Ian Lance Taylor <iant@google.com>
4294
4295 * version.cc (version_string): Bump to 1.10.
4296
4297 2010-08-03 Ian Lance Taylor <iant@google.com>
4298
4299 PR 11805
4300 * layout.h (enum Output_section_order): Define.
4301 (class Layout): Update declarations.
4302 * layout.cc (Layout::get_output_section): Add order parameter.
4303 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4304 is_first_non_relro parameters. Change all callers.
4305 (Layout::choose_output_section): Likewise.
4306 (Layout::add_output_section_data): Likewise.
4307 (Layout::make_output_section): Likewise. Set order.
4308 (Layout::default_section_order): New function.
4309 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4310 * output.cc (Output_section::Output_section): Initialize order_.
4311 Don't initialize deleted fields.
4312 (Output_segment::Output_segment): Don't initialize deleted
4313 fields.
4314 (Output_segment::add_output_section_to_load): New function
4315 replacing add_output_section. Change all callers to call this or
4316 add_output_section_to_nonload.
4317 (Output_segment::add_output_section_to_nonload): New function.
4318 (Output_segment::remove_output_section): Rewrite.
4319 (Output_segment::add_initial_output_data): Likewise.
4320 (Output_segment::has_any_data_sections): Likewise.
4321 (Output_segment::is_first_section_relro): Likewise.
4322 (Output_segment::maximum_alignment): Likewise.
4323 (Output_segment::has_dynamic_reloc): New function replacing
4324 dynamic_reloc_count. Change all callers.
4325 (Output_segment::has_dynamic_reloc_list): New function replacing
4326 dynamic_reloc_count_list. Change all callers.
4327 (Output_segment::set_section_addresses): Rewrite.
4328 (Output_segment::set_offset): Rewrite.
4329 (Output_segment::find_first_and_last_list): Remove.
4330 (Output_segment::set_tls_offsets): Rewrite.
4331 (Output_segment::first_section_load_address): Likewise.
4332 (Output_segment::output_section_count): Likewise.
4333 (Output_segment::section_with_lowest_load_address): Likewise.
4334 (Output_segment::write_section_headers): Likewise.
4335 (Output_segment::print_sections_to_map): Likewise.
4336 * output.h (class Output_data): Remove dynamic_reloc_count_
4337 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4338 (Output_data::add_dynamic_reloc): Rewrite.
4339 (Output_data::has_dynamic_reloc): New function.
4340 (Output_data::dynamic_reloc_count): Remove.
4341 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4342 is_last_relro_, is_first_non_relro_, is_interp_,
4343 is_dynamic_linker_section_ fields. Add order and set_order
4344 functions. Remove is_relro_local, set_is_relro_local,
4345 is_last_relro, set_is_last_relro, is_first_non_relro,
4346 set_is_first_non_relro functions, is_interp, set_is_interp,
4347 is_dynamic_linker_section, and set_is_dynamic_linker_section
4348 functions.
4349 (class Output_segment): Change Output_data_list from std::list to
4350 std:;vector. Add output_lists_ field. Remove output_data_ and
4351 output_bss_ fields. Update declarations.
4352
4353 2010-08-02 Ian Lance Taylor <iant@google.com>
4354
4355 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4356 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4357 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4358
4359 2010-08-02 Ian Lance Taylor <iant@google.com>
4360
4361 PR 11855
4362 * script.cc (Script_options::Script_options): Initialize
4363 symbol_definitions_ and symbol_references_.
4364 (Script_options::add_symbol_assignment): Update
4365 symbol_definitions_ and symbol_references_.
4366 (Script_options::add_symbol_reference): New function.
4367 (script_symbol): New function.
4368 * script.h (class Script_options): Add symbol_definitions_ and
4369 symbol_references_ fields.
4370 (Script_options::referenced_const_iterator): New type.
4371 (Script_options::referenced_begin): New function.
4372 (Script_options::referenced_end): New function.
4373 (Script_options::is_referenced): New function.
4374 (Script_options::any_unreferenced): New function.
4375 * script-c.h (script_symbol): Declare.
4376 * yyscript.y (exp): Call script_symbol.
4377 * symtab.cc: Include "script.h".
4378 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4379 Change all callers. Check symbols referenced by scripts.
4380 (Symbol_table::add_undefined_symbols_from_command_line): Add
4381 layout parameter. Change all callers.
4382 (Symbol_table::do_add_undefined_symbols_from_command_line):
4383 Likewise. Break out loop body. Check symbols referenced by
4384 scripts.
4385 (Symbol_table::add_undefined_symbol_from_command_line): New
4386 function broken out of
4387 do_add_undefined_symbols_from_command_line.
4388 * symtab.h (class Symbol_table): Update declarations.
4389 * archive.cc: Include "layout.h".
4390 (Archive::should_include_member): Add layout parameter. Change
4391 all callers. Check for symbol mentioned in expression.
4392 * archive.h (class Archive): Update declaration.
4393 * object.cc (Sized_relobj::do_should_include_member): Add layout
4394 parameter.
4395 * object.h (Object::should_include_member): Add layout parameter.
4396 Change all callers.
4397 (Object::do_should_include_member): Add layout parameter.
4398 (class Sized_relobj): Update declaration.
4399 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4400 parameter.
4401 * dynobj.h (class Sized_dynobj): Update declaration.
4402 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4403 layout parameter.
4404 * plugin.h (class Sized_pluginobj): Update declaration.
4405
4406 2010-08-02 Ian Lance Taylor <iant@google.com>
4407
4408 PR 11866
4409 * output.cc (Output_segment::set_offset): Search for the first and
4410 last sections rather than assuming that the list is in order.
4411 (Output_segment::find_first_and_last_list): New function.
4412 * output.h (class Output_segment): Update declarations.
4413 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4414 (relro_strip_test_SOURCES): New variable.
4415 (relro_strip_test_DEPENDENCIES): New variable.
4416 (relro_strip_test_LDFLAGS): New variable.
4417 (relro_strip_test_LDADD): New variable.
4418 (relro_strip_test.so): New target.
4419
4420 2010-08-02 Ian Lance Taylor <iant@google.com>
4421
4422 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4423 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4424 (Target_i386::got_tlsdesc_section): New function.
4425 (Target_i386::got_section): Create space for GOT entries for
4426 TLSDESC relocations.
4427 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4428 R_386_TLS_GOTDESC.
4429 (Target_i386::Scan::global): Likewise.
4430 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4431 using TLSDESC GOT.
4432 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4433 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4434 (Target_x86_64::got_tlsdesc_section): New function.
4435 (Target_x86_64::got_section): Create space for GOT entries for
4436 TLSDESC relocations.
4437 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4438 R_386_TLS_GOTDESC.
4439 (Target_x86_64::Scan::global): Likewise.
4440 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4441 using TLSDESC GOT.
4442
4443 2010-08-02 Ian Lance Taylor <iant@google.com>
4444
4445 * testsuite/final_layout.sh: Use dc to convert from hex to
4446 decimal.
4447
4448 2010-07-29 Sriraman Tallam <tmsriram@google.com>
4449
4450 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4451 paramter to the call to gold::gc_process_relocs.
4452 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4453 paramter to the call to gold::gc_process_relocs.
4454 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4455 parameter to the call to gold::gc_process_relocs.
4456 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4457 template parameter to the call to gold::gc_process_relocs.
4458 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4459 paramter to the call to gold::gc_process_relocs.
4460 * gc.h (get_embedded_addend_size): New function.
4461 (gc_process_relocs): Save the size of the reloc for use by ICF.
4462 * icf.cc (get_section_contents): Get the addend from the text section
4463 for SHT_REL relocation sections.
4464 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4465 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4466 * int_encoding.h (read_from_pointer): New overloaded function.
4467 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4468 * testsuite/icf_sht_rel_addend_test.sh: New file.
4469 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4470 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4471
4472 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4473
4474 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4475 * Makefile.in: Regenerate.
4476 * testsuite/Makefile.in: Regenerate.
4477
4478 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4479
4480 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4481 * gold/testsuite/debug_msg.cc: Likewise.
4482 * gold/testsuite/odr_violation1.cc
4483 * gold/testsuite/odr_violation2.cc
4484
4485 2010-07-21 Cary Coutant <ccoutant@google.com>
4486
4487 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4488 string, and length fields.
4489 (Output_merge_string::Merged_strings_list): New type.
4490 (Output_merge_string::Merged_strings_lists): New typedef.
4491 (Output_merge_string): Replace merged_strings_ with
4492 merged_strings_lists_.
4493 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4494 Merged_strings_list per input object and section. Don't store pointer
4495 to the string. Don't store length with each merged string entry.
4496 (Output_merge_string::finalize_merged_data): Loop over list of merged
4497 strings lists. Recompute length of each merged string.
4498
4499 2010-07-15 Cary Coutant <ccoutant@google.com>
4500
4501 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4502 here.
4503
4504 2010-07-14 Ian Lance Taylor <iant@google.com>
4505
4506 * descriptors.cc (Descriptors::open): Report correct name in error
4507 message.
4508
4509 2010-07-13 Doug Kwan <dougkwan@google.com>
4510
4511 * arm.cc (Arm_input_section::Arm_input_section): For a
4512 SHT_ARM_EXIDX section, always keeps the input sections.
4513 (Arm_input_section::set_exidx_section_link): New method.
4514 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4515 has_errors_ to false.
4516 (Arm_exidx_input_section::has_errors,
4517 Arm_exidx_input_section::set_has_errors): New methods.
4518 (Arm_exidx_input_section::has_errors_): New data member.
4519 (Arm_relobj::get_exidx_shndx_list): New method.
4520 (Arm_output_section::append_text_sections_to_list): Do not skip
4521 section without SHF_EXECINSTR.
4522 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4523 errors.
4524 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4525 section header. Make error messages more verbose. Check for
4526 a non-executable section linked to an EXIDX section.
4527 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4528 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4529 check that there is no deferred EXIDX section if we exit early.
4530 Instead of not making an EXIDX section in case of an error, make one
4531 and set the has_errors flag of it.
4532 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4533 in a relocatable link.
4534 (Target_arm::do_relax): Look for the EXIDX output section instead of
4535 assuming that it is called .ARM.exidx.
4536 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4537 section list. Do not check for SHF_EXECINSTR section flags but
4538 skip any input section with errors.
4539 * output.cc (Output_section::Output_section): Initialize
4540 always_keeps_input_sections_ to false.
4541 (Output_section::add_input_section): Check for
4542 always_keeps_input_sections_.
4543 * output.h (Output_section::always_keeps_input_sections,
4544 Output_section::set_always_keeps_input_sections): New methods.
4545 (Output_section::always_keeps_input_sections): New data member.
4546
4547 2010-07-13 Rafael Espindola <espindola@google.com>
4548
4549 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4550 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4551
4552 2010-07-13 Philip Herron <herron.philip@googlemail.com>
4553 Ian Lance Taylor <iant@google.com>
4554
4555 * output.h (Output_section_lookup_maps::add_merge_section):
4556 Correct check of whether value was inserted.
4557 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4558 (Output_section_lookup_maps::add_relaxed_input_section):
4559 Likewise.
4560 * arm.cc (Target_arm::got_section): Remove used local os.
4561 * i386.cc (Target_i386::got_section): Likewise.
4562 * x86_64.cc (Target_x86_64::got_section): Likewise.
4563 * sparc.cc (Target_sparc::got_section): Likewise.
4564 (Target_sparc::relocate): Remove unused local have_got_offset.
4565 * powerpc.cc (Target_powerpc::relocate): Likewise.
4566
4567 2010-07-13 Ian Lance Taylor <iant@google.com>
4568
4569 * compressed_output.cc (zlib_decompress): Fix signature in
4570 !HAVE_ZLIB_H case.
4571
4572 * archive.cc (Archive::include_member): Unlock an external member
4573 of a thin archive. Don't bother to delete an object we know is
4574 NULL.
4575
4576 2010-07-12 Cary Coutant <ccoutant@google.com>
4577
4578 * compressed_output.cc (zlib_decompress): New function.
4579 (get_uncompressed_size): New function.
4580 (decompress_input_section): New function.
4581 * compressed_output.h (get_uncompressed_size): New function.
4582 (decompress_input_section): New function.
4583 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4584 Handle compressed debug sections.
4585 * layout.cc (is_compressed_debug_section): New function.
4586 (Layout::output_section_name): Map compressed section names to
4587 canonical names.
4588 * layout.h (is_compressed_debug_section): New function.
4589 (is_debug_info_section): Recognize compressed debug sections.
4590 * merge.cc: Include compressed_output.h.
4591 (Output_merge_data::do_add_input_section): Handle compressed
4592 debug sections.
4593 (Output_merge_string::do_add_input_section): Handle compressed
4594 debug sections.
4595 * object.cc: Include compressed_output.h.
4596 (Sized_relobj::Sized_relobj): Initialize new data members.
4597 (build_compressed_section_map): New function.
4598 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4599 * object.h (Object::section_is_compressed): New method.
4600 (Object::do_section_is_compressed): New method.
4601 (Sized_relobj::Compressed_section_map): New type.
4602 (Sized_relobj::do_section_is_compressed): New method.
4603 (Sized_relobj::compressed_sections_): New data member.
4604 * output.cc (Output_section::add_input_section): Handle compressed
4605 debug sections.
4606 * reloc.cc: Include compressed_output.h.
4607 (Sized_relobj::write_sections): Handle compressed debug sections.
4608
4609 2010-07-08 Cary Coutant <ccoutant@google.com>
4610
4611 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4612 weak when resolving to a dynamic def.
4613 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4614 for weak undef/dynamic def cases. Adjust callers.
4615 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4616 undef_binding_weak_.
4617 (Symbol_table::sized_write_globals): Adjust symbol binding.
4618 (Symbol_table::sized_write_symbol): Add binding parameter.
4619 * symtab.h (Symbol::set_undef_binding): New method.
4620 (Symbol::is_undef_binding_weak): New method.
4621 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4622 (Symbol_table::should_override): Add new parameter.
4623 (Symbol_table::sized_write_symbol): Add new parameter.
4624
4625 * testsuite/weak_undef_file1.cc: Add new test case.
4626 * testsuite/weak_undef_file2.cc: Fix header comment.
4627 * testsuite/weak_undef_test.cc: Add new test case.
4628
4629 2010-06-29 Doug Kwan <dougkwan@google.com>
4630
4631 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4632 Initialize USE_SYMBOL_.
4633 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4634 definition.
4635 (Arm_reloc_property::uses_symbol_): New data member declaration.
4636 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4637 uses symbol value and symbol is undefined but not weakly undefined.
4638
4639 2010-06-28 Rafael Espindola <espindola@google.com>
4640
4641 * plugin.cc (Plugin::load): Use dlerror.
4642
4643 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4644
4645 * symtab.cc (detect_odr_violations): When reporting an ODR
4646 violation, report an object where the symbol is defined.
4647
4648 2010-06-25 Doug Kwan <dougkwan@google.com>
4649
4650 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4651 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4652 definition.
4653 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4654 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4655 target hook to detect function points.
4656 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4657 * icf.h (Icf::check_section_for_function_pointers): Change type of
4658 parameter SECTION_NAME to const reference to std::string. Use
4659 target hook to determine if section may have unsafe pointers.
4660 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4661 method definition.
4662
4663 2010-06-21 Rafael Espindola <espindola@google.com>
4664
4665 * fileread.cc (Input_file::find_fie): New
4666 (Input_file::open): Use Input_file::find_fie.
4667 * fileread.h (Input_file::find_fie): New
4668 * plugin.cc (set_extra_library_path): New.
4669 (Plugin::load): Add set_extra_library_path to the transfer vector.
4670 (Plugin_manager::set_extra_library_path): New.
4671 (Plugin_manager::add_input_file): Use the extra search path if set.
4672 (set_extra_library_path(): New.
4673 * plugin.h (Plugin_manager): Add set_extra_library_path and
4674 extra_search_path_.
4675
4676 2010-06-19 Cary Coutant <ccoutant@google.com>
4677
4678 * layout.cc (gdb_sections): Add .debug_types.
4679 (lines_only_debug_sections): Likewise.
4680
4681 2010-06-18 Rafael Espindola <espindola@google.com>
4682
4683 * plugin.cc (add_input_file,add_input_library)
4684 (Plugin_manager::add_input_file): Make filename arguments const.
4685 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4686 const.
4687
4688 2010-06-16 Doug Kwan <dougkwan@google.com>
4689
4690 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4691 .ARM.attributes section if we have not merged any input
4692 attributes sections.
4693
4694 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4695
4696 * arm.cc: Allow combining objects with no EABI version
4697 information.
4698
4699 2010-06-15 Rafael Espindola <espindola@google.com>
4700
4701 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4702
4703 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4704
4705 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4706 (struct iovec): Correct !HAVE_READV definition.
4707
4708 2010-06-10 Cary Coutant <ccoutant@google.com>
4709
4710 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4711 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4712 reloc sections.
4713 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4714
4715 PR 11683
4716 * symtab.h (Symbol::is_placeholder): New member function.
4717 * target-reloc.h (relocate_section): Check for placeholder symbols.
4718
4719 * testsuite/Makefile.am (plugin_test_8): New test.
4720 (plugin_test_9): New test.
4721 * testsuite/Makefile.in: Regenerate.
4722
4723 2010-06-09 Nick Clifton <nickc@redhat.com>
4724
4725 * yyscript.y (input_list_element): Allow strings prefixed with
4726 the '-' character. Treat these as libraries.
4727 * script.cc (script_add_library): New function. Adds a library
4728 specified by "-l<name>" found in an input script.
4729 * script-c.h: Add prototype for script_add_library.
4730
4731 2010-06-07 Doug Kwan <dougkwan@google.com>
4732
4733 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4734 Restrict stub-group size to be within long conditional branch
4735 range when working around cortex-A8 erratum.
4736
4737 2010-06-07 Damien Diederen <dd@crosstwine.com>
4738
4739 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4740 #ifdef typo.
4741
4742 2010-06-03 Sriraman Tallam <tmsriram@google.com>
4743
4744 PR gold/11658
4745 * output.cc
4746 (Output_section::Input_section_sort_entry::compare_section_ordering):
4747 Change to return non-zero correctly.
4748 (Output_section::Input_section_sort_section_order_index_compare
4749 ::operator()): Change to fix ambiguity in comparisons.
4750
4751 2010-06-01 Sriraman Tallam <tmsriram@google.com>
4752
4753 * gold.h (is_wildcard_string): New function.
4754 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4755 (Layout::layout_eh_frame): Ditto.
4756 (Layout::find_section_order_index): New method.
4757 (Layout::read_layout_from_file): New method.
4758 * layout.h (Layout::find_section_order_index): New method.
4759 (Layout::read_layout_from_file): New method.
4760 (Layout::input_section_position_): New private member.
4761 (Layout::input_section_glob_): New private member.
4762 * main.cc (main): Call read_layout_from_file here.
4763 * options.h (--section-ordering-file): New option.
4764 * output.cc (Output_section::input_section_order_specified_): New
4765 member.
4766 (Output_section::Output_section): Initialize new member.
4767 (Output_section::add_input_section): Add new parameter.
4768 Keep input sections when --section-ordering-file is used.
4769 (Output_section::set_final_data_size): Sort input sections when
4770 section ordering file is specified.
4771 (Output_section::Input_section_sort_entry): Add new parameter.
4772 Check sorting type.
4773 (Output_section::Input_section_sort_entry::compare_section_ordering):
4774 New method.
4775 (Output_section::Input_section_sort_compare::operator()): Change to
4776 consider section_order_index.
4777 (Output_section::Input_section_sort_init_fini_compare::operator()):
4778 Change to consider section_order_index.
4779 (Output_section::Input_section_sort_section_order_index_compare
4780 ::operator()): New method.
4781 (Output_section::sort_attached_input_sections): Change to sort
4782 according to section order when specified.
4783 (Output_section::add_input_section<32, true>): Add new parameter.
4784 (Output_section::add_input_section<64, true>): Add new parameter.
4785 (Output_section::add_input_section<32, false>): Add new parameter.
4786 (Output_section::add_input_section<64, false>): Add new parameter.
4787 * output.h (Output_section::add_input_section): Add new parameter.
4788 (Output_section::input_section_order_specified): New
4789 method.
4790 (Output_section::set_input_section_order_specified): New method.
4791 (Input_section::Input_section): Initialize section_order_index_.
4792 (Input_section::section_order_index): New method.
4793 (Input_section::set_section_order_index): New method.
4794 (Input_section::section_order_index_): New member.
4795 (Input_section::Input_section_sort_section_order_index_compare): New
4796 struct.
4797 (Output_section::input_section_order_specified_): New member.
4798 * script-sections.cc (is_wildcard_string): Delete and move modified
4799 method to gold.h.
4800 (Output_section_element_input::Output_section_element_input): Modify
4801 call to is_wildcard_string.
4802 (Output_section_element_input::Input_section_pattern
4803 ::Input_section_pattern): Ditto.
4804 (Output_section_element_input::Output_section_element_input): Ditto.
4805 * testsuite/Makefile.am (final_layout): New test case.
4806 * testsuite/Makefile.in: Regenerate.
4807 * testsuite/final_layout.cc: New file.
4808 * testsuite/final_layout.sh: New file.
4809
4810 2010-06-01 Rafael Espindola <espindola@google.com>
4811
4812 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4813
4814 2010-06-01 Rafael Espindola <espindola@google.com>
4815
4816 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4817 visibility of symbols.
4818
4819 2010-05-27 Doug Kwan <dougkwan@google.com>
4820
4821 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4822 from start of output section instead of address for a local symbol
4823 in a merged or relaxed section when doing a relocatable link.
4824
4825 2010-05-26 Rafael Espindola <espindola@google.com>
4826
4827 PR 11604
4828 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4829 adding sections the garbage collector removed.
4830 * gold/testsuite/Makefile.am: Add test.
4831 * gold/testsuite/Makefile.in: Regenerate.
4832 * gold/testsuite/plugin_test_7.sh: New.
4833 * gold/testsuite/plugin_test_7_1.c: New.
4834 * gold/testsuite/plugin_test_7_2.c: New.
4835
4836 2010-05-26 Rafael Espindola <espindola@google.com>
4837
4838 * script-sections.cc (Output_section_definition::set_section_addresses):
4839 Check for --section-start.
4840
4841 2010-05-26 Doug Kwan <dougkwan@google.com>
4842
4843 * arm.cc (Arm_scan_relocatable_relocs): New class.
4844 (Target_arm::relocate_special_relocatable): New method.
4845 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4846 (Arm_relocate_functions::thumb_branch_common): Same.
4847 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4848 instead of Default_scan_relocatable_relocs.
4849 * target-reloc.h (relocate_for_relocatable): Let target handle
4850 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4851 * target.h (Sized_target::relocate_special_relocatable): New method.
4852
4853 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4854
4855 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4856
4857 2010-05-23 Doug Kwan <dougkwan@google.com>
4858
4859 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4860 instead of a cast.
4861 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4862 with a direct branch, not a conditional branch, to a stub.
4863 * merge.cc (Output_merge_base::record_input_section): New method
4864 defintion.
4865 (Output_merge_data::do_add_input_section): Record input section if
4866 keeps-input-sections flag is set.
4867 (Output_merge_string::do_add_input_section): Ditto.
4868 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4869 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4870 INPUT_SECTIONS_.
4871 (Output_merge_base::keeps_input_sections,
4872 Output_merge_base::set_keeps_input_sections,
4873 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4874 method definitions.
4875 (Output_merge_base::Input_sections): New type declaration.
4876 (Output_merge_base::input_sections_begin,
4877 Output_merge_base::input_sections_end,
4878 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4879 (Output_merge_base::bool keeps_input_sections_,
4880 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4881 Output_merge_base::input_sections_): New data members.
4882 (Output_merge_data::do_set_keeps_input_sections): New method
4883 defintion.
4884 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4885 * output.cc (Output_section::Input_section::relobj): Move method
4886 defintion from class declaration to here and handle merge sections.
4887 (Output_section::Input_section::shndx): Ditto.
4888 (Output_section::Output_section): Remove initializations of removed
4889 data members and initialize new data member LOOKUP_MAPS_.
4890 (Output_section::add_input_section): Set keeps-input-sections flag
4891 for a newly created merge output section as appropriate. Adjust code
4892 to use Output_section_lookup_maps class.
4893 (Output_section::add_relaxed_input_section): Adjst code for lookup
4894 maps code refactoring.
4895 (Output_section::add_merge_input_section): Add a new parameter
4896 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4897 class. If adding input section to a newly created merge output
4898 section fails, remove the new merge section.
4899 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
4900 Adjust code for use of the Output_section_lookup_maps class.
4901 (Output_section::find_merge_section): Ditto.
4902 (Output_section::build_lookup_maps): New method defintion.
4903 (Output_section::find_relaxed_input_section): Adjust code to use
4904 Output_section_lookup_maps class.
4905 (Output_section::get_input_sections): Export merge sections. Adjust
4906 code to use Output_section_lookup_maps class.
4907 (Output_section:::add_script_input_section): Adjust code to use
4908 Output_section_lookup_maps class. Update lookup maps for merge
4909 sections also.
4910 (Output_section::discard_states): Use Output_section_lookup_maps.
4911 (Output_section::restore_states): Same.
4912 * output.h (Merge_section_properties): Move class defintion out of
4913 Output_section.
4914 (Output_section_lookup_maps): New class.
4915 (Output_section::Input_section::is_merge_section): New method
4916 defintion.
4917 (Output_section::Input_section::relobj): Move defintion out of class
4918 defintion. Declare method only.
4919 (Output_section::Input_section::shndx): Ditto.
4920 (Output_section::Input_section::output_merge_base): New method defintion.
4921 (Output_section::Input_section::u2_.pomb): New union field.
4922 (Output_section::Merge_section_by_properties_map,
4923 Output_section::Output_section_data_by_input_section_map,
4924 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4925 Remove types.
4926 (Output_section::add_merge_input_section): Add new parameter
4927 KEEPS_INPUT_SECTIONS.
4928 (Output_section::build_lookup_maps): New method declaration.
4929 (Output_section::merge_section_map_,
4930 Output_section::merge_section_by_properties_map_,
4931 Output_section::relaxed_input_section_map_,
4932 Output_section::is_relaxed_input_section_map_valid_): Remove data
4933 members.
4934 (Output_section::lookup_maps_): New data member.
4935
4936 2010-05-21 Doug Kwan <dougkwan@google.com>
4937
4938 PR gold/11619
4939 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4940 avoid a compilation error.
4941
4942 2010-05-19 Rafael Espindola <espindola@google.com>
4943
4944 * script-sections.cc (Output_section_definition::allocate_to_segment):
4945 Update the phdrs_list even when the output section is NULL.
4946 * testsuite/Makefile.am: Add test.
4947 * testsuite/Makefile.in: Regenerate.
4948 * testsuite/script_test_9.cc: New.
4949 * testsuite/script_test_9.sh: New.
4950 * testsuite/script_test_9.t: New.
4951
4952 2010-05-19 Doug Kwan <dougkwan@google.com>
4953
4954 * arm.cc (Arm_input_section::original_size): New method.
4955 (Arm_input_section::do_addralign): Add a cast.
4956 (Arm_input_section::do_output_offset): Remove static cast.
4957 (Arm_input_section::original_addralign,
4958 Arm_input_section::original_size_): Change type to uint32_t.
4959 (Arm_input_section::init): Add safe casts for section alignment
4960 and size.
4961 (Arm_input_section::set_final_data_size): Do not set address and
4962 offset of stub table.
4963 (Arm_output_section::fix_exidx_coverage): Change use of of
4964 Output_section::Simple_input_section to that of
4965 Output_section::Input_section.
4966 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4967 except for the first pass.
4968 * output.cc (Output_section::get_input_sections): Change type of
4969 input_sections to std::list<Input_section>.
4970 (Output_section::add_script_input_section): Rename from
4971 Output_section::add_simple_input_section. Change type of SIS
4972 parameter from Simple_input_section to Input_section.
4973 * output.h (Output_section::Simple_input_section): Remove class.
4974 (Output_section::Input_section): Change class visibility to public.
4975 (Output_section::Input_section::addralign): Use stored alignments
4976 for special input sections if set.
4977 (Output_section::Input_section::set_addralign): New method.
4978 (Output_section::get_input_sections): Change parameter type from
4979 list of Simple_input_section to list of Input_section.
4980 (Output_section::add_script_input_section): Rename from
4981 Output_section::add_simple_input_section. Change first parameter's
4982 type from Simple_input_section to Input_section and remove the
4983 second and third parameters.
4984 * script-sections.cc (Input_section::Input_section_list): Change
4985 type to list of Output_section::Input_section/
4986 (Input_section_info::Input_section_info): Change parameter type of
4987 INPUT_SECTION to Output_section::Input_section.
4988 (Input_section_info::input_section): Change return type.
4989 (Input_section_info::input_section_): Change type to
4990 Output_section::Input_section.
4991 (Output_section_element_input::set_section_addresses): Adjust code
4992 to use Output_section::Input_section instead of
4993 Output_section::Simple_input_section. Adjust code for renaming
4994 of Output_section::add_simple_input_section.
4995 (Orphan_output_section::set_section_addresses): Ditto.
4996
4997 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4998
4999 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5000 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5001
5002 2010-05-18 Rafael Espindola <espindola@google.com>
5003
5004 * options.cc (General_options::finalize): Handle -nostdlib.
5005 * options.h (nostdlib): New option.
5006 * script.cc (script_add_search_dir): Handle -nostdlib.
5007
5008 2010-05-12 Doug Kwan <dougkwan@google.com>
5009
5010 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5011 attributes section only if there no attributes section after merging.
5012 (Target_arm::merge_object_attributes): Move value of
5013 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5014 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5015 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5016 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5017 and arm_attr_merge_7.stdout.
5018 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5019 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5020 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5021 arm_attr_merge_7b.o): New rules.
5022 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5023 arm_attr_merge_7
5024 * testsuite/Makefile.in: Regenerate.
5025 * testsuite/arm_attr_merge.sh: New file.
5026 * testsuite/arm_attr_merge_[67][ab].s: Same.
5027
5028 2010-05-05 Nick Clifton <nickc@redhat.com>
5029
5030 * po/es.po: Updated Spanish translation.
5031
5032 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5033
5034 * Makefile.am (install-exec-local): Properly install gold as
5035 default cross linker.
5036 * Makefile.in: Regenerated.
5037
5038 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5039 Nick Clifton <nickc@redhat.com>
5040
5041 * configure.ac (install_as_default): Define and set to false
5042 unless --enable-gold or --enable-gold=both/gold has been
5043 specified.
5044 * configure: Regenerate.
5045
5046 * Makefile.am (install-exec-local): Install the executable as
5047 'ld.gold'. If install_as_default is true then also install it as
5048 'ld'.
5049 * Makefile.in: Regenerated.
5050
5051 2010-04-24 Ian Lance Taylor <iant@google.com>
5052
5053 * layout.cc (Layout::layout_reloc): In relocatable link don't
5054 combine reloc sections for grouped sections.
5055
5056 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5057
5058 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5059 sections that are not ordinary to icf.
5060 * icf.cc (get_section_contents): Handle relocation pointing to section
5061 with no object or shndx information.
5062 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5063 * testsuite/Makefile.in: Regenerate.
5064 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5065 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5066
5067 2010-04-22 Ian Lance Taylor <iant@google.com>
5068
5069 * expression.cc (Expression::Expression_eval_info): Add
5070 result_alignment_pointer field.
5071 (Expression::eval_with_dot): Add result_alignment_pointer
5072 parameter. Change all callers.
5073 (Expression::eval_maybe_dot): Likewise.
5074 (class Binary_expression): Add alignment_pointer parameter to
5075 left_value and right_value. Change all callers.
5076 (BINARY_EXPRESSION): Set result alignment.
5077 (class Trinary_expression): Add alignment_pointer parameter to
5078 arg2_value and arg3_value. Change all callers.
5079 (Trinary_cond::value): Set result alignment.
5080 (Max_expression::value, Min_expression::value): Likewise.
5081 (Align_expression::value): Likewise.
5082 * script-sections.cc (class Sections_element): Add dot_alignment
5083 parameter to set_section_addresses virtual function. Update
5084 instantiations.
5085 (class Output_section_element): Likewise.
5086 (Script_sections::create_segments): Add dot_alignment parameter.
5087 Change all callers.
5088 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5089 (Script_sections::set_phdrs_clause_addresses): Likewise.
5090 * script-sections.h: Update declarations.
5091 * script.h: Update declarations.
5092 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5093 min_p_align.
5094 * testsuite/script_test_3.t: Set large alignment.
5095 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5096 segment has expected alignment.
5097
5098 2010-04-22 Nick Clifton <nickc@redhat.com>
5099
5100 * po/gold.pot: Updated by the Translation project.
5101 * po/vi.po: Updated Vietnamese translation.
5102
5103 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5104
5105 * testsuite/Makefile.am (check_PROGRAMS): Add
5106 icf_virtual_function_folding_test.
5107 * testsuite/Makefile.in: Regenerated.
5108
5109 2010-04-15 Andrew Haley <aph@redhat.com>
5110
5111 * options.h (merge_exidx_entries): New option.
5112 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5113 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5114 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5115 (Target_arm::merge_exidx_entries): New function.
5116 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5117 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5118 to Arm_exidx_fixup constructor.
5119 Add new arg, merge_exidx_entries.
5120 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5121 Arm_output_section::fix_exidx_coverage.
5122
5123 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5124
5125 * icf.cc (get_section_contents): Check for preemptible functions.
5126 Ignore addend when appropriate.
5127 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5128 section folded.
5129 (add_from_relobj): Check for section folded.
5130 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5131 * symtab.h (should_add_dynsym_entry): Add new parameter.
5132 * target-reloc.h (scan_relocs): Check for section folded.
5133 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5134 Check reloc types for function pointers in shared objects.
5135 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5136 case.
5137 (icf_preemptible_functions_test): New test case.
5138 (icf_string_merge_test): New test case.
5139 * testsuite.Makefile.in: Regenerate.
5140 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5141 bar_glob. Refactor code.
5142 * testsuite/icf_preemptible_functions_test.cc: New file.
5143 * testsuite/icf_preemptible_functions_test.sh: New file.
5144 * testsuite/icf_string_merge_test.cc: New file.
5145 * testsuite/icf_string_merge_test.sh: New file.
5146 * testsuite/icf_virtual_function_folding_test.cc: New file.
5147 * testsuite/icf_virtual_function_folding_test.sh: New file.
5148
5149 2010-04-14 Doug Kwan <dougkwan@google.com>
5150
5151 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5152 for local symbol recounting if we remove a section due to ICF.
5153 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5154 there are no regular objects in input.
5155
5156 2010-04-13 Doug Kwan <dougkwan@google.com>
5157
5158 * arm.cc (Arm_input_section::set_final_data_size): Compute
5159 accurate final data size instead of using current data size.
5160
5161 2010-04-09 Doug Kwan <dougkwan@google.com>
5162
5163 * layout.cc (Layout::choose_output_section): Handle script section
5164 types.
5165 (Layout::make_output_section_for_script): Add section type parameter.
5166 Handle script section types.
5167 * layout.h (Layout::make_output_section_for_script): Add section
5168 type parameter.
5169 * output.cc (Output_section::Output_section): Initialize data member
5170 is_noload_.
5171 (Output_section::do_reset_address_and_file_offset): Do not set address
5172 to 0 if section is a NOLOAD section.
5173 * output.h (Output_section::is_noload): New method.
5174 (Output_section::set_is_noload): Ditto.
5175 (Output_section::is_noload_): New data member.
5176 * script-c.h (Script_section_type): New enum type.
5177 (struct Parser_output_section_header): Add new file section_type.
5178 * script-sections.cc (Sections_element::output_section_name): Add
5179 parameter for returning script section type.
5180 (Output_section_definition::output_section_name): Ditto.
5181 (Output_section_definition::section_type)P; New method.
5182 (Output_section_definiton::script_section_type_name): Ditto.
5183 (Output_section_definition::script_section_type_): New data member.
5184 (Output_section_definition::Output_section_definition): Initialize
5185 data member Output_section_definition::script_section_type_.
5186 (Output_section_definition::create_sections): Pass script section type
5187 to Layout::make_output_section_for_script.
5188 (Output_section_definition::output_section_name): Return script
5189 section type to caller.
5190 (Output_section_definition::set_section_address): Do not advance
5191 dot value and load address if section type is NOLOAD. Set address
5192 of NOLOAD sections regardless of section flags.
5193 (Output_section_definition::print): Print section type if it is
5194 not SCRIPT_SECTION_TYPE_NONE.
5195 (Output_section_definition::section_type): New method.
5196 (Output_section_definition::script_section_type_name): Ditto.
5197 (Script_sections::output_section_name): Add new parameter
5198 PSECTION_TYPE for returning script section type. Pass it to
5199 section elements. Handle discard sections.
5200 (Sort_output_sections::operator()): Handle NOLOAD sections.
5201 * script-sections.h (Script_sections::Section_type): New enum type.
5202 (Script_sections::output_section_name): Add a new parameter for
5203 returning script section type.
5204 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5205 INFO and NOLOAD.
5206 * yyscript.y (union): Add new field SECTION_TYPE.
5207 (COPY, DSECT, INFO, NOLOAD): New tokens.
5208 (opt_address_and_section_type): Change type to output_section_header.
5209 (section_type): New non-terminal
5210 (section_header): Handle section type.
5211 (opt_address_and_section_type): Return section type value.
5212
5213 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5214
5215 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5216 * testsuite/plugin_common_test_2.c (foo): Likewise.
5217
5218 2010-04-08 Doug Kwan <dougkwan@google.com>
5219
5220 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5221 Output_merge_data.
5222 * output.cc (Output_section::add_merge_input_section): Simplify
5223 code and return status of Output_merge_base::add_input_section.
5224 Update merge section map only if Output_merge_base::add_input_section
5225 returns true.
5226
5227 2010-04-07 Doug Kwan <dougkwan@google.com>
5228
5229 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5230 if section is marked as containing instructions but has no mapping
5231 symbols.
5232 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5233 correct section index.
5234 (Arm_relobj::find_linked_text_section): Ditto.
5235
5236 2010-04-07 Cary Coutant <ccoutant@google.com>
5237
5238 * archive.cc (include_member): Destroy Read_symbols_data object before
5239 releasing file.
5240 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5241 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5242 (Read_symbols_data::~Read_symbols_data) New destructor.
5243 (Section_relocs::Section_relocs) New constructor.
5244 (Section_relocs::~Section_relocs) New destructor.
5245 (Read_relocs_data::Read_relocs_data) New constructor.
5246 (Read_relocs_data::~Read_relocs_data) New destructor.
5247 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5248 pointers to NULL after deleting.
5249
5250 2010-04-07 Doug Kwan <dougkwan@google.com>
5251
5252 * arm.cc: Replace "endianity" with "endianness" in comments.
5253 (Arm_exidx_cantunwind): Ditto.
5254 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5255 (Arm_relobj::merge_flags_and_attributes): New method.
5256 (Arm_relobj::merge_flags_and_attributes_): New data member.
5257 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5258 (Arm_relobj::scan_sections_for_stubs): Ditto.
5259 (Arm_relobj::do_read_symbols): Check to see if we really want to
5260 merge processor-specific flags and attributes. Exit early if
5261 an object is empty except for section names and the undefined symbol.
5262 (Target_arm::do_finalize_sections): Move check for ELF format to
5263 Arm_relobj::do_read_symbols. Merge processor specific flags and
5264 attributes from a regular object only when we have determined that
5265 it is aapropriate. Do not create an .ARM.attributes section in
5266 output if there is no regular input object.
5267 (Target_arm::merge_processor_specific_flags): Check
5268 --warn-mismatch before printing any error.
5269 (Target_arm::merge_object_attributes): Ditto.
5270 * gold.cc (queue_middle_tasks): Handle the case in which there is
5271 no regular object in input.
5272 * options.cc (General_options::parse_EB): New method.
5273 (General_options::parse_EL): Same.
5274 (General_options::General_options): Initialize endianness_.
5275 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5276 New options.
5277 (General_options::Endianness): New enum.
5278 (General_options::endianness): New method.
5279 (General_options::endianness_): New data member.
5280 * parameters.cc (Parameters::set_options): Check target endianness.
5281 (Parameters::set_target_once): Ditto.
5282 (Parameters::check_target_endianness): New method.
5283 (parameters_force_valid_target): If either -EL or -EB is specified,
5284 use it to define endianness of default target.
5285 * parameters.h (Parameters::check_target_endianness): New method
5286 declaration.
5287 * target.h (class Target): Change "endianity" to "endianness"
5288 in comments.
5289
5290 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5291
5292 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5293 * configure: Regenerate.
5294 * Makefile.in: Regenerate.
5295 * testsuite/Makefile.in: Regenerate.
5296
5297 2010-04-06 Cary Coutant <ccoutant@google.com>
5298
5299 gcc PR lto/42757
5300 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5301 prevailing definitions of common symbols.
5302 * testsuite/plugin_test_6.sh: New test case.
5303 * testsuite/plugin_common_test_1.c: New test case.
5304 * testsuite/plugin_common_test_2.c: New test case.
5305 * testsuite/Makefile.am (plugin_test_6): New test case.
5306 * testsuite/Makefile.in: Regenerate.
5307
5308 2010-04-06 Nick Clifton <nickc@redhat.com>
5309
5310 * po/vi.po: New Vietnamese translation.
5311
5312 2010-03-30 Doug Kwan <dougkwan@google.com>
5313
5314 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5315
5316 2010-03-25 Doug Kwan <dougkwan@google.com>
5317
5318 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5319 to avoid a conversion warning on a 32-bit host.
5320
5321 2010-03-24 Ian Lance Taylor <iant@google.com>
5322
5323 * testsuite/script_test_3.t: Add a TLS segment.
5324 * testsuite/Makefile.am (check_PROGRAMS): Add
5325 tls_phdrs_script_test.
5326 (tls_phdrs_script_test_SOURCES): Define.
5327 (tls_phdrs_script_test_DEPENDENCIES): Define.
5328 (tls_phdrs_script_test_LDFLAGS): Define.
5329 (tls_phdrs_script_test_LDADD): Define.
5330 * testsuite/Makefile.in: Rebuild.
5331
5332 2010-03-23 Cary Coutant <ccoutant@google.com>
5333
5334 * fileread.cc (find_or_make_view): Fix comment.
5335
5336 2010-03-23 Ian Lance Taylor <iant@google.com>
5337
5338 * script-sections.cc (class Orphan_section_placement): Define
5339 PLACE_TLS and PLACE_TLS_BSS.
5340 (Orphan_section_placement::Orphan_section_placement): Initialize
5341 new places.
5342 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5343 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5344 (tls_script_test_SOURCES): Define.
5345 (tls_script_test_DEPENDENCIES): Define.
5346 (tls_script_test_LDFLAGS): Define.
5347 (tls_script_test_LDADD): Define.
5348 * testsuite/Makefile.in: Rebuild.
5349
5350 2010-03-22 Doug Kwan <dougkwan@google.com>
5351
5352 * arm.cc (Arm_relocate_functions::abs8,
5353 Arm_relocate_functions::abs16): Use correct check for overflow
5354 specified in the ARM ELF specs.
5355 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5356 target of a BLX instruction specially.
5357 (Reloc_stub::stub_type_for_reloc): Ditto.
5358 (Relocate::relocate): Use symbolic names instead of numeric relocation
5359 codes to report error.
5360 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5361 workaround.
5362 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5363 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5364 thumb2_blx_out_of_range.stdout
5365 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5366 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5367 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5368 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5369 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5370 thumb2_blx_in_range, thumb2_blx_in_range.o,
5371 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5372 thumb2_blx_out_of_range.o): New rules.
5373 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5374 thumb2_blx_in_range and thumb2_blx_out_of_range.
5375 * testsuite/Makefile.in: Regenerate.
5376 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5377 * testsuite/thumb_blx_in_range.s: New file.
5378 * testsuite/thumb_blx_out_of_range.s: New file.
5379
5380 2010-03-22 Rafael Espindola <espindola@google.com>
5381
5382 * archive.cc (Should_include): Move to archive.h.
5383 (should_include_member): Make it a member of Archive.
5384 (Lib_group): New.
5385 (Add_lib_group_symbols): New.
5386 * archive.h: Include options.h.
5387 (Archive_member): Moved from Archive.
5388 (Should_include): Moved from archive.cc.
5389 (Lib_group): New.
5390 (Add_lib_group_symbols): New.
5391 * dynobj.cc (do_should_include_member): New.
5392 * dynobj.h (do_should_include_member): New.
5393 * gold.cc (queue_initial_tasks): Update call to queue.
5394 * main.cc (main): Print lib group stats.
5395 * object.cc (do_should_include_member): New.
5396 * object.h: Include archive.h.
5397 (Object::should_include_member): New.
5398 (Object::do_should_include_member): New.
5399 (Sized_relobj::do_should_include_member): New.
5400 * options.cc (General_options::parse_start_lib): New.
5401 (General_options::parse_end_lib): New.
5402 (Input_arguments::add_file): Handle lib groups.
5403 (Input_arguments::start_group): Check we are not in a lib.
5404 (Input_arguments::start_lib): New.
5405 (Input_arguments::end_lib): New.
5406 * options.h (General_options): Add start_lib and end_lib.
5407 (Input_argument::lib_): New.
5408 (Input_argument::lib): New.
5409 (Input_argument::is_lib): New.
5410 (Input_file_lib): New.
5411 (Input_arguments::in_lib_): New.
5412 (Input_arguments::in_lib): New.
5413 (Input_arguments::start_lib): New.
5414 (Input_arguments::end_lib_): New.
5415 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5416 in unused members as preempted.
5417 (Sized_pluginobj::do_should_include_member): New.
5418 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5419 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5420 return the blocker.
5421 (Read_symbols::do_whole_lib_group): New.
5422 (Read_symbols::do_lib_group): New.
5423 (Read_symbols::do_read_symbols): Handle lib groups.
5424 (Read_symbols::get_name): Handle lib groups.
5425 * readsyms.h (Read_symbols): Add an archive member pointer.
5426 (Read_symbols::do_whole_lib_group): New.
5427 (Read_symbols::do_lib_group): New.
5428 (Read_symbols::member_): New.
5429 * script.cc (read_input_script): Update call to queue_soon.
5430
5431 2010-03-19 Doug Kwan <dougkwan@google.com>
5432
5433 * arm.cc (Stub_table::Stub_table): Initialize new data members
5434 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5435 (Stub_table::add_reloc_stub): Assign stub offset and update
5436 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5437 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5438 New data members.
5439 (Stub_table::update_data_size_and_addralign): Use
5440 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5441 instead of going over all reloc stubs.
5442 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5443 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5444 Stringpool_template::offset_ to size of Stringpool_char.
5445 (Stringpool_template::new_key_offset): Remove code to initialize
5446 Stringpool_template::offset_.
5447 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5448 Stringpool_template::offset_ to zero.
5449
5450 2010-03-15 Doug Kwan <dougkwan@google.com>
5451
5452 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5453 offset_.
5454 (Stringpool_template::new_key_offset): New method.
5455 (Stringpool_template::add_string): Assign offsets when adding new
5456 strings.
5457 (Stringpool_template::set_string_offsets): Do not set string offsets
5458 when not optimizing.
5459 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5460 member size_.
5461 (Chunked_vector::clear): Clear size_.
5462 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5463 (Chunked_vector::size): Return size_.
5464 (Chunked_vector::push_back): Use size_ to find insert position.
5465 (Chunked_vector::size_): New data member.
5466 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5467 (Stringpool_template::new_key_offset): New method declaration.
5468 (Stringpool_template::offset_): New data member.
5469
5470 2010-03-15 Rafael Espindola <espindola@google.com>
5471
5472 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5473 Add_symbols' constructor.
5474 * readsyms.h (Add_symbols): Remove the input_group member.
5475
5476 2010-03-10 Ian Lance Taylor <iant@google.com>
5477
5478 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5479 target to ask whether a reference to a symbol requires a stack
5480 split.
5481 * target.h (Target::is_call_to_non_split): New function.
5482 (Target::do_is_call_to_non_split): Declare virtual function.
5483 * target.cc: Include "symtab.h".
5484 (Target::do_is_call_to_non_split): New function.
5485 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5486
5487 2010-03-10 Cary Coutant <ccoutant@google.com>
5488
5489 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5490 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5491 (File_read::open[2]): Add whole_file_view_ to list of views.
5492 (File_read::make_view): Remove test of whole_file_view_.
5493 (File_read::find_or_make_view): Create whole_file_view_ if
5494 necessary.
5495 (File_read::clear_views): Replace bool parameter with enum;
5496 adjust all callers. Don't delete views with permanent data;
5497 do delete cached views and views from archives if
5498 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5499 if clearing the corresponding view.
5500 * fileread.h (File_read::Clear_views_mode): New enum.
5501 (File_read::View::is_permanent_view): New method.
5502 (File_read::clear_views): Replace bool parameter
5503 with enum; adjust all callers.
5504 * options.h (General_options): Change keep_files_mapped option;
5505 add map_whole_files.
5506 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5507 releasing the file.
5508 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5509 the file.
5510
5511 2010-03-10 David S. Miller <davem@davemloft.net>
5512
5513 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5514
5515 2010-03-09 Sriraman Tallam <tmsriram@google.com>
5516
5517 * icf.cc (get_section_contents): Add '@' marker after processing the
5518 merge reloc.
5519
5520 2010-03-08 Doug Kwan <dougkwan@google.com>
5521
5522 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5523 due to a conversion warning.
5524 (Arm_relobj::update_output_local_symbol_count): Check for local
5525 symbol with unset output index.
5526
5527 2010-03-05 Ian Lance Taylor <iant@google.com>
5528
5529 * options.h (class General_options): Add --spare-dynamic-tags.
5530 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5531 --spare-dynamic-tags.
5532
5533 2010-03-05 Ian Lance Taylor <iant@google.com>
5534
5535 * incremental.cc: Include "libiberty.h".
5536
5537 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5538
5539 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5540 function, is_info_ member.
5541 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5542 (Versions::Versions): Update caller.
5543 (Versions::define_base_version): Likewise.
5544 (Versions::add_def): Likewise.
5545
5546 2010-03-03 Sriraman Tallam <tmsriram@google.com>
5547
5548 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5549 (Scan::possible_function_pointer_reloc): New function.
5550 (Scan::local_reloc_may_be_function_pointer): Change to call
5551 possible_function_pointer_reloc.
5552 (Scan::global_reloc_may_be_function_pointer): Ditto.
5553 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5554 relocations in ".data.rel.ro._ZTV" section.
5555 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5556 * testsuite/icf_safe_so_test.cc: Ditto.
5557 * testsuite/icf_safe_test.cc: Ditto.
5558 * testsuite/icf_safe_test.sh: Ditto.
5559
5560 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5561 Ian Lance Taylor <iant@google.com>
5562
5563 * target-reloc.h (relocate_section): Check the symbol table index
5564 for -1U before setting the local symbol index.
5565 (scan_relocatable_relocs): If copying the relocation, record that
5566 the local symbol is required.
5567 * object.h (Symbol_value::is_output_symtab_index_set): New
5568 function.
5569 (Symbol_value::may_be_discarded_from_output_symtab): New
5570 function.
5571 (Symbol_value::has_output_symtab_entry): New function.
5572 (Symbol_value::needs_output_symtab_entry): Remove.
5573 (Symbol_value::output_symtab_index): Make sure the symbol index is
5574 set.
5575 (Symbol_value::set_output_symtab_index): Make sure the symbol
5576 index is not set. Make sure the new index is valid.
5577 (Symbol_value::set_must_have_output_symtab_entry): New function.
5578 (Symbol_value::has_output_dynsym_entry): New function.
5579 (Symbol_value::set_output_dynsym_index): Make sure the new index
5580 is valid.
5581 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5582 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5583 local symbol if permitted.
5584 (Sized_relobj::do_finalize_local_symbols): Call
5585 is_output_symtab_index_set rather than needs_output_symtab_entry.
5586 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5587 rather than needs_output_symtab_entry. Call
5588 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5589 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5590 is_output_symtab_index_set rather than needs_output_symtab_entry.
5591 * testsuite/discard_locals_relocatable_test.c: New file.
5592 * testsuite/discard_locals_test.sh: Test -r.
5593 * testsuite/Makefile.am (check_DATA): Add
5594 discard_locals_relocatable_test1.syms,
5595 discard_local_relocatable_test2.syms.
5596 (MOSTLYCLEANFILES): Likewise. Also add
5597 discard_locals_relocatable_test1.lout and
5598 discard_locals_relocatable_test2.out.
5599 (discard_locals_relocatable_test1.syms): New target.
5600 (discard_locals_relocatable_test.o): New target.
5601 (discard_locals_relocatable_test1.out): New target.
5602 (discard_locals_relocatable_test2.syms): New target.
5603 (discard_locals_relocatable_test2.out): New target.
5604 (various): Add missing ../ld-new dependencies.
5605 * testsuite/Makefile.in: Rebuild.
5606
5607 2010-03-03 Nick Clifton <nickc@redhat.com>
5608
5609 * po/fi.po: New Finnish translation.
5610
5611 2010-03-01 Doug Kwan <dougkwan@google.com>
5612
5613 * layout.cc (Layout::Layout): Force section types of .init_array*,
5614 .preinit_array* and .fini_array* sections.
5615 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5616 Fix check of return value of std::string::find.().
5617 (Output_section::Input_section_sort_compare::operator()): Remove
5618 comment about .init_array.
5619 (Output_section::Input_section_sort_init_fini_compare::operator()):
5620 New method.
5621 (Output_section::sort_attached_input_sections): Handle .init_array
5622 and .fini_array specially.
5623 * output.h (Output_section::Inut_section_sort_compare): Update
5624 comment.
5625 (Output_section::Input_section_sort_init_fini_compare): New struct.
5626
5627 2010-02-26 Doug Kwan <dougkwan@google.com>
5628
5629 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5630 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5631 * testsuite/debug_msg.sh: Avoid matching source line number for
5632 use of global variable undef_int.
5633
5634 2010-02-26 Doug Kwan <dougkwan@google.com>
5635
5636 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5637 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5638 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5639 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5640 * options.cc (General_options::General_options): Initialize member
5641 fix_v4bx_.
5642 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5643 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5644 and rm_no_fix_v4bx.stdout
5645 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5646 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5647 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5648 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5649 and arm_no_fix_v4bx.
5650 * Makefile.in: Regenerate.
5651 * testsuite/arm_fix_v4bx.s: New file.
5652 * testsuite/arm_fix_v4bx.sh: Ditto.
5653
5654 2010-02-24 Doug Kwan <dougkwan@google.com>
5655
5656 * arm.cc (Target_arm::got_section): Make the .got section the first
5657 non RELRO section in the data segment.
5658 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5659 suffixes of section names.
5660
5661 2010-02-24 Doug Kwan <dougkwan@google.com>
5662
5663 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5664 flags and attributes merging if an input file is a binary file.
5665 * fileread.cc (Input_file::open): Record format of original file.
5666 * fileread.h (Input_file::Format): New enum type.
5667 (Input_file::Input_file): Initialize data member format_.
5668 (Input_file::format): New method definition.
5669 (Input_file::format_):: New data member.
5670
5671 2010-02-24 Doug Kwan <dougkwan@google.com>
5672
5673 * arm.cc (Arm_output_data_got): New class.
5674 (ARM_TCB_SIZE): New constant
5675 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5676 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5677 If user uses a script with a SECTIONS clause, issue only a warning
5678 for a misplaced EXIDX input section. Otherwise, issue an error.
5679 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5680 garbage collection.
5681 (Target_arm::got_mode_index_entry): Handle static linking.
5682 (Target_arm::Scan::local): Ditto.
5683 (Target_arm::Scan::global): Ditto.
5684 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5685 all incorrectly implemented relocations.
5686 (Target_arm::fix_exidx_coverage): Pass layout to
5687 Arm_output_section::fix_exidx_coverage.
5688 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5689 from ".ARM.exidx." and ".ARM.extab.".
5690
5691 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5692
5693 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5694 section if it does not already exist.
5695 * attributes.cc (Attributes_section_data::Attributes_section_data):
5696 Don't crash if size is zero.
5697
5698 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5699 Ian Lance Taylor <iant@google.com>
5700
5701 * gold.cc (queue_middle_tasks): If no input files were opened,
5702 exit.
5703 * workqueue.h (Task_function::Task_function): Assert that there is
5704 a blocker.
5705
5706 2010-02-22 Doug Kwan <dougkwan@google.com>
5707
5708 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5709 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5710 types to avoid warnings due to different uint64_t implementations
5711 on different hosts.
5712
5713 2010-02-21 Doug Kwan <dougkwan@google.com>
5714
5715 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5716 handling of the maximum backward branch offset.
5717 (Arm_relocate_functions::thumb_branch_common): Ditto.
5718 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5719 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
5720 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
5721 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5722 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5723 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5724 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5725 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5726 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5727 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5728 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5729 thumb2_bl_out_of_range.o): New rules.
5730 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5731 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5732 thumb2_bl_out_of_range
5733 * testsuite/Makefile.in: Regenerate.
5734 * testsuite/arm_bl_in_range.s: New file.
5735 * testsuite/arm_bl_out_of_range.s: Ditto.
5736 * testsuite/arm_branch_in_range.sh: Ditto.
5737 * testsuite/arm_branch_range.t: Ditto.
5738 * testsuite/thumb2_branch_range.t: Ditto.
5739 * testsuite/thumb_bl_in_range.s: Ditto.
5740 * testsuite/thumb_bl_out_of_range.s: Ditto.
5741 * testsuite/thumb_branch_range.t: Ditto.
5742
5743 2010-02-20 Sriraman Tallam <tmsriram@google.com>
5744
5745 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5746 Add reloc offset information.
5747 * icf.cc (get_section_contents): Change iterators to point to the new
5748 vectors. Add reloc offset information to the contents.
5749 * icf.h (Icf::Sections_reachable_info): New typedef.
5750 (Icf::Sections_reachable_list): New typedef.
5751 (Icf::Offset_info): New typedef.
5752 (Icf::Reloc_info): New struct typedef.
5753 (Icf::Reloc_info_list): New typedef.
5754 (Icf::symbol_reloc_list): Delete method.
5755 (Icf::addend_reloc_list): Delete method.
5756 (Icf::section_reloc_list): Delete method.
5757 (Icf::reloc_info_list): New method.
5758 (Icf::reloc_info_list_): New member.
5759
5760 2010-02-19 Doug Kwan <dougkwan@google.com>
5761
5762 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5763 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5764 * arm.cc (Arm_relocation_functions): New forward declaration.
5765 (Target_arm::Target_arm): Initialize new data members
5766 got_mod_index_offset_ and tls_base_symbol_defined_.
5767 (Target_arm::Relocate::relocate_tls): New method.
5768 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5769 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5770 New methods.
5771 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5772 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5773 (Target_arm::got_mod_index_offset_,
5774 Target_arm::tls_base_symbol_defined_): New data members.
5775 (Target_arm::Scan::local, Target::Scan::global,
5776 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5777 relocations.
5778
5779 2010-02-18 Doug Kwan <dougkwan@google.com>
5780
5781 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5782 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5783 text section as a parameter becuase some broken tools may not set
5784 the link in section header.
5785 (Target_arm::has_got_section): New method.
5786 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5787 without any mapping symbol as data only. Remove warning.
5788 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5789 link in its section header, try to discover the link by inspecting the
5790 REL31 relocation at the beginning of the section.
5791 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5792 in error message.
5793 (Target_arm::Scan::global): Treat any reference to the symbol
5794 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5795
5796 2010-02-12 Sriraman Tallam <tmsriram@google.com>
5797
5798 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5799 (Scan::global_reloc_may_be_function_pointer): New function.
5800 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5801 (Scan::global_reloc_may_be_function_pointer): New function.
5802 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5803 (Scan::global_reloc_may_be_function_pointer): New function.
5804 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5805 (Scan::global_reloc_may_be_function_pointer): New function.
5806 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5807 (Scan::global_reloc_may_be_function_pointer): New function.
5808 (Scan::possible_function_pointer_reloc): New function.
5809 (Target_x86_64::can_check_for_function_pointers): New function.
5810 * gc.h (gc_process_relocs): Scan relocation types to determine if
5811 function pointers were taken for targets that support it.
5812 * icf.cc (Icf::find_identical_sections): Include functions for
5813 folding in safe ICF whose pointer is not taken.
5814 * icf.h (Secn_fptr_taken_set): New typedef.
5815 (fptr_section_id_): New member.
5816 (section_has_function_pointers): New function.
5817 (set_section_has_function_pointers): New function.
5818 (check_section_for_function_pointers): New function.
5819 * options.h: Fix comment for safe ICF option.
5820 * target.h (can_check_for_function_pointers): New function.
5821 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5822 Modify icf_safe_test for X86-64.
5823 * testsuite/Makefile.in: Regenerate.
5824 * testsuite/icf_safe_so_test.cc: New file.
5825 * testsuite/icf_safe_so_test.sh: New file.
5826 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5827 (main): Change to take pointer to function kept_func_3.
5828 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5829 folding is done correctly for X86-64.
5830
5831 2010-02-12 David S. Miller <davem@davemloft.net>
5832
5833 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5834 is_symbolless parameter.
5835 (Output_reloc<SHT_REL>::is_symbolless): New.
5836 (Output_reloc<SHT_REL>::is_symbolless_): New.
5837 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5838 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5839 (Output_reloc<SHT_RELA>::is_symbolless): New.
5840 (Output_data_reloc::add_global): Handle is_symbolless.
5841 (Output_data_reloc::add_global_relative): Likewise.
5842 (Output_data_reloc::add_local): Likewise.
5843 (Output_data_reloc::add_local_relative): Likewise.
5844 (Output_data_reloc::add_symbolless_global_addend): New.
5845 (Output_data_reloc::add_symbolless_local_addend): New.
5846 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5847 is_symbolless.
5848 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5849 instead of ->is_relative_
5850 (Output_reloc::write): Likewise.
5851 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5852 (Output_reloc::write_rel): Simplify.
5853
5854 * sparc.cc (Target_sparc::Scan::local): Use
5855 ->add_symbolless_local_addend as needed.
5856 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5857 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5858 based upon relocation offset.
5859
5860 2010-02-11 Doug Kwan <dougkwan@google.com>
5861
5862 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5863 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5864 beginning of function.
5865 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5866 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5867 parameter is_32bit in calls to should_apply_static_reloc.
5868 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5869 (check_DATA): Add arm_abs_global.stdout.
5870 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5871 arm_abs_global.stdout): New rules.
5872 (MOSTLLYCLEANFILES): Add arm_abs_global
5873 * Makefile.in: Regenerate.
5874 * testsuite/arm_abs_global.s: New file.
5875 * testsuite/arm_abs_global.sh: Ditto.
5876 * testsuite/arm_abs_lib.s: Ditto.
5877
5878 2010-02-11 Ian Lance Taylor <iant@google.com>
5879
5880 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5881 Read_relocs task.
5882 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5883 Allocate_commons_task first.
5884 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5885 task, rather than symtab_lock_.
5886 (Gc_process_relocs::~Gc_process_relocs): New function.
5887 (Gc_process_relocs::is_runnable): Check this_blocker_.
5888 (Gc_process_relocs::locks): Use next_blocker_ rather than
5889 blocker_.
5890 (Scan_relocs::~Scan_relocs): New function.
5891 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5892 symtab_lock_.
5893 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5894 next_blocker_.
5895 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5896 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5897 constructor accordingly.
5898 (class Gc_process_relocs): Likewise.
5899 (class Scan_relocs): Likewise.
5900 * common.h (class Allocate_commons_task): Remove symtab_lock_
5901 field, and corresponding constructor parameter.
5902 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5903 symtab_lock_.
5904 (Allocate_commons_task::locks): Likewise.
5905
5906 2010-02-11 Ian Lance Taylor <iant@google.com>
5907
5908 * gold-threads.h (class Once): Define.
5909 (class Initialize_lock): Rewrite as child of Once.
5910 * gold-threads.cc (class Once_initialize): Define.
5911 (once_pointer_control): New static variable.
5912 (once_pointer, once_arg): New static variables.
5913 (c_run_once): New static function.
5914 (Once::Once, Once::run_once, Once::internal_run): New functions.
5915 (class Initialize_lock_once): Remove.
5916 (initialize_lock_control): Remove.
5917 (initialize_lock_pointer): Remove.
5918 (initialize_lock_once): Remove.
5919 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5920 (Initialize_lock::initialize): Rewrite.
5921 (Initialize_lock::do_run_once): New function.
5922 * archive.cc (Archive::interpret_header): Only clear name if it is
5923 not already empty.
5924 * fileread.cc: Include "gold-threads.h"
5925 (file_counts_lock): New static variable.
5926 (file_counts_initialize_lock): Likewise.
5927 (File_read::release): Only increment counts when using --stats.
5928 Use a lock around the increment.
5929 * parameters.cc (class Set_parameters_target_once): Define.
5930 (set_parameters_target_once): New static variable.
5931 (Parameters::Parameters): Move here from parameters.h.
5932 (Parameters::set_target): Rewrite.
5933 (Parameters::set_target_once): New function.
5934 (Parameters::clear_target): Move here and rewrite.
5935 * parameters.h (class Parameters): Update declarations. Add
5936 set_parameters_target_once_ field.
5937 (Parameters::Parameters): Move to parameters.cc.
5938 (Parameters::clear_target): Likewise.
5939 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5940 task.
5941 (Start_group::~Start_group): New function.
5942 (Start_group::is_runnable): New function.
5943 (Start_group::locks, Start_group::run): New functions.
5944 (Finish_group::run): Change saw_undefined to size_t.
5945 * readsyms.h (class Start_group): Define.
5946 (class Finish_group): Change saw_undefined_ field to size_t.
5947 (Finish_group::Finish_group): Remove saw_undefined and
5948 this_blocker parameters. Change all callers.
5949 (Finish_group::set_saw_undefined): New function.
5950 (Finish_group::set_blocker): New function.
5951 * symtab.h (class Symbol_table): Change saw_undefined to return
5952 size_t. Change saw_undefined_ field to size_t.
5953 * target-select.cc (Set_target_once::do_run_once): New function.
5954 (Target_selector::Target_selector): Initialize set_target_once_
5955 field. Don't initialize lock_ and initialize_lock_ fields.
5956 (Target_selector::instantiate_target): Rewrite.
5957 (Target_selector::set_target): New function.
5958 * target-select.h (class Set_target_once): Define.
5959 (class Target_selector): Update declarations. Make
5960 Set_target_once a friend. Remove lock_ and initialize_lock_
5961 fields. Add set_target_once_ field.
5962
5963 2010-02-10 Ian Lance Taylor <iant@google.com>
5964
5965 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5966 queueing any tasks.
5967 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5968 (queue_middle_tasks): Add all blockers before queueing any tasks.
5969 (queue_final_tasks): Likewise.
5970 * token.h (Task_token::add_blockers): New function.
5971 * object.h (Input_objects::number_of_relobjs): New function.
5972
5973 2010-02-10 Ian Lance Taylor <iant@google.com>
5974
5975 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5976 shared, not if not position independent.
5977 * x86_64.cc (Relocate::relocate_tls): Likewise.
5978 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5979 (tls_pie_pic_test): New target.
5980 * testsuite/Makefile.in: Rebuild.
5981
5982 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5983 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5984 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5985 * testsuite/Makefile.in: Rebuild.
5986
5987 2010-02-09 David S. Miller <davem@davemloft.net>
5988
5989 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5990 R_SPARC_RELATIVE using ->add_local_relative().
5991 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5992
5993 * output.h (Output_data_dynamic::add_section_size): New method
5994 that takes two Output_data objects.
5995 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5996 entry param. Handle it in initializers.
5997 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5998 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5999 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6000 arg.
6001 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6002 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6003 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6004 for dynrel_includes_plt.
6005 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6006 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6007 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6008 before .rela.plt
6009 (Target_sparc::do_finalize_sections): Update to pass true for
6010 dynrel_includes_plt.
6011 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6012 output before .rela.plt
6013 (Target_powerpc::do_finalize_sections): Update to pass true for
6014 dynrel_includes_plt when 32-bit.
6015
6016 2010-02-08 Doug Kwan <dougkwan@google.com>
6017
6018 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6019 method.
6020 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6021 Arm_relobj::scan_section_for_cortex_a8_stubs,
6022 Arm_relobj::do_relocation_section): Instead of calling
6023 Output_section::output_address, use faster
6024 Arm_relobj::simple_input_section_output_address.
6025
6026 2010-02-08 David S. Miller <davem@davemloft.net>
6027
6028 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6029 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6030 relocation helper function.
6031
6032 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6033 just like R_SPARC_GOT{10,13,22}.
6034 (Target_sparc::Scan::local): Likewise.
6035 (Target_sparc::Relocate:relocate): Likewise.
6036
6037 2010-02-06 Ian Lance Taylor <iant@google.com>
6038
6039 * configure.ac: Rewrite targetobjs duplicate removal code to use
6040 only shell constructs.
6041 * configure: Rebuild.
6042
6043 2010-02-05 Doug Kwan <dougkwan@google.com>
6044
6045 PR 11247
6046 * arm.cc (Arm_relobj::section_is_scannable): New method.
6047 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6048 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6049
6050 2010-02-04 Doug Kwan <dougkwan@google.com>
6051
6052 PR 11247
6053 * arm-reloc-property.cc (cstdio): Include.
6054 * configure.ac (targetobjs): Remove duplicates.
6055 * configure: Regenerate.
6056 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6057 big and little endian version for a given address size.
6058
6059 2010-02-03 Doug Kwan <dougkwan@google.com>
6060
6061 * arm-reloc-property.cc
6062 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6063 definition.
6064 * arm-reloc-property.h
6065 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6066 New method definition.
6067 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6068 declaration.
6069 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6070 overflow to N.
6071 (GOT_PREL): Change implemented to Y.
6072 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6073 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6074 (Arm_relocate_functions::movw_abs_nc): Remove method.
6075 (Arm_relocate_functions::movt_abs): Ditto.
6076 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6077 (Arm_relocate_functions::thm_movt_abs): Ditto.
6078 (Arm_relocate_functions::movw_rel_nc): Ditto.
6079 (Arm_relocate_functions::movw_rel): Ditto.
6080 (Arm_relocate_functions::movt_rel): Ditto.
6081 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6082 (Arm_relocate_functions:thm_movw_rel): Ditto.
6083 (Arm_relocate_functions:thm_movt_rel): Ditto.
6084 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6085 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6086 New method definitions.
6087 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6088 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6089 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6090 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6091 (Target_arm::Relocate::relocate): Check for non-static or
6092 unimplemented relocation code and exit early. Change calls to
6093 Target_arm::reloc_uses_thumb_bit and
6094 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6095 instead. Refactor code to handle similar relocations to increase
6096 code sharing. Remove check for unsupported relocation code in switch
6097 statement.
6098 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6099 relocation property table to find out size. Change error message to
6100 print out the name of a relocation code instead of the numeric value.
6101 (Target_arm::scan_reloc_for_stub): Use relocation property table
6102 instead of calling Target_arm::reloc_uses_thumb_bit().
6103
6104 2010-02-02 Doug Kwan <dougkwan@google.com>
6105
6106 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6107 types of relaxed input section.
6108
6109 2010-02-02 Doug Kwan <dougkwan@google.com>
6110
6111 * Makefile.am (HFILES): Add arm-reloc-property.h.
6112 (DEFFILES): New.
6113 (TARGETSOURCES): Add arm-reloc-property.cc
6114 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6115 (libgold_a_SOURCES): $(DEFFILES)
6116 * Makefile.in: Regenerate.
6117 * arm-reloc-property.cc: New file.
6118 * arm-reloc-property.h: New file.
6119 * arm-reloc.def: New file.
6120 * arm.cc: Update comments.
6121 (arm-reloc-property.h): New included header.
6122 (arm_reloc_property_table): New global variable.
6123 (Target_arm::do_select_as_default_target): New method definition.
6124 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6125 arm-reloc-property to targ_extra_obj.
6126 * parameters.cc (set_parameters_target): Call
6127 Target::select_as_default_target().
6128 * target.h (Target::select_as_default_target): New method definition.
6129 (Target::do_select_as_default_target): Same.
6130
6131 2010-02-01 Doug Kwan <dougkwan@google.com>
6132
6133 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6134 first_output_text_section_.
6135 (Arm_exidx_fixup::first_output_text_section): New method definition.
6136 (Arm_exidx_fixup::first_output_text_section_): New data member.
6137 (Arm_exidx_fixup::process_exidx_section): Record the first text
6138 output section seen.
6139 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6140 and entsize in output section header.
6141
6142 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6143
6144 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6145 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6146 (Arm_relocate_functions::thm_alu11): New Method.
6147 (Arm_relocate_functions::thm_pc8): New Method.
6148 (Arm_relocate_functions::thm_pc12): New Method.
6149 (Target_arm::Scan::local): Handle the relocations.
6150 (Target_arm::Scan::global): Likewise.
6151 (Target_arm::Relocate::relocate): Likewise.
6152 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6153
6154 2010-01-29 Doug Kwan <dougkwan@google.com>
6155
6156 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6157 of relocation types as ld.
6158
6159 2010-01-29 Doug Kwan <dougkwan@google.com>
6160
6161 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6162 to public.
6163 (Arm_relocate_functions::thumb_branch_common): Ditto.
6164 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6165 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6166 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6167 Arm_relocate_functions::jump24): Remove.
6168 (Target_arm::Relocate::relocate): Adjust code to call
6169 Arm_relocation_functions::arm_branch_common and
6170 Arm_relocation_functions::thumb_branch_common instead of their removed
6171 wrappers. Merge switch-cases together to reduce source code size.
6172
6173 2010-01-29 Doug Kwan <dougkwan@google.com>
6174
6175 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6176 output_local_symbol_count_needs_update_.
6177 (Arm_relobj::output_local_symbol_count_needs_update,
6178 Arm_relobj::set_output_local_symbol_count_needs_update,
6179 Arm_relobj::update_output_local_symbol_count): New methods.
6180 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6181 member.
6182 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6183 of pointed function as in a R_ARM_PREL31 relocation.
6184 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6185 for output local symbol count updating.
6186 (Target_arm::do_relax): Update output local symbol counts in objects
6187 if necessary.
6188 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6189
6190 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6191
6192 * arm.cc: Added support for the ARM relocations:
6193 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6194 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6195 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6196 movw_prel_nc).
6197 (Arm_relocate_functions::movw_rel): New method.
6198 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6199 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6200 thm_movw_prel_nc).
6201 (Arm_relocate_functions::thm_movw_rel): New method.
6202 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6203 thm_movt_prel).
6204 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6205 relocations.
6206 (Target_arm::Scan::global): Likewise.
6207 (Target_arm::Relocate::relocate): Likewise.
6208 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6209 Likewise.
6210
6211 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6212
6213 * arm.cc: Added support for ARM group relocations.
6214 (Target_arm::reloc_needs_sym_origin): New method.
6215 (Arm_relocate_functions::calc_grp_kn): New method.
6216 (Arm_relocate_functions::calc_grp_residual): New method.
6217 (Arm_relocate_functions::calc_grp_gn): New method.
6218 (Arm_relocate_functions::arm_grp_alu): New Method.
6219 (Arm_relocate_functions::arm_grp_ldr): New Method.
6220 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6221 (Arm_relocate_functions::arm_grp_ldc): New Method.
6222 (Target_arm::Scan::local): Handle the ARM group relocations.
6223 (Target_arm::Scan::global): Likewise.
6224 (Target_arm::Relocate::relocate): Likewise.
6225 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6226 Likewise.
6227
6228 2010-01-26 Doug Kwan <dougkwan@google.com>
6229
6230 * arm.cc (set): Include.
6231 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6232 pointer type.
6233 (Arm_output_section::Text_section_list): New type.
6234 (Arm_output_section::append_text_sections_to_list): New method.
6235 (Arm_output_section::fix_exidx_coverage): Ditto.
6236 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6237 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6238 Relobj::set_section_offset() instead of
6239 Sized_relobj::invalidate_section_offset().
6240 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6241 parameter for section headers. Ignore relocation sections for
6242 unallocated sections and EXIDX sections.
6243 (Target_arm::fix_exidx_coverage): New method.
6244 (Target_arm::output_section_address_less_than): New type.
6245 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6246 linked text section instead of the EXIDX section.
6247 (Arm_output_section::create_stub_group): Add an assertion to check
6248 that this is not an EXIDX output section.
6249 (Arm_output_section::append_text_sections_to_list): New method.
6250 (Arm_output_section::fix_exidx_coverage): Ditto.
6251 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6252 Arm_relobj::section_needs_reloc_stub_scanning.
6253 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6254 first pass.
6255 (Target_arm::fix_exidx_coverage): New method.
6256 * object.h (Relobj::set_output_section): New method.
6257 (Sized_relobj::invalidate_section_offset): Remove method.
6258 (Sized_relobj::do_invalidate_section_offset): Remove method.
6259 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6260
6261 2010-01-25 Doug Kwan <dougkwan@google.com>
6262
6263 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6264 Fix warning due to signed and unsigned comparison on a 32-bit host.
6265
6266 2010-01-22 Doug Kwan <dougkwan@google.com>
6267
6268 * arm.cc (Target_arm::do_relax): Record an output section for section
6269 offset adjustment it contains any stub table that has changed.
6270 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6271 offsets in an output section if necessary.
6272 * output.cc (Output_section::Output_section): Initialize
6273 section_offsets_need_adjustments_.
6274 (Output_section::add_input_section_for_script): Renamed to
6275 Output_section::add_simple_input_section.
6276 (Output_section::save_states): Add a comment.
6277 (Output_section::discard_states): New method defintion.
6278 (Output_section::adjust_section_offsets): Same.
6279 * output.h (Output_section::add_input_section_for_script): Renamed to
6280 Output_section::add_simple_input_section.
6281 (Output_section::discard_states): New method declaration.
6282 (Output_section::adjust_section_offsets): Same.
6283 (Output_section::section_offsets_need_adjustment,
6284 Output_section::set_section_offsets_need_adjustment): New method
6285 definitions.
6286 (Output_section::section_offsets_need_adjustment_): New data member.
6287 * script-sections.cc
6288 (Output_section_element_input::set_section_address): Adjust code for
6289 renaming of Output_section::add_input_section_for_script.
6290 (Orphan_output_section::set_section_address): Same.
6291
6292 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6293
6294 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6295 Fix_v4bx enum values .
6296 * gold/options.h (General_options): New option definitions.
6297 (General_options::fix_v4bx): New method.
6298 (General_options::Fix_v4bx): New enum.
6299 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6300 (General_options::parse_fix_v4bx_interworking): New method.
6301
6302 2010-01-22 Doug Kwan <dougkwan@google.com>
6303
6304 * arm.cc (Arm_exidx_fixup): New class.
6305
6306 2010-01-21 Doug Kwan <dougkwan@google.com>
6307
6308 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6309 classes.
6310 (Arm_exidx_section_offset_map): New type.
6311
6312 2010-01-21 Doug Kwan <dougkwan@google.com>
6313
6314 * arm.cc (Arm_exidx_input_section): New class.
6315 (Arm_relobj::exidx_input_section_by_link,
6316 Arm_relobj::exidx_input_section_by_shndx,
6317 Arm_relobj::make_exidx_input_section): New methods.
6318 (read_arm_attributes_section): Remove.
6319 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6320 information about them.
6321 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6322 to here.
6323
6324 2010-01-20 Doug Kwan <dougkwan@google.com>
6325
6326 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6327 Input_section_specifier to Section_id.
6328 (Target_arm::new_arm_input_section: Adjust code for change of key
6329 type.
6330 (Target_arm::find_arm_input_section): Ditto.
6331 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6332 (Section_id): Remove.
6333 (Garbage_collection::Section_id_hash): Remove.
6334 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6335 (Section_id): Remove.
6336 (Icf::Section_id_hash): Remove.
6337 * object.h (Section_id, Const_section_id, Section_id_hash,
6338 Const_section_id_hash): New type definitions.
6339 * output.cc (Output_section::add_relaxed_input_section): Change to
6340 use Const_section_id instead of Input_section_specifier as key type.
6341 (Output_section::add_merge_input_section): Ditto.
6342 (Output_section::build_relaxation_map): Change to use Section_id
6343 instead of Input_section_specifier as key type.
6344 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6345 Ditto.
6346 (Output_section::convert_input_sections_to_relaxed_sections): Change
6347 to use Const_section_id instead of Input_section_specifier as key type.
6348 (Output_section::find_merge_section): Ditto.
6349 (Output_section::find_relaxed_input_section): Ditto.
6350 * output.h (Input_section_specifier): Remove class.
6351 (Output_section::Output_section_data_by_input_section_map): Change
6352 key type to Const_section_id.
6353 (Output_section::Output_relaxed_input_section_by_input_section_map):
6354 Ditto.
6355 (Output_section::Relaxation_map): Change key type to Section_id.
6356
6357 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6358
6359 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6360 (class Arm_v4bx_stub): New class.
6361 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6362 (Stub_factory::make_arm_v4bx_stub): New method.
6363 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6364 (Stub_table::empty): Handle v4bx stubs.
6365 (Stub_table::add_arm_v4bx_stub): New method.
6366 (Stub_table::find_arm_v4bx_stub): New method.
6367 (Arm_relocate_functions::v4bx): New method.
6368 (Target_arm::fix_v4bx): New method.
6369 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6370 (Stub_table::relocate_stubs): Likewise.
6371 (Stub_table::do_write): Likewise.
6372 (Stub_table::update_data_size_and_addralign): Likewise.
6373 (Stub_table::finalize_stubs): Likewise.
6374 (Target_arm::Scan::local): Likewise.
6375 (Target_arm::Scan::global): Likewise.
6376 (Target_arm::do_finalize_sections): Likewise.
6377 (Target_arm::Relocate::relocate): Likewise.
6378 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6379 Likewise.
6380 (Target_arm::scan_reloc_for_stub): Likewise.
6381 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6382
6383 2010-01-19 Ian Lance Taylor <iant@google.com>
6384
6385 * output.cc (Output_section_headers::do_sized_write): Write large
6386 segment count to sh_info field.
6387 (Output_file_header::do_sized_write): For large segment count,
6388 write PN_XNUM to e_phnum field.
6389
6390 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6391
6392 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6393 (Arm_relocate_functions::thm_jump8): New function.
6394 (Arm_relocate_functions::thm_jump11): New function.
6395 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6396 R_ARM_THM_JUMP11.
6397 (Target_arm::Scan::global): Likewise.
6398 (Target_arm::Relocate::relocate): Likewise.
6399 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6400 Likewise.
6401
6402 2010-01-14 Doug Kwan <dougkwan@google.com>
6403
6404 * arm.cc (map, utility): Include headers.
6405 (Target_arm::apply_cortex_a8_workaround): New method.
6406 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6407 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6408 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6409 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6410 the --[no-]fix-cortex-a8 command line options.
6411 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6412 (Target_arm::relocate_stub): Use addend in instruction template.
6413 * options.h (DEFINE_bool): Set the user-set flag.
6414 (General_options): Add --[no-]-fix-cortex options.
6415 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
6416 : Update fast look-up map after conversion.
6417
6418 2010-01-14 Sriraman Tallam <tmsriram@google.com>
6419
6420 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6421 in the first pass of do_layout.
6422
6423 2010-01-13 Doug Kwan <dougkwan@google.com>
6424
6425 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6426 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6427 apparent compiler problem of not folding static constant integral
6428 data members of elfcpp::Elf_sizes<32>.
6429
6430 2010-01-13 Doug Kwan <dougkwan@google.com>
6431
6432 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6433 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6434 Arm_relobj::scan_section_for_cortex_a8_erratum,
6435 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6436 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6437 sections to scan for relocation stubs into a new method
6438 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6439 relocation and Cortex-A8 stub scanning.
6440 (Target_arm::do_relax): Force stubs to be after stubbed sections
6441 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
6442 the beginning of a new relaxation pass. Update a comment.
6443 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6444
6445 2010-01-12 Ian Lance Taylor <iant@google.com>
6446
6447 * target-reloc.h (visibility_error): New inline function.
6448 (relocate_section): Call visibility_error.
6449 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6450 (MOSTLYCLEANFILES): Likewise.
6451 (protected_4_pic.o, protected_3.err): New targets.
6452 * testsuite/protected_4.cc: New file.
6453
6454 2010-01-12 Doug Kwan <dougkwan@google.com>
6455
6456 * arm.cc (Cortex_a8_reloc): New class.
6457 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6458 and cortex_a8_relocs_info_.
6459 (Target_arm::fix_cortex_a8): New method definition.
6460 (Target_arm::Cortex_a8_relocs_info): New type.
6461 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6462 New data member declarations.
6463 (Target_arm::scan_reloc_for_stub): Record information about
6464 relocations for THUMB branches that might be exempted from the
6465 Cortex-A8 workaround.
6466 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6467 at the beginning of a relaxation pass.
6468
6469 2010-01-12 Doug Kwan <dougkwan@google.com>
6470
6471 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6472 (Arm_relobj::Mapping_symbol_position,
6473 Arm_reloj::Mapping_symbol_position_less,
6474 Arm_relobj::Mapping_symbols_info): New types.
6475 (Target_arm::is_mapping_symbol_name): New method definition.
6476 (Arm_relobj::do_count_local_symbols): Save information about mapping
6477 symbols.
6478
6479 2010-01-11 Doug Kwan <dougkwan@google.com>
6480
6481 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6482 Arm_relocate_functions::thumb32_branch_upper,
6483 Arm_relocate_functions::thumb32_branch_lower,
6484 Arm_relocate_functions::thumb32_cond_branch_offset,
6485 Arm_relocate_functions::thumb32_cond_branch_upper,
6486 Arm_relocate_functions::thumb32_cond_branch_lower,
6487 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6488 branch offset encoding.
6489 (Arm_relocate_functions::thumb_branch_common): Use new branch
6490 offset encoding methods to avoid code duplication.
6491 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6492 (Stub_addend_reader::operator()): Use new branch encoding method
6493 to avoid code duplication.
6494
6495 2010-01-11 Doug Kwan <dougkwan@google.com>
6496
6497 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6498 (Target_arm::do_finalize_sections): Define special EXIDX section
6499 symbols only if referenced.
6500 * gc.h (Garbage_collection::add_reference): New method.
6501 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6502 code duplication.
6503
6504 2010-01-11 Ian Lance Taylor <iant@google.com>
6505
6506 * script.cc (Version_script_info::build_expression_list_lookup):
6507 Change complaing about duplicate wildcard match from error to
6508 warning.
6509
6510 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6511 of 2009-12-30.
6512 (Version_script_info::Version_script_info): Initialize globs_,
6513 default_version_, default_is_global_, and exact_. Don't
6514 initialize globals_ or locals_.
6515 (Version_script_info::build_lookup_tables): Build local symbols
6516 first.
6517 (Version_script_info::unquote): New function.
6518 (Version_script_info::add_exact_match): New function.
6519 (Version_script_info::build_expression_list_lookup): Remove lookup
6520 parameter. Add is_global parameter. Change all callers. Handle
6521 wildcard pattern specially. Unquote pattern. Call
6522 add_exact_match.
6523 (Version_script_info::get_name_to_match): New function.
6524 (Version_script_info::get_symbol_version): New function.
6525 (Version_script_info::get_symbol_version_helper): Remove.
6526 (Version_script_info::check_unmatched_names): Call unquote.
6527 * script.h (class Version_script_info): Change get_symbol_version
6528 to be non-inline and add is_global parameter; change all callers.
6529 Rewrite symbol_is_local. Update declarations. Define struct
6530 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6531 Remove globals_ and locals_ members. Add exact_, globs_,
6532 default_version_, is_global_.
6533 (Version_script_info::Glob): Remove pattern, add expression and
6534 is_global. Update constructor. Change all callers.
6535 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6536 default version.
6537 (Versions::symbol_section_contents): If a symbol is undefined, or
6538 defined in a dynamic object, set the version index to
6539 VER_NDX_LOCAL.
6540 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6541 symbol_is_local.
6542 (Symbol_table::add_from_pluginobj): Likewise.
6543 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6544
6545 2010-01-11 Doug Kwan <dougkwan@google.com>
6546
6547 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6548 (incremental_dump_LDADD): Add linking option for libintl.
6549 * Makefile.in: Regenerate.
6550
6551 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6552
6553 PR gold/11144
6554 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6555 instead of -Ds.
6556 * testsuite/Makefile.in: Regenerated.
6557
6558 2010-01-10 Doug Kwan <dougkwan@google.com>
6559
6560 * options.h (DEFINE_var): Use parentheses around argument varname__
6561 in macro body to avoid any unintended subsequent substitutions.
6562
6563 2010-01-10 Ian Lance Taylor <iant@google.com>
6564
6565 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6566 candidates before doing symbol resolution.
6567
6568 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6569 ODR candidates if only one is weak.
6570
6571 2010-01-08 Ian Lance Taylor <iant@google.com>
6572
6573 * script.cc (Version_script_info::build_expression_list_lookup):
6574 Don't warn about ambiguous version, just record the ambiguity.
6575 (Version_script_info::get_symbol_version_helper): Give error if
6576 version is ambiguous.
6577
6578 2010-01-08 Doug Kwan <dougkwan@google.com>
6579
6580 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6581 prev_data_size_ and prev_addralign_. Remove initializer for
6582 deleted data member has_been_changed_.
6583 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6584 to determine if the table is empty.
6585 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6586 Remove.
6587 (Stub_table::add_reloc_stub): Define method in class definition
6588 instead of just declaring it there.
6589 (Stub_table::add_cortex_a8_stub): New method definition.
6590 (Stub_table::update_data_size_and_addralign): Ditto.
6591 (Stub_table::finalize_stubs): Ditto.
6592 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6593 (Stub_table::do_addralign_): Return address alignment in the
6594 (Stub_table::do_reset_address_and_file_offset): Define method in
6595 class definition instead of declaring it there. Set current data
6596 size to be the data size of the previous pass.
6597 (Stub_table::set_final_data_size): Use current data size as the
6598 final data size.
6599 (Stub_table::relocate_stub): Change parameter type of stub from
6600 Reloc_stub pointer to Stub pointer.
6601 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6602 (Stub_table::Cortex_a8_stub_list): New typedef.
6603 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6604 Stub_table::prev_addralign_): New data member.
6605 (Arm_relobj::Arm_relobj): Initialize data member
6606 section_has_cortex_a8_workaround_.
6607 (Arm_relobj::section_has_cortex_a8_workaround,
6608 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6609 definitions.
6610 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6611 declarations.
6612 (Target_arm::relocate_stub): Change parameter type of stub from
6613 Reloc_stub pointer to Stub pointer.
6614 (Insn_template::size, Insn_template::alignment): Handle
6615 THUMB16_SPECIAL_TYPE.
6616 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6617 Stub_table::update_data_size_and_addralign,
6618 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6619 definitions.
6620 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6621 (Stub_table::do_write): Ditto.
6622 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6623
6624 2010-01-08 Ian Lance Taylor <iant@google.com>
6625
6626 PR 11108
6627 * symtab.h (class Symbol): Remove fields is_target_special_ and
6628 has_plt_offset_. Add field is_defined_in_discarded_section_.
6629 (Symbol::is_defined_in_discarded_section): New function.
6630 (Symbol::set_is_defined_in_discarded_section): New function.
6631 (Symbol::has_plt_offset): Rewrite.
6632 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6633 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6634 Don't initialize is_target_special_ or has_plt_offset_.
6635 Initialize is_defined_in_discarded_section_.
6636 (Symbol_table::add_from_relobj): If appropriate, set
6637 is_defined_in_discarded_section.
6638 * resolve.cc (Symbol::override_base_with_special): Don't test
6639 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6640 * target-reloc.h (relocate_section): Do special handling for
6641 symbols defined in discarded sections for global symbols as well
6642 as local symbols.
6643
6644 2010-01-08 Ian Lance Taylor <iant@google.com>
6645
6646 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6647 the SHT_SYMTAB case.
6648
6649 2010-01-08 Ian Lance Taylor <iant@google.com>
6650
6651 * object.cc (Sized_relobj::do_layout): Don't get confused if
6652 layout_eh_frame returns NULL.
6653
6654 2010-01-08 Ian Lance Taylor <iant@google.com>
6655
6656 PR 11084
6657 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6658 dynamic symbol table, use the normal symbol table.
6659 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6660 symbol table.
6661
6662 2010-01-08 Ian Lance Taylor <iant@google.com>
6663
6664 PR 11072
6665 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6666 sections.
6667
6668 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6669
6670 * version.cc (print_version): Change to "Copyright 2010".
6671
6672 2010-01-08 Ian Lance Taylor <iant@google.com>
6673
6674 PR 10287
6675 PR 11063
6676 * i386.cc (class Target_i386): Change return type of plt_section
6677 to be non-const.
6678 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6679 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6680 tls_desc_rel_ field.
6681 (Output_data_plt_i386::rel_tls_desc): New function.
6682 (Target_i386::rel_tls_desc_section): New function.
6683 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6684 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6685 R_386_TLS_DESC reloc in rel_tls_desc_section.
6686 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6687 Define struct Tlsdesc_info.
6688 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6689 (Target_x86_64::do_reloc_symbol_index): New function.
6690 (Target_x86_64::add_tlsdesc_info): New function.
6691 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6692 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6693 tlsdesc_rel_ field.
6694 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6695 all callers.
6696 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6697 (Target_x86_64::rela_tlsdesc_section): New function.
6698 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6699 handling.
6700 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6701 (Target_x86_64::do_reloc_addend): New function.
6702 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6703 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6704 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6705 (Output_reloc::type): New function.
6706 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6707 (Output_reloc::is_target_specific): New function.
6708 (Output_reloc::target_arg): New function.
6709 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6710 absolute relocs and target specific relocs.
6711 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6712 add_target_specific.
6713 (class Output_data_reloc) [SHT_RELA]: Likewise.
6714 * output.cc (Output_reloc::Output_reloc): Add four new versions
6715 for absolute relocs and target specific relocs.
6716 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6717 (Output_reloc::get_symbol_index): Likewise.
6718 (Output_reloc::local_section_offset): Check that local_sym_index_
6719 is not TARGET_CODE or 0.
6720 (Output_reloc::symbol_value): Likewise.
6721 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6722 reloc.
6723 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6724 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6725 functions.
6726 * layout.cc (add_target_dynamic_tags): Use output section for
6727 DT_PLTRELSZ and DT_JMPREL.
6728
6729 2010-01-07 Ian Lance Taylor <iant@google.com>
6730
6731 PR 11061
6732 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6733 function.
6734 (class Output_data_reloc_generic): Define.
6735 (class Output_data_reloc_base): Change base class to
6736 Output_data_reloc_generic. Change add() method to call
6737 bump_relative_reloc_count for a relative reloc. Remove
6738 sort_relocs_ field.
6739 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6740 to sort_relocs().
6741 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6742 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6743 appropriate.
6744 * layout.h (class Layout): Update declaration.
6745
6746 2010-01-07 Ian Lance Taylor <iant@google.com>
6747
6748 * output.h (class Output_data): Add const version of
6749 output_section and do_output_section.
6750 (class Output_section_data): Add const version of
6751 do_output_section.
6752 (class Output_section): Likewise.
6753 * layout.cc (Layout::add_target_dynamic_tags): New function.
6754 * layout.h (class Layout): Update declarations.
6755 * arm.cc (Target_arm::do_finalize_sections): Use
6756 add_target_dynamic_tags.
6757 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6758 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6759 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6760 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6761
6762 2010-01-07 Ian Lance Taylor <iant@google.com>
6763
6764 PR 11042
6765 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6766 object as needed.
6767
6768 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6769 Ian Lance Taylor <iant@google.com>
6770
6771 PR 11019
6772 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6773 Xindex::read_symtab_xindex.
6774
6775 2010-01-07 Doug Kwan <dougkwan@google.com>
6776
6777 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6778 (Insn_template::thumb16_bcond_insn): New method declaration.
6779 (Insn_template): Fix spelling.
6780 (Stub::thumb16_special): New method declaration.
6781 (Stub::do_write): Define virtual method which was previously pure
6782 virtual.
6783 (Stub::do_thumb16_special): New method declaration.
6784 (Stub::do_fixed_endian_write): New template member.
6785 (Reloc_stub::do_write): Remove.
6786 (Reloc_stub::do_fixed_endian_write): Remove.
6787 (Cortex_a8_stub): New class definition.
6788 (Stub_factory::make_cortex_a8_stub): New method definition.
6789 (Stub_factory::Stub_factory): Add missing static storage class
6790 qualifier for elf32_arm_stub_a8_veneer_blx.
6791
6792 2010-01-07 Ian Lance Taylor <iant@google.com>
6793
6794 PR 10980
6795 * options.h (class General_options): Add --warn-unresolved-symbols
6796 and --error-unresolved-symbols.
6797 * errors.cc (Errors::undefined_symbol): Implement
6798 --warn-unresolved-symbols.
6799
6800 * options.h (class General_options): Add -z text and -z textoff.
6801 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6802
6803 2010-01-06 Sriraman Tallam <tmsriram@google.com>
6804
6805 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6806 (Garbage_collection::cident_sections): New function.
6807 (Garbage_collection::add_cident_section): New function.
6808 (Garbage_collection::cident_sections_): New member.
6809 (gc_process_relocs): Add references to sections whose names are C
6810 identifiers.
6811 * gold.h (cident_section_start_prefix): New constant.
6812 (cident_section_stop_prefix): New constant.
6813 (is_cident): New function.
6814 * layout.cc (Layout::define_section_symbols): Replace string constants
6815 with the newly defined constants.
6816 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6817 C identifiers.
6818 * testsuite/Makefile.am: Add gc_orphan_section_test.
6819 * testsuite/Makefile.in: Regenerate.
6820 * testsuite/gc_orphan_section_test.cc: New file.
6821 * testsuite/gc_orphan_section_test.sh: New file.
6822
6823 2010-01-06 Ian Lance Taylor <iant@google.com>
6824
6825 PR 10980
6826 * options.h (class General_options): Add --warn-shared-textrel.
6827 * layout.cc (Layout::finish_dynamic_section): Implement
6828 --warn-shared-textrel.
6829
6830 PR 10980
6831 * options.h (class General_options): Add --warn-multiple-gp.
6832
6833 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6834
6835 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6836 $(THREADSLIB) and $(LIBDL).
6837 * Makefile.in: Rebuild.
6838
6839 2010-01-06 Ian Lance Taylor <iant@google.com>
6840
6841 PR 10980
6842 * options.cc (General_options::parse_section_start): New function.
6843 (General_options::section_start): New function.
6844 (General_options::General_options): Initialize all members.
6845 * options.h: Include <map>
6846 (class General_options): Add --section-start. Add section_starts_
6847 member.
6848 * layout.cc (Layout::attach_allocated_section_to_segment): If
6849 --section-start was used, set the address of the segment. Remove
6850 local sort_sections.
6851 (Layout::relaxation_loop_body): If the address of the load segment
6852 has been set by --section-start, don't use it.
6853 * output.h (Output_segment::update_flags_for_output_section): New
6854 function.
6855 * output.cc (Output_segment::add_output_section): Call
6856 update_flags_for_output_section.
6857
6858 2010-01-05 Ian Lance Taylor <iant@google.com>
6859
6860 PR 10980
6861 * options.h (class General_options): Add --undefined-version.
6862 * script.cc (struct Version_expression): Add was_matched_by_symbol
6863 field.
6864 (Version_script_info::matched_symbol): New function.
6865 (Version_script_info::get_symbol_version_helper): Call
6866 matched_symbol.
6867 (Version_script_info::check_unmatched_names): New function.
6868 * script.h (class Version_script_info): Update declarations.
6869 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6870
6871 * options.h (class General_options): Use DEFINE_bool_alias for
6872 allow_multiple_definition.
6873 * resolve.cc (Symbol_table::should_override): Don't test
6874 allow_multiple_definition.
6875
6876 PR 10980
6877 * options.h (class General_options): Add --cref.
6878 * main.cc (main): Print cref table if --cref. Don't close mapfile
6879 until after printing cref table.
6880 * cref.cc: Include "symtab.h".
6881 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6882 (Cref_table_compare::operator()): New function.
6883 (Cref_inputs::gather_cref): New function.
6884 (filecol): New static const.
6885 (Cref_inputs::print_cref): New function.
6886 (Cref::print_cref): New function.
6887 * cref.h: Include <cstdio>.
6888 (class Cref): Update declarations.
6889 * mapfile.h (Mapfile::file): New function.
6890 * object.h (class Object): Define Symbols. Declare virtual
6891 do_get_global_symbols.
6892 (Object::get_global_symbols): New function.
6893 * object.cc (Input_objects::add_object): Pass object to cref_ if
6894 --cref.
6895 (Input_objects::archive_start): Likewise.
6896 (Input_objects::archive_stop): Likewise.
6897 (Input_objects::print_cref): New function.
6898 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6899 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6900 --cref.
6901 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6902 function.
6903 * plugin.h (class Sized_pluginobj): Update declarations.
6904
6905 2010-01-05 Ian Lance Taylor <iant@google.com>
6906
6907 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6908 to is_default_version. Rename insdef to insdefault.
6909 (Symbol_table::add_from_relobj): Rename def to is_default_version
6910 and local to is_forced_local.
6911 (Symbol_table::add_from_pluginobj): Likewise.
6912 (Symbol_table::add_from_dynobj): Likewise.
6913 (Symbol_table::define_special_symbol): Rename insdef to
6914 insdefault.
6915
6916 2010-01-04 Ian Lance Taylor <iant@google.com>
6917
6918 PR 10980
6919 * options.h (class General_options): Add
6920 --allow-multiple-definition and -z muldefs.
6921 * resolve.cc (Symbol_table::should_override): Don't warn about a
6922 multiple symbol definition if --allow-multiple-definition or -z
6923 muldefs.
6924
6925 PR 10980
6926 * options.h (class General_options): Add --add-needed and
6927 --copy-dt-needed-entries. Tweak --as-needed help entry.
6928 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6929 error if --copy-dt-needed-entries aka --add-needed is used and
6930 would cause a change in behaviour.
6931
6932 PR 10980
6933 * options.h (class General_options): Add -G as a short version of
6934 --shared. Add no-op options -assert, -g, and -i.
6935
6936 2010-01-04 Sriraman Tallam <tmsriram@google.com>
6937
6938 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6939 check for .text or .gnu.linkonce.t sections.
6940 * icf.cc (Icf::find_identical_sections): Ditto.
6941 Change the detection for mangled function name within the section
6942 name.
6943 * icf.h (is_section_foldable_candidate): New function.
6944
6945 2009-12-30 Ian Lance Taylor <iant@google.com>
6946
6947 PR 10980
6948 * options.h (class General_options): Permit two dashes with
6949 --retain-symbols-file.
6950
6951 2009-12-30 Ian Lance Taylor <iant@google.com>
6952
6953 PR 10979
6954 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6955 don't put the file header and segment headers in the text
6956 segment.
6957
6958 PR 10979
6959 * common.cc (Sort_commons::operator()): Stabilize sort when both
6960 entries are NULL.
6961 (Symbol_table::do_allocate_commons_list): When allocating common
6962 symbols, skip a symbol which is no longer common.
6963 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6964 an object before checking its type.
6965 * testsuite/common_test_2.c: New file.
6966 * testsuite/common_test_3.c: New file.
6967 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6968 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6969 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6970 (common_test_2_pic.o, common_test_2.so): New targets.
6971 (common_test_3_pic.o, common_test_3.so): New targets.
6972 * testsuite/Makefile.in: Rebuild.
6973
6974 PR 10979
6975 * script.cc (read_input_script): If we see a new SECTIONS clause,
6976 and we have added an input section, give an error.
6977 * layout.h (class Layout): Add have_added_input_section function.
6978 Add have_added_input_section_ field.
6979 * layout.cc (Layout::Layout): Initialize
6980 have_added_input_section_.
6981 (Layout::layout): Set have_added_input_section_.
6982 (Layout::layout_eh_frame): Likewise.
6983
6984 2009-12-30 Ian Lance Taylor <iant@google.com>
6985
6986 PR 10931
6987 * options.h (class General_options): Add --sort-common option.
6988 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6989 * common.cc (Sort_common): Add sort_order parameter to
6990 constructor. Add sort_order_ field.
6991 (Sort_commons::operator): Check sort_order_.
6992 (Symbol_table::allocate_commons): Determine the sort order.
6993 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6994 Change all callers.
6995 (Symbol_table::do_allocate_commons_list): Likewise.
6996
6997 2009-12-30 Ian Lance Taylor <iant@google.com>
6998
6999 PR 10916
7000 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7001 symbols from this object, don't change the visibility of an
7002 undefined symbol.
7003 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7004
7005 2009-12-30 Ian Lance Taylor <iant@google.com>
7006
7007 PR 10861
7008 * script.h (class Version_script_info): Define Language enum.
7009 Update declarations. Define Glob, Exact, and Lookup types. Add
7010 new fields globals_, locals_, and is_finalized_.
7011 * script.cc: Various formatting fixes.
7012 (class Parser_closure): Change language_stack_ from a vector of
7013 std::string to one of Version_script_info::Language. Adjust all
7014 uses accordingly.
7015 (class Lazy_demangler): Remove.
7016 (struct Version_expression): Change language from std::string to
7017 Version_script_info::Language.
7018 (Version_script_info::Version_script_info): New function.
7019 (Version_script_info::~Version_script_info): Don't call clear.
7020 (Version_script_info::finalize): New function.
7021 (Version_script_info::build_lookup_tables): New function.
7022 (Version_script_info::build_expression_list_lookup): New
7023 function.
7024 (Version_script_info::get_symbol_version_helper): Rewrite to use
7025 lookup tables.
7026 (Version_script_info::print_expression_list): Adjust to use
7027 Version_script_info::Language.
7028 (script_push_lex_into_version_mode): Check that the version script
7029 has not been finalized.
7030 (version_script_push_lang): Change language string to
7031 Version_script_info::Language.
7032 * options.cc (Command_line::version_script): New function.
7033 * options.h (class General_options): Add finalize_dynamic_list
7034 function. Change version_script from declaration to definition.
7035 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7036 * testsuite/version_script.map: Remove duplicate def of foo.
7037 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7038 version_script.map.
7039 * testsuite/Makefile.in: Rebuild.
7040
7041 2009-12-30 Ian Lance Taylor <iant@google.com>
7042
7043 PR 10843
7044 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7045 if the input symbol index is 0, make the output symbol index 0.
7046
7047 2009-12-30 Ian Lance Taylor <iant@google.com>
7048
7049 PR 10670
7050 * options.h (class General_options): Add -x/--discard-all.
7051 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7052 --discard-all. If the local symbol needs a dynamic entry, check
7053 that before handling --discard-locals.
7054
7055 2009-12-30 Ian Lance Taylor <iant@google.com>
7056
7057 PR 10450
7058 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7059 flags to PF_R.
7060 (Output_segment::add_output_section): Don't change the flags if
7061 the type is PT_TLS.
7062
7063 PR 10450
7064 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7065 GNU hash table if they need a dynamic value. Otherwise, don't add
7066 them if they are defined in a dynamic object or are forced local.
7067
7068 2009-12-29 Ian Lance Taylor <iant@google.com>
7069
7070 PR 10450
7071 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7072 .gnu.hash table for a 32-bit target.
7073
7074 PR 10450
7075 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7076 regular and a dynamic object only needs a dynamic symbol table
7077 entry if it is externally visible.
7078
7079 PR 10450
7080 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7081 constructor. Add global_offset_table_ field.
7082 (Target_i386::got_section): Set global_offset_table_.
7083 (Target_i386::do_finalize_sections): Set global_offset_table_
7084 size.
7085 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7086 in constructor. Add global_offset_table_ field.
7087 (Target_x86_64::got_section): Set global_offset_table_.
7088 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7089 size.
7090
7091 * layout.cc (Layout::Layout): Initialize increase_relro_.
7092 (Layout::get_output_section): Add is_relro, is_last_relro, and
7093 is_first_non_relro parameters. Change all callers.
7094 (Layout::choose_output_section): Likewise.
7095 (Layout::add_output_section_data): Likewise.
7096 (Layout::make_output_section): Likewise.
7097 (Layout::set_segment_offsets): Clear increase_relro when using a
7098 linker script.
7099 * layout.h (class Layout): Add increase_relro method. Add
7100 increase_relro_ field. Update declarations.
7101 * output.cc (Output_section::Output_section): Initialize
7102 is_last_relro_ and is_first_non_relro_.
7103 (Output_segment::add_output_section): Group relro sections is
7104 do_sort is true. Handle is_last_relro and is_first_non_relro.
7105 (Output_segment::maximum_alignment): Remove relro handling.
7106 (Output_segment::set_section_addresses): Add increase_relro
7107 parameter. Change all callers. Add initial alignment to align
7108 relro sections on separate page. Remove old relro handling.
7109 (Output_segment::set_section_list_addresses): Remove in_relro
7110 parameter. Change all callers.
7111 (Output_segment::set_offset): Add increase parameter. Change all
7112 callers. Remove old relro handling.
7113 * output.h (class Output_section): Add new methods: is_last_relro,
7114 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7115 Add is_last_relro_ and is_first_non_relro_ fields.
7116 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7117 Create separate .got.plt section. Call increase_relro.
7118 * x86_64.cc (Target_x86_64::got_section): Likewise.
7119 * testsuite/relro_script_test.t: Add .got.plt.
7120
7121 PR 10450
7122 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7123 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7124 (Layout::finalize): Call set_dynamic_symbol_size.
7125 (Layout::set_dynamic_symbol_size): New function.
7126 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7127 set_dynamic_symbol_size.
7128
7129 PR 10450
7130 * output.h (class Output_section): Add is_entsize_zero_ field.
7131 * output.cc (Output_section::Output_section): Initialize
7132 is_entsize_zero_.
7133 (Output_section::set_entsize): If two different entsizes are
7134 requested, force it to zero.
7135 (Output_section::add_input_section): Set flags for .debug_str
7136 before updating section flags. Set entsize.
7137 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7138 and SHF_STRING if all input sections have those flags.
7139
7140 2009-12-29 Rafael Espindola <espindola@google.com>
7141
7142 * main.cc (main): Fix the sys time reporting.
7143 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7144 reporting.
7145
7146 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7147
7148 * options.cc (General_options::parse_version): Allow -v to exit
7149 without an error if there is nothing to link.
7150
7151 2009-12-29 Ian Lance Taylor <iant@google.com>
7152
7153 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7154 using a version of gcc before 4.1.
7155 * configure: Rebuild.
7156
7157 2009-12-28 Chris Demetriou <cgd@google.com>
7158
7159 * attributes.cc (Output_attributes_section_data::do_write): Use
7160 std::vector::front rather than std::vector::data.
7161
7162 2009-12-28 Ian Lance Taylor <iant@google.com>
7163
7164 * symtab.h (class Symbol_table): Add enum Defined.
7165 * resolve.cc (Symbol_table::should_override): Add defined
7166 parameter. Change all callers. Test whether object is NULL
7167 before calling a method on it.
7168 (Symbol_table::report_resolve_problem): Add defined parameter.
7169 Change all callers.
7170 (Symbol_table::should_override_with_special): Likewise.
7171 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7172 parameter. Change all callers.
7173 (Symbol_table::do_define_in_output_data): Likewise.
7174 (Symbol_table::define_in_output_segment): Likewise.
7175 (Symbol_table::do_define_in_output_segment): Likewise.
7176 (Symbol_table::define_as_constant): Likewise.
7177 (Symbol_table::do_define_as_constant): Likewise.
7178 * script.h (class Symbol_assignment): Add is_defsym parameter to
7179 constructor; change all callers.
7180 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7181 parameter. Change all callers. Add is_defsym_ field.
7182 (class Parser_closure): Add parsing_defsym parameter to
7183 constructor; change all callers. Add parsing_defsym accessor
7184 function. Add parsing_defsym_ field.
7185
7186 2009-12-28 Ian Lance Taylor <iant@google.com>
7187
7188 * gold.cc (queue_middle_tasks): Fix formatting.
7189 * object.cc (Relobj::is_section_name_included): Likewise.
7190
7191 2009-12-23 Ian Lance Taylor <iant@google.com>
7192
7193 * i386.cc (Target_i386::do_calls_non_split): Recognize
7194 -fsplit-stack prologue for a function with a static chain.
7195 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7196 -fsplit-stack prologue when using %r11.
7197
7198 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7199
7200 * options.cc (General_options::parse_version): Make -v continue and do
7201 the link like GNU ld does.
7202
7203 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7204
7205 * Makefile.am (CCFILES): Add timer.cc.
7206 (HFILES): Add timer.h.
7207 * configure.ac: Check for sysconf and times.
7208 * main.cc: include timer.h.
7209 (main): Use Timer instead of get_run_time.
7210 * timer.cc: New.
7211 * timer.h: New.
7212 * workqueue.cc: include timer.h.
7213 (Workqueue::find_and_run_task):
7214 Report user, sys and wall time.
7215 * Makefile.in: Regenerate.
7216 * config.in: Regenerate.
7217 * configure: Regenerate.
7218
7219 2009-12-16 Doug Kwan <dougkwan@google.com>
7220
7221 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7222 sections.
7223 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7224 relaxed input sections.
7225 * output.cc (Output_section::find_relaxed_input_section): Change
7226 return type to Output_relaxed_input_section pointer. Adjust code
7227 for new type of relaxed_input_section_map_.
7228 * output.h (Output_section::find_relaxed_input_section): Change
7229 return type to Output_relaxed_input_section pointer.
7230 (Output_section::Output_relaxed_input_section_by_input_section_map):
7231 New type.
7232 (Output_section::relaxed_input_section_map_): Change type to
7233 Output_section::Output_relaxed_input_section_by_input_section_map.
7234 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7235 input section.
7236
7237 2009-12-15 Ian Lance Taylor <iant@google.com>
7238
7239 * layout.cc (Layout::create_shstrtab): Only write out after input
7240 sections if we are compressing debug sections.
7241
7242 2009-12-15 Ian Lance Taylor <iant@google.com>
7243
7244 * archive.cc (Archive::add_symbols): Only look up a symbol without
7245 a version if there is, in fact, a version.
7246
7247 2009-12-14 Ian Lance Taylor <iant@google.com>
7248
7249 Revert -Wshadow changes, all changes from:
7250 2009-12-11 Doug Kwan <dougkwan@google.com>
7251 2009-12-11 Nick Clifton <nickc@redhat.com>
7252 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7253
7254 2009-12-11 Doug Kwan <dougkwan@google.com>
7255
7256 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7257 due to -Wshadow.
7258 * attributes.cc (Object_attribute::size): Ditto.
7259 (Attributes_section_data::size): Ditto.
7260 (Attributes_section_data::Attributes_section_data): Ditto.
7261 (Output_attributes_section_data::do_write): Ditto.
7262 * attributes.h (Object_attribute::set_type): Ditto.
7263 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7264
7265 2009-12-11 Nick Clifton <nickc@redhat.com>
7266
7267 * archive.cc: Fix shadowed variable warnings.
7268 * arm.cc: Likewise.
7269 * compressed_output.cc: Likewise.
7270 * compressed_output.h: Likewise.
7271 * configure: Likewise.
7272 * dwarf_reader.cc: Likewise.
7273 * dynobj.cc: Likewise.
7274 * dynobj.h: Likewise.
7275 * ehframe.cc: Likewise.
7276 * ehframe.h: Likewise.
7277 * errors.cc: Likewise.
7278 * expression.cc: Likewise.
7279 * fileread.cc: Likewise.
7280 * fileread.h: Likewise.
7281 * freebsd.h: Likewise.
7282 * i386.cc: Likewise.
7283 * icf.cc: Likewise.
7284 * incremental.h: Likewise.
7285 * layout.cc: Likewise.
7286 * layout.h: Likewise.
7287 * mapfile.cc: Likewise.
7288 * merge.cc: Likewise.
7289 * merge.h: Likewise.
7290 * object.cc: Likewise.
7291 * object.h: Likewise.
7292 * options.h: Likewise.
7293 * output.cc: Likewise.
7294 * output.h: Likewise.
7295 * parameters.cc: Likewise.
7296 * plugin.cc: Likewise.
7297 * powerpc.cc: Likewise.
7298 * reduced_debug_output.cc: Likewise.
7299 * reduced_debug_output.h: Likewise.
7300 * reloc.cc: Likewise.
7301 * reloc.h: Likewise.
7302 * resolve.cc: Likewise.
7303 * script-sections.cc: Likewise.
7304 * script.cc: Likewise.
7305 * script.h: Likewise.
7306 * sparc.cc: Likewise.
7307 * symtab.cc: Likewise.
7308 * symtab.h: Likewise.
7309 * target-select.cc: Likewise.
7310 * target-select.h: Likewise.
7311 * token.h: Likewise.
7312 * workqueue.cc: Likewise.
7313 * workqueue.h: Likewise.
7314 * x86_64.cc: Likewise.
7315
7316 2009-12-10 Doug Kwan <dougkwan@google.com>
7317
7318 * arm.cc (attributes.h): New include.
7319 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7320 (Arm_relobj::~Arm_relobj): Delete object pointed by
7321 attributes_section_data_.
7322 (Arm_relobj::attributes_section_data): New method definition.
7323 (Arm_relobj::attributes_section_data_): New data member declaration.
7324 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7325 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7326 attributes_section_data_.
7327 (Arm_dynobj::attributes_section_data): New method definition.
7328 (Arm_dynobj::attributes_section_data_): New data member declaration.
7329 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7330 initialization value of may_use_blx_ to false.
7331 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7332 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7333 object attributes to compute results instead of hard-coding.
7334 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7335 Target_arm::get_secondary_compatible_arch,
7336 Target_arm::set_secondary_compatible_arch
7337 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7338 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7339 New method declarations.
7340 (Target_arm::get_aeabi_object_attribute): New method definition.
7341 (Target_arm::attributes_section_data_): New data member declaration.
7342 (read_arm_attributes_section): New template definition.
7343 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7344 (Arm_dynobj::do_read_symbols): Ditto.
7345 (Target_arm::do_finalize_sections): Merge attributes sections from
7346 input. Check for BLX use after attributes section merging.
7347 Fix __exidx_start and __exidx_end visibility. Create an
7348 .ARM.attributes section if necessary.
7349 (Target_arm::get_secondary_compatible_arch,
7350 Target_arm::set_secondary_compatible_arch,
7351 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7352 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7353 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7354 New method definitions.
7355
7356 2009-12-09 Ian Lance Taylor <iant@google.com>
7357
7358 * plugin.cc (Plugin::load): Don't cast from void* to a function
7359 pointer.
7360
7361 2009-12-09 Ian Lance Taylor <iant@google.com>
7362
7363 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7364 information fields.
7365
7366 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7367
7368 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7369 Replace two_file_shared_1.so with two_file_shared_2.so.
7370 * testsuite/Makefile.in: Regenerated.
7371
7372 2009-12-08 Doug Kwan <dougkwan@google.com>
7373
7374 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7375 (HFILES): Add attributes.h and int_encoding.h.
7376 * Makefile.in: Regenerate.
7377 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7378 function definitions to int_encoding.cc
7379 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7380 prototypes to int_encoding.h
7381 * reduced_debug_output.cc (int_encoding.h): New include.
7382 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7383 function definitions to int_encoding.cc
7384 (insert_into_vector, read_from_pointer): Move template definitions to
7385 int_encoding.h
7386 * attributes.cc: New file.
7387 * attributes.h: New file.
7388 * int_encoding.cc: New file.
7389 * int_encoding.h: New file.
7390
7391 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7392
7393 PR gold/11055
7394 * incremental-dump.cc (dump_incremental_inputs): New.
7395 (main): Use dump_incremental_inputs.
7396
7397 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7398
7399 PR gold/10893
7400 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7401 checking elfcpp::STT_FUNC.
7402 (Target_i386::Relocate::relocate): Likewise.
7403 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7404
7405 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7406 symbols from shared libraries into normal FUNC symbols.
7407
7408 * symtab.h (Symbol): Add is_func and use it.
7409
7410 2009-12-05 Doug Kwan <dougkwan@google.com>
7411
7412 * arm.cc (Target_arm::arm_info): Initialize new fields
7413 attributes_section and attributes_vendor.
7414 * i386.cc (Target_i386::i386_info): Same.
7415 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7416 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7417 fields attributes_section and attributes_vendor.
7418 * sparc.cc (Target_sparc::sparc_info): Same.
7419 * target.h (Target::attributes_section, Target::attributes_vendor,
7420 Target::is_attributes_section, Target::attribute_arg_type,
7421 Target::attributes_order): New method definitions.
7422 (Target::Target_info::attributes_section,
7423 Target::Target_info::attributes_vendor): New fields.
7424 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7425 virtual method definitions.
7426 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7427 attributes_section and attributes_vendor.
7428 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7429
7430 2009-12-05 Doug Kwan <dougkwan@google.com>
7431
7432 * arm.cc: Update comments about interworking and stub generation.
7433 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7434 considered as non-PIC.
7435 (Arm_relocate_functions::base_abs): Fix formatting.
7436 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7437 of function to use GOT entry address instead of offset.
7438 (Target_arm::Scan::global): Issue an error if a symbol would need a
7439 PLT does not get one because it is untyped. Remove code to create
7440 dynamic symbols for relative branches.
7441 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7442 takes unsigned integer instead of boolean.
7443
7444 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7445
7446 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7447 (two_file_test_LDADD): Likewise.
7448 (common_test_1_LDADD): Likewise.
7449 (exception_test_LDADD) Likewise.
7450 (weak_test_LDADD): Likewise.
7451 (many_sections_test_LDADD): Likewise.
7452 (initpri1_LDADD): Likewise.
7453 (script_test_1_LDADD): Likewise.
7454 (script_test_2_LDADD): Likewise.
7455 (justsyms_LDADD): Likewise.
7456 (binary_test_LDADD): Likewise.
7457 (large_LDADD): Likewise.
7458 * testsuite/Makefile.in: Regenerated.
7459
7460 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
7461
7462 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7463 (Symbol_table::override_with_special): Likewise.
7464 (Symbol_table::add_from_object): Likewise.
7465
7466 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7467
7468 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7469 Don't set the data_offset twice.
7470
7471 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7472
7473 * testsuite/Makefile.in: Regenerate.
7474
7475 2009-12-03 Doug Kwan <dougkwan@google.com>
7476
7477 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7478 (Target_arm::do_finalize_sections): Add parameter for symbol table
7479 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7480 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7481 parameter for symbol table pointer.
7482 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7483 an additional parameter for a pointer to symbol table.
7484 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7485 parameter for a symbol table pointer.
7486 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7487 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7488 Ditto.
7489 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7490 parameter for a symbol table pointer.
7491
7492 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
7493
7494 * incremental.cc (Incremental_inputs_header)
7495 (Incremental_inputs_header_write, Incremental_inputs_entry)
7496 (Incremental_inputs_entry_write): Move ...
7497 * incremental.h (Incremental_inputs_header)
7498 (Incremental_inputs_header_write, Incremental_inputs_entry)
7499 (Incremental_inputs_entry_write): here.
7500
7501 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7502
7503 * incremental.cc (make_sized_incremental_binary): Set the target.
7504 Error if it is incompatible.
7505 * output.h (Output_file): Add filename method.
7506
7507 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7508
7509 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7510 from the get_* methods.
7511
7512 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7513
7514 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7515 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7516 Write 0 for the data_offset of scripts.
7517
7518 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7519
7520 * testsuite/Makefile.am: Add the incremental_test.sh test.
7521 * testsuite/incremental_test.sh: New.
7522 * testsuite/incremental_test_1.c: New.
7523 * testsuite/incremental_test_2.c: New.
7524
7525 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
7526
7527 * incremental-dump.cc (main): Fix typos.
7528
7529 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
7530
7531 PR gold/11025
7532 * incremental-dump.cc (main): Use llu to print 64 bit values.
7533
7534 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7535 H.J. Lu <hongjiu.lu@intel.com>
7536
7537 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7538 $(LIBDL).
7539 (incremental_dump_LDADD): Likewise.
7540 * Makefile.in: Regenerated.
7541
7542 2009-11-25 Doug Kwan <dougkwan@google.com>
7543
7544 Revert:
7545
7546 2009-11-25 Doug Kwan <dougkwan@google.com>
7547
7548 * arm.cc (Target_arm::Target_arm): Move method definition
7549 outside of class definition. Add code to handle
7550 --target1-rel, --target1-abs and --target2= options.
7551 (Target_arm::get_reloc_reloc_type): Change method to be
7552 non-static and const.
7553 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7554 New data member declaration.
7555 (Target_arm::Scan::local, Target_arm::Scan::global,
7556 Target_arm::Relocate::relocate,
7557 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7558 Adjust call to Target_arm::get_real_reloc_type.
7559 (Target_arm::get_real_reloc_type): Use command line options
7560 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7561 * options.h (--target1-rel, --target1-abs, --target2): New
7562 ARM-only options.
7563
7564 2009-11-25 Doug Kwan <dougkwan@google.com>
7565
7566 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7567 class definition. Add code to handle --target1-rel, --target1-abs
7568 and --target2= options.
7569 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7570 and const.
7571 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7572 member declaration.
7573 (Target_arm::Scan::local, Target_arm::Scan::global,
7574 Target_arm::Relocate::relocate,
7575 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7576 call to Target_arm::get_real_reloc_type.
7577 (Target_arm::get_real_reloc_type): Use command line options to
7578 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7579 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7580 options.
7581
7582 2009-11-25 Doug Kwan <dougkwan@google.com>
7583
7584 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7585 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7586 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7587 formatting.
7588 (Arm_relocate_functions::thm_call): Replace body with a call to
7589 Arm_relocate_functions::thumb_branch_common.
7590 (Arm_relocate_functions::thm_jump24,
7591 Arm_relocate_functions::thm_xpc22): New method definitions.
7592 (Arm_relocate_functions::thumb_branch_common): New method definition.
7593 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7594 operator.
7595 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7596 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7597
7598 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7599
7600 * Makefile.am: Build incremental-dump
7601 * Makefile.in: Regenerate.
7602 * incremental-dump.cc: New.
7603 * incremental.cc (Incremental_inputs_header_data,
7604 Incremental_inputs_entry_data): Move to incremental.h
7605 * incremental.h: (Incremental_inputs_header_data,
7606 Incremental_inputs_entry_data): Move from incremental.cc
7607
7608 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7609
7610 * incremental.cc (Incremental_inputs_header,
7611 Incremental_inputs_header_write, Incremental_inputs_entry,
7612 Incremental_inputs_entry_write): Add a typedef with the data type.
7613
7614 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7615
7616 * incremental.cc (Incremental_inputs_header,
7617 Incremental_inputs_header_write, Incremental_inputs_entry,
7618 Incremental_inputs_entry_write): Update comment about which
7619 type has the filed descriptions.
7620
7621 2009-11-15 Doug Kwan <dougkwan@google.com>
7622
7623 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7624 (Arm_relocate_functions::arm_branch_common): Change method defintion
7625 in class definition to a method declaration and update list of formal
7626 parameters.
7627 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7628 Arm_relocation_functions::jump24): Adjust call to
7629 Arm_relocate_functions::arm_branch_common. Update list of formal
7630 parameters.
7631 (Arm_relocate_functions::xpc25): New method definition.
7632 (Arm_relocate_functions::arm_branch_common): Move method defintion
7633 out from class definition. Use stubs for mode-switching and extending
7634 branch ranges.
7635 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7636 specially. Change code to enable use of stubs in ARM branches.
7637
7638 2009-11-10 Doug Kwan <dougkwan@google.com>
7639
7640 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7641 in method declaration.
7642 (Target_arm::relocate_stub): New method declaration.
7643 (Target_arm::default_target): Change to return a pointer instead of
7644 a const reference.
7645 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7646 Target_arm::default_target.
7647 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7648 method definition.
7649 (Target_arm::relocate_section): Adjust view.
7650 (Target_arm::relocate_stub): New method definition.
7651
7652 2009-11-10 Doug Kwan <dougkwan@google.com>
7653
7654 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7655 a format warning.
7656 * incremental.cc (open_incremental_binary): Initialized local
7657 variables to avoid warnings.
7658 * object.cc (make_elf_object): Ditto.
7659 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7660 a format warning.
7661
7662 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7663
7664 PR gold/10930
7665 * testsuite/plugin_test.c: Include "config.h".
7666
7667 2009-11-09 Doug Kwan <dougkwan@google.com>
7668
7669 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7670 (arm_symbol_value): Remove.
7671 (Arm_relocate_functions::arm_branch_common,
7672 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7673 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7674 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7675 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7676 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7677 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7678 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7679 Arm_relocate_functions::thm_mobw_abs_nc,
7680 Arm_relocate_functions::thm_mov_abs,
7681 Arm_relocate_functions::movw_prel_nc,
7682 Arm_relocate_functions::thm_movt_abs,
7683 Arm_relocate_functions::movt_prel,
7684 Arm_relocate_functions::thm_movw_prel_nc,
7685 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7686 (Target_arm::Relocate::relocate): Only decompose address into two
7687 parts if relocation type uses the thumb-bit and pass the actual
7688 bit instead of a flag indicating that the thumb-bit is used. Adjust
7689 calls to methods in Arm_relocate_functions for this change.
7690
7691 2009-11-08 Ian Lance Taylor <iant@google.com>
7692
7693 PR 10925
7694 * reloc.cc: Instantiate
7695 Sized_relobj::initialize_input_to_output_maps and
7696 Sized_relobj:free_input_to_output_maps.
7697
7698 2009-11-06 Ian Lance Taylor <iant@google.com>
7699
7700 PR 10876
7701 * defstd.cc (in_segment): Set only_if_ref true for "end".
7702
7703 2009-11-06 Doug Kwan <dougkwan@google.com>
7704
7705 * arm.cc (class Reloc_stub): Correct a comment.
7706 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7707 (Target_arm::scan_section_for_stubs): New method declaration.
7708 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7709 Change methods from private to protected.
7710 (Target_arm::do_may_relax): New method definition.
7711 (Target_arm::do_relax, Target_arm::group_sections,
7712 Target_arm::scan_reloc_for_stub,
7713 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7714 (Target_arm::arm_input_section_map_): New data member declaration.
7715 (Target_arm::scan_reloc_for_stub,
7716 Target_arm::scan_reloc_section_for_stubs,
7717 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7718 Target_arm::do_relax): New method definitions.
7719
7720 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7721
7722 * configure.ac: Check for (struct stat)::st_mtim
7723 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7724 * config.in: Regenerate.
7725 * configure: Regenerate.
7726
7727 2009-11-05 Ian Lance Taylor <iant@google.com>
7728
7729 PR 10910
7730 * output.cc (Output_segment::add_output_section): Add missing
7731 return statement.
7732
7733 2009-11-04 Ian Lance Taylor <iant@google.com>
7734
7735 PR 10880
7736 * object.h (class Object): Add is_needed and set_is_needed
7737 methods. Add is_needed_ field. Make bool fields into bitfields.
7738 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7739 defined in a dynamic object and referenced by a regular object,
7740 set is_needed for the dynamic object.
7741 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7742 if the file is marked with as_needed and it is not needed.
7743
7744 2009-11-04 Ian Lance Taylor <iant@google.com>
7745
7746 PR 10887
7747 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7748 tags if data is discarded by linker script.
7749 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7750 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7751 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7752 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7753
7754 2009-11-04 Ian Lance Taylor <iant@google.com>
7755
7756 * layout.cc (Layout::get_output_section): Add is_interp and
7757 is_dynamic_linker_section parameters. Change all callers.
7758 (Layout::choose_output_section): Likewise.
7759 (Layout::make_output_section): Likewise.
7760 (Layout::add_output_section_data): Add is_dynamic_linker_section
7761 parameter. Change all callers.
7762 * layout.h (class Layout): Update declarations.
7763 * output.h (class Output_section): Add is_interp, set_is_interp,
7764 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7765 Add is_interp_, is_dynamic_linker_section_ fields. Change
7766 generate_code_fills_at_write_ to a bitfield.
7767 * output.cc (Output_section::Output_sections): Initialize new
7768 fields.
7769 (Output_segment::add_output_section): Add do_sort parameter.
7770 Change all callers.
7771
7772 2009-11-03 Ian Lance Taylor <iant@google.com>
7773
7774 PR 10860
7775 * options.h (class General_options): Add --warn-common.
7776 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7777 merging two common symbols.
7778 (Symbol_table::should_override): Handle --warn-common when merging
7779 a common symbol with a defined symbol. Use report_resolve_problem
7780 for multiple definitions.
7781 (Symbol_table::report_resolve_problem): New function.
7782 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7783
7784 2009-11-03 Doug Kwan <dougkwan@google.com>
7785
7786 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7787 stub_factory_.
7788 (Target_arm::stub_factory): New method definition.
7789 (Target_arm::new_arm_input_section,
7790 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7791 Target_arm::reloc_uses_thumb_bit): New method declarations.
7792 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
7793 New type definitions.
7794 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7795 member declarations.
7796 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7797 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7798 New method definitions.
7799
7800 2009-11-03 Ian Lance Taylor <iant@google.com>
7801
7802 * options.h (class General_options): Add --warn_constructors.
7803
7804 2009-11-03 Ian Lance Taylor <iant@google.com>
7805
7806 PR 10893
7807 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7808 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7809
7810 2009-11-03 Ian Lance Taylor <iant@google.com>
7811
7812 PR 10895
7813 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7814 --msgid-bugs-address.
7815 (install-pdf): New target.
7816 (install-data_yes): Look up one directory to find mkinstalldirs.
7817
7818 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7819
7820 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7821 tree.
7822
7823 2009-10-30 Doug Kwan <dougkwan@google.com>
7824
7825 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7826
7827 2009-10-30 Doug Kwan <dougkwan@google.com>
7828
7829 * arm.cc (Stub_addend_reader): New struct template definition
7830 and partial specializations.
7831 (Stub_addend_reader::operator()): New method definition for a
7832 partially specialized template.
7833
7834 2009-10-30 Doug Kwan <dougkwan@google.com>
7835
7836 * arm.cc (Arm_relobj::processor_specific_flags): New method
7837 definition.
7838 (Arm_relobj::do_read_symbols): New method declaration.
7839 (Arm_relobj::processor_specific_flags_): New data member declaration.
7840 (Arm_dynobj): New class definition.
7841 (Target_arm::do_finalize_sections): Add input_objects parameter.
7842 (Target_arm::do_adjust_elf_header): New method declaration.
7843 (Target_arm::are_eabi_versions_compatible,
7844 (Target_arm::merge_processor_specific_flags): New method declaration.
7845 (Target_arm::do_make_elf_object): New overloaded method definitions
7846 and declaration.
7847 (Arm_relobj::do_read_symbols): New method definition.
7848 (Arm_dynobj::do_read_symbols): Ditto.
7849 (Target_arm::do_finalize_sections): Add input_objects parameters.
7850 Merge processor-specific flags from all input objects.
7851 (Target_arm::are_eabi_versions_compatible,
7852 Target_arm::merge_processor_specific_flags,
7853 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7854 New method definitions.
7855 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7856 Input_objects pointer type parameter.
7857 * layout.cc (Layout::finalize): Pass input objects to target's.
7858 finalize_sections function.
7859 * output.cc (Output_file_header::do_sized_write): Set ELF file
7860 header's processor-specific flags.
7861 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7862 Input_objects pointer type parameter.
7863 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7864 * target.h (Input_objects): New forward class declaration.
7865 (Target::processor_specific_flags,
7866 Target::are_processor_specific_flags_sect): New method definitions.
7867 (Target::finalize_sections): Add input_objects parameter.
7868 (Target::Target): Initialize processor_specific_flags_ and
7869 are_processor_specific_flags_set_.
7870 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7871 parameter.
7872 (Target::set_processor_specific_flags): New method definition.
7873 (Target::processor_specific_flags_,
7874 Target::are_processor_specific_flags_set_): New data member
7875 declarations.
7876 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7877 Input_objects pointer type parameter.
7878
7879 2009-10-30 Doug Kwan <dougkwan@google.com>
7880
7881 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7882
7883 2009-10-28 Ian Lance Taylor <iant@google.com>
7884
7885 * object.h (class Relobj): Drop options parameter from
7886 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7887 do_scan_relocs, do_relocate. Change all callers.
7888 (class Sized_relobj): Drop options parameters from
7889 do_gc_process_relocs, do_scan_relocs, do_relocate,
7890 do_relocate_sections, relocate_sections, emit_relocs_scan,
7891 emit_relocs_scan_reltype. Change all callers.
7892 (struct Relocate_info): Remove options field and all references to
7893 it.
7894 * reloc.h (class Read_relocs): Remove options constructor
7895 parameter and options_ field. Change all callers.
7896 (class Gc_process_relocs, class Scan_relocs): Likewise.
7897 (class Relocate_task): Likewise.
7898 * target-reloc.h (scan_relocs): Remove options parameter. Change
7899 all callers.
7900 (scan_relocatable_relocs): Likewise.
7901 * target.h (class Sized_target): Remove options parameter from
7902 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7903 all callers.
7904 * gc.h (gc_process_relocs): Remove options parameter. Change all
7905 callers.
7906 * arm.cc: Update functions to remove options parameters.
7907 * i386.cc: Likewise.
7908 * powerpc.cc: Likewise.
7909 * sparc.cc: Likewise.
7910 * x86_64.cc: Likewise.
7911 * testsuite/testfile.cc: Likewise.
7912
7913 2009-10-28 Doug Kwan <dougkwan@google.com>
7914
7915 * arm.cc (Arm_relobj): New class definition.
7916 (Arm_relobj::scan_sections_for_stubs,
7917 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7918 New method definitions.
7919
7920 2009-10-28 Cary Coutant <ccoutant@google.com>
7921
7922 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7923 (Plugin::cleanup_done_): New member.
7924 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7925 (Plugin_manager::cleanup_done_): Remove.
7926 (Plugin_manager::add_input_file): Edit error message.
7927 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7928 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7929
7930 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7931
7932 * fileread.cc: (File_read::View::~View): Use the new
7933 data_ownership_ filed.
7934 (File_read::~File_read): Dispose the new whole_file_view_.
7935 (File_read::open): Mmap the whole file if needed.
7936 (File_read::open): Use whole_file_view_ instead of contents_.
7937 (File_read::find_view): Use whole_file_view_ if applicable.
7938 (File_read::do_read): Use whole_file_view_ instead of contents_.
7939 (File_read::make_view): Use whole_file_view_ instead of contents_,
7940 update File_read::View::View call.
7941 (File_read::find_or_make_view): Update File_read::View::View
7942 call.
7943 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7944 remove contents_
7945 (File_read::View::Data_ownership): New enum.
7946 (File_read::View::View): Replace bool mapped_ with Data_ownership
7947 argument.
7948 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7949 (File_read::View::data_ownership_): New field.
7950 (File_read::contents_): Remove (replaced by whole_file_view_).
7951 (File_read::whole_file_view_): New field.
7952 * options.h (class General_options): Add --keep-files-mapped.
7953
7954 2009-10-27 Cary Coutant <ccoutant@google.com>
7955
7956 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7957 * testsuite/Makefile.am (plugin_test_5): New test case.
7958 * testsuite/Makefile.in: Regenerate.
7959
7960 2009-10-25 Doug Kwan <dougkwan@google.com>
7961
7962 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7963 from private to protected to allow access by child class.
7964 (Sized_relobj::do_relocate_sections): New method declaration.
7965 (Sized_relobj::relocate_sections): Virtualize.
7966 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
7967 Sized_relobj::relocate_sections. Instantiate template explicitly
7968 for different target sizes and endianity.
7969
7970 2009-10-24 Doug Kwan <dougkwan@google.com>
7971
7972 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7973 (Arm_input_section::as_arm_input_section): New method.
7974 (Arm_output_section): New class definition.
7975 (Arm_output_section::create_stub_group,
7976 Arm_output_section::group_sections): New method definitions.
7977
7978 2009-10-22 Doug Kwan <dougkwan@google.com>
7979
7980 * arm.cc (Arm_input_section): New class definition.
7981 (Arm_input_section::init, Arm_input_section:do_write,
7982 Arm_input_section::set_final_data_size,
7983 Arm_input_section::do_reset_address_and_file_offset): New method
7984 definitions.
7985
7986 2009-10-21 Doug Kwan <dougkwan@google.com>
7987
7988 * arm.cc (Stub_table, Arm_input_section): New forward class
7989 declarations.
7990 (Stub_table): New class defintion.
7991 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7992 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7993 New method definition.
7994
7995 2009-10-21 Doug Kwan <dougkwan@google.com>
7996
7997 * arm.cc: Update copyright comments.
7998 (Target_arm): New forward class template declaration.
7999 (Arm_address): New type.
8000 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8001 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8002 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8003 constants.
8004 (Insn_template): Same.
8005 (DEF_STUBS): New macro.
8006 (Stub_type): New enum type.
8007 (Stub_template): New class definition.
8008 (Stub): Same.
8009 (Reloc_stub): Same.
8010 (Stub_factory): Same.
8011 (Target_arm::Target_arm): Initialize may_use_blx_ and
8012 should_force_pic_veneer_.
8013 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8014 Target_arm::should_force_pic_veneer,
8015 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8016 Target_arm::using_thumb_only, Target_arm:;default_target): New
8017 method defintions.
8018 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8019 New data member declarations.
8020 (Insn_template::size, Insn_template::alignment): New method defintions.
8021 (Stub_template::Stub_template): New method definition.
8022 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8023 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8024 (Stub_factory::Stub_factory): New method definition.
8025 * gold.h (string_hash): New template.
8026 * output.h (Input_section_specifier::hash_value): Use
8027 gold::string_hash.
8028 (Input_section_specifier::string_hash): Remove.
8029 * stringpool.cc (Stringpool_template::string_hash): Use
8030 gold::string_hash.
8031
8032 2009-10-20 Doug Kwan <dougkwan@google.com>
8033
8034 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8035 symbols of relaxed input sections.
8036 * output.h (Output_section::find_relaxed_input_section): Make
8037 method public.
8038
8039 2009-10-16 Doug Kwan <dougkwan@google.com>
8040
8041 * dynobj.cc (Versions::Versions): Initialize version_script_.
8042 Only insert base version symbol definition for a shared object
8043 if version script defines any version versions.
8044 (Versions::define_base_version): New method definition.
8045 (Versions::add_def): Check that base version is not needed.
8046 (Versions::add_need): Define base version lazily.
8047 * dynobj.h (Versions::define_base_version): New method declaration.
8048 (Versions::needs_base_version_): New data member declaration.
8049 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8050 (check_DATA): Add no_version_test.stdout.
8051 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8052 New make rules.
8053 * testsuite/Makefile.in: Regenerate.
8054 * testsuite/no_version_test.c: New file.
8055 * testsuite/no_version_test.sh: Ditto.
8056
8057 2009-10-16 Doug Kwan <dougkwan@google.com>
8058
8059 * expression.cc (class Segment_start_expression): New class definition.
8060 (Segment_start_expression::value): New method definition.
8061 (script_exp_function_segment_start): Return a new
8062 Segment_start_expression.
8063 * gold/script-c.h (script_saw_segment_start_expression): New function
8064 prototype.
8065 * script-sections.cc (Script_sections::Script_sections): Initialize
8066 SAW_SEGMENT_START_EXPRESSION_ to false.
8067 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8068 and -Tbbs options to specify section addresses if given in
8069 command line and no SEGMENT_START expression is seen in a script.
8070 * script-sections.h (Script_sections::saw_segment_start_expression,
8071 Script_sections::set_saw_segment_start_expression): New method
8072 definition.
8073 (Script_sections::saw_segment_start_expression_): New data member
8074 declaration.
8075 * script.cc (script_saw_segment_start_expression): New function.
8076 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8077 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8078 script_test_7.sh and script_test_8.sh.
8079 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8080 script_test_8.stdout.
8081 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8082 (script_test_6, script_test_6.stdout, script_test_7,
8083 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8084 * Makefile.in: Regenerate.
8085 * testsuite/script_test_6.sh: New file.
8086 * testsuite/script_test_6.t: Same.
8087 * testsuite/script_test_7.sh: Same.
8088 * testsuite/script_test_7.t: Same.
8089 * testsuite/script_test_8.sh: Same.
8090
8091 2009-10-16 Doug Kwan <dougkwan@google.com>
8092
8093 * output.cc (Output_segment::set_section_list_address): Cast
8094 expressions to unsigned long long type to avoid format warnings.
8095
8096 2009-10-15 Ian Lance Taylor <iant@google.com>
8097
8098 * script.cc (Script_options::add_symbol_assignment): Always add a
8099 dot assignment to script_sections_.
8100 * script-sections.cc (Script_sections::add_dot_assignment):
8101 Initialize if necessary.
8102
8103 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8104 program headers with no load segment if there is a linker script.
8105
8106 * layout.cc (Layout::set_segment_offsets): Align the file offset
8107 to the segment aligment for -N or -n with no load segment.
8108 * output.cc (Output_segment::add_output_section): Don't crash if
8109 the first section is a TLS section.
8110 (Output_segment::set_section_list_addresses): Print an error
8111 message if the address moves backward in a linker script.
8112 * script-sections.cc
8113 (Output_section_element_input::set_section_addresses): Don't
8114 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8115 (Orphan_output_section::set_section_addresses): Likewise.
8116
8117 2009-10-15 Doug Kwan <dougkwan@google.com>
8118
8119 * layout.cc (Layout::finish_dynamic_section): Generate tags
8120 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8121 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8122 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8123
8124 2009-10-14 Ian Lance Taylor <iant@google.com>
8125
8126 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8127 fields.
8128 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8129 data_shdr fields of relinfo.
8130 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8131 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8132 R_386_TLS_LDO_32, adjust based on section flags.
8133 (Target_i386::Relocate::fix_up_ldo): Remove.
8134
8135 2009-10-13 Ian Lance Taylor <iant@google.com>
8136
8137 Add support for -pie.
8138 * options.h (class General_options): Add -pie and
8139 --pic-executable.
8140 (General_options::output_is_position_independent): Test -pie.
8141 (General_options::output_is_executable): Return true if not shared
8142 and not relocatable.
8143 (General_options::output_is_pie): Remove.
8144 * options.cc (General_options::finalize): Reject incompatible uses
8145 of -pie.
8146 * gold.cc (queue_middle_tasks): A -pie link is not static.
8147 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8148 * symtab.cc (Symbol::final_value_is_known): Return false if
8149 output_is_position_independent.
8150 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8151 output_is_position_independent.
8152 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8153 output_is_position_independent.
8154 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8155 output_is_position_independent.
8156 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8157 two_file_pie_test.
8158 (basic_pie_test.o, basic_pie_test): New targets.
8159 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8160 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8161 (two_file_pie_test): New target.
8162 * testsuite/Makefile.in: Rebuild.
8163 * README: Remove note saying that -pie is not supported.
8164
8165 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8166
8167 * options.h (class General_options): Add -init and -fini.
8168 * layout.cc (Layout::finish_dynamic_section): Emit
8169 given init and fini functions.
8170
8171 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8172
8173 * gc.h (gc_process_relocs): Check if icf is enabled using new
8174 function.
8175 * gold.cc (queue_initial_tasks): Likewise.
8176 (queue_middle_tasks): Likewise.
8177 * object.cc (do_layout): Likewise.
8178 * symtab.cc (is_section_folded): Likewise.
8179 * main.cc (main): Likewise.
8180 * reloc.cc (Read_relocs::run): Likewise.
8181 (Sized_relobj::do_scan_relocs): Likewise.
8182 * icf.cc (is_function_ctor_or_dtor): New function.
8183 (Icf::find_identical_sections): Check if function is ctor or dtor when
8184 safe icf is chosen.
8185 * options.h (General_options::icf): Change option to be an enum.
8186 (Icf_status): New enum.
8187 (icf_enabled): New method.
8188 (icf_safe_folding): New method.
8189 (set_icf_status): New method.
8190 (icf_status_): New variable.
8191 * (options.cc) (General_options::finalize): Set icf_status_.
8192 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8193 icf_test and icf_keep_unique_test to use the --icf enum flag.
8194 * testsuite/icf_safe_test.sh: New file.
8195 * testsuite/icf_safe_test.cc: New file.
8196
8197 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8198
8199 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8200 includes to gc.h and icf.h.
8201 * arm.cc: Include gc.h.
8202 * gold.cc: Likewise.
8203 * i386.cc: Likewise.
8204 * powerpc.cc: Likewise.
8205 * sparc.cc: Likewise.
8206 * x86_64.cc: Likewise.
8207 * gc.h: Include icf.h.
8208
8209 2009-10-11 Ian Lance Taylor <iant@google.com>
8210
8211 * plugin.cc: Include "gold.h" before other header files.
8212
8213 2009-10-10 Chris Demetriou <cgd@google.com>
8214
8215 * options.h (Input_file_argument::Input_file_type): New enum.
8216 (Input_file_argument::is_lib_): Replace with...
8217 (Input_file_argument::type_): New member.
8218 (Input_file_argument::Input_file_argument): Take Input_file_type
8219 'type' rather than boolean 'is_lib' as second argument.
8220 (Input_file_argument::is_lib): Use type_.
8221 (Input_file_argument::is_searched_file): New function.
8222 (Input_file_argument::may_need_search): Handle is_searched_file.
8223 * options.cc (General_options::parse_library): Support -l:filename.
8224 (General_options::parse_just_symbols): Update for Input_file_argument
8225 changes.
8226 (Command_line::process): Likewise.
8227 * archive.cc (Archive::get_file_and_offset): Likewise.
8228 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8229 * script.cc (read_script_file, script_add_file): Likewise.
8230 * fileread.cc (Input_file::Input_file): Likewise.
8231 (Input_file::will_search_for): Handle is_searched_file.
8232 (Input_file::open): Likewise.
8233 * readsyms.cc (Read_symbols::get_name): Likewise.
8234 * testsuite/Makefile.am (searched_file_test): New test.
8235 * testsuite/Makefile.in: Regenerate.
8236 * testsuite/searched_file_test.cc: New file.
8237 * testsuite/searched_file_test_lib.cc: New file.
8238
8239 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8240 Ian Lance Taylor <iant@google.com>
8241
8242 * descriptor.cc: Include <cstdio> and "binary-io.h".
8243 (Descriptors::open): Open the files in binary mode always.
8244 * script.cc (Lex::get_token): Treat \r as whitespace.
8245
8246 2009-10-09 Ian Lance Taylor <iant@google.com>
8247
8248 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8249
8250 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8251 Ian Lance Taylor <iant@google.com>
8252
8253 * configure.ac: Check for readv function also.
8254 * fileread.cc (readv): Define if not HAVE_READV.
8255 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8256 does not exist.
8257 * config.in: Regenerate.
8258 * configure: Regenerate.
8259
8260 2009-10-09 Doug Kwan <dougkwan@google.com>
8261
8262 * layout.cc (Layout::make_output_section): Call target hook to make
8263 ordinary output section.
8264 (Layout::finalize): Adjust parameter list of call the
8265 Target::may_relax().
8266 * layout.h (class Layout::section_list): New method.
8267 * merge.h (Output_merge_base::entsize): Change visibility to public.
8268 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8269 New methods.
8270 (Output_merge_string::do_is_string): New method.
8271 * object.cc (Sized_relobj::do_setup): renamed from
8272 Sized_relobj::set_up.
8273 * object.h (Sized_relobj::adjust_shndx,
8274 Sized_relobj::initializ_input_to_output_maps,
8275 Sized_relobj::free_input_to_output_maps): Change visibilities to
8276 protected.
8277 (Sized_relobj::setup): Virtualize.
8278 (Sized_relobj::do_setup): New method declaration.
8279 (Sized_relobj::invalidate_section_offset,
8280 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8281 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8282 * options.cc (parse_int): New function.
8283 * options.h (parse_int): New declaration.
8284 (DEFINE_int): New macro.
8285 (stub_group_size): New option.
8286 * output.cc (Output_section::Output_section): Initialize memebers
8287 merge_section_map_, merge_section_by_properties_map_,
8288 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8289 (Output_section::add_input_section): Handled deferred code-fill
8290 generation and remove an old comment.
8291 (Output_section::add_relaxed_input_section): New method definition.
8292 (Output_section::add_merge_input_section): Use merge section by
8293 properties map to speed to search. Update merge section maps
8294 as appropriate.
8295 (Output_section::build_relaxation_map): New method definition.
8296 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8297 Same.
8298 (Output_section::relax_input_section): Renamed to
8299 Output_section::convert_input_sections_to_relaxed_sections and change
8300 interface to take a vector of pointers to relaxed sections.
8301 (Output_section::find_merge_section,
8302 Output_section::find_relaxed_input_section): New method definitions.
8303 (Output_section::is_input_address_mapped,
8304 Output_section::output_offset, Output_section::output_address):
8305 Use output section data maps to speed up searching.
8306 (Output_section::find_starting_output_address): Add comments.
8307 (Output_section::do_write,
8308 Output_section::write_to_postprocessing_buffer): Do code-fill
8309 generation as appropriate.
8310 (Output_section::get_input_sections): Invalidate relaxed input section
8311 map.
8312 (Output_section::restore_states): Adjust type of checkpoint .
8313 Invalidate relaxed input section map.
8314 * output.h (Output_merge_base): New class declaration.
8315 (Input_section_specifier): New class defintion.
8316 (class Output_relaxed_input_section) Change base class to
8317 Output_section_data_build.
8318 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8319 base class initializer.
8320 (Output_section::add_relaxed_input_section): New method declaration.
8321 (Output_section::Input_section): Change visibility to protected.
8322 (Output_section::Input_section::relobj,
8323 Output_section::Input_section::shndx): Handle relaxed input sections.
8324 Output_section::input_sections) Change visibility to protected. Also
8325 define overload to return a non-const pointer.
8326 (Output_section::Merge_section_properties): New class defintion.
8327 (Output_section::Merge_section_by_properties_map,
8328 Output_section::Output_section_data_by_input_section_map,
8329 Output_section::Relaxation_map): New types.
8330 (Output_section::relax_input_section): Rename method to
8331 Output_section::convert_input_sections_to_relaxed_sections and change
8332 interface to take a vector of relaxed section pointers.
8333 (Output_section::find_merge_section,
8334 Output_section::find_relaxed_input_section,
8335 Output_section::build_relaxation_map,
8336 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8337 New method declarations.
8338 (Output_section::merge_section_map_
8339 Output_section::merge_section_by_properties_map_,
8340 Output_section::relaxed_input_section_map_,
8341 Output_section::is_relaxed_input_section_map_valid_,
8342 Output_section::generate_code_fills_at_write_): New data members.
8343 * script-sections.cc
8344 (Output_section_element_input::set_section_addresses): Call
8345 current_data_size and addralign methods of relaxed input sections.
8346 (Orphan_output_section::set_section_addresses): Call current_data_size
8347 and addralign methods of relaxed input sections.
8348 * symtab.cc (Symbol_table::compute_final_value): Extract template
8349 from the body of Symbol_table::sized_finalize_symbol.
8350 (Symbol_table::sized_finalized_symbol): Call
8351 Symbol_table::compute_final_value.
8352 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8353 (Symbol_table::compute_final_value): New templated method declaration.
8354 * target.cc (Target::do_make_output_section): New method defintion.
8355 * target.h (Target::make_output_section): New method declaration.
8356 (Target::relax): Add more parameters for input objects, symbol table
8357 and layout. Adjust call to do_relax.
8358 (Target::do_make_output_section): New method declaration.
8359 (Target::do_relax): Add parameters for input objects, symbol table
8360 and layout.
8361
8362 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8363
8364 * pread.c: Include stdio.h.
8365
8366 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8367
8368 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8369 defined.
8370
8371 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8372
8373 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8374 Change read_shndx type to unsigned int.
8375 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8376 int.
8377 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8378 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8379 Change read_shndx type to unsigned int.
8380 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8381 int.
8382 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8383 * layout.cc (Layout::create_symtab_sections): Cast the result of
8384 local_symcount * symsize to off_t in the gold_assert.
8385
8386 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8387
8388 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8389 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8390 R_ARM_BASE_ABS.
8391 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8392 (Arm_relocate_functions::thm_abs5): New function.
8393 (Arm_relocate_functions::abs12): New function.
8394 (Arm_relocate_functions::abs16): New function.
8395 (Arm_relocate_functions::base_abs): New function.
8396 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8397 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8398 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8399 R_ARM_BASE_ABS.
8400 (Scan::global): Likewise.
8401 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8402 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8403 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8404 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8405 R_ARM_BASE_ABS.
8406
8407 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8408
8409 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8410 (Arm_relocate_functions::movt_prel): New function.
8411 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8412 (Arm_relocate_functions::thm_movt_prel): New function.
8413 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8414 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8415 (Scan::global, Relocate::relocate): Likewise.
8416 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8417
8418 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8419
8420 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8421 Incremental_checker.
8422 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8423 unsigned int.
8424 (class Incremental_inputs_header): New class.
8425 (Incremental_inputs_header_writer): Edit comment.
8426 (Incremental_inputs_entry): New class.
8427 (Incremental_inputs_entry_writer): Edit comment.
8428 (Sized_incremental_binary::do_find_incremental_inputs_section):
8429 Add *strtab_shndx parameter, fill it.
8430 (Sized_incremental_binary::do_check_inputs): New method.
8431 (Incremental_checker::can_incrementally_link_output_file): Use
8432 Sized_incremental_binary::check_inputs.
8433 (Incremental_inputs::report_command_line): Save command line in
8434 command_line_.
8435 * incremental.h:
8436 (Incremental_binary::find_incremental_inputs_section): New
8437 method.
8438 (Incremental_binary::do_find_incremental_inputs_section): Add
8439 strtab_shndx parameter.
8440 (Incremental_binary::do_check_inputs): New pure virtual method.
8441 (Sized_incremental_binary::do_check_inputs): Declare.
8442 (Incremental_checker::Incremental_checker): Add incremental_inputs
8443 parameter, use it to initialize incremental_inputs_.
8444 (Incremental_checker::incremental_inputs_): New field.
8445 (Incremental_checker::command_line): New method.
8446 (Incremental_checker::inputs): New method.
8447 (Incremental_checker::command_line_): New field.
8448
8449 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8450
8451 * incremental.cc: Include <cstdarg> and "target-select.h".
8452 (vexplain_no_incremental): New function.
8453 (explain_no_incremental): New function.
8454 (Incremental_binary::error): New method.
8455 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8456 method.
8457 (make_sized_incremental_binary): New function.
8458 (open_incremental_binary): New function.
8459 (can_incrementally_link_file): Add checks if output is ELF and has
8460 inputs section.
8461 * incremental.h: Include "elfcpp_file.h" and "output.h".
8462 (Incremental_binary): New class.
8463 (Sized_incremental_binary): New class.
8464 (open_incremental_binary): Declare.
8465 * object.cc (is_elf_object): Use
8466 elfcpp::Elf_recognizer::is_elf_file.
8467 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8468 * output.h (Output_file::filesize): New method.
8469
8470 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8471
8472 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8473 New function.
8474 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8475 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8476 function.
8477 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8478 function.
8479 (Arm_relocate_functions::movw_abs_nc): New function.
8480 (Arm_relocate_functions::movt_abs): New function.
8481 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8482 (Arm_relocate_functions::thm_movt_abs): New function.
8483 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8484 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8485 (Scan::global): Likewise.
8486 (Relocate::relocate): Likewise.
8487 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8488
8489 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8490
8491 * arm.cc (Arm_relocate_functions::got_prel) New function.
8492 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8493 (Relocate::relocate): Likewise.
8494 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8495
8496 2009-10-06 Ian Lance Taylor <iant@google.com>
8497
8498 * options.h (class General_options): Define
8499 split_stack_adjust_size parameter.
8500 * object.h (class Object): Add uses_split_stack_ and
8501 has_no_split_stack_ fields. Add uses_split_stack and
8502 has_no_split_stack accessor functions. Declare
8503 handle_split_stack_section.
8504 (class Reloc_symbol_changes): Define.
8505 (class Sized_relobj): Define Function_offsets. Declare
8506 split_stack_adjust, split_stack_adjust_reltype, and
8507 find_functions.
8508 * object.cc (Object::handle_split_stack_section): New function.
8509 (Sized_relobj::do_layout): Call handle_split_stack_section.
8510 * dynobj.cc (Sized_dynobj::do_layout): Call
8511 handle_split_stack_section.
8512 * reloc.cc (Sized_relobj::relocate_sections): Call
8513 split_stack_adjust for executable sections in split_stack
8514 objects. Pass reloc_map to relocate_section.
8515 (Sized_relobj::split_stack_adjust): New function.
8516 (Sized_relobj::split_stack_adjust_reltype): New function.
8517 (Sized_relobj::find_functions): New function.
8518 * target-reloc.h: Include "object.h".
8519 (relocate_section): Add reloc_symbol_changes parameter. Change
8520 all callers.
8521 * target.h (class Target): Add calls_non_split method. Declare
8522 do_calls_non_split virtual method. Declare match_view and
8523 set_view_to_nop.
8524 * target.cc: Include "elfcpp.h".
8525 (Target::do_calls_non_split): New function.
8526 (Target::match_view): New function.
8527 (Target::set_view_to_nop): New function.
8528 * gold.cc (queue_middle_tasks): Give an error if mixing
8529 split-stack and non-split-stack objects with -r.
8530 * i386.cc (Target_i386::relocate_section): Add
8531 reloc_symbol_changes parameter.
8532 (Target_i386::do_calls_non_split): New function.
8533 * x86_64.cc (Target_x86_64::relocate_section): Add
8534 reloc_symbol_changes parameter.
8535 (Target_x86_64::do_calls_non_split): New function.
8536 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8537 parameter.
8538 * powerpc.cc (Target_powerpc::relocate_section): Add
8539 reloc_symbol_changes parameter.
8540 * sparc.cc (Target_sparc::relocate_section): Add
8541 reloc_symbol_changes parameter.
8542 * configure.ac: Call AM_CONDITIONAL for the default target.
8543 * configure: Rebuild.
8544 * testsuite/Makefile.am (TEST_AS): New variable.
8545 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8546 (check_DATA): Add split_i386 and split_x86_64 files.
8547 (SPLIT_DEFSYMS): Define.
8548 (split_i386_[1234n].o): New targets.
8549 (split_i386_[124]): New targets.
8550 (split_i386_[1234r].stdout): New targets.
8551 (split_x86_64_[1234n].o): New targets.
8552 (split_x86_64_[124]): New targets.
8553 (split_x86_64_[1234r].stdout): New targets.
8554 (MOSTLYCLEANFILES): Add new executables.
8555 * testsuite/split_i386.sh: New file.
8556 * testsuite/split_x86_64.sh: New file.
8557 * testsuite/split_i386_1.s: New file.
8558 * testsuite/split_i386_2.s: New file.
8559 * testsuite/split_i386_3.s: New file.
8560 * testsuite/split_i386_4.s: New file.
8561 * testsuite/split_i386_n.s: New file.
8562 * testsuite/split_x86_64_1.s: New file.
8563 * testsuite/split_x86_64_2.s: New file.
8564 * testsuite/split_x86_64_3.s: New file.
8565 * testsuite/split_x86_64_4.s: New file.
8566 * testsuite/split_x86_64_n.s: New file.
8567 * testsuite/testfile.cc (Target_test): Update relocation_section
8568 function.
8569 * testsuite/Makefile.in: Rebuild.
8570
8571 2009-10-06 Ian Lance Taylor <iant@google.com>
8572
8573 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8574 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8575 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8576 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8577 the address on ldo_addrs_.
8578 (Target_i386::Relocate::fix_up_ldo): New function.
8579
8580 2009-10-06 Rafael Espindola <espindola@google.com>
8581
8582 * plugin.cc (add_input_library): New.
8583 (Plugin::load): Add add_input_library to tv.
8584 (Plugin_manager::add_input_file): Add the is_lib argument.
8585 (add_input_file): Update call to Plugin_manager::add_input_file.
8586 (add_input_library): New.
8587 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8588
8589 2009-09-30 Doug Kwan <dougkwan@google.com>
8590
8591 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8592 symbol and call Symbol::may_need_copy_reloc to determine if
8593 a copy reloc is needed.
8594 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8595 nocopyreloc is given in command line.
8596 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8597 given in command line.
8598 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8599 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8600 of the removed Target_i386::may_need_copy_reloc.
8601 * options.h (copyreloc): New option with default value false.
8602 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8603 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8604 instead of the removed Target_powerpc::may_need_copy_reloc.
8605 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8606 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8607 instead of the removed Target_sparc::may_need_copy_reloc.
8608 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8609 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8610 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8611 instead of the removed Target_x86_64::may_need_copy_reloc.
8612
8613 2009-09-30 Ian Lance Taylor <iant@google.com>
8614
8615 * object.h (class Object): Remove target_ field, and target,
8616 sized_target, and set_target methods.
8617 (Object::sized_target): Remove.
8618 (class Sized_relobj): Update declarations. Remove sized_target.
8619 * object.cc (Sized_relobj::setup): Remove target parameter.
8620 Change all callers.
8621 (Input_objects::add_object): Don't do anything with the target.
8622 (make_elf_sized_object): Add punconfigured parameter. Change all
8623 callers. Set or test parameter target.
8624 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8625 Change all callers.
8626 * parameters.cc (Parameters::set_target): Change parameter type to
8627 be non-const.
8628 (Parameters::default_target): Remove.
8629 (set_parameters_target): Change parameter type to be non-const.
8630 (parameters_force_valid_target): New function.
8631 (parameters_clear_target): New function.
8632 * parameters.h (class Parameters): Update declarations. Remove
8633 default_target method. Add sized_target and clear_target
8634 methods. Change target_ to be non-const.
8635 (set_parameters_target): Update declaration.
8636 (parameters_force_valid_target): Declare.
8637 (parameters_clear_target): Declare.
8638 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8639 as NULL if we aren't searching.
8640 (Add_symbols::run): Don't check for compatible target.
8641 * fileread.cc (Input_file::open_binary): Call
8642 parameters_force_valid_target.
8643 * gold.cc (queue_middle_tasks): Likewise.
8644 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8645 set_target on object.
8646 * dynobj.h (class Sized_dynobj): Update declarations.
8647 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8648 make_elf_object returns NULL.
8649 (Archive::include_member): Don't check whether object target is
8650 compatible.
8651 * output.cc (Output_section::add_input_section): Get target from
8652 parameters.
8653 (Output_section::relax_input_section): Likewise.
8654 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8655 parameters.
8656 (Sized_relobj::do_scan_relocs): Likewise.
8657 (Sized_relobj::relocate_sections): Likewise.
8658 * resolve.cc (Symbol_table::resolve): Likewise.
8659 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8660 parameter. Change all callers.
8661 (Symbol_table::add_from_object): Get target from parameters.
8662 (Symbol_table::add_from_relobj): Don't check object target.
8663 (Symbol_table::add_from_dynobj): Likewise.
8664 (Symbol_table::define_special_symbol): Get target from
8665 parameters.
8666 * symtab.h (class Symbol_table): Update declaration.
8667 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8668 parameter. Change all callers. Clear parameter target.
8669 (Binary_test): Test target here.
8670 * testsuite/object_unittest.cc (gold_testsuite): Remove
8671 target_test_pointer parameter. Change all callers.
8672 (Object_test): Test target here.
8673
8674 2009-09-26 Ian Lance Taylor <iant@google.com>
8675
8676 * testsuite/initpri1.c: Don't try to use constructor priorities if
8677 compiling with gcc before 4.3.
8678
8679 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8680
8681 * testsuite/retain_symbols_file_test.sh (check_present): Change
8682 output file name to retain_symbols_file_test.stdout.
8683 (check_absent): Likewise.
8684
8685 2009-09-18 Craig Silverstein <csilvers@google.com>
8686
8687 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8688 * options.cc: Include <cerrno> and <fstream>.
8689 (General_options::finalize): Parse -retain-symbols-file tag.
8690 * options.h: New flag.
8691 (General_options): New method should_retain_symbol, new
8692 variable symbols_to_retain.
8693 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8694 should_retain_symbol map.
8695 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8696 * testsuite/Makefile.in: Regenerate.
8697 * testsuite/retain_symbols_file_test.sh: New file.
8698
8699 2009-09-18 Nick Clifton <nickc@redhat.com>
8700
8701 * po/es.po: Updated Spanish translation.
8702
8703 2009-09-17 Doug Kwan <dougkwan@google.com>
8704
8705 * debug.h (DEBUG_RELAXATION): New constant.
8706 (DEBUG_ALL): Add DEBUG_RELAXATION.
8707 (debug_string_to_enum): Add relaxation debug option.
8708 * layout.cc
8709 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8710 Layout::Relaxation_debug_check::read_sections,
8711 Layout::Relaxation_debug_check::read_sections): New method definitions.
8712 (Layout::Layout): Initialize data members
8713 record_output_section_data_from_scrips_,
8714 script_output_section_data_list_ and relaxation_debug_check_.
8715 (Layout::save_segments, Layout::restore_segments,
8716 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8717 Layout::relaxation_loop_body): New method definitions.
8718 (Layout::finalize): Support relaxation. Move section layout code to
8719 Layout::relaxation_loop_body.
8720 (Layout::set_asection_address_from_script): Move code for orphan
8721 section placement out.
8722 (Layout::place_orphan_sections_in_script): New method definition.
8723 * layout.h (Output_segment_headers, Output_file_header):
8724 New forward class declarations.
8725 (Layout::~Layout): Define.
8726 (Layout::new_output_section_data_from_script): New method definition.
8727 (Layout::place_orphan_sections_in_script): New method declaration.
8728 (Layout::Segment_states): New type declaration.
8729 (Layout::save_segments, Layout::restore_segments,
8730 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8731 Layout::relaxation_loop_body): New method declarations.
8732 (Layout::Output_section_data_list): New type declaration.
8733 (Layout::Relaxation_debug_check): New class definition.
8734 (Layout::record_output_section_data_from_script_,
8735 Layout::script_output_section_data_list_, Layout::segment_states_,
8736 Layout::relaxation_debug_check_): New data members.
8737 * output.cc: (Output_section_headers::do_size): New method definition.
8738 (Output_section_headers::Output_section_headers): Move size
8739 computation to Output_section_headers::do_size.
8740 (Output_segment_headers::do_size): New method definition.
8741 (Output_file_header::Output_file_header): Move size computation to
8742 Output_file_header::do_size and call it.
8743 (Output_file_header::do_size): New method definition.
8744 (Output_data_group::Output_data_group): Adjust call to
8745 Output_section_data.
8746 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8747 (Output_symtab_xindex::do_write): Add array bound check.
8748 (Output_section::Input_section::print_to_mapfile): Handle
8749 RELAXED_INPUT_SECTION_CODE.
8750 (Output_section::Output_section): Initialize data member checkpoint_.
8751 (Output_section::~Output_section): Delete checkpoint object pointed
8752 by checkpoint_.
8753 (Output_section::add_input_section): Always add an Input_section if
8754 relaxing.
8755 (Output_section::add_merge_input_section): Add assert.
8756 (Output_section::relax_input_section): New method definition.
8757 (Output_section::set_final_data_size): Set load address to zero for
8758 an unallocated section.
8759 (Output_section::do_address_and_file_offset_have_reset_values):
8760 New method definition.
8761 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8762 Handle relaxed input section.
8763 (Output_section::sort_attached_input_sections): Checkpoint input
8764 section list lazily.
8765 (Output_section::get_input_sections): Change type of input_sections to
8766 list of Simple_input_section pointers. Checkpoint input section list
8767 lazily. Also handle relaxed input sections.
8768 (Output_section::add_input_section_for_script): Take a reference to
8769 a Simple_input_section object instead of Relobj pointer and section
8770 index as parameter. Handle relaxed input sections.
8771 (Output_section::save_states, Output_section::restore_states): New
8772 method definitions.
8773 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8774 (Output_data::is_data_size_fixed): New method definition.
8775 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8776 if it is fixed.
8777 (Output_data::address_and_file_offset_have_reset_values): New method
8778 definition.
8779 (Output_data::do_address_and_file_offset_have_reset_values): New method
8780 definition.
8781 (Output_data::set_data_size): Check that data size is not fixed.
8782 (Output_data::fix_data_size): New method definition.
8783 (Output_data::is_data_size_fixed_): New data member.
8784 (Output_section_headers::set_final_data_size): New method definition.
8785 (Output_section_headers::do_size): New method declaration.
8786 (Output_segment_headers::set_final_data_size): New method definition.
8787 (Output_segment_headers::do_size): New method declaration.
8788 (Output_file_header::set_final_data_size)::New method definition.
8789 (Output_file_header::do_size)::New method declaration.
8790 (Output_section_data::Output_section_data): Add new parameter
8791 is_data_size_fixed and use it to fix data size.
8792 (Output_data_const::Output_data_const): Adjust call to base class
8793 constructor and fix data size.
8794 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8795 base class constructor and fix data size.
8796 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8797 base class constructor and fix data size.
8798 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8799 class constructor and fix data size.
8800 (Output_data_group::set_final_data_size): New method definition.
8801 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8802 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8803 class constructor and fix data size.
8804 (Output_relaxed_input_section): New class definition.
8805 (Output_section::Simple_input_section): New class definition.
8806 (Output_section::get_input_sections): Adjust parameter list.
8807 (Output_section::add_input_section_for_script): Same.
8808 (Output_section::save_states, Output_section::restore_states,
8809 Output_section::do_address_and_file_offset_have_reset_values,
8810 (Output_section::Input_section::Input_section): Handle
8811 RELAXED_INPUT_SECTION_CODE. Add new overload for
8812 Output_relaxed_input_section.
8813 (Output_section::Input_section::is_input_section,
8814 Output_section::Input_section::set_output_section): Handle relaxed
8815 input section.
8816 (Output_section::Input_section::is_relaxed_input_section,
8817 Output_section::Input_section::output_section_data,
8818 Output_section::Input_section::relaxed_input_section): New method
8819 definitions.
8820 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8821 value.
8822 (Output_section::Input_section::u1_): Update comments.
8823 (Output_section::Input_section::u2_): Add new union member poris.
8824 (Output_section::Checkpoint_output_section): New classs definition.
8825 (Output_section::relax_input_section): New method declaration.
8826 (Output_section::checkpoint_): New data member.
8827 (Output_segment): Update comments.
8828 (Output_segment::Output_segment): Un-privatize copy constructor.
8829 (Output_segment::operator=): Un-privatize.
8830 * script-sections.cc (Output_section_element::Input_section_list):
8831 Change element type to Output_section::Simple_input_section.
8832 (Output_section_element_dot_assignment::set_section_addresses):
8833 Register output section data for relaxation clean up.
8834 (Output_data_exression::Output_data_expression): Adjust call to base
8835 constructor to fix data size.
8836 (Output_section_element_data::set_section_addresses): Register
8837 Output_data_expression object for relaxation clean up.
8838 (struct Input_section_info): Replace Relobj pointer and section index
8839 pair with Output_section::Simple_input_section and Convert struct to a
8840 class.
8841 (Input_section_sorter::operator()): Adjust access to
8842 Input_section_info data member to use accessors.
8843 (Output_section_element_input::set_section_addresses): Use layout
8844 parameter. Adjust code to use Output_section::Simple_input_section
8845 and Input_secction_info classes. Register filler for relaxation
8846 clean up.
8847 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8848 and section index pair with Output_section::Simple_input_section
8849 class. Adjust code accordingly.
8850 (Phdrs_element::release_segment): New method definition.
8851 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8852 segment list.
8853 (Script_sections::release_segments): New method definition.
8854 * gold/script-sections.h (Script_sections::release_segments): New
8855 method declaration.
8856 * gold/target.h (Target::may_relax, Target::relax,
8857 Target::do_may_relax, Target::do_relax): New method definitions.
8858
8859 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8860
8861 * arm.cc (has_signed_unsigned_overflow): New function.
8862 (Arm_relocate_functions::abs8): New function.
8863 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8864 (Target_arm::Scan::global): Likewise.
8865 (Target_arm::relocate::relocate): Likewise.
8866 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8867 Likewise.
8868
8869 2009-09-16 Cary Coutant <ccoutant@google.com>
8870
8871 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8872 * testsuite/Makefile.in: Regenerate.
8873
8874 2009-09-11 Nick Clifton <nickc@redhat.com>
8875
8876 * po/gold.pot: Updated by the Translation project.
8877
8878 2009-09-08 Cary Coutant <ccoutant@google.com>
8879
8880 * output.cc (Output_file::open): Add execute permission to empty file.
8881 * testsuite/Makefile.am (permission_test): New test.
8882 * testsuite/Makefile.in: Regenerate.
8883
8884 2009-09-02 Ian Lance Taylor <iant@google.com>
8885
8886 * output.cc (Output_file::resize): Call map_no_anonymous rather
8887 than map.
8888
8889 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8890
8891 * gold.cc: Include "incremental.h".
8892 (queue_initial_tasks): Call Incremental_checker methods.
8893 * incremental.cc: Include "output.h".
8894 (Incremental_checker::can_incrementally_link_output_file): New
8895 method.
8896 * incremental.h (Incremental_checker): New class.
8897
8898 * output.cc (Output_file::open_for_modification): New method.
8899 (Output_file::map_anonymous): Changed return type to bool. Record
8900 map in base_ field.
8901 (Output_file::map_no_anonymous): New method, broken out of map.
8902 (Output_file::map): Use map_no_anonymous and map_anonymous.
8903 * output.h (class Output_file): Update declarations.
8904
8905 2009-08-24 Cary Coutant <ccoutant@google.com>
8906
8907 * options.h (Command_line::Pre_options): New class.
8908 (Command_line::pre_options): New member.
8909 * options.cc (gold::options::ready_to_register): New variable.
8910 (One_option::register_option): Do nothing if not registering options.
8911 Assert if same short option registered twice.
8912 (General_options::General_options): Turn off option registration when
8913 done constructing.
8914 (Command_line::Pre_options::Pre_options): New constructor.
8915
8916 2009-08-24 Cary Coutant <ccoutant@google.com>
8917
8918 * options.h (General_options::no_keep_memory): Remove incorrect
8919 short option.
8920
8921 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8922
8923 * Makefile.am (am__skiplex, am__skipyacc): New.
8924 * Makefile.in: Regenerate.
8925
8926 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8927
8928 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8929 (INCLUDES): ... this.
8930 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8931 (AM_CPPFLAGS): Renamed from ...
8932 (INCLUDE): ... this.
8933 * Makefile.in, testsuite/Makefile.in: Regenerate.
8934
8935 * Makefile.in: Regenerate.
8936 * aclocal.m4: Likewise.
8937 * config.in: Likewise.
8938 * configure: Likewise.
8939 * testsuite/Makefile.in: Likewise.
8940
8941 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8942 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8943 * Makefile.in: Regenerate.
8944 * testsuite/Makefile.in: Regenerate.
8945
8946 2009-08-19 Cary Coutant <ccoutant@google.com>
8947
8948 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8949 symbols in shared libraries overridden by hidden or internal symbols
8950 in the main program.
8951
8952 2009-08-19 Chris Demetriou <cgd@google.com>
8953
8954 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8955 checking source file names in error messages.
8956
8957 2009-08-18 Doug Kwan <dougkwan@google.com>
8958
8959 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8960 an elcpp::Ehdr as parameter. Adjust call to set_target.
8961 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8962 an elfcpp::Ehdr as parameter.
8963 * object.cc (Object::set_target): Remove the version that looks up
8964 a target and sets it.
8965 (Sized_relobj::setup): Take a Target object instead of
8966 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8967 (make_elf_sized_object): Find target and ask target to
8968 make an ELF object.
8969 * object.h: (Object::set_target): Remove the version that looks up
8970 a target and sets it.
8971 (Sized_relobj::setup): Take a Target object instead of
8972 an elfcpp:Ehdr as parameter.
8973 * target.cc: Include dynobj.h.
8974 (Target::do_make_elf_object_implementation): New.
8975 (Target::do_make_elf_object): New.
8976 * target.h (Target::make_elf_object): New template declaration.
8977 (Target::do_make_elf_object): New method declarations.
8978 (Target::do_make_elf_object_implementation): New template declaration.
8979
8980 2009-08-14 Ian Lance Taylor <iant@google.com>
8981
8982 * gold.h (FUNCTION_NAME): Define.
8983 (gold_unreachable): Use FUNCTION_NAME.
8984
8985 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8986
8987 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8988 symbol in the --keep-unique list is not found.
8989
8990 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8991
8992 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8993 been maked as --keep-unique.
8994 (Icf::unfold_section): New function.
8995 * icf.h (Icf::unfold_section): New function.
8996 * options.h (General_options::keep_unique): New option.
8997 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8998 * testsuite/Makefile.in: Regenerate.
8999 * testsuite/icf_keep_unique_test.sh: New file.
9000 * testsuite/icf_keep_unique_test.cc: New file.
9001
9002 2009-08-12 Cary Coutant <ccoutant@google.com>
9003
9004 PR 10471
9005 * resolve.cc (Symbol_table::resolve): Check for references from
9006 dynamic objects to hidden and internal symbols.
9007 * testsuite/Makefile.am (hidden_test.sh): New test.
9008 * testsuite/Makefile.in: Regenerate.
9009 * testsuite/hidden_test.sh: New script.
9010 * testsuite/hidden_test_1.c: New test source.
9011 * testsuite/hidden_test_main.c: New test source.
9012
9013 2009-08-11 Doug Kwan <dougkwan@google.com>
9014
9015 * arm.cc: Update comments.
9016 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9017 segment to locate the .ARM.exidx section if present.
9018
9019 2009-08-09 Doug Kwan <dougkwan@google.com>
9020
9021 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9022 patch.
9023
9024 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9025 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9026 compiler warnings.
9027
9028 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9029
9030 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9031 valid tls_segment only for non-debug-section relocations.
9032 * testsuite/Makefile.am: Add gc_tls_test.
9033 * testsuite/Makefile.in: Regenerate.
9034 * testsuite/gc_tls_test.cc: New file.
9035 * testsuite/gc_tls_test.sh: New file.
9036
9037 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9038
9039 * icf.cc: New file.
9040 * icf.h: New file.
9041 * Makefile.am (CCFILES): Add icf.cc.
9042 (HFILES): Add icf.h
9043 * Makefile.in: Regenerate.
9044 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9045 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9046 section, symbol and addend information for the relocs.
9047 * gold.cc (queue_middle_tasks): Call identical code folding.
9048 * gold.h: Add defines for multimap.
9049 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9050 to the call of finalize_local_symbols.
9051 * main.cc (main): Create object of class Icf.
9052 * object.cc (Sized_relobj::do_layout): Allow this function to be
9053 called twice during icf.
9054 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9055 to sections marked as identical by icf.
9056 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9057 when available.
9058 (Sized_relobj::do_section_entsize): New function.
9059 * object.h (Object::section_entsize): New function.
9060 (Object::do_section_entsize): New pure virtual function.
9061 (Relobj::finalize_local_symbols): Add new parameter.
9062 (Relobj::do_section_entsize): New function.
9063 * options.h (General_options::icf): New option.
9064 (General_options::icf_iterations): New option.
9065 (General_options::print_icf_sections): New option.
9066 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9067 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9068 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9069 icf.
9070 * symtab.cc (Symbol_table::is_section_folded): New function.
9071 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9072 to sections marked as identical by icf.
9073 * symtab.h (Symbol_table::set_icf): New function.
9074 (Symbol_table::icf): New function.
9075 (Symbol_table::is_section_folded): New function.
9076 (Symbol_table::icf_): New data member.
9077 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9078 * testsuite/Makefile.am: Add commands to build icf_test.
9079 * testsuite/Makefile.in: Regenerate.
9080 * testsuite/icf_test.sh: New file.
9081 * testsuite/icf_test.cc: New file.
9082
9083 2009-07-24 Chris Demetriou <cgd@google.com>
9084
9085 * layout.cc (is_compressible_debug_section): Fix incorrect
9086 comment about compressed section names.
9087
9088 2009-07-20 Ian Lance Taylor <ian@airs.com>
9089
9090 PR 10419
9091 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9092
9093 2009-07-16 Ian Lance Taylor <iant@google.com>
9094
9095 PR 10400
9096 * layout.h: #include <map>.
9097 (class Kept_section): Change from struct to class. Add accessors
9098 and setters. Add section size to Comdat_group mapping. Change
9099 Comdat_group to std::map. Add is_comdat_ field. Add
9100 linkonce_size field in union.
9101 (class Layout): Update declaration of find_or_add_kept_section.
9102 Don't declare find_kept_object.
9103 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9104 parameter. Add object, shndx, is_comdat, and is_group_name
9105 parameters. Change all callers. Adjust for new Kept_section.
9106 (Layout::find_kept_object): Remove.
9107 * object.cc (Sized_relobj::include_section_group): Update use of
9108 Kept_section. Rename secnum to shndx. Only record
9109 Kept_comdat_section if sections are the same size.
9110 (Sized_relobj::include_linkonce_section): Update use of
9111 Kept_section. Only record Kept_comdat_section if sections are the
9112 same size. Set size of linkonce section.
9113 (Sized_relobj::map_to_kept_section): Update call to
9114 get_kept_comdat_section.
9115 * object.h (class Sized_relobj): Rename fields in
9116 Kept_comdat_section to drop trailing underscores; change object
9117 field to Relobj*. Change Kept_comdat_section_table to store
9118 struct rather than pointer.
9119 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9120 Add kept_object and kept_shndx parameters. Change all callers.
9121 (Sized_relobj::get_kept_comdat_section): Change return type to
9122 bool. Add kept_object and kept_shndx parameters. Change all
9123 callers.
9124 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9125 Layout::find_or_add_kept_section.
9126
9127 2009-07-09 Ian Lance Taylor <iant@google.com>
9128
9129 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9130 Reserve space in the hash table.
9131
9132 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9133
9134 * fileread.cc (File_read::get_mtime): New method.
9135 * fileread.h (Timespec): New structure.
9136 (File_read::get_mtime): New method.
9137 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9138 Renamed from timestamp_nsec.
9139 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9140 Elf_Xword.
9141 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9142 timestamp_nsec.
9143 (Incremental_inputs::report_archive): Save mtime; style fix.
9144 (Incremental_inputs::report_obejct): Save mtime; style fix.
9145 (Incremental_inputs::report_script): Save mtime; style fix.
9146 (Incremental_inputs::finalize_inputs): Style fix.
9147 (Incremental_inputs::finalize): Style fix.
9148 (Incremental_inputs::create_input_section_data): Store inputs
9149 mtime.
9150 * incremental.h (Incremental_inputs::report_script): Add mtime
9151 argument.
9152 (Incremental_inputs::Input_info::Input_info): Intialize only one
9153 union member.
9154 (Incremental_inputs::Input_info::archive): Move to nameless
9155 union.
9156 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9157 (Incremental_inputs::Input_info::script): Move to nameless union.
9158 (Incremental_inputs::mtime): New field.
9159 * script.cc (read_input_script): Pass file mtime to
9160 Incremental_input.
9161 * script.h (Script_info::inputs): Style fix.
9162
9163 2009-07-01 Ian Lance Taylor <ian@airs.com>
9164
9165 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9166 instead of 32.
9167
9168 2009-06-24 Ian Lance Taylor <iant@google.com>
9169
9170 PR 10156
9171 * layout.cc (Layout::choose_output_section): If we find an
9172 existing section, update the flags.
9173 (Layout::create_notes): New function, broken out of
9174 Layout::finalize.
9175 (Layout::finalize): Don't create note sections.
9176 (Layout::create_note): Don't crash if linker script discards
9177 section.
9178 (Layout::create_gold_note): Likewise.
9179 (Layout::create_build_id): Likewise. Don't set
9180 after_input_sections on the section.
9181 (Layout::create_executable_stack_info): Remove target parameter.
9182 Change caller.
9183 * layout.h (class Layout): Declare create_notes. Update
9184 declaration of create_executable_stack_info.
9185 * gold.cc (queue_middle_tasks): Call create_notes.
9186 * output.cc (Output_section::update_flags_for_input_section): Move
9187 here from output.h. If SHF_ALLOC flag is newly set, mark address
9188 invalid.
9189 * output.h (Output_data::mark_address_invalid): New function.
9190 (class Output_section): Only declare, not define,
9191 update_flags_for_input_section. Remove set_flags.
9192
9193 2009-06-24 Ian Lance Taylor <iant@google.com>
9194
9195 * script-sections.cc (Output_section_definition::
9196 set_section_addresses): Rename shadowing local load_address to
9197 laddr.
9198
9199 2009-06-24 Ian Lance Taylor <iant@google.com>
9200
9201 PR 10244
9202 * reloc.cc (relocate_sections): Skip empty relocation sections.
9203
9204 2009-06-23 Ian Lance Taylor <iant@google.com>
9205
9206 PR 10156
9207 * layout.cc (Layout::create_note): Use choose_output_section
9208 rather than make_output_section.
9209
9210 2009-06-23 Ian Lance Taylor <iant@google.com>
9211
9212 PR 10237
9213 * options.cc (General_options::parse_V): Set printed_version_.
9214 (General_options::General_options): Initialize printed_version_.
9215 * options.h (class General_options): Add printed_version_ field.
9216 * gold.cc (queue_initial_tasks): If there are no input files,
9217 don't give a fatal error if we printed the version information.
9218 (queue_middle_tasks): If using -r with a shared object, give a
9219 fatal error rather than an ordinary error.
9220
9221 2009-06-23 Ian Lance Taylor <iant@google.com>
9222
9223 PR 10219
9224 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9225 (Layout::make_output_section): Set have_stabstr_section_ if we see
9226 a .stab*str section.
9227 (Layout::finalize): Call link_stabs_sections.
9228 (Layout::link_stabs_sections): New file.
9229 * layout.h (class Layout): Add have_stabstr_section_ field.
9230 Declare link_stabs_sections.
9231
9232 2009-06-23 Doug Kwan <dougkwan@google.com>
9233
9234 * Makefile.am (libgold_a_LIBADD): New.
9235 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9236 * Makefile.in: Regenerate.
9237 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9238 * configure: Regenerate.
9239 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9240 * fileread.cc: Include sys/state.h
9241 * gold.h: Declare memmem and strndup if found missing.
9242 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9243
9244 2009-06-23 Ian Lance Taylor <iant@google.com>
9245
9246 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9247 * configure: Rebuild.
9248
9249 2009-06-23 Ian Lance Taylor <iant@google.com>
9250
9251 PR 10147
9252 * object.cc (Object::section_contents): Don't try to get a view if
9253 the section has length zero.
9254 (Object::handle_gnu_warning_section): If the section is empty, use
9255 the name of the section as the warning.
9256
9257 2009-06-23 Ian Lance Taylor <iant@google.com>
9258
9259 PR 10133
9260 * stringpool.h (class Stringpool_template): Add optimize_ field.
9261 (Stringpool_template::set_optimize): New function.
9262 * stringpool.cc (Stringpool_template::Stringpool_template):
9263 Initialize optimize_ field.
9264 (Stringpool_template::set_string_offsets): Test local optimize
9265 fild rather than parameter.
9266 * layout.cc (Layout::Layout): Call set_optimize on the section
9267 name stringpool.
9268
9269 2009-06-22 Ian Lance Taylor <iant@google.com>
9270
9271 PR 10030
9272 * yyscript.y: Parse TARGET.
9273 * script.cc (script_set_target): New function.
9274 * script-c.h (script_set_target): Declare.
9275 * options.cc (General_options::string_to_object_format): Rename
9276 from string_to_object_format in anonymous namespace. Change
9277 callers.
9278 * options.h (class General_options): Declare
9279 string_to_object_format.
9280
9281 2009-06-22 Ian Lance Taylor <iant@google.com>
9282
9283 * script-sections.cc (Script_sections::create_segments): Don't put
9284 program headers in a PT_LOAD segment if -n or -N.
9285
9286 2009-06-22 Ian Lance Taylor <iant@google.com>
9287
9288 PR 10141
9289 * options.h (class General_options): Add -z lazy and -z now. Sort
9290 -z options into alphabetical order.
9291 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9292
9293 2009-06-21 Ian Lance Taylor <iant@google.com>
9294
9295 * layout.cc (Layout::make_output_section): Call
9296 Target::new_output_section.
9297 (Layout::attach_allocated_section_to_segment): Put large section
9298 sections in a separate load segment with the large segment flag
9299 set.
9300 (Layout::segment_precedes): Sort large data segments after other
9301 load segments.
9302 (align_file_offset): New static function.
9303 (Layout::set_segment_offsets): Use align_file_offset.
9304 * output.h (class Output_section): Add is_small_section_ and
9305 is_large_section_ fields.
9306 (Output_section::is_small_section): New function.
9307 (Output_section::set_is_small_section): New function.
9308 (Output_section::is_large_section): New function.
9309 (Output_section::set_is_large_section): New function.
9310 (Output_section::is_large_data_section): New function.
9311 (class Output_segment): Add is_large_data_segment_ field.
9312 (Output_segment::is_large_data_segment): New function.
9313 (Output_segment::set_is_large_data_segment): New function.
9314 * output.cc (Output_section::Output_section): Initialize new
9315 fields.
9316 (Output_segment::Output_segment): Likewise.
9317 (Output_segment::add_output_section): Add assertion that large
9318 data sections always go in large data segments. Force small data
9319 sections to the end of the list of data sections. Force small BSS
9320 sections to the start of the list of BSS sections. For large BSS
9321 sections to the end of the list of BSS sections.
9322 * symtab.h (class Symbol): Declare is_common_shndx.
9323 (Symbol::is_defined): Check Symbol::is_common_shndx.
9324 (Symbol::is_common): Likewise.
9325 (class Symbol_table): Define enum Commons_section_type. Update
9326 declarations. Add small_commons_ and large_commons_ fields.
9327 * symtab.cc (Symbol::is_common_shndx): New function.
9328 (Symbol_table::Symbol_table): Initialize new fields.
9329 (Symbol_table::add_from_object): Put small and large common
9330 symbols in the right list.
9331 (Symbol_table::sized_finalized_symbol): Check
9332 Symbol::is_common_shndx.
9333 (Symbol_table::sized_write_globals): Likewise.
9334 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9335 common symbol lists. Don't call do_allocate_commons_list if the
9336 list is empty.
9337 (Symbol_table::do_allocate_commons_list): Remove is_tls
9338 parameter. Add comons_section_type parameter. Change all
9339 callers. Handle small and large common symbols.
9340 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9341 Symbol::is_common_shndx.
9342 * resolve.cc (symbol_to_bits): Likewise.
9343 * target.h (Target::small_common_shndx): New function.
9344 (Target::small_common_section_flags): New function.
9345 (Target::large_common_shndx): New function.
9346 (Target::large_common_section_flags): New function.
9347 (Target::new_output_section): New function.
9348 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9349 small_common_section_flags, and large_common_section_flags
9350 fields.
9351 (Target::do_new_output_section): New virtual function.
9352 * arm.cc (Target_arm::arm_info): Initialize new fields.
9353 * i386.cc (Target_i386::i386_info): Likewise.
9354 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9355 Likewise.
9356 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9357 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9358 (Target_x86_64::do_new_output_section): New function.
9359 * configure.ac: Define conditional MCMODEL_MEDIUM.
9360 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9361 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9362 (large_LDFLAGS): Define.
9363 * testsuite/large.c: New file.
9364 * testsuite/testfile.cc (Target_test::test_target_info):
9365 Initialize new fields.
9366 * configure, testsuite/Makefile.in: Rebuild.
9367
9368 2009-06-05 Doug Kwan <dougkwan@google.com>
9369
9370 * Makefile.am (CCFILES): Add target.cc.
9371 * Makefile.in: Regenerate.
9372 * i386.cc (class Target_i386): Define new virtual method to
9373 override do_is_local_label_name in parent.
9374 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9375 local symbols if --discard-locals or -X is given.
9376 * options.h (class General_options): Declare new options
9377 '--discard-locals' and '-X' for discarding locals.
9378 * target.h (class Target): Define new methods is_local_label_name.
9379 Declare new virtual method do_is_local_label_name.
9380 * target.cc: New file.
9381 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9382 (check_SCRIPTS): Add discard_locals_test.sh.
9383 (check_DATA): Add discard_local_tests.syms.
9384 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9385 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9386 * testsuite/Makefile.in: Regenerate.
9387 * testsuite/discard_locals_test.c: New file.
9388 * testsuite/discard_locals_test.sh: Same.
9389
9390 2009-06-05 Doug Kwan <dougkwan@google.com>
9391
9392 * object.cc (Sized_relobj::Sized_relobj): Initialize
9393 discarded_eh_frame_shndx_ to -1U.
9394 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9395 section.
9396 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9397 a discarded .eh_frame section.
9398 (Sized_relobj::do_finalize_local_symbols): Ditto.
9399 * object.h (class Sized_relobj): Declare new member
9400 discarded_eh_frame_shndx_.
9401 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9402 (local_labels_test.o, local_labels_test): New rules.
9403 * testsuite/Makefile.in: Regenerate.
9404
9405 2009-06-04 Doug Kwan <dougkwan@google.com>
9406
9407 * layout.cc (Layout::section_name_mapping): Add mapping for
9408 special ARM sections.
9409
9410 2009-06-03 Doug Kwan <dougkwan@google.com>
9411
9412 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9413 (utils::has_overflow): Same.
9414
9415 2009-06-03 Ian Lance Taylor <iant@google.com>
9416
9417 * layout.cc (Layout::section_name_mapping): New array, replacing
9418 Layout::linkonce_mapping.
9419 (Layout::section_name_mapping_count): New variable, replacing
9420 Layout::linkonce_mapping_count.
9421 (Layout::linkonce_output_name): Remove.
9422 (Layout::output_section_name): Rewrite.
9423 * layout.h (class Layout): Rename Linkonce_mapping to
9424 Section_name_mapping, linkonce_mapping to section_name_mapping,
9425 linkonce_mapping_count to section_name_mapping_count. Don't
9426 declare linkonce_output_name.
9427
9428 2009-06-03 Doug Kwan <dougkwan@google.com>
9429
9430 * gold/arm.cc (namespace utils): New.
9431 (Target_arm::reloc_is_non_pic): Define new method.
9432 (class Arm_relocate_functions): New.
9433 (Target_arm::Relocate::relocate): Handle relocation types used by
9434 Android.
9435
9436 2009-06-03 Ian Lance Taylor <iant@google.com>
9437
9438 * arm.cc (Target_arm::scan::global): Use || instead of |.
9439
9440 2009-06-02 Doug Kwan <dougkwan@google.com>
9441
9442 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9443 issued_non_pic_error_.
9444 (class Target_arm::Scan): Declare new method check_non_pic.
9445 Define new method symbol_needs_plt_entry.
9446 Declare new data member issued_non_pic_error_.
9447 (class Target_arm::Relocate): Declare new method
9448 should_apply_static_reloc.
9449 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9450 (Target_arm::Scan::check_non_pic): Define new method.
9451 (Target_arm::Scan::local): Handle a small subset of reloc types used
9452 by Android.
9453 (Target_arm::Scan::local): Same.
9454 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9455
9456 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9457
9458 * incremental.cc (Incremental_inputs::report_command_line): Filter
9459 out --incremental-* options.
9460
9461 2009-05-29 Doug Kwan <dougkwan@google.com>
9462
9463 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9464 template class.
9465 (class Target_arm): Update comment.
9466 (Target_arm::Target_arm): Initialize new data members GOT_,
9467 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9468 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9469 and Target_arm::rel_dyn_section.
9470 Declare new_enum Target_arm::Got_type.
9471 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9472 and DYNBSS_.
9473 Update commments for member do_dynsym_value.
9474 (Target_arm::got_size, Target_arm::plt_section,
9475 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9476 new methods inside class defintion.
9477 (Target_arm::got_section): Define new method.
9478 (Target_arm::rel_dyn_section): Same.
9479 (Output_data_plt_arm): New template class.
9480 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9481 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9482 (Output_data_plt_arm::add_entry): Same.
9483 (Output_data_plt_arm::first_plt_entry): Define new
9484 static data member for PLT instruction template.
9485 (Output_data_plt_arm::plt_entry): Same.
9486 (Output_data_plt_arm::do_write): Define new method.
9487 (Target_arm::make_plt_entry): Same.
9488 (Target_arm::do_finalize_sections): Same.
9489 (Target_arm::do_dynsym_value): Same.
9490
9491 2009-05-28 Doug Kwan <dougkwan@google.com>
9492
9493 * Makefile.am (TARGETSOURCES): Add arm.cc.
9494 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9495 * Makefile.in: Regenerate.
9496 * arm.cc: New file.
9497 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9498
9499 2009-05-26 Doug Kwan <dougkwan@google.com>
9500
9501 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9502 (General_options::check_excluded_libs): Strip off directories in
9503 archive name before matching like GNU ld does.
9504 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9505 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9506 (exclude_libs_test_LDFLAGS): Add linker option
9507 -Wl,--exclude-libs,libexclude_libs_test_3
9508 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9509 an explicit archive without using -l.
9510 (alt/libexclude_libs_test_3.a): New make rule.
9511 * testsuite/Makefile.in: Regenerate.
9512 * testsuite/exclude_libs_test.c : Declare lib3_default().
9513 (main): Call it.
9514 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9515 * exclude_libs_test_3.c: New file.
9516
9517 2009-05-26 Nick Clifton <nickc@redhat.com>
9518
9519 * po/id.po: New Indonesian translation.
9520 * po/gold.pot: Updated template file.
9521
9522 2009-05-22 Sriraman Tallam <tmsriram@google.com>
9523
9524 * testsuite/Makefile.am: Add -ffunction-sections to compile
9525 gc_comdat_test files. Add -Wl,--gc-sections to build
9526 gc_comdat_test.
9527 * testsuite/Makefile.in: Regenerate.
9528 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9529
9530 2009-05-21 Sriraman Tallam <tmsriram@google.com>
9531
9532 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9533 kept comdat section was garbage collected.
9534 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9535 * testsuite/Makefile.in: Regenerate.
9536 * testsuite/gc_comdat_test.sh: New file.
9537 * testsuite/gc_comdat_test_1.cc: New file.
9538 * testsuite/gc_comdat_test_2.cc: New file.
9539
9540 2009-05-19 Doug Kwan <dougkwan@google.com>
9541
9542 * archive.cc (Archive::Archive): Move constructor from archive.h
9543 to here. Initialize no_export_.
9544 (Archive::get_elf_object_for_member): Set no_export flag of object.
9545 * archive.h (Archive::Archive): Move constructor body to
9546 archive.cc.
9547 (Archive::no_export): New method.
9548 (Archive::no_export_): New field.
9549 * object.h (Object::Object): Initialize no_export_ to false.
9550 (Object::no_export, Object::set_no_export): New methods.
9551 (Object::no_export_): New field.
9552 * options.cc (General_options::parse_exclude_libs): New method.
9553 (General_options::check_excluded_libs) Same.
9554 * options.h (exclude_libs): New option.
9555 (General_options::check_excluded_libs): New method declaration.
9556 (General_options::excluded_libs_): New field.
9557 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9558 default or protected visibility if an object has no-export flag set.
9559 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9560 (check_SCRIPTS): Add exclude_libs_test.sh.
9561 (check_DATA): Add exclude_libs_test.syms.
9562 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9563 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9564 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9565 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9566 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9567 libexclude_libs_test_2.a): New rules.
9568 * testsuite/Makefile.in: Regenerate.
9569 * testsuite/exclude_libs_test.c: New file.
9570 * testsuite/exclude_libs_test.sh: Ditto.
9571 * testsuite/exclude_libs_test_1.c: Ditto.
9572 * testsuite/exclude_libs_test_2.c: Ditto.
9573
9574 2009-05-15 Ian Lance Taylor <iant@google.com>
9575
9576 * configure.ac: Check for declarations for cases where libiberty.h
9577 checks HAVE_DECL_xxx.
9578 * configure, config.in: Rebuild.
9579
9580 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9581
9582 * gold.h (Incremental_argument_list): Remove (invalid) forward
9583 declaration.
9584 * incremental.cc (Incremental_inputs::report_achive): New method.
9585 (Incremental_inputs::report_object): New method.
9586 (Incremental_inputs::report_script): New method.
9587 (Incremental_inputs::finalize_inputs): New method.
9588 (Incremental_inputs::finalize): Call finalize_inputs().
9589 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9590 Create inputs entries.
9591 * incremental.h (Incremental_input_type): New enum.
9592 (Incremental_inputs::Incremental_input): Initialize new fields.
9593 (Incremental_inputs::report_inputs): New method.
9594 (Incremental_inputs::report_achive): New method.
9595 (Incremental_inputs::report_object): New method.
9596 (Incremental_inputs::report_script): New method.
9597 (Incremental_inputs::finalize_inputs): New method.
9598 (Incremental_inputs::Input_info): New struct.
9599 (Incremental_inputs::Input_info_map): New typedef.
9600 (Incremental_inputs::lock_): New field.
9601 (Incremental_inputs::Inputs_): New field.
9602 (Incremental_inputs::Inputs_map): New field.
9603 * main.cc (main): Call Incremental_input::report_inputs.
9604 * options.h (Input_argument_list): Typedef moved from
9605 Input_arguments.
9606 (Input_file_group::Files): Remove, use ::Input_argument_list.
9607 (Input_file_group::Input_argument_list): Remove, use
9608 ::Input_argument_list.
9609 * plugin.cc (Plugin_manager::add_input_file): Add error in
9610 incremental build.
9611 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9612 functions.
9613 * script.cc (read_input_script): Call
9614 Incremental_input::report_script.
9615 * script.h (Script_info): New class.
9616
9617 2009-04-27 Ian Lance Taylor <iant@google.com>
9618
9619 * x86_64.cc (do_adjust_output_section): Set entsize to
9620 plt_entry_size.
9621
9622 2009-04-23 Elliott Hughes <enh@google.com>
9623
9624 * output.cc (Output_file::close): After short writes, continue
9625 writing from the correct offset in the buffer being written.
9626
9627 2009-04-23 Chris Demetriou <cgd@google.com>
9628
9629 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9630 * configure: Regenerate.
9631 * config.in: Regenerate.
9632 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9633 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9634
9635 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9636
9637 * incremental.cc (Incremental_inputs_header_data): Renamed from
9638 Incremental_input_header_data.
9639 (Incremental_inputs_header_data::data_size): New field.
9640 (Incremental_inputs_header_data::put_input_file_count): Renamed
9641 from input_file_count.
9642 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9643 from command_line_offset.
9644 (Incremental_inputs_header_data::put_reserved): Renamed from
9645 put_reserved.
9646 (Incremental_inputs_entry_data): Renamed from
9647 Incremental_input_entry_data.
9648 (Incremental_inputs_entry_data::data_size): New field.
9649 (Incremental_inputs::report_command_line): New method.
9650 (Incremental_inputs::finalize): New method.
9651 (Incremental_inputs::create_incremental_inputs_data): New method.
9652 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9653 * incremental.h: New file.
9654 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9655 (Layout::finalize): Create incremental inputs section in
9656 incremental builds.
9657 (Layout::create_incremental_info_sections): New method.
9658 * layout.h (Layout::incremental_inputs): New method.
9659 (Layout::create_incremental_info_sections): New method.
9660 (Layout::incremental_inputs_): New field.
9661 * main.cc (main): Notify Incremental_input of the command line.
9662
9663 2009-04-01 Ian Lance Taylor <iant@google.com>
9664 Mikolaj Zalewski <mikolajz@google.com>
9665
9666 * gold.h (reserve_unordered_map): Define, three versions, one for
9667 each version of Unordered_map.
9668 * layout.cc (Layout::Layout): Remove options parameter. Add
9669 number_of_input_files parameter. Don't initialize options_.
9670 Initialize number_of_input_files_ and resized_signatures_. Move
9671 sections_are_attached_.
9672 (Layout::layout_group): Reserve space for group_signatures_.
9673 (Layout::find_or_add_kept_section): Change name parameter to be a
9674 reference. Resize signatures_ map when it gets large enough.
9675 (Layout::layout_eh_frame): Use parameters->options() instead of
9676 this->options_.
9677 (Layout::make_output_section): Likewise.
9678 (Layout::attach_allocated_section_to_segment): Likewise.
9679 (Layout::finalize, Layout::create_executable_stack): Likewise.
9680 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9681 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9682 * layout.h (class Layout): Update declarations. Remove options_
9683 field. Add number_of_input_files_ and resized_signatures_
9684 fields. Move sections_are_attached_ field.
9685 * main.cc (main): Pass number of input files to Layout
9686 constructor. Don't pass options.
9687
9688 2009-03-30 Ian Lance Taylor <iant@google.com>
9689
9690 * ffsll.c (ffsll): Correct implementation.
9691
9692 2009-03-27 Ian Lance Taylor <iant@google.com>
9693
9694 * ffsll.c: New file.
9695 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9696 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9697 * ftruncate.c (ftruncate): Declare before definition.
9698 * mremap.c (mremap): Likewise.
9699 * pread.c (pread): Likewise.
9700 * configure, Makefile.in, config.in: Rebuild.
9701
9702 * mremap.c: New file.
9703 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9704 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9705 (mremap): Declare if HAVE_MREMAP is not defined.
9706 * configure, Makefile.in, config.in: Rebuild.
9707
9708 2009-03-27 Cary Coutant <ccoutant@google.com>
9709
9710 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9711 position independent.
9712 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9713 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9714
9715 2009-03-24 Cary Coutant <ccoutant@google.com>
9716
9717 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9718 an executable.
9719 (needs_dynamic_reloc): Likewise.
9720
9721 2009-03-24 Ian Lance Taylor <iant@google.com>
9722
9723 * yyscript.y (file_cmd): Recognize EXTERN.
9724 (extern_name_list, extern_name_list_body): New nonterminals.
9725 * script.cc (script_add_extern): Define.
9726 * script-c.h (script_add_extern): Declare.
9727
9728 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
9729
9730 * object.cc (is_elf_object): Define.
9731 * object.h (is_elf_object): Declare.
9732 * archive.cc (Archive::get_elf_object_for_member): Call
9733 is_elf_object.
9734 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
9735
9736 2009-03-24 Elliott Hughes <enh@google.com>
9737
9738 * output.cc (Output_file::map_anonymous): Define.
9739 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9740 try an anonymous one. Report the size if the mmap fails.
9741 * output.h (class Output_file): Declare map_anonymous.
9742
9743 2009-03-24 Ian Lance Taylor <iant@google.com>
9744
9745 * target-select.cc (instantiate_target): Don't acquire the lock if
9746 the instantiated_target_ field has already been set.
9747
9748 2009-03-23 Ian Lance Taylor <iant@google.com>
9749
9750 * gold-threads.h (class Initialize_lock): Define.
9751 * gold-threads.cc (class Initialize_lock_once): Define.
9752 (initialize_lock_control): New static variable.
9753 (initialize_lock_pointer): New static variable.
9754 (initialize_lock_once): New static function.
9755 (Initialize_lock::Initialize_lock): Define.
9756 (Initialize_lock::initialize): Define.
9757 * target-select.h: Include "gold-threads.h".
9758 (class Target_selector): Add lock_ and initialize_lock_ fields.
9759 Don't define instantiate_target, just declare it.
9760 * target-select.cc (Target_selector::Target_selector): Initialize
9761 new fields.
9762 (Target_selector::instantiate_target): Define.
9763 * descriptors.h: Include "gold-threads.h".
9764 (class Descriptors): Add initialize_lock_ field.
9765 * descriptors.cc (Descriptors::Descriptors): Initialize new
9766 field.
9767 (Descriptors::open): Use initialize_lock_ field
9768 * errors.h (class Errors): Add initialize_lock_ field.
9769 * errors.cc (Errors::Errors): Initialize new field.
9770 (Errors::initialize_lock): Use initialize_lock_ field.
9771 * powerpc.cc (class Target_selector_powerpc): Remove
9772 instantiated_target_ field. In do_recognize call
9773 instantiate_target rather than do_instantiate_target. In
9774 do_instantiate_target just allocate a new target.
9775 * sparc.cc (class Target_selector_sparc): Likewise.
9776
9777 * freebsd.h: New file.
9778 * i386.cc: Include "freebsd.h".
9779 (Target_i386): Derive from Target_freebsd rather than
9780 Sized_target.
9781 (Target_selector_i386): Derive from Target_selector_freebsd rather
9782 than Target_selector.
9783 * x86_64.cc: Include "freebsd.h".
9784 (Target_x86_64): Derive from Target_freebsd rather than
9785 Sized_target.
9786 (Target_selector_x86_64): Derive from Target_selector_freebsd
9787 rather than Target_selector.
9788 * target.h (class Target): Add adjust_elf_header and
9789 do_adjust_elf_header.
9790 * output.cc (Output_file_header:: do_sized_write): Call target
9791 adjust_elf_header routine.
9792 * configure.tgt: Set targ_osabi.
9793 * configure.ac: Define GOLD_DEFAULT_OSABI.
9794 * parameters.cc (Parameters::default_target): Pass
9795 GOLD_DEFAULT_OSABI to select_target.
9796 * target-select.h (class Target_selector): Make instantiate_target
9797 protected rather than private.
9798 * Makefile.am (HFILES): Add freebsd.h.
9799 * configure, Makefile.in, config.in: Rebuild.
9800
9801 * merge.cc (do_add_input_section): Correct pend value. Change
9802 message about last entry not being null terminated from error to
9803 warning.
9804
9805 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9806
9807 * incremental.cc: New file.
9808 * Makefile.am (CCFILES): Add incremental.cc.
9809 * Makefile.in: Rebuild.
9810
9811 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9812
9813 * layout.cc (Layout::output_section_name): Preserve names
9814 of '.note.' sections.
9815
9816 2009-03-19 Ian Lance Taylor <iant@google.com>
9817
9818 * descriptors.cc (Descriptors::open): Check that the options are
9819 valid before using them.
9820
9821 2009-03-18 Ian Lance Taylor <iant@google.com>
9822
9823 * script-sections.h: Include <list>.
9824 (class Script_sections): Change Sections_elements from std::vector
9825 to std::list. Typedef public Elements_iterator. Add
9826 orphan_section_placement_, data_segment_align_start_, and
9827 saw_data_segment_align_ fields. Remove data_segment_align_index_
9828 field.
9829 * script-sections.cc (class Orphan_section_placement): New class.
9830 (class Sections_element): Add virtual functions is_relro and
9831 orphan_section_init. Remove virtual function place_orphan_here.
9832 (class Output_section_definition): Add is_relro and
9833 orphan_section_init. Remove place_orphan_here.
9834 (class Orphan_output_section): Likewise.
9835 (Script_sections::Script_sections): Update for field changes.
9836 (Script_sections::data_segment_align): Set saw_data_segment_align_
9837 and data_segment_align_start_, not data_segment_align_index.
9838 (Script_sections::data_segment_relro_end): Check
9839 saw_data_segment_align_. Use data_segment_align_start_ rather
9840 than data_segment_align_index_.
9841 (Script_sections::place_orphan): Rewrite to use
9842 Orphan_section_placement.
9843
9844 2009-03-17 Ian Lance Taylor <iant@google.com>
9845
9846 * archive.cc (Archive::add_symbols): Check for a version attached
9847 to the symbol name in the archive map.
9848 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9849 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9850 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9851 (ver_test_11.a): New target.
9852 * testsuite/Makefile.in: Rebuild.
9853
9854 * configure.ac: Check for chsize and posix_fallocate. Replace
9855 ftruncate.
9856 * ftruncate.c: New file, from gnulib.
9857 * output.cc (posix_fallocate): Define dummy version if not
9858 HAVE_POSIX_FALLOCATE.
9859 (Output_file::map): Call posix_fallocate rather than lseek and
9860 write.
9861 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9862 * configure, Makefile.in, config.in: Rebuild.
9863
9864 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
9865
9866 * layout.h (Layout::create_note): Add section_name parameter.
9867 * layout.cc (Layout::create_note): Likewise.
9868 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
9869
9870 2009-03-17 Ian Lance Taylor <iant@google.com>
9871
9872 * descriptors.cc: Include "options.h".
9873 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9874 (Descriptors::open): Always use O_CLOEXEC when opening a new
9875 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9876 then set FD_CLOEXEC.
9877
9878 * sparc.cc (class Target_sparc): Add has_got_section.
9879 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9880 make sure we have a GOT section.
9881
9882 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9883 (Target_sparc::Scan::local): Likewise.
9884 (Target_sparc::Scan::global): Likewise.
9885 (Target_sparc::Relocate::relocate): Likewise.
9886 (Target_sparc::Relocate::relocate_tls): Likewise.
9887
9888 * symtab.cc (Symbol_table::define_default_version): New function,
9889 broken out of add_from_object.
9890 (Symbol_table::add_from_object): Call define_default_version.
9891 (Symbol_table::define_special_symbol): Add resolve_oldsym
9892 parameter. Change all callers. If the version for a symbol comes
9893 from a version script, resolve it with the symbol with the same
9894 name with no version. Also add the symbol without a version if
9895 appropriate.
9896 (do_define_in_output_data): If resolving with oldsym, don't delete
9897 sym.
9898 (do_define_in_output_segment): Likewise.
9899 (do_define_as_constant): Likewise.
9900 * symtab.h (class Symbol_table): Update declarations.
9901
9902 2009-03-13 Ian Lance Taylor <iant@google.com>
9903
9904 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9905 (Read_symbols::requeue): New function.
9906 (Read_symbols::do_read_symbols): If make_elf_object fails because
9907 the target type is not configured, and the file was searched for,
9908 issue a warning and retry with the next directory.
9909 (Add_symbols::run): If the file has an incompatible format, and
9910 it was searched for, requeue the Read_symbols task. On error,
9911 release the object.
9912 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9913 dirindex parameter to constructor. Change all callers. Declare
9914 incompatible_warning and requeue.
9915 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9916 input_argument_ and input_group_ fields. Add them to
9917 constructor. Change all callers.
9918 (class Read_script): Add dirindex_ field. Add it to constructor.
9919 Change all callers.
9920 * archive.cc (Archive::setup): Remove input_objects parameter.
9921 Change all callers.
9922 (Archive::get_file_and_offset): Likewise.
9923 (Archive::read_all_symbols): Likewise.
9924 (Archive::read_symbols): Likewise.
9925 (Archive::get_elf_object_for_member): Remove input_objects
9926 parameter. Add punconfigured parameter. Change all callers.
9927 (Archive::add_symbols): Change return type to bool. Check return
9928 value of include_member.
9929 (Archive::include_all_members): Likewise.
9930 (Archive::include_member): Change return type to bool. Return
9931 false if first included object has incompatible target. Set
9932 included_member_ field.
9933 (Add_archive_symbols::run): If add_symbols returns false, requeue
9934 Read_symbols task.
9935 * archive.h (class Archive): Add included_member_ field.
9936 Initialize it in constructor. Add input_file and searched_for
9937 methods. Update declarations.
9938 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9939 input_argument_ fields. Add them to constructor. Change all
9940 callers.
9941 * script.cc: Include "target-select.h".
9942 (class Parser_closure): Add skip_on_incompatible_target_ and
9943 found_incompatible_target_ fields. Add
9944 skip_on_incompatible_target parameter to constructor. Change all
9945 callers. Add methods skip_on_incompatible_target,
9946 clear_skip_on_incompatible_target, found_incompatible_target, and
9947 set_found_incompatible_target.
9948 (read_input_script): Add dirindex parameter. Change all callers.
9949 If parser finds an incompatible target, requeue Read_symbols
9950 task.
9951 (script_set_symbol): Clear skip_on_incompatible_target in
9952 closure.
9953 (script_add_assertion, script_parse_option): Likewise.
9954 (script_start_sections, script_add_phdr): Likewise.
9955 (script_check_output_format): New function.
9956 * script.h (read_input_script): Update declaration.
9957 * script-c.h (script_check_output_format): Declare.
9958 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9959 (ignore_cmd): Remove OUTPUT_FORMAT.
9960 * fileread.cc (Input_file::Input_file): Add explicit this.
9961 (Input_file::will_search_for): New function.
9962 (Input_file::open): Add pindex parameter. Change all callers.
9963 * fileread.h (class Input_file): Add input_file_argument method.
9964 Declare will_search_for. Update declarations.
9965 * object.cc (make_elf_object): Add punconfigured parameter.
9966 Change all callers.
9967 * object.h (class Object): Make input_file public. Add
9968 searched_for method.
9969 (make_elf_object): Update declaration.
9970 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9971 restart search.
9972 * dirsearch.h (class Dirsearch): Update declaration.
9973 * options.h (class General_options): Add --warn-search-mismatch.
9974 * parameters.cc (Parameters::is_compatible_target): New function.
9975 * parameters.h (class Parameters): Declare is_compatible_target.
9976 * workqueue.cc (Workqueue::add_blocker): New function.
9977 * workqueue.h (class Workqueue): Declare add_blocker.
9978
9979 * fileread.cc (Input_file::open): Remove options parameter.
9980 Change all callers.
9981 (Input_file::open_binary): Likewise.
9982 * script.cc (read_input_script): Likewise.
9983 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9984 options parameter from constructor. Change all callers.
9985 (class Read_script): Likewise.
9986 * fileread.h (class Input_file): Update declarations.
9987 * script.h (read_input_script): Update declaration.
9988
9989 2009-03-10 Nick Clifton <nickc@redhat.com>
9990
9991 * po/es.po: New Spanish translation.
9992
9993 2009-03-06 Cary Coutant <ccoutant@google.com>
9994
9995 * options.cc (parse_short_option): Keep dash_z from registering itself.
9996
9997 2009-03-03 Ian Lance Taylor <iant@google.com>
9998
9999 PR 9918
10000 * target-reloc.h (relocate_section): Pass output_section to
10001 relocate.
10002 * i386.cc (Target_i386::should_apply_static_reloc): Add
10003 output_section parameter. Change all callers.
10004 (Target_i386::Relocate::relocate): Add output_section parameter.
10005 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10006 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10007 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10008 * testsuite/two_file_shared.sh: New script.
10009 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10010 (check_DATA): Add two_file_shared.dbg.
10011 (two_file_shared.dbg): New target.
10012 * testsuite/Makefile.in: Rebuild.
10013
10014 2009-03-01 Ian Lance Taylor <iant@google.com>
10015
10016 * configure.ac: Check for byteswap.h.
10017 * configure: Rebuild.
10018 * config.in: Rebuild.
10019
10020 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10021
10022 * layout.cc (Layout::find_or_add_kept_section): New function.
10023 (Layout::add_comdat): Removed.
10024 * layout.h (struct Kept_section): Move out of class Layout.
10025 Remove trailing underscores from field names. Add group_sections
10026 field. Rename group_ field to is_group. Change all uses.
10027 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10028 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10029 comdat_groups_ field.
10030 (Sized_relobj::include_section_group): Use
10031 find_or_add_kept_section and Kept_section::group_sections.
10032 (Sized_relobj::include_linkonce_section): Likewise.
10033 * object.cc (class Sized_relobj): Don't define Comdat_group or
10034 Comdat_group_table. Remove find_comdat_group and
10035 add_comdat_group. Remove comdat_groups_ field.
10036 * plugin.cc (include_comdat_group): Use
10037 Layout::find_or_add_kept_section.
10038
10039 2009-02-28 Ian Lance Taylor <iant@google.com>
10040
10041 * README: --gc-sections and map files are now supported. Document
10042 some build requirements.
10043
10044 PR 6992
10045 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10046 relocatable link set the value of the section symbol to zero.
10047 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10048 relocatable link don't include the section address in the local
10049 symbol value.
10050
10051 2009-02-27 Ian Lance Taylor <iant@google.com>
10052
10053 PR 6811
10054 * options.h (class Search_directory): Add is_system_directory.
10055 (class General_options): Declare is_in_system_directory.
10056 * options.cc (get_relative_sysroot): Make static.
10057 (get_default_sysroot): Make static.
10058 (General_optoins::is_in_system_directory): New function.
10059 * fileread.cc (Input_file::is_in_system_directory): New function.
10060 * fileread.h (class Input_file): Declare is_in_system_directory.
10061 * object.h (class Object): Add is_in_system_directory.
10062 (class Input_objects): Remove system_library_directory_ field.
10063 * object.cc (Input_objects::add_object): Don't set
10064 system_library_directory_.
10065 (input_objects::found_in_system_library_directory): Remove.
10066 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10067 parameter. Change all callers.
10068 (Symbol_table::sized_write_globals): Likewise.
10069 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10070 Call Object::is_in_system_directory.
10071 * symtab.h (class Symbol_table): Update declarations.
10072
10073 PR 5990
10074 * descriptors.h (Open_descriptor): Add is_on_stack field.
10075 * descriptors.cc (Descriptors::open): If the descriptor is on the
10076 top of the stack, remove it. Initialize is_on_stack field.
10077 (Descriptors::release): Only add pod to stack if it is not on the
10078 stack already.
10079 (Descriptors::close_some_descriptor): Clear stack_next and
10080 is_on_stack fields.
10081
10082 PR 7091
10083 * output.cc (Output_section::find_starting_output_address): Rename
10084 from starting_output_address; add PADDR parameter; change return
10085 type.
10086 * output.h (class Output_section): Declare
10087 find_starting_output_address instead of starting_output_address.
10088 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10089 section symbol for which we can't find a merge section.
10090
10091 PR 9836
10092 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10093 hidden or internal, force the symbol to be local.
10094 * resolve.cc (Symbol::override_visibility): Define.
10095 (Symbol::override_base): Use override_visibility.
10096 (Symbol_table::resolve): Likewise.
10097 (Symbol::override_base_with_special): Likewise.
10098 (Symbol_table::override_with_special): If the visibility is hidden
10099 or internal, force the symbol to be local.
10100 * symtab.h (class Symbol): Add set_visibility and
10101 override_visibility.
10102 * testsuite/ver_test_1.sh: New file.
10103 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10104 (check_DATA): Add ver_test_1.syms.
10105 (ver_test_1.syms): New target.
10106 * testsuite/Makefile.in: Rebuild.
10107
10108 2009-02-25 Cary Coutant <ccoutant@google.com>
10109
10110 * layout.cc (Layout::choose_output_section): Don't rename sections
10111 when using a linker script that has a SECTIONS clause.
10112 * Makefile.in: Regenerate.
10113
10114 * testsuite/Makefile.am (script_test_5.sh): New test case.
10115 * testsuite/Makefile.in: Regenerate.
10116 * testsuite/script_test_5.cc: New file.
10117 * testsuite/script_test_5.sh: New file.
10118 * testsuite/script_test_5.t: New file.
10119
10120 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10121
10122 * archive.cc (Archive::include_member): Update calls to add_symbols.
10123 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10124 the Layout argument.
10125 * dynobj.h (do_add_symbols): Add the Layout argument.
10126 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10127 Layout argument.
10128 * object.h (Object::add_symbols): Add the Layout argument.
10129 (Object::do_add_symbols): Add the Layout argument.
10130 (Sized_relobj::do_add_symbols): Add the Layout argument.
10131 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10132 Unify the two versions.
10133 (Add_plugin_symbols): Remove.
10134 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10135 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10136 (Add_plugin_symbols): Remove.
10137 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10138 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10139 (Add_symbols::run): Make it work with Pulginobj.
10140
10141 2009-02-06 Ian Lance Taylor <iant@google.com>
10142
10143 * object.cc (Sized_relobj::do_layout): Make info message start
10144 with lower case letter.
10145
10146 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10147
10148 * binary.cc: Fix file comment.
10149
10150 * options.h (enum Incremental_disposition): Define.
10151 (class General_options): Add new options: --incremental,
10152 --incremental_changed, --incremental_unchanged,
10153 --incremental_unknown. Add incremental_disposition_ and
10154 implicit_incremental_ fields.
10155 (General_options::incremental_disposition): New function.
10156 (class Position_dependent_options): Add incremental_disposition
10157 option.
10158 (Position_dependent_options::copy_from_options): Set incremental
10159 dispositions.
10160 * options.cc (General_options::parse_incremental_changed): New
10161 function.
10162 (General_options::parse_incremental_unchanged): New function.
10163 (General_options::parse_incremental_unknown): New function.
10164 (General_options::General_options): Initialize new fields
10165 incremental_disposition_ and implicit_incremental_.
10166 (General_options::finalize): Check for uasge of --incremental-*
10167 without --incremental.
10168
10169 2009-02-06 Chris Demetriou <cgd@google.com>
10170
10171 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10172 pointer and to report location as the file name associated with
10173 the symbol.
10174 (gold_undefined_symbol_at_location): New function to replace the
10175 old gold_undefined_symbol functionality.
10176 * target-reloc.h (relocate_section): Update to use
10177 gold_undefined_symbol_at_location.
10178 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10179 Call gold_undefined_symbol function rather than gold_error.
10180 * errors.h (Errors::undefined_symbol): Take location as a
10181 string, rather than calculating it from a relocation.
10182 * errors.cc (Errors::fatal): Print "fatal error:" before the
10183 formatted message.
10184 (Errors::error, Errors::error_at_location): Print "error: "
10185 before the formatted message.
10186 (Errors::undefined_symbol): Take location as a string, rather
10187 than calculating it from a relocation.
10188 (gold_undefined_symbol_at_location): New function akin to
10189 old gold_undefined_symbol, calculates location from relocation.
10190 (gold_undefined_symbol): Change to take only a Symbol pointer
10191 and to report location as the file name associated with the symbol.
10192 * testsuite/debug_msg.sh: Update for changed error messages.
10193 * testsuite/undef_symbol.sh: Likewise.
10194
10195 2009-02-04 Duncan Sands <baldrick@free.fr>
10196
10197 PR 9812
10198 * reduced_debug_output.h
10199 (Output_reduced_debug_abbrev_section::failed): Use format for
10200 gold_warning.
10201 (Output_reduced_debug_info_section::faild): Likewise.
10202
10203 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10204
10205 * script.cc (Lazy_demangler): New class.
10206 (Version_script_info::get_symbol_version_helper): Demangle a
10207 symbol only once.
10208
10209 2009-01-29 Cary Coutant <ccoutant@google.com>
10210
10211 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10212 to __tls_get_addr.
10213 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10214
10215 2009-01-28 Ian Lance Taylor <iant@google.com>
10216
10217 * version.cc (version_string): Bump to 1.9.
10218
10219 * gold.h: Include <cstring> and <stdint.h>.
10220 * version.cc: Include <cstdio>.
10221 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10222 warning.
10223 * reduced_debug_output.cc (insert_into_vector): Rename from
10224 Insert_into_vector; change all callers. Use Swap_unaligned to
10225 avoid aliasing issue; remove union since it is unnecessary.
10226
10227 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10228
10229 * Makefile.am (CCFILES): Add gc.cc.
10230 (HFILES): Add gc.h.
10231 * Makefile.in: Regenerate.
10232 * gold.cc (Gc_runner): New class.
10233 (queue_initial_tasks): Call garbage collection related tasks
10234 when corresponding options are invoked.
10235 (queue_middle_gc_tasks): New function.
10236 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10237 processed early before laying out sections during garbage collection.
10238 * gold.h (queue_middle_gc_tasks): New function.
10239 (is_prefix_of): Move from "layout.cc".
10240 * i386.cc (Target_i386::gc_process_relocs): New function.
10241 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10242 * main.cc (main): Create object of class "Garbage_collection".
10243 * object.cc (Relobj::copy_symbols_data): New function.
10244 (Relobj::is_section_name_included): New function.
10245 (Sized_relobj::do_layout): Allow this function to be called twice
10246 during garbage collection and defer layout of section during the
10247 first call.
10248 * object.h (Relobj::get_symbols_data): New function.
10249 (Relobj::is_section_name_included): New function.
10250 (Relobj::copy_symbols_data): New function.
10251 (Relobj::set_symbols_data): New function.
10252 (Relobj::get_relocs_data): New function.
10253 (Relobj::set_relocs_data): New function.
10254 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10255 (Relobj::gc_process_relocs): New function.
10256 (Relobj::do_gc_process_relocs): New pure virtual function.
10257 (Relobj::sd_): New data member.
10258 (Sized_relobj::is_output_section_offset_invalid): New function.
10259 (Sized_relobj::do_gc_process_relocs): New function.
10260 * options.h (General_options::gc_sections): Modify to not be a no-op.
10261 (General_options::print_gc_sections): New option.
10262 * plugin.cc (Plugin_finish::run): Remove function call to
10263 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10264 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10265 * reloc.cc (Read_relocs::run): Add task to process relocs and
10266 determine unreferenced sections when doing garbage collection.
10267 (Gc_process_relocs): New class.
10268 (Sized_relobj::do_gc_process_relocs): New function.
10269 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10270 sections that are garbage collected.
10271 * reloc.h (Gc_process_relocs): New class.
10272 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10273 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10274 symbols whose corresponding sections are garbage collected.
10275 (Symbol_table::Symbol_table): Add new parameter for the garbage
10276 collection object.
10277 (Symbol_table::gc_mark_undef_symbols): New function.
10278 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10279 (Symbol_table::gc_mark_dyn_syms): New function.
10280 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10281 as garbage.
10282 (Symbol_table::add_from_object): Likewise.
10283 (Symbol_table::add_from_relobj): When building shared objects, do not
10284 treat externally visible symbols as garbage.
10285 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10286 table information for static and relocatable links.
10287 * symtab.h (Symbol_table::set_gc): New function.
10288 (Symbol_table::gc): New function.
10289 (Symbol_table::gc_mark_undef_symbols): New function.
10290 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10291 (Symbol_table::gc_mark_dyn_syms): New function.
10292 (Symbol_table::gc_): New data member.
10293 * target.h (Sized_target::gc_process_relocs): New pure virtual
10294 function.
10295 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10296 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10297
10298 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10299
10300 * options.h (General_options::gc_sections): Define as a no-op for now.
10301 (General_options::no_keep_memory): Ditto.
10302 (General_options::Bshareable): Define.
10303 * options.cc (General_options::finalize): Honor -Bshareable.
10304
10305 2009-01-20 Andreas Schwab <schwab@suse.de>
10306
10307 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10308 read the value in the contents, since we don't use it. Use the
10309 template endianness when writing.
10310 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10311
10312 2009-01-19 Andreas Schwab <schwab@suse.de>
10313
10314 * configure.tgt (powerpc64-*): Fix targ_obj.
10315
10316 2009-01-15 Ian Lance Taylor <iant@google.com>
10317
10318 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10319 local symbols when stripping all symbols.
10320
10321 2009-01-14 Cary Coutant <ccoutant@google.com>
10322
10323 * output.cc (Output_reloc): Add explicit instantiations.
10324
10325 2009-01-14 Cary Coutant <ccoutant@google.com>
10326
10327 * archive.cc (Archive::get_elf_object_for_member): Remove call
10328 to File_read::claim_for_plugin.
10329 * descriptors.cc (Descriptors::open): Remove reference to
10330 is_claimed.
10331 (Descriptors::claim_for_plugin): Remove.
10332 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10333 (Descriptors::is_claimed): Remove.
10334 (claim_descriptor_for_plugin): Remove.
10335 * fileread.cc (File_read::claim_for_plugin): Remove.
10336 * fileread.h (File_read::claim_for_plugin): Remove.
10337 (File_read::descriptor): Reopen descriptor if necessary.
10338 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10339 (Plugin_manager::all_symbols_read): Add task parameter. Change
10340 all callers.
10341 (Plugin_manager::get_input_file): New function.
10342 (Plugin_manager::release_input_file): New function.
10343 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10344 corresponding data member.
10345 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10346 and pass to base constructor. Change all callers.
10347 (get_input_file, release_input_file): New functions.
10348 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10349 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10350 (Plugin_manager::all_symbols_read): Add task parameter.
10351 (Plugin_manager::get_input_file): New function.
10352 (Plugin_manager::release_input_file): New function.
10353 (Plugin_manager::task_): New data member.
10354 (Pluginobj::Pluginobj): Add filesize parameter.
10355 (Pluginobj::filename): New function.
10356 (Pluginobj::descriptor): New function.
10357 (Pluginobj::filesize): New function.
10358 (Pluginobj::filesize_): New data member.
10359 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10360 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10361 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10362
10363 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10364 with archive libraries.
10365 * testsuite/Makefile.in: Regenerate.
10366 * testsuite/plugin_test.c (struct sym_info): New type.
10367 (get_input_file, release_input_file): New static variables.
10368 (onload): Capture new transfer vector entries.
10369 (claim_file_hook): Stop reading at end of file according to filesize.
10370 Factor out parsing of readelf output into separate function.
10371 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10372 APIs and get the source file name from the symbol table. Convert
10373 source file name to corresponding object file name. Print info
10374 message when adding new input files.
10375 (parse_readelf_line): New function.
10376 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10377 * testsuite/plugin_test_2.sh: Likewise.
10378 * testsuite/plugin_test_3.sh: Likewise.
10379 * testsuite/plugin_test_4.sh: New test case.
10380
10381 2009-01-07 Ian Lance Taylor <iant@google.com>
10382
10383 * version.cc (version_string): Bump to 1.8.
10384
10385 2008-12-23 Cary Coutant <ccoutant@google.com>
10386
10387 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10388 * plugin.cc (Plugin_manager::finish): Rename as
10389 layout_deferred_objects. Move cleanup to separate function.
10390 (Plugin_manager::cleanup): New function.
10391 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10392 separately.
10393 * plugin.h (Plugin_manager::finish): Rename as
10394 layout_deferred_objects.
10395 (Plugin_manager::cleanup): New function.
10396 (Plugin_manager::cleanup_done): New field.
10397
10398 2008-12-23 Cary Coutant <ccoutant@google.com>
10399
10400 * plugin.cc (is_visible_from_outside): New function.
10401 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10402 so we don't return "IR only" status for exported symbols or -r links.
10403
10404 * testsuite/Makefile.am (plugin_test_3): New test case.
10405 * testsuite/Makefile.in: Regenerate.
10406 * testsuite/plugin_test_3.sh: New file.
10407
10408 2008-12-22 Cary Coutant <ccoutant@google.com>
10409
10410 * object.cc (Sized_relobj::layout_section): New function.
10411 (Sized_relobj::do_layout): Defer layout of input sections until after
10412 plugin has provided replacement files.
10413 (Sized_relobj::do_layout_deferred_sections): New function.
10414 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10415 (Relobj::layout_deferred_sections): New function.
10416 (Relobj::do_layout_deferred_sections): New function.
10417 (Sized_relobj::do_layout_deferred_sections): New function.
10418 (Sized_relobj::layout_section): New function.
10419 (Sized_relobj::Deferred_layout): New structure.
10420 (Sized_relobj::deferred_layout_): New field.
10421 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10422 Change all callers. Layout deferred sections.
10423 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10424 references.
10425 (Plugin_hook::run): Move code from do_plugin_hook inline.
10426 (Plugin_hook::do_plugin_hook): Remove.
10427 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10428 (Plugin_manager::finish): Renamed, was cleanup.
10429 (Plugin_manager::should_defer_layout): New function.
10430 (Plugin_manager::add_deferred_layout_object): New function.
10431 (Plugin_manager::Deferred_layout_list): New type.
10432 (Plugin_manager::deferred_layout_objects_): New field.
10433 (Plugin_hook::do_plugin_hook): Remove.
10434
10435 2008-12-17 Ian Lance Taylor <iant@google.com>
10436
10437 * options.h (class General_options): Add --no case for
10438 --export-dynamic.
10439
10440 2008-12-16 Cary Coutant <ccoutant@google.com>
10441
10442 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10443 vector.
10444 (Plugin_manager::claim_file): Create plugin object even if
10445 plugin did not call the add_symbols callback.
10446 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10447 asking for more symbols than were added.
10448 * testsuite/Makefile.am (plugin_test_1): Add test case with
10449 no global symbols.
10450 (empty.syms): New target.
10451 * testsuite/Makefile.in: Regenerate.
10452 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10453 message. Don't call add_symbols if no globals.
10454 (all_symbols_read_hook): Don't provide replacement for empty
10455 claimed file.
10456
10457 2008-12-12 Ian Lance Taylor <iant@google.com>
10458
10459 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10460 r_type == 0 for a local symbol with r_sym == 0.
10461 (scan_relocatable_relocs): Pass r_sym to
10462 local_non_section_strategy.
10463 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10464 r_sym parameter.
10465
10466 * configure.ac: Update test for TLS descriptors: they are
10467 supported as of glibc 2.9.
10468 * configure: Rebuild.
10469
10470 2008-12-11 Ian Lance Taylor <iant@google.com>
10471
10472 PR 7091
10473 * target-reloc.h (Default_scan_relocatable_relocs): For each
10474 function, map r_type == 0 to RELOC_DISCARD.
10475
10476 2008-12-10 Cary Coutant <ccoutant@google.com>
10477
10478 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10479 object to override a kept COMDAT group from a plugin object.
10480
10481 2008-12-09 Ian Lance Taylor <iant@google.com>
10482
10483 PR 7088
10484 * yyscript.y (file_cmd): Handle INPUT.
10485
10486 * testsuite/initpri1.c: Change all declarations to be full
10487 prototypes by adding void, to avoid compiler warnings.
10488
10489 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
10490
10491 * options.cc (General_options::parse_plugin_opt): New.
10492 (General_options::add_plugin): The argument now is just the filename.
10493 (General_options::add_plugin_option): New.
10494 * options.h (plugin_opt): New.
10495 (add_plugin): Change argument name.
10496 (add_plugin_option): New.
10497 * plugin.cc (Plugin::load): Don't parse the plugin option.
10498 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10499 (Plugin::add_option): New.
10500 (Plugin::args_): Change type.
10501 (Plugin::filename_): New.
10502 (Plugin_manager::add_plugin_option): New.
10503 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10504 * testsuite/Makefile.in: Regenerate.
10505
10506 2008-12-05 Cary Coutant <ccoutant@google.com>
10507
10508 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10509 Handle --strip-lto-sections option.
10510 * options.h (strip_lto_sections): New option.
10511
10512 2008-12-01 Cary Coutant <ccoutant@google.com>
10513
10514 * plugin.cc (ld_plugin_message): Change format parameter to const.
10515 Fix mismatch between new[] and delete.
10516
10517 2008-11-14 Cary Coutant <ccoutant@google.com>
10518
10519 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10520 instead of -1U.
10521
10522 2008-11-05 Craig Silverstein <csilvers@google.com>
10523
10524 * options.cc (General_options::parse_dynamic_list): New function.
10525 * options.h (General_options): New flags dynamic_list,
10526 dynamic_list_data, dynamic_list_cpp_new, and
10527 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10528 (General_options::in_dynamic_list): New function.
10529 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10530 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10531 (Lex::can_continue_name): Likewise.
10532 (yylex): Likewise.
10533 (read_script_file): New parameter script_options.
10534 (read_dynamic_list): New function.
10535 (Script_options::define_dynamic_list): New function.
10536 (dynamic_list_keyword_parsecodes): New variable.
10537 (dynamic_list_keywords): New variable.
10538 * script.h (Script_options::define_dynamic_list): New function
10539 prototype.
10540 (read_dynamic_list): New function prototype.
10541 * symtab.cc (strprefix): New macro.
10542 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10543 dynamic_list_data, dynamic_list_cpp_new, and
10544 dynamic_list_cpp_typeinfo.
10545 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10546 (dynamic_list_expr): New rule.
10547 (dynamic_list_nodes): Likewise.
10548 (dynamic_list_node): Likewise.
10549 * testsuite/Makefile.am (dynamic_list): New test.
10550 * testsuite/Makefile.in: Regenerated.
10551 * testsuite/dynamic_list.t: New file.
10552 * testsuite/dynamic_list.sh: New file.
10553
10554 2008-11-05 Craig Silverstein <csilvers@google.com>
10555
10556 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10557 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10558 (t11_last): Likewise.
10559 * testsuite/ver_test_6.c (main): Likewise.
10560
10561 2008-10-07 Cary Coutant <ccoutant@google.com>
10562
10563 * options.c (General_options::finalize): Add check for -static and
10564 -shared.
10565 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10566 is not empty.
10567
10568 2008-10-02 Cary Coutant <ccoutant@google.com>
10569
10570 * plugin.cc (make_sized_plugin_object): Fix conditional
10571 compilation to work when not all targets are enabled.
10572
10573 2008-09-29 Cary Coutant <ccoutant@google.com>
10574
10575 * archive.cc (Archive::get_file_and_offset): Use filename instead
10576 of name to get library path.
10577 (Archive::include_member): Unlock external member of a thin archive.
10578
10579 * testsuite/Makefile.am (TEST_AR): New variable.
10580 (thin_archive_test_1): New test.
10581 (thin_archive_test_2): New test.
10582 * testsuite/Makefile.in: Regenerate.
10583 * testsuite/thin_archive_main.cc: New file.
10584 * testsuite/thin_archive_test_1.cc: New file.
10585 * testsuite/thin_archive_test_2.cc: New file.
10586 * testsuite/thin_archive_test_3.cc: New file.
10587 * testsuite/thin_archive_test_4.cc: New file.
10588
10589 2008-09-29 Cary Coutant <ccoutant@google.com>
10590
10591 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10592 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10593 instead of -1U.
10594 (Sized_relobj::do_finalize_local_symbols): Likewise.
10595 (Sized_relobj::map_to_kept_section): Likewise.
10596 * object.h (Sized_relobj::invalid_address): New constant.
10597 (Sized_relobj::do_output_section_offset): Check for invalid_address
10598 and return -1ULL.
10599 * output.cc (Output_reloc::local_section_offset): Use constant
10600 invalid_address instead of -1U.
10601 (Output_reloc::get_address): Likewise.
10602 (Output_section::output_address): Change -1U to -1ULL.
10603 * output.h (Output_reloc::invalid_address): New constant.
10604 * reloc.cc (Sized_relobj::write_sections): Use constant
10605 invalid_address instead of -1U.
10606 (Sized_relobj::relocate_sections): Likewise.
10607 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10608 values for merge sections.
10609 * target-reloc.h (relocate_for_relocatable): Use constant
10610 invalid_address instead of -1U.
10611
10612 2008-09-19 Cary Coutant <ccoutant@google.com>
10613
10614 Add plugin functionality for link-time optimization (LTO).
10615 * configure.ac (plugins): Add --enable-plugins option.
10616 * configure: Regenerate.
10617 * config.in: Regenerate.
10618 * Makefile.am (LIBDL): New variable.
10619 (CCFILES): Add plugin.cc.
10620 (HFILES): Add plugin.h.
10621 (ldadd_var): Add LIBDL.
10622 * Makefile.in: Regenerate.
10623
10624 * archive.cc: Include "plugin.h".
10625 (Archive::setup): Don't preread archive symbols when using a plugin.
10626 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10627 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10628 files.
10629 (Archive::include_member): Add symbols from plugin objects.
10630 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10631 * descriptors.cc (Descriptors::open): Check for file descriptors
10632 abandoned by plugins.
10633 (Descriptors::claim_for_plugin): New function.
10634 * descriptors.h (Descriptors::claim_for_plugin): New function.
10635 (Open_descriptor::is_claimed): New field.
10636 (claim_descriptor_for_plugin): New function.
10637 * fileread.cc (File_read::claim_for_plugin): New function.
10638 * fileread.h (File_read::claim_for_plugin): New function.
10639 (File_read::descriptor): New function.
10640 * gold.cc: Include "plugin.h".
10641 (queue_initial_tasks): Add task to call plugin hooks for generating
10642 new object files.
10643 * main.cc: Include "plugin.h".
10644 (main): Load plugin libraries.
10645 * object.h (Pluginobj): Declare.
10646 (Object::pluginobj): New function.
10647 (Object::do_pluginobj): New function.
10648 (Object::set_target): New function.
10649 * options.cc: Include "plugin.h".
10650 (General_options::parse_plugin): New function.
10651 (General_options::General_options): Initialize plugins_ field.
10652 (General_options::add_plugin): New function.
10653 * options.h (Plugin_manager): Declare.
10654 (General_options): Add --plugin option.
10655 (General_options::has_plugins): New function.
10656 (General_options::plugins): New function.
10657 (General_options::add_plugin): New function.
10658 (General_options::plugins_): New field.
10659 * plugin.cc: New file.
10660 * plugin.h: New file.
10661 * readsyms.cc: Include "plugin.h".
10662 (Read_symbols::do_read_symbols): Check for archive before checking
10663 for ELF file. Call plugin hooks to claim files.
10664 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10665 from a real object file; force override when processing replacement
10666 files.
10667 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10668 (Symbol::init_base_object): Likewise.
10669 (Symbol::init_base_output_data): Likewise.
10670 (Symbol::init_base_output_segment): Likewise.
10671 (Symbol::init_base_constant): Likewise.
10672 (Symbol::init_base_undefined): Likewise.
10673 (Symbol::output_section): Assert that object is not a plugin.
10674 (Symbol_table::add_from_pluginobj): New function.
10675 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10676 undefined.
10677 (Symbol_table::sized_write_globals): Likewise.
10678 (Symbol_table::add_from_pluginobj): Instantiate template.
10679 * symtab.h (Sized_pluginobj): Declare.
10680 (Symbol::in_real_elf): New function.
10681 (Symbol::set_in_real_elf): New function.
10682 (Symbol::in_real_elf_): New field.
10683 (Symbol_table::add_from_pluginobj): New function.
10684
10685 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10686 (LIBDL): New variable.
10687 (LDADD): Add LIBDL.
10688 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10689 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10690 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10691 (MOSTLYCLEANFILES): Likewise.
10692 * testsuite/Makefile.in: Regenerate.
10693 * testsuite/plugin_test.c: New file.
10694 * testsuite/plugin_test_1.sh: New file.
10695 * testsuite/plugin_test_2.sh: New file.
10696
10697 2008-09-16 Ian Lance Taylor <iant@google.com>
10698
10699 * target-reloc.h (relocate_section): Check whether a symbol is
10700 defined by the ABI before reporting an undefined symbol error.
10701 * target.h (Target::is_defined_by_abi): Make parameter const.
10702 (Target::do_is_defined_by_abi): Likewise.
10703 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10704 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10705 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10706 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10707 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10708 * testsuite/Makefile.in: Rebuild.
10709
10710 * fileread.cc (make_view): Add casts to avoid warning.
10711
10712 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10713
10714 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10715 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10716
10717 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10718
10719 * options.h (General_options::output_is_executable): New.
10720 (General_options::output_is_pie): New.
10721 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10722 for shared libraries.
10723 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10724
10725 2008-09-11 Chris Demetriou <cgd@google.com>
10726
10727 * options.h (origin): New -z option.
10728 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10729 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10730 in DT_FLAGS_1.
10731
10732 2008-09-05 Cary Coutant <ccoutant@google.com>
10733
10734 * fileread.cc (File_read::make_view): Add check for attempt to map
10735 beyond end of file.
10736
10737 2008-09-05 Cary Coutant <ccoutant@google.com>
10738
10739 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10740 explicit instantiations.
10741
10742 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10743
10744 PR gold/6858
10745 * options.cc (General_options::finalize): Allow undefined symbols
10746 in shlibs if linking -shared.
10747
10748 PR gold/6859
10749 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10750 symbols as not needing a dynsym entry.
10751
10752 2008-08-20 Craig Silverstein <csilvers@google.com>
10753
10754 * fileread.cc (File_read::open): Do not lock the file unless it
10755 was successfully opened.
10756
10757 2008-08-14 Cary Coutant <ccoutant@google.com>
10758
10759 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10760 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10761 * testsuite/tls_test.cc (struct int128): 128-bit struct
10762 for testing TLS relocs with non-zero addend.
10763 (v12): New TLS variable.
10764 (t12): New test.
10765 (t_last): Add check for v12.
10766 * testsuite/tls_test.h (t12): New function.
10767 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10768
10769 2008-08-13 Ian Lance Taylor <iant@google.com>
10770
10771 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10772 set tls_segment_ or relro_segment_.
10773 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10774 when appropriate.
10775 * output.h (Output_section::clear_is_relro): New function.
10776 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10777 sections specially even when output_data_ is empty.
10778 (Output_segment::maximum_alignment): When first section is relro,
10779 only force alignment for PT_LOAD segments.
10780 * script.cc (script_data_segment_align): New function.
10781 (script_data_segment_relro_end): New function.
10782 * script-c.h (script_data_segment_align): Declare.
10783 (script_data_segment_relro_end): Declare.
10784 * script-sections.h (class Script_sections): Declare
10785 data_segment_align and data_segment_relro_end. Add fields
10786 segment_align_index_ and saw_relro_end_.
10787 * script-sections.cc (class Sections_element): Add set_is_relro
10788 virtual function. Add new bool* parameter to place_orphan_here.
10789 Add get_output_section virtual function.
10790 (class Output_section_definition): Add set_is_relro. Add new
10791 bool* parameter to place_orphan_here. Add get_output_section.
10792 Add is_relro_ field.
10793 (Output_section_definition::Output_section_definition): Initialize
10794 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10795 and is_relro_ fields.
10796 (Output_section_definition::place_orphan_here): Add is_relro
10797 parameter.
10798 (Output_section_definition::set_section_addresses): Set relro for
10799 output section.
10800 (Output_section_definition::alternate_constraint): Likewise.
10801 (class Orphan_output_section): Add new bool* parameter to
10802 place_orphan_here. Add get_output_section.
10803 (Orphan_output_section::place_orphan_here): Add is_relro
10804 parameter.
10805 (Script_sections::Script_sections): Initialize
10806 data_segment_align_index_ and saw_relro_end_.
10807 (Script_sections::data_segment_align): New function.
10808 (Script_sections::data_segment_relro_end): New function.
10809 (Script_sections::place_orphan): Set or clear is_relro.
10810 (Script_sections::set_section_addresses): Force alignment of first
10811 TLS section.
10812 * yyscript.y (exp): Call script_data_segment_align and
10813 script_data_segment_relro_end.
10814 * testsuite/relro_script_test.t: New file.
10815 * testsuite/relro_test.cc (using_script): Declare.
10816 (t1, t2): Test using_script.
10817 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10818 (relro_script_test_SOURCES): Define.
10819 (relro_script_test_DEPENDENCIES): Define.
10820 (relro_script_test_LDFLAGS): Define.
10821 (relro_script_test_LDADD): Define.
10822 (relro_script_test.so): New target.
10823 * testsuite/Makefile.in: Rebuild.
10824
10825 2008-08-06 Cary Coutant <ccoutant@google.com>
10826
10827 * archive.cc (Archive::total_archives, Archive::total_members)
10828 (Archive::total_members_loaded): New variables.
10829 (Archive::setup): Add parameter. Add option to preread
10830 archive symbols.
10831 (Archive::read_armap): Add counter.
10832 (Archive::get_file_and_offset): New function.
10833 (Archive::get_elf_object_for_member): New function.
10834 (Archive::read_all_symbols): New function.
10835 (Archive::read_symbols): New function.
10836 (Archive::add_symbols): Add counters.
10837 (Archive::include_all_members): Use armap to find members if it's
10838 already built.
10839 (Archive::include_member): Skip reading symbols if already read.
10840 Factored code into Archive::get_file_and_offset and
10841 Archive::get_elf_object_for_member. Changed call to
10842 Mapfile::report_include_archive_member.
10843 (Archive::print_stats): New function.
10844 * archive.h: Declare Object and Read_symbols_data classes.
10845 (Archive::Archive): Add initializers for new members.
10846 (Archive::setup): Add parameter.
10847 (Archive::print_stats): New function.
10848 (Archive::total_archives, Archive::total_members)
10849 (Archive::total_members_loaded): New variables.
10850 (Archive::get_file_and_offset): New function.
10851 (Archive::get_elf_object_for_member): New function.
10852 (Archive::read_all_symbols): New function.
10853 (Archive::read_symbols): New function.
10854 (Archive::Archive_member): New class.
10855 (Archive::members_): New member.
10856 (Archive::num_members_): New member.
10857 * main.cc: Include archive.h.
10858 (main): Call Archive::print_stats.
10859 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10860 archive parameter; member_name is now the fully-decorated name.
10861 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10862 * options.h: (General_options): Add --preread-archive-symbols option.
10863 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10864 Archive::setup.
10865
10866 2008-08-04 Ian Lance Taylor <iant@google.com>
10867
10868 * symtab.h (Symbol::use_plt_offset): New function.
10869 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10870 * powerpc.cc (Relocate::relocate): Likewise.
10871 * sparc.cc (Relocate::relocate): Likewise.
10872 * x86_64.cc (Relocate::relocate): Likewise.
10873 * testsuite/weak_plt.sh: New test.
10874 * testsuite/weak_plt_main.cc: New test.
10875 * testsuite/weak_plt_shared.cc: New test.
10876 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10877 (check_PROGRAMS): Add weak_plt.
10878 (check_DATA): Add weak_plt_shared.so.
10879 (weak_plt_main_pic.o, weak_plt): New targets.
10880 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10881 * testsuite/Makefile.in: Rebuild.
10882
10883 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10884 gcctestdir/ld.
10885 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10886 * testsuite/Makefile.in: Rebuild.
10887
10888 2008-08-04 Alan Modra <amodra@bigpond.net.au>
10889
10890 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10891 * Makefile.in: Regenerate.
10892 * po/POTFILES.in: Regenerate.
10893
10894 2008-07-29 Ian Lance Taylor <iant@google.com>
10895
10896 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10897 symbols before other symbols.
10898 * testsuite/script_test_2.cc (test_addr): Declare.
10899 (test_addr_alias): Declare.
10900 (main): Check that test_addr and test_addr_alias have the right
10901 values.
10902 * testsuite/script_test_2.t: Define test_addr_alias and
10903 test_addr.
10904
10905 2008-07-24 Ian Lance Taylor <iant@google.com>
10906
10907 PR 5990
10908 * descriptors.cc: New file.
10909 * descriptors.h: New file.
10910 * gold-threads.h (class Hold_optional_lock): New class.
10911 * fileread.cc: Include "descriptors.h".
10912 (File_read::~File_read): Release descriptor rather than closing
10913 it.
10914 (File_read::open) [file]: Call open_descriptor rather than open.
10915 Set is_descriptor_opened_.
10916 (File_read::open) [memory]: Assert that descriptor is not open.
10917 (File_read::reopen_descriptor): New function.
10918 (File_read::release): Release descriptor.
10919 (File_read::do_read): Make non-const. Reopen descriptor.
10920 (File_read::read): Make non-const.
10921 (File_read::make_view): Reopen descriptor.
10922 (File_read::do_readv): Likewise.
10923 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10924 Update declarations.
10925 * layout.cc: Include "descriptors.h".
10926 (Layout::create_build_id): Use open_descriptor rather than open.
10927 * output.cc: Include "descriptors.h".
10928 (Output_file::open): Use open_descriptor rather than open.
10929 * archive.cc (Archive::const_iterator): Change Archive to be
10930 non-const.
10931 (Archive::begin, Archive::end): Make non-const.
10932 (Archive::count_members): Likewise.
10933 * archive.h (class Archive): Update declarations.
10934 * object.h (Object::read): Make non-const.
10935 * Makefile.am (CCFILES): Add descriptors.cc.
10936 (HFILES): Add descriptors.h.
10937 * Makefile.in: Rebuild.
10938
10939 PR 6716
10940 * gold.h: Always include <clocale>. Add Solaris workarounds
10941 following code in binutils/sysdep.h.
10942
10943 PR 6048
10944 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10945 this->eh_frame_hdr_ is NULL before using it.
10946
10947 * dynobj.cc (Versions::Versions): Update comment.
10948
10949 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10950 the base version name.
10951
10952 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10953 array size plus one.
10954 (Stringpool_template::set_string_offsets): Subtract one from key
10955 before using it as an array index.
10956 (Stringpool_template::get_offset_with_length): Likewise.
10957 (Stringpool_template::write_to_buffer): Likewise.
10958 * stringpool.h (Stringpool_template::get_offset_from_key):
10959 Likewise.
10960
10961 2008-07-23 Ian Lance Taylor <iant@google.com>
10962
10963 PR 6658
10964 * object.h (Merged_symbol_value::value): Do our best to handle a
10965 negative addend.
10966
10967 PR 6647
10968 * script.cc (Version_script_info::get_versions): Don't add empty
10969 version tag to return value.
10970 (Version_script_info::get_symbol_version_helper): Change return
10971 type to bool. Add pversion parameter. Change all callers.
10972 (script_register_vers_node): Don't require a non-NULL tag.
10973 * script.h (class Version_script_info): Update declarations.
10974 (Version_script_info::get_symbol_version): Change return type to
10975 bool. Add version parameter. Change all callers.
10976 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10977 handling. Handle an empty version from a version script.
10978 (Symbol_table::define_special_symbol): Likewise.
10979 * testsuite/ver_test_10.script: New file.
10980 * testsuite/ver_test_10.sh: New file.
10981 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10982 (check_DATA): Add ver_test_10.syms.
10983 (ver_test_10.syms, ver_test_10.so): New target.
10984 * testsuite/Makefile.in: Rebuild.
10985
10986 2008-07-23 Simon Baldwin <simonb@google.com>
10987
10988 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10989 to zero for undefined symbols from dynamic libraries.
10990
10991 2008-07-23 Ian Lance Taylor <iant@google.com>
10992
10993 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10994 Change all callers.
10995 * symtab.h (class Symbol_table): Update declaration.
10996 * testsuite/ver_test_9.cc: New file.
10997 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10998 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10999 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11000 (ver_test_9.so, ver_test_9.o): New targets.
11001 * testsuite/Makefile.in: Rebuild.
11002
11003 2008-07-22 Ian Lance Taylor <iant@google.com>
11004
11005 * options.h (class General_options): Define --check-sections.
11006 * layout.cc (Layout::set_segment_offsets): Handle
11007 --check-sections.
11008
11009 * options.h (class General_options): Define -n/--nmagic and
11010 -N/--omagic.
11011 * options.cc (General_options::finalize): For -n/--nmagic or
11012 -N/--omagic, set -static.
11013 * layout.cc (Layout::attach_allocated_section_to_segment): If
11014 -N/--omagic, don't put read-only and read-write sections in
11015 different segments.
11016 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11017 finding a read-only segment.
11018 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11019 don't set the minimum segment alignment to the common page size,
11020 and don't set the file offset to the address modulo the page size.
11021 * script-sections.cc (Script_sections::create_segments): If
11022 -n/--omagic, don't put read-only and read-write sections in
11023 different segments.
11024
11025 * cref.cc: New file.
11026 * cref.h: New file.
11027 * options.h (class General_options): Add --print-symbol-counts.
11028 * main.cc (main): Issue defined symbol report if requested.
11029 * archive.cc (Archive::interpret_header): Make into a const member
11030 function.
11031 (Archive::add_symbols): Call Input_objects::archive_start and
11032 archive_stop.
11033 (Archive::const_iterator): Define new class.
11034 (Archive::begin, Archive::end): New functions.
11035 (Archive::include_all_members): Rewrite to use iterator.
11036 (Archive::count_members): New function.
11037 * archive.h (class Archive): Update declarations.
11038 (Archive::filename): New function.
11039 * object.cc: Include "cref.h".
11040 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11041 (Sized_relobj::do_get_global_symbol_counts): New function.
11042 (Input_objects::add_object): Add object to cross-referencer.
11043 (Input_objects::archive_start): New function.
11044 (Input_objects::archive_stop): New function.
11045 (Input_objects::print_symbol_counts): New function.
11046 * object.h: Declare Cref and Archive.
11047 (Object::get_global_symbol_counts): New function.
11048 (Object::do_get_global_symbol_counts): New pure virtual function.
11049 (class Sized_relobj): Add defined_count_ field. Update
11050 declarations.
11051 (class Input_objects): Add cref_ field. Update constructor.
11052 Update declarations.
11053 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11054 defined_count_.
11055 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11056 symbol counts.
11057 (Sized_dynobj::do_get_global_symbol_counts): New function.
11058 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11059 defined_count_. Update declarations. Define Symbols typedef.
11060 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11061 parameter. Change all callers.
11062 (Symbol_table::add_from_dynobj): Add sympointers and defined
11063 parameters. Change all callers.
11064 * symtab.h (class Symbol_table): Update declarations.
11065 * Makefile.am (CCFILES): Add cref.cc.
11066 (HFILES): Add cref.h.
11067 * Makefile.in: Rebuild.
11068
11069 2008-07-22 Simon Baldwin <simonb@google.com>
11070
11071 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11072 to zero when writing undefined symbols.
11073
11074 2008-07-22 Ian Lance Taylor <iant@google.com>
11075
11076 * output.cc (Output_section::add_input_section): Don't try to
11077 merge empty merge sections.
11078
11079 2008-07-21 Craig Silverstein <csilvers@google.com>
11080
11081 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11082 Include symbol version in error message.
11083
11084 2008-07-20 Chris Demetriou <cgd@google.com>
11085
11086 * configure.ac (gold_cv_c_random_seed): New configured variable.
11087 (RANDOM_SEED_CFLAGS): New substituted variable.
11088 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11089 * configure: Rebuild.
11090 * Makefile.in: Likewise.
11091 * testsuite/Makefile.in: Likewise.
11092
11093 2008-07-18 Ian Lance Taylor <iant@google.com>
11094
11095 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11096 where we see NAME/NULL and NAME/VERSION as separate symbols.
11097 * testsuite/ver_test_main.cc (main): Call t4.
11098 (t4, t4_2a): Define.
11099 * testsuite/ver_test_2.cc (t4_2): Define.
11100 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11101 * testsuite/ver_test_4.cc (t4_2a): Define.
11102 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11103 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11104
11105 2008-07-17 Ian Lance Taylor <iant@google.com>
11106
11107 * dynobj.cc (Versions::add_def): If we give an error about a
11108 missing version, go ahead and create the version anyhow.
11109
11110 2008-07-10 Ian Lance Taylor <iant@google.com>
11111
11112 Handle output sections with more than 0x7fffffff bytes.
11113 * object.h (class Relobj): Change map_to_output_ to
11114 output_sections_, and just keep a section pointer. Change all
11115 uses. Move comdat group support to Sized_relobj.
11116 (Relobj::is_section_specially_mapped): Remove.
11117 (Relobj::output_section): Remove poff parameter. Change all
11118 callers.
11119 (Relobj::output_section_offset): New function.
11120 (Relobj::set_section_offset): Rewrite.
11121 (Relobj::map_to_output): Remove.
11122 (Relobj::output_sections): New function.
11123 (Relobj::do_output_section_offset): New pure virtual function.
11124 (Relobj::do_set_section_offset): Likewise.
11125 (class Sized_relobj): Add section_offsets_ field. Add comdat
11126 group support from Relobj. Update declarations.
11127 (Sized_relobj::get_output_section_offset): New function.
11128 (Sized_relobj::do_output_section_offset): New function.
11129 (Sized_relobj::do_set_section_offset): New function.
11130 * object.cc (Relobj::output_section_address): Remove.
11131 (Sized_relobj::Sized_relobj): Initialize new fields.
11132 (Sized_relobj::include_section_group): Cast find_kept_object to
11133 Sized_relobj.
11134 (Sized_relobj::include_linkonce_section): Likewise.
11135 (Sized_relobj::do_layout): Use separate arrays for output section
11136 and output offset.
11137 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11138 output_sections.
11139 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11140 output_sections and section_offsets.
11141 (Sized_relobj::write_local_symbols): Likewise.
11142 (map_to_kept_section): Compute output address directly.
11143 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11144 output_sections and section_offsets.
11145 (Sized_relobj::write_sections): Likewise.
11146 (Sized_relobj::relocate_sections): Likewise.
11147 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11148 * output.h (class Output_reloc): Update declarations. Change
11149 u2_.relobj to Sized_relobj*.
11150 (class Output_data_reloc): Change add functions to use
11151 Sized_relobj*.
11152 * output.cc (Output_reloc::Output_reloc): Change relobj to
11153 Sized_relobj*.
11154 (Output_reloc::local_section_offset): Change return type to
11155 Elf_Addr. Use get_output_section_offset.
11156 (Output_reloc::get_address): Likewise.
11157 (Output_section::is_input_address_mapped): Don't call
11158 is_section_specially_mapped.
11159 (Output_section::output_offset): Likewise.
11160 (Output_section::output_address): Likewise.
11161 (Output_section::starting_output_address): Likewise.
11162 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11163 parameter to Sized_relobj*.
11164 (Copy_relocs::need_copy_reloc): Likewise.
11165 (Copy_relocs::save): Likewise.
11166 * copy-relocs.h (class Copy_relocs): Update declarations.
11167 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11168 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11169 * target-reloc.h (relocate_for_relocatable): Change
11170 offset_in_output_section type to Elf_Addr. Change code that uses
11171 it as well.
11172 * layout.cc (Layout::layout): Always set *off.
11173 * mapfile.cc (Mapfile::print_input_section): Use
11174 output_section_offset.
11175 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11176 Sized_relobj*.
11177 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11178 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11179 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11180
11181 2008-07-03 Ian Lance Taylor <iant@google.com>
11182
11183 * layout.cc (Layout::include_section): Do not discard unrecognized
11184 SHT_STRTAB sections.
11185
11186 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11187
11188 * script.cc (Lex::can_continue_name): Make '?' allowable in
11189 version-script names.
11190 * testsuite/version_script.map: Change glob pattern to use '?'
11191
11192 2008-06-30 Manish Singh <yosh@gimp.org>
11193
11194 PR 6585
11195 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11196 Correct typo.
11197
11198 2008-06-30 Ian Lance Taylor <iant@google.com>
11199
11200 PR 6660
11201 PR 6682
11202 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11203 versions]: Don't try to read the value in the contents, since we
11204 don't use it. Use the template endianness when writing.
11205
11206 2008-06-25 Cary Coutant <ccoutant@google.com>
11207
11208 * fileread.cc (File_read::make_view): Assert on zero-length view.
11209 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11210 symbol table when there are no symbols to read.
11211
11212 2008-06-23 Craig Silverstein <csilvers@google.com>
11213
11214 * version.cc (version_string): Bump to 1.7
11215
11216 2008-06-18 Craig Silverstein <csilvers@google.com>
11217
11218 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11219 constant 0xFFFF to type Valtype.
11220 (Powerpc_relocate_functions::rel16_ha): Likewise.
11221
11222 2008-06-17 Ian Lance Taylor <iant@google.com>
11223
11224 * output.h (Output_section::Input_section): Initialize p2align_ to
11225 zero for Output_section_data constructors.
11226 (Output_section::Input_section::addralign): If not an input
11227 section, return the alignment of the Output_section_data.
11228 * testsuite/copy_test.cc: New file.
11229 * testsuite/copy_test_1.cc: New file.
11230 * testsuite/copy_test_2.cc: New file.
11231 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11232 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11233 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11234 (copy_test_1_pic.o, copy_test_1.so): New targets.
11235 (copy_test_2_pic.o, copy_test_2.so): New targets.
11236 * testsuite/Makefile.in: Rebuild.
11237
11238 * script-sections.cc (Script_sections::place_orphan): Initialize
11239 local variable exact.
11240
11241 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11242
11243 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11244
11245 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11246 David S. Miller <davem@davemloft.net>
11247
11248 * powerpc.cc: New file.
11249 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11250 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11251 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11252 * Makefile.in: Rebuild.
11253
11254 2008-06-09 Ian Lance Taylor <iant@google.com>
11255
11256 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11257 <exception>.
11258 (throwing, orig_terminate): New static variables.
11259 (terminate_handler): New static function.
11260 (t2): Set terminate handler.
11261
11262 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11263
11264 PR 6584
11265 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11266 alignment.
11267
11268 2008-05-30 Cary Coutant <ccoutant@google.com>
11269
11270 * archive.cc (Archive::include_all_members) Correct to step
11271 over symbol table and extended name table in thin archives.
11272
11273 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11274
11275 PR 6407
11276 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11277 calculation.
11278
11279 2008-05-28 Caleb Howe <cshowe@google.com>
11280
11281 * reduced_debug_output.cc: New file.
11282 * reduced_debug_output.h: New file.
11283 * options.h (class General_options): Add --strip-debug-non-line.
11284 * options.cc (General_options::finalize): Add strip_debug_non_line
11285 to the strip heirarchy.
11286 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11287 fields.
11288 * layout.cc: Include "reduced_debug_output.h".
11289 (Layout::Layout): Initialize new fields.
11290 (line_only_debug_sections): New static array.
11291 (is_lines_only_debug_sections): New static inline function.
11292 (Layout::include_section): Handle --strip-debug-non-line.
11293 (Layout::make_output_section): If --strip-debug-non-line, build
11294 new output sections for .debug_abbrev and .debug_info.
11295 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11296 gold. Warn about possible overflow.
11297 (read_signed_LEB_128): Likewise.
11298 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11299 (read_signed_LEB_128): Declare.
11300 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11301 (HFILES): Add reduced_debug_output.h.
11302 * Makefile.in: Rebuild.
11303
11304 2008-05-21 Ian Lance Taylor <iant@google.com>
11305
11306 * mapfile.cc: New file.
11307 * mapfile.h: New file.
11308 * options.h (class General_options): Add -M/--print-map and -Map.
11309 * options.cc (General_options::finalize): Make -M equivalent to
11310 -Map -.
11311 * main.cc: Include <cstdio> and "mapfile.h".
11312 (main): Open mapfile if requested.
11313 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11314 constructor. Change caller.
11315 (queue_initial_tasks): Add mapfile parameter. Change caller.
11316 (queue_middle_tasks): Likewise.
11317 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11318 declarations.
11319 * archive.cc: Include "mapfile.h".
11320 (Archive::add_symbols): Add mapfile parameter. Change all
11321 callers. Pass mapfile, symbol, and reason to include_member.
11322 (Archive::include_all_members): Add mapfile parameter. Change all
11323 callers.
11324 (Archive::include_member): Add mapfile, sym, and why parameters.
11325 Change all callers. Report inclusion to map file.
11326 * archive.h: Include "fileread.h".
11327 (class Archive): Update declarations.
11328 (Archive::file): New const method.
11329 (class Add_archive_symbols): Add mapfile_ field. Update
11330 constructor. Change all callers.
11331 * readsyms.h (class Read_symbols): Likewise.
11332 (class Finish_group): Likewise.
11333 (class Read_script): Likewise.
11334 * common.cc: Include "mapfile.h".
11335 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11336 all callers.
11337 (Symbol_table::do_allocate_commons): Likewise.
11338 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11339 symbol allocation to mapfile.
11340 * common.h (class Allocate_commons_task): Add mapfile_ field.
11341 Update constructor. Change all callers.
11342 * symtab.h (class Symbol_table): Update declarations.
11343 * layout.cc: Include "mapfile.h".
11344 (Layout_task_runner::run): Print information to mapfile.
11345 (Layout::create_gold_note): Change Output_data_fixed_space to
11346 Output_data_zero_fill.
11347 (Layout::create_build_id): Likewise.
11348 (Layout::print_to_mapfile): New function.
11349 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11350 constructor. Change caller.
11351 (class Layout): Declare print_to_mapfile.
11352 * output.cc (Output_section::Input_section::print_to_mapfile): New
11353 function.
11354 (Output_section::add_input_section): If producing a map, always
11355 add to input_sections_ list.
11356 (Output_section::do_print_to_mapfile): New function.
11357 (Output_segment::print_sections_to_mapfile): New function.
11358 (Output_segment::print_section_list_to_mapfile): New function.
11359 * output.h: Include "mapfile.h".
11360 (Output_data::print_to_mapfile): New function.
11361 (Output_data::do_print_to_mapfile): New virtual function.
11362 (Output_segment_headers::do_print_to_mapfile): New function.
11363 (Output_file_header::do_print_to_mapfile): New function.
11364 (Output_data_const::do_print_to_mapfile): New function.
11365 (class Output_data_const_buffer): Add map_name_ field. Update
11366 constructor. Change all callers. Add do_print_to_mapfile
11367 function.
11368 (class Output_data_fixed_space): Likewise.
11369 (class Output_data_space): Likewise.
11370 (class Output_data_zero_fill): New class.
11371 (Output_data_strtab::do_print_to_mapfile): New function.
11372 (Output_data_reloc_base::do_print_to_mapfile): New function.
11373 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11374 (Output_data_group::do_print_to_mapfile): New function.
11375 (Output_data_got::do_print_to_mapfile): New function.
11376 (Output_data_dynamic::do_print_to_mapfile): New function.
11377 (Output_symtab_xindex::do_print_to_mapfile): New function.
11378 (class Output_section): Declare do_print_to_mapflie. Declare
11379 print_to_mapfile in Input_section.
11380 (class Output_segment): Declare new functions.
11381 * object.h (Sized_relobj::symbol_count): New function.
11382 * script-sections.cc
11383 (Output_section_element_dot_assignment::set_section_addresses):
11384 Change Output_data_fixed_space to Output_data_zero_fill.
11385 (Output_data_expression::do_print_to_mapfile): New function.
11386 * script.cc (read_input_script): Add mapfile parameter. Change
11387 all callers.
11388 * script.h (read_input_script): Update declaration.
11389 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11390 (Eh_frame::do_print_to_mapfile): New function.
11391 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11392 (Output_merge_string::do_print_to_mapfile): New function.
11393 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11394 function.
11395 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11396 function.
11397 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11398 function.
11399 * Makefile.am (CCFILES): Add mapfile.cc.
11400 (HFILES): Add mapfile.h.
11401 * Makefile.in: Rebuild.
11402
11403 2008-05-19 Ian Lance Taylor <iant@google.com>
11404
11405 * options.h (class General_options): Add -z relro.
11406 * layout.cc (Layout::Layout): Initialize relro_segment_.
11407 (Layout::add_output_section_data): Return the output section.
11408 (Layout::make_output_section): Rcognize relro sections and mark
11409 them appropriately.
11410 (Layout::attach_allocated_section_to_segment): Put relro sections
11411 in a PT_GNU_RELRO segment.
11412 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11413 section as relro.
11414 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11415 PT_TLS segments.
11416 (Layout::linkonce_mapping): Map d.rel.ro.local to
11417 .data.rel.ro.local.
11418 (Layout::output_section_name): Us .data.rel.ro.local for any
11419 section which begins with that.
11420 * layout.h (class Layout): Update add_output_section_data
11421 declaration. Add relro_segment_ field.
11422 * output.cc (Output_section::Output_section): Initialize is_relro_
11423 and is_relro_local_ fields.
11424 (Output_segment::add_output_section): Group relro sections.
11425 (Output_segment::is_first_section_relro): New function.
11426 (Output_segment::maximum_alignment): If there is a relro section,
11427 align the segment to the common page size.
11428 (Output_segment::set_section_addresses): Track whether we are
11429 looking at relro sections. If the last section is a relro
11430 section, align to the common page size.
11431 (Output_segment::set_section_list_addresses): Add in_relro
11432 parameter. Change all callers. Align to the page size when
11433 moving from relro to non-relro section.
11434 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11435 segment.
11436 * output.h (class Output_section): Add is_relro_ and
11437 is_relro_local_ fields.
11438 (Output_section::is_relro): New function.
11439 (Output_section::set_is_relro): New function.
11440 (Output_section::is_relro_local): New function.
11441 (Output_section::set_is_relro_local): New function.
11442 (class Output_segment): Update declarations.
11443 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11444 * sparc.cc (Target_sparc::got_section): Likewise.
11445 * x86_64.cc (Target_x86_64::got_section): Likewise.
11446 * testsuite/relro_test_main.cc: New file.
11447 * testsuite/relro_test.cc: New file.
11448 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11449 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11450 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11451 (relro_test.so, relro_test_pic.o): New targets.
11452 * testsuite/Makefile.in: Rebuild.
11453
11454 2008-05-16 Ian Lance Taylor <iant@google.com>
11455
11456 * output.cc (Output_segment::add_output_section): Remove front
11457 parameter.
11458 * output.h (class Output_segment): Remove
11459 add_initial_output_section and overloaded add_output_section.
11460 Update declaration of remaining add_output_section.
11461 * layout.cc (Layout::create_interp): Call add_output_section
11462 rather than add_initial_output_section.
11463 (Layout::finish_dynamic_section): Likewise.
11464
11465 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11466 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11467 know the dynamic type.
11468 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11469 field. Initialize it in constructor.
11470 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11471 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11472 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11473 reloc.
11474
11475 * output.cc (Output_reloc::get_address): Change return type to
11476 Elf_Addr.
11477 * output.h (class Output_reloc): Update get_address declaration.
11478 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11479 for section addresses.
11480
11481 2008-05-09 Ian Lance Taylor <iant@google.com>
11482
11483 PR 6493
11484 * gold.cc (gold_nomem): Use return value of write.
11485
11486 2008-05-08 Ian Lance Taylor <iant@google.com>
11487
11488 * symtab.c (Symbol::init_base_output_data): Add version
11489 parameter. Change all callers.
11490 (Symbol::init_base_output_segment): Likewise.
11491 (Symbol::init_base_constant): Likewise.
11492 (Symbol::init_base_undefined): Likewise.
11493 (Sized_symbol::init_output_data): Likewise.
11494 (Sized_symbol::init_output_segment): Likewise.
11495 (Sized_symbol::init_constant): Likewise.
11496 (Sized_symbol::init_undefined): Likewise.
11497 (Symbol_table::do_define_in_output_data): If the new symbol has a
11498 version, mark it as the default.
11499 (Symbol_table::do_define_in_output_segment): Likewise.
11500 (Symbol_table::do_define_as_constant): Likewise.
11501 * symtab.h (class Symbol): Update declarations.
11502 (class Sized_symbol): Likewise.
11503 * resolve.cc (Symbol::override_version): New function.
11504 (Symbol::override_base): Call override_version.
11505 (Symbol::override_base_with_special): Likewise.
11506 * testsuite/ver_script_8.script: New file.
11507 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11508 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11509 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11510 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11511
11512 2008-05-06 Ian Lance Taylor <iant@google.com>
11513
11514 PR 6049
11515 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11516 functions.
11517 (class General_options): Remove existing --undefined, and add
11518 --no-undefined instead. Add new --undefined as synonym for -u.
11519 * archive.cc (Archive::add_symbols): Check whether symbol was
11520 named with -u.
11521 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11522 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11523 all uses. Add IS_UNDEFINED. Update declarations to split
11524 different versions of init_base. Declare init_base_undefined.
11525 (Symbol::is_defined): Handle IS_UNDEFINED.
11526 (Symbol::is_undefined): Likewise.
11527 (Symbol::is_weak_undefined): Call is_undefined.
11528 (Symbol::is_absolute): Handle IS_CONSTANT.
11529 (class Sized_symbol): Update declarations to split different
11530 versions of init. Declare init_undefined.
11531 (class Symbol_table): Declare new functions.
11532 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11533 Change all callers.
11534 (Symbol::init_base_output_data): Likewise.
11535 (Symbol::init_base_output_segment): Likewise.
11536 (Symbol::init_base_constant): Likewise.
11537 (Symbol::init_base_undefined): New function.
11538 (Sized_symbol::init_object): Rename from init. Change all
11539 callers.
11540 (Sized_symbol::init_output_data): Likewise.
11541 (Sized_symbol::init_output_segment): Likewise.
11542 (Sized_symbol::init_constant): Likewise.
11543 (Sized_symbol::init_undefined): New function.
11544 (Symbol_table::add_undefined_symbols_from_command_line): New
11545 function.
11546 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11547 function.
11548 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11549 (Symbol::output_section): Likewise.
11550 (Symbol::set_output_section): Likewise.
11551 (Symbol_table::sized_finalize_symbol): Likewise.
11552 (Symbol_table::sized_write_globals): Likewise.
11553 * resolve.cc (Symbol_table::should_override): Likewise.
11554 (Symbol::override_base_with_special): Likewise.
11555
11556 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11557 symbol, change it to have default visibility.
11558 * testsuite/protected_1.cc: New file.
11559 * testsuite/protected_2.cc: New file.
11560 * testsuite/protected_3.cc: New file.
11561 * testsuite/protected_main_1.cc: New file.
11562 * testsuite/protected_main_2.cc: New file.
11563 * testsuite/protected_main_3.cc: New file.
11564 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11565 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11566 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11567 (protected_1.so): New target.
11568 (protected_1_pic.o, protected_2_pic.o): New targets.
11569 (protected_3_pic.o): New target.
11570 (check_PROGRAMS): Add protected_2.
11571 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11572 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11573 * testsuite/Makefile.in: Rebuild.
11574
11575 * options.h (DEFINE_var): Add set_user_set_##varname__.
11576 (DEFINE_bool_alias): New macro.
11577 (class General_options): Define -Bstatic using DEFINE_bool_alias
11578 rather than DEFINE_special. Add --undefined as an alias for -z
11579 defs.
11580 * options.cc (General_options::parse_Bstatic): Remove.
11581
11582 * options.h (class General_options): Add --fatal-warnings.
11583 * main.cc (main): Implement --fatal-warnings.
11584 * errors.h (Errors::warning_count): New function.
11585
11586 * options.h (class General_options): Add -Bsymbolic-functions.
11587 * symtab.h (Symbol::is_preemptible): Check for
11588 -Bsymbolic-functions.
11589
11590 2008-05-05 Ian Lance Taylor <iant@google.com>
11591
11592 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11593 as noVARNAME rather than no-VARNAME.
11594 (class General_options): Add option -z combreloc.
11595 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11596 get_address.
11597 (Output_reloc::sort_before) [SHT_REL]: New function.
11598 (Output_reloc::sort_before) [SHT_RELA]: New function.
11599 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11600 Sort_relocs_comparison.
11601 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11602 parameter. Change all callers.
11603 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11604 sort_relocs parameter. Change all callers.
11605 * output.cc (Output_reloc::get_address): New function, broken out
11606 of write_rel.
11607 (Output_reloc::write_rel): Call it.
11608 (Output_reloc::compare): New function.
11609 (Output_data_reloc_base::do_write): Optionally sort relocs.
11610
11611 * configure.ac: If targ_extra_obj is set, link it in.
11612 * configure.tgt: Initialize all variables.
11613 (x86_64*): Set targ_extra_obj and targ_extra_size.
11614 * configure: Rebuild.
11615
11616 * object.cc (Sized_relobj::include_section_group): Adjust section
11617 indexes read from group data. Build vector to pass to
11618 layout_group.
11619 * layout.cc (Layout::layout_group): Add flags and shndxes
11620 parameters. Remove contents parameter. Change caller. Update
11621 explicit instantiations.
11622 * layout.h (class Layout): Update layout_group declaration.
11623 * output.cc (Output_data_group::Output_data_group): Add flags and
11624 input_shndxes parameters. Remove contents parameter. Change
11625 caller.
11626 (Output_data_group::do_write): Change input_sections_ to
11627 input_shndxes_.
11628 * output.h (class Output_data_group): Update constructor
11629 declaration. Rename input_sections_ to input_shndxes_.
11630 * testsuite/many_sections_test.cc: Add template.
11631
11632 2008-04-30 Cary Coutant <ccoutant@google.com>
11633
11634 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11635
11636 * layout.cc (Layout::include_section): Refactored check for debug
11637 info section.
11638 (Layout::add_comdat): Add new parameters. Change type
11639 of signature parameter. Add object and shndx to signatures table.
11640 (Layout::find_kept_object): New function.
11641 * layout.h: Include <cstring>.
11642 (Layout::is_debug_info_section): New function.
11643 (Layout::add_comdat): Add new parameters.
11644 (Layout::find_kept_object): New function.
11645 (Layout::Kept_section): New struct.
11646 (Layout::Signatures): Change type of map range.
11647 * object.cc (Relobj::output_section_address): New function.
11648 (Sized_relobj::include_section_group): Add new parameters. Change
11649 calls to Layout::add_comdat. Change to build table of kept comdat
11650 groups and table mapping discarded sections to kept sections.
11651 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11652 (Sized_relobj::do_layout): Change calls to include_section_group and
11653 include_linkonce_section.
11654 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11655 value to zero when section is discarded.
11656 (Sized_relobj::map_to_kept_section): New function.
11657 * object.h (Relobj::output_section_address): New function.
11658 (Relobj::Comdat_group): New type.
11659 (Relobj::find_comdat_group): New function.
11660 (Relobj::Comdat_group_table): New type.
11661 (Relobj::Kept_comdat_section): New type.
11662 (Relobj::Kept_comdat_section_table): New type.
11663 (Relobj::add_comdat_group): New function.
11664 (Relobj::set_kept_comdat_section): New function.
11665 (Relobj::get_kept_comdat_section): New function.
11666 (Relobj::comdat_groups_): New field.
11667 (Relobj::kept_comdat_sections_): New field.
11668 (Symbol_value::input_value): Update comment.
11669 (Sized_relobj::map_to_kept_section) New function.
11670 (Sized_relobj::include_linkonce_section): Add new parameter.
11671 * target-reloc.h (Comdat_behavior): New type.
11672 (get_comdat_behavior): New function.
11673 (relocate_section): Add code to map a discarded section to the
11674 corresponding kept section when applying a relocation.
11675
11676 2008-04-30 Craig Silverstein <csilvers@google.com>
11677
11678 * dwarf_reader.cc (next_generation_count): New static var.
11679 (Addr2line_cache_entry): New struct.
11680 (addr2line_cache): New static var.
11681 (Dwarf_line_info::one_addr2line): Added caching.
11682 (Dwarf_line_info::clear_addr2line_cache): New function.
11683 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11684 cache-size parameter.
11685 (Dwarf_line_info::one_addr2line_cache): New function.
11686 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11687 new cache-size argument to one_addr2line(), and clear cache.
11688
11689 2008-04-28 Cary Coutant <ccoutant@google.com>
11690
11691 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11692 R_386_PC8 relocations.
11693
11694 2008-04-23 Ian Lance Taylor <iant@google.com>
11695
11696 * object.cc (Sized_relobj::include_section_group): Check for
11697 invalid section group.
11698
11699 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11700 header size.
11701
11702 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11703 than read for file header.
11704 * archive.cc (Archive::include_member): Likewise.
11705
11706 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
11707
11708 * aclocal.m4: Regenerate.
11709 * configure: Regenerate.
11710
11711 2008-04-19 Ian Lance Taylor <iant@google.com>
11712
11713 * version.cc (version_string): Bump to 1.6.
11714
11715 * testsuite/Makefile.am (many_sections_r_test): New target.
11716 (many_sections_r_test_SOURCES): Remove.
11717 (many_sections_r_test_DEPENDENCIES): Remove.
11718 (many_sections_r_test_LDFLAGS): Remove.
11719 (many_sections_r_test_LDADD): Remove.
11720
11721 * object.cc (Sized_relobj::do_add_symbols): Always pass
11722 local_symbol_count_ to add_from_relobj.
11723
11724 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11725 every thousand variables.
11726 * testsuite/Makefile.in: Rebuild.
11727
11728 * object.cc (Xindex::initialize_symtab_xindex): New function.
11729 (Xindex::read_symtab_xindex): New function.
11730 (Xindex::sym_xindex_to_shndx): New function.
11731 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11732 available.
11733 (Sized_relobj::do_initialize_xindex): New function.
11734 (Sized_relobj::do_read_symbols): Adjust section links.
11735 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11736 parameter. Change all callers.
11737 (Sized_relobj::include_section_group): Adjust section links and
11738 symbol section indexes.
11739 (Sized_relobj::do_layout): Adjust section links.
11740 (Sized_relobj::do_count_local_symbols): Adjust section links and
11741 symbol section indexes.
11742 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11743 ordinary and special symbols.
11744 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11745 dynsym_xindex parameters. Change all callers. Adjust section
11746 links. Use SHN_XINDEX when needed.
11747 (Sized_relobj::get_symbol_location_info): Adjust section links.
11748 Don't get fooled by special symbols.
11749 * object.h (class Xindex): Define.
11750 (class Object): Add xindex_ parameter. Declare virtual functoin
11751 do_initialize_xindex.
11752 (Object::adjust_sym_shndx): New function.
11753 (Object::set_xindex): New protected function.
11754 (class Symbol_value): Add is_ordinary_shndx_ field.
11755 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11756 (Symbol_value::value): Assert ordinary section.
11757 (Symbol_value::initialize_input_to_output_map): Likewise.
11758 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11759 Change all callers.
11760 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11761 all callers.
11762 (class Sized_relobj): Update declarations.
11763 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11764 parameter. Change all callers.
11765 (Sized_relobj::adjust_shndx): New function.
11766 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11767 field.
11768 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11769 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11770 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11771 (Sized_dynobj::read_dynsym_section): Adjust section links.
11772 (Sized_dynobj::read_dynamic): Likewise.
11773 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11774 section links.
11775 (Sized_dynobj::do_initialize_xindex): New function.
11776 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11777 do_initialize_xindex.
11778 (Sized_dynobj::adjust_shndx): New function.
11779 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11780 dynsym_xindex_ fields.
11781 (Layout::finalize): Add a call to set_section_indexes before
11782 creating the symtab sections.
11783 (Layout::set_section_indexes): Don't do anything if the section
11784 already has a section index.
11785 (Layout::create_symtab_sections): Add shnum parameter. Change
11786 caller. Create .symtab_shndx section if needed.
11787 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11788 caller.
11789 (Layout::allocated_output_section_count): New function.
11790 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11791 needed.
11792 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11793 fields. Update declarations.
11794 (Layout::symtab_xindex): New function.
11795 (Layout::dynsym_xindex): New function.
11796 (class Write_symbols_task): Add layout_ field.
11797 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11798 Change caller.
11799 * output.cc (Output_section_headers::Output_section_headers): Add
11800 shstrtab_section parameter. Change all callers.
11801 (Output_section_headers::do_sized_write): Store overflow values
11802 for section count and section string table section index in
11803 section header zero.
11804 (Output_file_header::do_sized_write): Check for overflow of
11805 section count and section string table section index.
11806 (Output_symtab_xindex::do_write): New function.
11807 (Output_symtab_xindex::endian_do_write): New function.
11808 * output.h (class Output_section_headers): Add shstrtab_section_.
11809 Update declarations.
11810 (class Output_symtab_xindex): Define.
11811 (Output_section::has_out_shndx): New function.
11812 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11813 field.
11814 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11815 Change all callers.
11816 (Sized_symbol::init): Likewise.
11817 (Symbol::output_section): Check for ordinary symbol.
11818 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11819 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11820 callers.
11821 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11822 Change all callers. Simplify handling of symbols from sections
11823 not included in the link.
11824 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11825 distinction.
11826 (Weak_alias_sorter::operator()): Assert that symbols are
11827 ordinary.
11828 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11829 distinction.
11830 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11831 parameters. Change all callers.
11832 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11833 symbol distinction. Use SHN_XINDEX when needed.
11834 (Symbol_table::write_section_symbol): Add symtab_xindex
11835 parameter. Change all callers.
11836 (Symbol_table::sized_write_section_symbol): Likewise. Use
11837 SHN_XINDEX when needed.
11838 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11839 declarations.
11840 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11841 (Symbol::is_defined): Check is_ordinary.
11842 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11843 (Symbol::is_absolute, Symbol::is_common): Likewise.
11844 (class Sized_symbol): Update declarations.
11845 (class Symbol_table): Update declarations.
11846 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11847 parameters. Change all callers.
11848 (Sized_symbol::override): Likewise.
11849 (Symbol_table::override): Likewise.
11850 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11851 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11852 is_ordinary, and orig_st_shndx parameters. Change all callers.
11853 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11854 to be in an ordinary section.
11855 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11856 object and is_ordinary parameters. Change all callers.
11857 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11858 Change all callers. Don't add undefined or non-ordinary symbols
11859 to reloc_map_.
11860 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11861 Change all callers.
11862 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11863 declarations.
11864 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11865 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11866 (Sized_relobj::relocate_sections): Likewise.
11867 * target-reloc.h (scan_relocs): Adjust section symbol index.
11868 (scan_relocatable_relocs): Likewise.
11869 * i386.cc (Scan::local): Check for ordinary symbols.
11870 * sparc.cc (Scan::local): Likewise.
11871 * x86_64.cc (Scan::local): Likewise.
11872 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11873 to symbol_section_and_value.
11874 * testsuite/many_sections_test.cc: New file.
11875 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11876 (check_PROGRAMS): Add many_sections_test.
11877 (many_sections_test_SOURCES): Define.
11878 (many_sections_test_DEPENDENCIES): Define.
11879 (many_sections_test_LDFLAGS): Define.
11880 (BUILT_SOURCES): Add many_sections_define.h.
11881 (many_sections_define.h): New target.
11882 (BUILT_SOURCES): Add many_sections_check.h.
11883 (many_sections_check.h): New target.
11884 (check_PROGRAMS): Add many_sections_r_test.
11885 (many_sections_r_test_SOURCES): Define.
11886 (many_sections_r_test_DEPENDENCIES): Define.
11887 (many_sections_r_test_LDFLAGS): Define.
11888 (many_sections_r_test_LDADD): Define.
11889 (many_sections_r_test.o): New target.
11890 * testsuite/Makefile.in: Rebuild.
11891
11892 2008-04-17 Cary Coutant <ccoutant@google.com>
11893
11894 * errors.cc (Errors::info): New function.
11895 (gold_info): New function.
11896 * errors.h (Errors::info): New function.
11897 * gold.h (gold_info): New function.
11898 * object.cc (Input_objects::add_object): Print trace output.
11899 * options.cc (options::parse_set): New function.
11900 (General_options::parse_wrap): Deleted.
11901 (General_options::General_options): Deleted initializer.
11902 * options.h (options::String_set): New typedef.
11903 (options::parse_set): New function.
11904 (DEFINE_set): New macro.
11905 (General_options::wrap): Changed to use DEFINE_set. Changed
11906 callers of any_wrap_symbols and is_wrap_symbol.
11907 (General_options::trace, General_options::trace_symbol):
11908 New options.
11909 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11910 (General_options::wrap_symbols_): Deleted.
11911 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11912
11913 2008-04-17 David S. Miller <davem@davemloft.net>
11914
11915 * options.cc (General_options::parse_V): New function.
11916 * options.h: Add entries for -V and -Qy.
11917
11918 2008-04-17 Ian Lance Taylor <iant@google.com>
11919
11920 * common.cc (Symbol_table::allocate_commons): Remove options
11921 parameter. Change caller.
11922 (Symbol_table::do_allocate_commons): Remove options parameter.
11923 Change caller. Just call do_allocate_commons_list twice.
11924 (Symbol_table::do_allocate_commons_list): New function, broken out
11925 of do_allocate_commons.
11926 * common.h (class Allocate_commons_task): Remove options_ field.
11927 Update constructor.
11928 * symtab.cc (Symbol_table::Symbol_table): Initialize
11929 tls_commons_.
11930 (Symbol_table::add_from_object): Put TLS common symbols on
11931 tls_commons_ list.
11932 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11933 which are IN_OUTPUT_DATA.
11934 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11935 allocate_commons and do_allocate_commons declarations. Declare
11936 do_allocate_commons_list.
11937 * gold.cc (queue_middle_tasks): Update creation of
11938 Allocate_commons_task to not pass options.
11939 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11940 (TLS_TEST_C_FLAGS): New variable.
11941 (tls_test_c_pic.o): New target.
11942 (tls_test_shared.so): Link in tls_test_c_pic.o.
11943 (tls_test_c_pic_ie.o): New target.
11944 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11945 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11946 (tls_test_c.o): New target.
11947 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11948 (tls_pic_test_LDADD): Likewise.
11949 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11950 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11951 (tls_test_c_gnu2.o): New target.
11952 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11953 tls_test_c_gnu2.o.
11954 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11955 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11956 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11957 * testsuite/tls_test.cc: Include "config.h".
11958 (t_last): Call t11_last.
11959 * testsuite/tls_test.h (t11, t11_last): Declare.
11960 * testsuite/tls_test_c.c: New file.
11961 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11962 * configure.ac: Check for OpenMP support.
11963 * configure, config.in, Makefile.in: Rebuild.
11964 * testsuite/Makefile.in: Rebuild.
11965
11966 2008-04-16 Cary Coutant <ccoutant@google.com>
11967
11968 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11969 (Target_i386::tls_base_symbol_defined_): New field.
11970 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11971 (Target_i386::Scan::global): Likewise.
11972 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11973 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11974 (Target_x86_64::tls_base_symbol_defined_): New field.
11975 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11976 (Target_x86_64::Scan::global): Likewise.
11977
11978 2008-04-16 Cary Coutant <ccoutant@google.com>
11979
11980 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11981 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11982 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11983 building shared libraries.
11984 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11985 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11986 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11987 * testsuite/Makefile.in: Rebuild.
11988 * testsuite/weak_undef.h: New file.
11989 * testsuite/weak_undef_file1.cc: Add extra test cases.
11990 * testsuite/weak_undef_file2.cc: Likewise.
11991 * testsuite/weak_undef_test.cc: Likewise.
11992
11993 2008-04-16 David S. Miller <davem@davemloft.net>
11994
11995 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11996 Add issued_non_pic_error_ field. Declare check_non_pic.
11997 (Target_sparc::Scan::check_non_pic): New function.
11998 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11999 (Target_sparc::Scan::global): Likewise.
12000
12001 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12002 * configure: Rebuild.
12003
12004 * options.h (DEFINE_enable): New macro.
12005 (new_dtags): New enable option.
12006 (initfirst, interpose, loadfltr, nodefaultlib,
12007 nodelete, nodlopen, nodump): New -z options.
12008 * layout.cc (Layout:finish_dynamic_section): If new
12009 dtags enabled, emit DT_RUNPATH. Also, emit a
12010 DT_FLAGS_1 containing any specified -z flags.
12011
12012 2008-04-16 Ian Lance Taylor <iant@google.com>
12013
12014 * copy-relocs.cc: New file.
12015 * copy-relocs.h: New file.
12016 * reloc.cc: Remove Copy_relocs code.
12017 * reloc.h: Likewise.
12018 * reloc-types.h (struct Reloc_types) [both versions]: Add
12019 get_reloc_addend_noerror.
12020 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12021 variants of add_global which take an addend which must be zero.
12022 * i386.cc: Include "copy-relocs.h".
12023 (class Target_i386): Change type of copy_relocs_ to variable,
12024 update initializer.
12025 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12026 Change all callers.
12027 (Target_i386::do_finalize_sections): Change handling of
12028 copy_relocs_.
12029 * sparc.cc: Include "copy-relocs.h".
12030 (class Target_sparc): Change type of copy_relocs_ to variable,
12031 update initializer.
12032 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12033 Change all callers.
12034 (Target_sparc::do_finalize_sections): Change handling of
12035 copy_relocs_.
12036 * x86_64.cc: Include "copy-relocs.h".
12037 (class Target_x86_64): Change type of copy_relocs_ to variable,
12038 update initializer.
12039 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12040 class. Change all callers.
12041 (Target_x86_64::do_finalize_sections): Change handling of
12042 copy_relocs_.
12043 * Makefile.am (CCFILES): Add copy-relocs.cc.
12044 (HFILES): Add copy-relocs.h.
12045
12046 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12047
12048 * testsuite/script_test_4.sh: Permit leading zeroes.
12049
12050 2008-04-15 Ian Lance Taylor <iant@google.com>
12051
12052 * script-sections.cc (Script_sections::create_segments): Use
12053 header_size_adjustment even when there is enough room for the
12054 headers.
12055 * testsuite/script_test_4.sh: New file.
12056 * testsuite/script_test_4.t: New file.
12057 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12058 (check_DATA): Add script_test_4.stdout.
12059 (MOSTLYCLEANFILES): Likewise.
12060 (script_test_4): New target.
12061 (script_test_4.stdout): New target.
12062 * testsuite/Makefile.in: Rebuild.
12063
12064 * sparc.cc: Add definitions for Output_data_plt_sparc class
12065 constants.
12066
12067 2008-04-14 David S. Miller <davem@davemloft.net>
12068
12069 * sparc.cc: New file.
12070 * Makefile.am (TARGETSOURCES): Add sparc.cc
12071 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12072 * configure.tgt: Document targ_extra_size and
12073 targ_extra_big_endian. Add entries for sparc-* and
12074 sparc64-*.
12075 * configure.ac: Handle targ_extra_size and
12076 targ_extra_big_endian.
12077 * Makefile.in: Rebuild.
12078 * configure: Likewise.
12079 * po/POTFILES.in: Likewise.
12080 * po/gold.pot: Likewise.
12081
12082 2008-04-14 Ian Lance Taylor <iant@google.com>
12083
12084 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12085 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12086 in the name/type/flags to section mapping. Don't call
12087 allocate_output_section.
12088 (Layout::choose_output_section): Change parameter from adjust_name
12089 to is_input_section. Don't permit input sections after sections
12090 are attached to segments. Don't call allocate_output_section.
12091 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12092 not write_enable_output_section.
12093 (Layout::make_output_section): Don't push to
12094 unattached_section_list_ nor call attach_to_segment. Call
12095 attach_section_to_segment if sections are attached.
12096 (Layout::attach_sections_to_segments): New function.
12097 (Layout::attach_section_to_segment): New function.
12098 (Layout::attach_allocated_section_to_segment): Rename from
12099 attach_to_segment. Remove flags parameter.
12100 (Layout::allocate_output_section): Remove function.
12101 (Layout::write_enable_output_section): Remove function.
12102 * layout.h (class Layout): Update for above changes. Add new
12103 field sections_are_attached_.
12104 * output.h (Output_section::update_flags_for_input_section): New
12105 function.
12106 * output.cc (Output_section::add_input_section): Call
12107 update_flags_for_input_section.
12108 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12109
12110 2008-04-11 Cary Coutant <ccoutant@google.com>
12111
12112 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12113 thought unnecessary.
12114 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12115
12116 2008-04-11 Ian Lance Taylor <iant@google.com>
12117
12118 * output.h (class Output_section_data): Remove inline definition
12119 of set_addralign.
12120 * output.cc (Output_section_data::set_addralign): New function.
12121
12122 2008-04-11 Cary Coutant <ccoutant@google.com>
12123
12124 Add support for TLS descriptors for i386 and x86_64.
12125 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12126 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12127 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12128 GOT_TYPE_TLS_DESC.
12129 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12130 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12131 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12132 relocations.
12133 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12134 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12135 Fix problem with initial-exec relocations.
12136 (Target_i386::Relocate::relocate_tls): Likewise.
12137 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12138 relaxation.
12139 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12140 support for section-plus-offset dynamic table entries.
12141 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12142 (Output_data_dynamic::Dynamic_entry): Add support for
12143 section-plus-offset dynamic table entries.
12144 (Output_data_dynamic::Classification): Likewise.
12145 (Output_data_dynamic::classification_): Renamed offset_.
12146 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12147 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12148 (Target_x86_64::make_plt_section): New function.
12149 (Target_x86_64::reserve_tlsdesc_entries): New function.
12150 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12151 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12152 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12153 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12154 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12155 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12156 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12157 add extra PLT entry for TLS descriptors.
12158 (Output_data_plt_x86_64::got_): New field.
12159 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12160 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12161 fields.
12162 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12163 descriptors.
12164 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12165 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12166 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12167 R_386_TLS_DESC_CALL relocations.
12168 (Target_x86_64::Scan::global): Likewise.
12169 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12170 for TLS descriptors.
12171 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12172 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12173 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12174 GD-to-IE relaxation.
12175 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12176 and TLS_DESCRIPTORS.
12177 * Makefile.in: Rebuild.
12178 * configure: Rebuild.
12179 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12180 (tls_test_shared2.so): New target.
12181 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12182 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12183 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12184 (tls_shared_gd_to_ie_test_LDADD): New variable.
12185 (tls_shared_gnu2_gd_to_ie_test): New target.
12186 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12187 New targets.
12188 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12189 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12190 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12191 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12192 (tls_shared_gnu2_test): New target.
12193 (tls_test_gnu2_shared.so): New target.
12194 (tls_shared_gnu2_test_SOURCES): New variable.
12195 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12196 (tls_shared_gnu2_test_LDFLAGS): New variable.
12197 (tls_shared_gnu2_test_LDADD): New variable.
12198 * testsuite/Makefile.in: Rebuild.
12199 * testsuite/Makefile.
12200
12201 2008-04-11 Ian Lance Taylor <iant@google.com>
12202
12203 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12204 justsyms.t.
12205 * testsuite/Makefile.in: Rebuild.
12206
12207 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12208 long.
12209 * testsuite/script_test_2.cc (main): Adjust test.
12210
12211 2008-04-11 David S. Miller <davem@davemloft.net>
12212 Ian Lance Taylor <iant@google.com>
12213
12214 * options.h (General_options): Add entries for '-Y' and
12215 '-relax'.
12216 * options.cc (General_options:finalize): If -Y was used, add those
12217 entries to the library path instead of the default "/lib" and
12218 "/usr/lib".
12219
12220 2008-04-11 David S. Miller <davem@davemloft.net>
12221
12222 * testsuite/justsyms.t: Start at 0x100.
12223 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12224 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12225 long.
12226 * testsuite/script_test_2.cc: Adjust string and section length
12227 checks.
12228
12229 2008-04-09 Ian Lance Taylor <iant@google.com>
12230
12231 PR gold/5996
12232 * script-sections.cc (Sections_element::allocate_to_segment): Add
12233 orphan parameter.
12234 (Output_section_definition::allocate_to_segment): Likewise.
12235 (Orphan_output_section::allocate_to_segment): Likewise.
12236 (Script_sections::attach_sections_using_phdrs_clause): Don't
12237 propagate non-PT_LOAD segments to orphan sections.
12238 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12239 readelf rather than objdump.
12240 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12241 .interp section and PT_INTERP segment are the same size.
12242 * testsuite/Makefile.in: Rebuild.
12243
12244 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12245 aliases for symbols defined in the same object.
12246 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12247 (weak_alias_test_SOURCES): New variable.
12248 (weak_alias_test_DEPENDENCIES): New variable.
12249 (weak_alias_test_LDFLAGS): New variable.
12250 (weak_alias_test_LDADD): New variable.
12251 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12252 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12253 (weak_alias_test_3.o): New target.
12254 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12255 * testsuite/weak_alias_test_main.cc: New file.
12256 * testsuite/weak_alias_test_1.cc: New file.
12257 * testsuite/weak_alias_test_2.cc: New file.
12258 * testsuite/weak_alias_test_3.cc: New file.
12259
12260 2008-04-08 Ian Lance Taylor <iant@google.com>
12261
12262 * options.h (class General_options): Add --noinhibit-exec option.
12263 * main.cc (main): Check --noinhibit-exec.
12264
12265 * options.h (class General_options): Define --wrap as a special
12266 option. Add wrap_symbols_ field.
12267 (General_options::any_wrap_symbols): New function.
12268 (General_options::is_wrap_symbol): New function.
12269 * options.cc (General_options::parse_wrap): New function.
12270 (General_options::General_options): Initialize wrap_symbols_.
12271 * symtab.cc (Symbol_table::wrap_symbol): New function.
12272 (Symbol_table::add_from_object): Handle --wrap.
12273 * symtab.h (class Symbol_table): Declare wrap_symbol.
12274 * target.h (Target::wrap_char): New function.
12275 (Target::Target_info): Add wrap_char field.
12276 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12277 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12278 * testsuite/testfile.cc (Target_test::test_target_info):
12279 Likewise.
12280
12281 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12282 there is one.
12283
12284 * layout.h (class Layout): Add added_eh_frame_data_ field.
12285 * layout.cc (Layout::Layout): Initialize new field.
12286 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12287 output section until we find a section we merged successfully.
12288 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12289 that the size be non-zero.
12290
12291 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12292 qualifier.
12293
12294 2008-04-08 Craig Silverstein <csilvers@google.com>
12295
12296 * configure.ac: Export new conditional variable HAVE_ZLIB.
12297 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12298 on HAVE_ZLIB.
12299 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12300 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12301
12302 2008-04-07 Ian Lance Taylor <iant@google.com>
12303
12304 * version.cc (version_string): Set to "1.5".
12305
12306 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12307 Add issued_non_pic_error_ field. Declare check_non_pic.
12308 (Target_x86_64::Scan::check_non_pic): New function.
12309 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12310 (Target_x86_64::Scan::global): Likewise.
12311
12312 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12313 addend parameter. Change caller. Handle merge sections.
12314 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12315 Address to Addend. Don't add in the result of
12316 local_section_offset, pass down the addend and use the returned
12317 value.
12318 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12319 Update declarations of local_section_offset and symbol_value.
12320 * testsuite/two_file_test_1.cc (t18): New function.
12321 * testsuite/two_file_test_2.cc (f18): New function.
12322 * testsuite/two_file_test_main.cc (main): Call t18.
12323 * testsuite/two_file_test.h (t18, f18): Declare.
12324
12325 * configure.ac: Don't test for objdump, c++filt, or readelf.
12326 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12327 conditionals.
12328 (TEST_READELF): New variable.
12329 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12330 (check_PROGRAMS): Add two_file_strip_test.
12331 (two_file_strip_test): New target.
12332 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12333 (two_file_same_shared_strip_test_SOURCES): New variable.
12334 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12335 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12336 (two_file_same_shared_strip_test_LDADD): New variable.
12337 (two_file_shared_strip.so): New target.
12338 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12339 (ver_test_5.syms, ver_test_7.syms): Likewise.
12340 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12341 (strip_test_3.stdout): Use TEST_OBJDUMP.
12342 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12343
12344 2008-04-04 Cary Coutant <ccoutant@google.com>
12345
12346 * symtab.h (Symbol::is_weak_undefined): New function.
12347 (Symbol::is_strong_undefined): New function.
12348 (Symbol::is_absolute): New function.
12349 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12350 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12351 absolute symbols.
12352 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12353 (weak_undef_test): New target.
12354 * testsuite/Makefile.in: Rebuild.
12355 * testsuite/weak_undef_file1.cc: New file.
12356 * testsuite/weak_undef_file2.cc: New file.
12357 * testsuite/weak_undef_test.cc: New file.
12358
12359 2008-04-03 Craig Silverstein <csilvers@google.com>
12360
12361 * compressed_output.h (class Output_compressed_section): Use
12362 unsigned buffer.
12363 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12364 add zlib header.
12365 (zlib_compressed_suffix): Removed.
12366 (Output_compressed_section::set_final_data_size): Use unsigned
12367 buffers.
12368 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12369 Fix linker invocation.
12370 (flagstest_o_specialfile_and_compress_debug_sections):
12371 Likewise.
12372 * testsuite/Makefile.in: Regenerated.
12373
12374 2008-04-02 David S. Miller <davem@davemloft.net>
12375
12376 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12377 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12378
12379 2008-04-02 Craig Silverstein <csilvers@google.com>
12380
12381 * TODO: New file.
12382
12383 2008-04-02 Ian Lance Taylor <iant@google.com>
12384
12385 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12386 parameters. Update for new key type to views_. Change all
12387 callers.
12388 (File_read::read): Adjust for byteshift in returned view.
12389 (File_read::add_view): New function, broken out of
12390 find_and_make_view.
12391 (File_read::make_view): New function, broken out of
12392 find_and_make_view.
12393 (File_read::find_or_make_view): Add offset and aligned
12394 parameters. Rewrite accordingly. Change all callers.
12395 (File_read::get_view): Add offset and aligned parameters. Adjust
12396 for byteshift in return value.
12397 (File_read::get_lasting_view): Likewise.
12398 * fileread.h (class File_read): Update declarations.
12399 (class File_read::View): Add byteshift_ field. Add byteshift to
12400 constructor. Add byteshift method.
12401 * archive.h (Archive::clear_uncached_views): New function.
12402 (Archive::get_view): Add aligned parameter. Change all callers.
12403 * object.h (Object::get_view): Add aligned parameter. Change all
12404 callers.
12405 (Object::get_lasting_view): Likewise.
12406
12407 * fileread.cc (File_read::release): Don't call clear_views if
12408 there are multiple objects.
12409 * fileread.h (File_read::clear_uncached_views): New function.
12410 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12411 on the archive.
12412
12413 2008-03-31 Cary Coutant <ccoutant@google.com>
12414
12415 Add thin archive support.
12416 * archive.cc (Archive::armagt): New const.
12417 (Archive::setup): Remove task parameter and calls to unlock.
12418 (Archive::unlock_nested_archives): New function.
12419 (Archive::read_header): Add nested_off parameter. Change
12420 all callers.
12421 (Archive::interpret_header): Likewise.
12422 (Archive::include_all_members): Change to handle thin
12423 archives.
12424 (Archive::include_member): Likewise.
12425 * archive.h (Archive::Archive): Add new parameters and
12426 initializers.
12427 (Archive::armagt): New const.
12428 (Archive::setup): Remove task parameter.
12429 (Archive::unlock_nested_archives): New function.
12430 (Archive::read_header): Add nested_off parameter.
12431 (Archive::interpret_header): Likewise.
12432 (Archive::Nested_archive_table): New typedef.
12433 (Archive::is_thin_archive_): New field.
12434 (Archive::nested_archives_): New field.
12435 (Archive::options_): New field.
12436 (Archive::dirpath_): New field.
12437 (Archive::task_): New field.
12438 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12439 for thin archives. Pass additional parameters to
12440 Archive::Archive. Unlock the archive file after calling
12441 Archive::setup.
12442
12443 2008-03-29 Ian Lance Taylor <iant@google.com>
12444
12445 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12446 version symbol to be local.
12447 * testsuite/ver_test_4.sh: New file.
12448 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12449 (check_DATA): Add ver_test_4.syms.
12450 (ver_test_4.syms): New target.
12451 * testsuite/Makefile.in: Rebuild.
12452
12453 * output.cc
12454 (Output_section::Input_section_sort_entry::has_priority): New
12455 function.
12456 (Output_section::Input_section_sort_entry::match_file_name): New
12457 function.
12458 (Output_section::Input_section_sort_entry::match_section_name):
12459 Remove.
12460 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12461 Remove.
12462 (Output_section::Input_section_sort_entry::match_section_file):
12463 Remove.
12464 (Output_section::Input_section_sort_compare::operator()): Rewrite
12465 using new Input_section_sort_entry functions. Sort crtbegin and
12466 crtend first. Sort sections with no priority before sections with
12467 a priority.
12468 * testsuite/initpri1.c (d3): Check j != 4.
12469 (cd5): New constructor/destructor function.
12470 (main): Check j != 2.
12471
12472 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12473 new symbol when resolving, don't call set_is_default.
12474 * testsuite/ver_test_7.cc: New file.
12475 * testsuite/ver_test_7.sh: New file.
12476 * testsuite/Makefile.am (ver_test_7.so): New target.
12477 (ver_test_7.o): New target.
12478 (check_SCRIPTS): Add ver_test_7.sh.
12479 (check_DATA): Add ver_test_7.syms.
12480 (ver_test_7.syms): New target.
12481
12482 2008-03-28 Ian Lance Taylor <iant@google.com>
12483
12484 * layout.cc (Layout::layout): If we see an input section with a
12485 name that needs sorting, set the must_sort flag for the output
12486 section.
12487 (Layout::make_output_section): If the name of the output section
12488 indicates that it might require sorting, set the may_sort flag.
12489 * output.h (Output_section::may_sort_attached_input_sections): New
12490 function.
12491 (Output_section::set_may_sort_attached_input_sections): New
12492 function.
12493 (Output_section::must_sort_attached_input_sections): New
12494 function.
12495 (Output_section::set_must_sort_attached_input_sections): New
12496 function.
12497 (class Output_section): Declare Input_section_sort_entry. Define
12498 Input_section_sort_compare. Declare
12499 sort_attached_input_sections. Add new fields:
12500 may_sort_attached_input_sections_,
12501 must_sort_attached_input_sections_,
12502 attached_input_sections_are_sorted_.
12503 * output.cc (Output_section::Output_section): Initialize new
12504 fields.
12505 (Output_section::add_input_section): Add an entry to
12506 input_sections_ if may_sort or must_sort are true.
12507 (Output_section::set_final_data_size): Call
12508 sort_attached_input_sections if necessary.
12509 (Output_section::Input_section_sort_entry): Define new class.
12510 (Output_section::Input_section_sort_compare::operator()): New
12511 function.
12512 (Output_section::sort_attached_input_sections): New function.
12513 * configure.ac: Check whether the compiler supports constructor
12514 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12515 * testsuite/initpri1.c: New file.
12516 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12517 CONSTRUCTOR_PRIORITY.
12518 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12519 (initpri1_LDFLAGS): New variable.
12520 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12521
12522 2008-03-27 Ian Lance Taylor <iant@google.com>
12523
12524 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12525 * testsuite/common_test_1.c: New file.
12526 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12527 (common_test_1_SOURCES): New variable.
12528 (common_test_1_DEPENDENCIES): New variable.
12529 (common_test_1_LDFLAGS): New variable.
12530
12531 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12532 and commons_ correctly when NAME/VERSION does not override
12533 NAME/NULL.
12534 * testsuite/ver_test_6.c: New file.
12535 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12536 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12537 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12538
12539 2008-03-26 Ian Lance Taylor <iant@google.com>
12540
12541 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12542 of an undefined symbol from a version script.
12543 * testsuite/Makefile.am (ver_test_5.so): New target.
12544 (ver_test_5.o): New target.
12545 (check_SCRIPTS): Add ver_test_5.sh.
12546 (check_DATA): Add ver_test_5.syms.
12547 (ver_test_5.syms): New target.
12548 * testsuite/ver_test_5.cc: New file.
12549 * testsuite/ver_test_5.script: New file.
12550 * testsuite/ver_test_5.sh: New file.
12551 * Makefile.in, testsuite/Makefile.in: Rebuild.
12552
12553 PR gold/5986
12554 Fix problems building gold with gcc 4.3.0.
12555 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12556 (gold_error_at_location, gold_warning_at_location): Use it.
12557 * configure.ac: Check whether we can compile and use a template
12558 function with a printf attribute.
12559 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12560 when jumping over bytes.
12561 * object.cc: Instantiate Object::read_section_data.
12562 * debug.h: Include <cstring>
12563 * dwarf_reader.cc: Include <algorithm>
12564 * main.cc: Include <cstring>.
12565 * options.cc: Include <cstring>.
12566 * output.cc: Include <cstring>.
12567 * script.cc: Include <cstring>.
12568 * script.h: Include <string>.
12569 * symtab.cc: Include <cstring> and <algorithm>.
12570 * target-select.cc: Include <cstring>.
12571 * version.cc: Include <string>.
12572 * testsuite/testmain.cc: Include <cstdlib>.
12573 * configure, config.in: Rebuild.
12574
12575 2008-03-25 Ian Lance Taylor <iant@google.com>
12576
12577 * options.cc: Include "../bfd/bfdver.h".
12578 (options::help): Print bug reporting address.
12579
12580 * version.cc (print_version): Adjust output for current value of
12581 BFD_VERSION_STRING.
12582
12583 * NEWS: New file.
12584
12585 * options.cc (options::help): Print list of supported targets.
12586 * target-select.h: Include <vector>.
12587 (class Target_selector): Make machine_, size_, and is_big_endian_
12588 fields const. Add bfd_name_ and instantiated_target_ fields.
12589 (Target_selector::Target_selector): Add bfd_name parameter.
12590 (Target_selector::recognize): Make non-virtual, call
12591 do_recognize.
12592 (Target_selector::recognize_by_name): Make non-virtual, call
12593 do_recognize_by_name.
12594 (Target_selector::supported_names): New function.
12595 (Target_selector::bfd_name): New function.
12596 (Target_selector::do_instantiate_target): New pure virtual
12597 function.
12598 (Target_selector::do_recognize): New virtual function.
12599 (Target_selector::do_recognize_by_name): New virtual function.
12600 (Target_selector::instantiate_target): New private function.
12601 (supported_target_names): Declare.
12602 * target-select.cc (Target_selector::Target_selector): Update for
12603 new parameter and fields.
12604 (select_target_by_name): Check that the name matches before
12605 calling recognize_by_name.
12606 (supported_target_names): New function.
12607 * i386.cc (class Target_selector_i386): Update Target_selector
12608 constructor call. Remove recognize and recognize_by_name. Add
12609 do_instantiate_target.
12610 * x86_64.cc (class Target_selector_x86_64): Likewise.
12611 * testsuite/testfile.cc (class Target_selector_test): Update for
12612 changes to Target_selector.
12613
12614 * README: Rewrite, with some notes on unsupported features.
12615
12616 2008-03-24 Cary Coutant <ccoutant@google.com>
12617
12618 * i386.cc (Target_i386::Got_type): New enum declaration.
12619 (Target_i386::Scan::local): Updated callers of Output_data_got
12620 member functions.
12621 (Target_i386::Scan::global): Likewise.
12622 (Target_i386::Relocate::relocate): Likewise.
12623 (Target_i386::Relocate::relocate_tls): Likewise.
12624 * object.h (Got_offset_list): New class.
12625 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12626 (Sized_relobj::local_got_offset): Likewise.
12627 (Sized_relobj::set_local_got_offset): Likewise.
12628 (Sized_relobj::local_has_tls_got_offset): Removed.
12629 (Sized_relobj::local_tls_got_offset): Removed.
12630 (Sized_relobj::set_local_tls_got_offset): Removed.
12631 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12632 * output.cc (Output_data_got::add_global): Added got_type parameter.
12633 (Output_data_got::add_global_with_rel): Likewise.
12634 (Output_data_got::add_global_with_rela): Likewise.
12635 (Output_data_got::add_global_pair_with_rel): New function.
12636 (Output_data_got::add_global_pair_with_rela): New function.
12637 (Output_data_got::add_local): Added got_type parameter.
12638 (Output_data_got::add_local_with_rel): Likewise.
12639 (Output_data_got::add_local_with_rela): Likewise.
12640 (Output_data_got::add_local_pair_with_rel): New function.
12641 (Output_data_got::add_local_pair_with_rela): New function.
12642 (Output_data_got::add_global_tls): Removed.
12643 (Output_data_got::add_global_tls_with_rel): Removed.
12644 (Output_data_got::add_global_tls_with_rela): Removed.
12645 (Output_data_got::add_local_tls): Removed.
12646 (Output_data_got::add_local_tls_with_rel): Removed.
12647 (Output_data_got::add_local_tls_with_rela): Removed.
12648 * output.h (Output_data_got::add_global): Added got_type parameter.
12649 (Output_data_got::add_global_with_rel): Likewise.
12650 (Output_data_got::add_global_with_rela): Likewise.
12651 (Output_data_got::add_global_pair_with_rel): New function.
12652 (Output_data_got::add_global_pair_with_rela): New function.
12653 (Output_data_got::add_local): Added got_type parameter.
12654 (Output_data_got::add_local_with_rel): Likewise.
12655 (Output_data_got::add_local_with_rela): Likewise.
12656 (Output_data_got::add_local_pair_with_rel): New function.
12657 (Output_data_got::add_local_pair_with_rela): New function.
12658 (Output_data_got::add_global_tls): Removed.
12659 (Output_data_got::add_global_tls_with_rel): Removed.
12660 (Output_data_got::add_global_tls_with_rela): Removed.
12661 (Output_data_got::add_local_tls): Removed.
12662 (Output_data_got::add_local_tls_with_rel): Removed.
12663 (Output_data_got::add_local_tls_with_rela): Removed.
12664 * resolve.cc (Symbol::override_base_with_special): Removed
12665 reference to has_got_offset_ field.
12666 * symtab.cc (Symbol::init_fields): Replaced initialization
12667 of got_offset_ with got_offsets_. Removed initialization
12668 of has_got_offset_
12669 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
12670 (Symbol::got_offset): Likewise.
12671 (Symbol::set_got_offset): Likewise.
12672 (Symbol::has_tls_got_offset): Removed.
12673 (Symbol::tls_got_offset): Removed.
12674 (Symbol::set_tls_got_offset): Removed.
12675 (Symbol::got_offset_): Removed.
12676 (Symbol::tls_mod_got_offset_): Removed.
12677 (Symbol::tls_pair_got_offset_): Removed.
12678 (Symbol::got_offsets_): New field.
12679 (Symbol::has_got_offset): Removed.
12680 (Symbol::has_tls_mod_got_offset): Removed.
12681 (Symbol::has_tls_pair_got_offset): Removed.
12682 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12683 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12684 member functions.
12685 (Target_x86_64::Scan::global): Likewise.
12686 (Target_x86_64::Relocate::relocate): Likewise.
12687 (Target_x86_64::Relocate::relocate_tls): Likewise.
12688
12689 2008-03-25 Ben Elliston <bje@au.ibm.com>
12690
12691 * yyscript.y: Fix spelling error in comment.
12692
12693 2008-03-24 Ian Lance Taylor <iant@google.com>
12694
12695 * options.h (class General_options): Define build_id option.
12696 * layout.h (class Layout): Declare write_build_id, create_note,
12697 create_build_id. Add build_id_note_ member.
12698 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12699 "libiberty.h", "md5.h", "sha1.h".
12700 (Layout::Layout): Initialize eh_frame_data_,
12701 eh_frame_hdr_section_, and build_id_note_.
12702 (Layout::finalize): Call create_build_id.
12703 (Layout::create_note): New function, broken out of
12704 Layout::create_gold_note.
12705 (Layout::create_gold_note): Call create_note.
12706 (Layout::create_build_id): New function.
12707 (Layout::write_build_id): New function.
12708 (Close_task_runner::run): Call write_build_id.
12709
12710 * x86_64.cc: Correct license to GPLv3.
12711
12712 2008-03-23 Ian Lance Taylor <iant@google.com>
12713
12714 * options.cc: Include "demangle.h".
12715 (parse_optional_string): New function.
12716 (parse_long_option): Handle takes_optional_argument.
12717 (parse_short_option): Update dash_z initializer. Handle
12718 takes_optional_argument.
12719 (General_options::General_options): Initialize do_demangle_.
12720 (General_options::finalize): Set do_demangle_. Handle demangling
12721 style.
12722 * options.h (parse_optional_string): Declare.
12723 (struct One_option): Add optional_arg field. Update constructor.
12724 Update call constructor calls. Add takes_optional_argument
12725 function.
12726 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12727 (DEFINE_optional_string): Define.
12728 (General_options::demangle): Change from DEFINE_bool to
12729 DEFINE_optional_string.
12730 (General_options::no_demangle): New function.
12731 (General_options::do_demangle): New function.
12732 (General_options::set_do_demangle): New function.
12733 (General_options::execstack_status_): Move definition to end of
12734 class definition.
12735 (General_options::static_): Likewise.
12736 (General_options::do_demangle_): New field.
12737 * object.cc (big_endian>::get_symbol_location_info): Call
12738 Options::do_demangle, not Options::demangle.
12739 * symtab.cc (demangle): Likewise.
12740
12741 2008-03-22 Ian Lance Taylor <iant@google.com>
12742
12743 * gold.h: Include <cstddef> and <sys/types.h>
12744 * options.h: Include <cstring>.
12745
12746 2008-03-21 Ian Lance Taylor <iant@google.com>
12747
12748 * Added source code to GNU binutils.
This page took 0.320849 seconds and 4 git commands to generate.