daily update
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c1027032
CC
12012-03-21 Cary Coutant <ccoutant@google.com>
2
3 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4 * Makefile.in: Regenerate.
5 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
6 (Sized_elf_reloc_mapper::symbol_section): New function.
7 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
8 (make_elf_reloc_mapper): New function.
9 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
10 (Dwarf_abbrev_table::do_read_abbrevs): New function.
11 (Dwarf_abbrev_table::do_get_abbrev): New function.
12 (Dwarf_ranges_table::read_ranges_table): New function.
13 (Dwarf_ranges_table::read_range_list): New function.
14 (Dwarf_pubnames_table::read_section): New function.
15 (Dwarf_pubnames_table::read_header): New function.
16 (Dwarf_pubnames_table::next_name): New function.
17 (Dwarf_die::Dwarf_die): New function.
18 (Dwarf_die::read_attributes): New function.
19 (Dwarf_die::skip_attributes): New function.
20 (Dwarf_die::set_name): New function.
21 (Dwarf_die::set_linkage_name): New function.
22 (Dwarf_die::attribute): New function.
23 (Dwarf_die::string_attribute): New function.
24 (Dwarf_die::int_attribute): New function.
25 (Dwarf_die::uint_attribute): New function.
26 (Dwarf_die::ref_attribute): New function.
27 (Dwarf_die::child_offset): New function.
28 (Dwarf_die::sibling_offset): New function.
29 (Dwarf_info_reader::check_buffer): New function.
30 (Dwarf_info_reader::parse): New function.
31 (Dwarf_info_reader::do_parse): New function.
32 (Dwarf_info_reader::do_read_string_table): New function.
33 (Dwarf_info_reader::lookup_reloc): New function.
34 (Dwarf_info_reader::get_string): New function.
35 (Dwarf_info_reader::visit_compilation_unit): New function.
36 (Dwarf_info_reader::visit_type_unit): New function.
37 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
38 Sized_elf_reloc_mapper.
39 (Sized_dwarf_line_info::symbol_section): Remove function.
40 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
41 (Sized_dwarf_line_info::read_line_mappings): Remove object
42 parameter, adjust callers.
43 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
44 * dwarf_reader.h: Include <sys/types.h>.
45 (class Track_relocs): Remove forward declaration.
46 (class Elf_reloc_mapper): New class.
47 (class Sized_elf_reloc_mapper): New class.
48 (class Dwarf_abbrev_table): New class.
49 (class Dwarf_range_list): New class.
50 (class Dwarf_ranges_table): New class.
51 (class Dwarf_pubnames_table): New class.
52 (class Dwarf_die): New class.
53 (class Dwarf_info_reader): New class.
54 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
55 (Sized_dwarf_line_info::symbol_section): Remove member function.
56 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
57 base class.
58 * gdb-index.cc: New source file.
59 * gdb-index.h: New source file.
60 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
61 and .debug_types sections, call Layout::add_to_gdb_index.
62 (Sized_relobj_incr::do_section_name): Implement.
63 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
64 return type; Implement.
65 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
66 return type.
67 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
68 parameter list and return type.
69 (Sized_incr_dynobj::do_section_contents): Likewise.
70 * layout.cc: Include gdb-index.h.
71 (Layout::Layout): Initialize gdb_index_data_.
72 (Layout::init_fixed_output_section): Check for .gdb_index section.
73 (Layout::add_to_gdb_index): New function. Instantiate.
74 * layout.h: Add forward declaration for class Gdb_index.
75 (Layout::add_to_gdb_index): New member function.
76 (Layout::gdb_index_data_): New data member.
77 * main.cc: Include gdb-index.h.
78 (main): Print statistics for gdb index.
79 * object.cc (Object::section_contents): Move code into
80 do_section_contents.
81 (need_decompressed_section): Check for sections needed when building
82 gdb index.
83 (build_compressed_section_map): Likewise.
84 (Sized_relobj_file::do_read_symbols): Need local symbols when building
85 gdb index.
86 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
87 sections; call Layout::add_to_gdb_index.
88 (Sized_relobj_file::do_decompressed_section_contents): Call
89 do_section_contents directly.
90 * object.h (Object::do_section_contents): Adjust parameter list and
91 return type.
92 (Object::do_decompressed_section_contents): Call do_section_contents
93 directly.
94 (Sized_relobj_file::do_section_contents): Adjust parameter list and
95 return type.
96 * options.h (class General_options): Add --gdb-index option.
97 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
98 list and return type.
99 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
100 * reloc.h (Track_relocs::checkpoint): New function.
101 (Track_relocs::reset): New function.
102
103 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
104 New test cases.
105 * testsuite/Makefile.in: Regenerate.
106 * testsuite/gdb_index_test.cc: New test source file.
107 * testsuite/gdb_index_test_1.sh: New test source file.
108 * testsuite/gdb_index_test_2.sh: New test source file.
109
647f1574
DK
1102012-03-19 Doug Kwan <dougkwan@google.com>
111
112 * arm.cc (Target_arm::do_define_standard_symbols): New method.
113 (Target_arm::do_finalize_sections): Remove code which defines
114 __exidx_start and __exidx_end. Make symbol table parameter
115 anonymous as it is not used.
116 * gold.cc (queue_middle_tasks): Call target hook to define any
117 target-specific symbols.
118 * target.h (Target::define_standard_symbols): New method.
119 (Target::do_define_standard_symbols): Same.
120 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
121 * testsuite/Makefile.in: Regenerate.
122 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
123 and __exidx_end.
124 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
125 relocations are generated for __exidx_start and __exidx_end.
126
7c6109da
DK
1272012-03-16 Doug Kwan <dougkwan@google.com>
128
129 * testsuite/Makefile.am: Disable test initpri3b.
130 * testsuite/Makefile.in: Regenerate.
131
7b8957f8
DK
1322012-03-15 Doug Kwan <dougkwan@google.com>
133
134 * arm.cc (Target_arm::got_section): Make .got section read-only
135 if -z now is given.
136
14dc9ef7
ILT
1372012-03-15 Ian Lance Taylor <iant@google.com>
138
139 PR gold/13850
140 * layout.cc (Layout::make_output_section): Correctly mark
141 SHT_INIT_ARRAY, et. al., as relro.
142
fa40b62a
DK
1432012-03-14 Doug Kwan <dougkwan@google.com>
144
145 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
146 dynamic relocations for protected symbols in shared objects.
147
fd325007
ILT
1482012-03-13 Ian Lance Taylor <iant@google.com>
149
150 * resolve.cc (Symbol_table::resolve): When merging common symbols,
151 keep the larger alignment.
152
e8dd54e1
CC
1532012-03-12 Cary Coutant <ccoutant@google.com>
154
155 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
156 handling of DW_LNE_define_file.
157
feb5f3b0
CC
1582012-03-12 Cary Coutant <ccoutant@google.com>
159
160 * reduced_debug_output.cc
161 (Output_reduced_debug_info_section::get_die_end): Add new FORM
162 codes to switch.
163
a1fb4256
CC
1642012-02-29 Cary Coutant <ccoutant@google.com>
165
166 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
167
5dd8762a
CC
1682012-02-29 Cary Coutant <ccoutant@google.com>
169
170 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
171 Call Object::decompressed_section_contents.
172 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
173 New dtor.
174 (Sized_dwarf_line_info::buffer_start_): New data member.
175 * merge.cc (Output_merge_data::do_add_input_section): Call
176 Object::decompressed_section_contents.
177 (Output_merge_string::do_add_input_section): Likewise.
178 * object.cc (need_decompressed_section): New function.
179 (build_compressed_section_map): Decompress sections needed later.
180 (Sized_relobj_file::do_decompressed_section_contents): New function.
181 (Sized_relobj_file::do_discard_decompressed_sections): New function.
182 * object.h (Object::decompressed_section_contents): New function.
183 (Object::discard_decompressed_sections): New function.
184 (Object::do_decompressed_section_contents): New function.
185 (Object::do_discard_decompressed_sections): New function.
186 (Compressed_section_info): New type.
187 (Compressed_section_map): Include decompressed section contents.
188 (Sized_relobj_file::do_decompressed_section_contents): New function.
189 (Sized_relobj_file::do_discard_decompressed_sections): New function.
190
7b5de7ee
CC
1912012-02-16 Cary Coutant <ccoutant@google.com>
192
193 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
194 * testsuite/Makefile.in: Regenerate.
195
f9fa4a63
CC
1962012-02-14 Cary Coutant <ccoutant@google.com>
197
198 * options.cc (General_options::finalize): Disallow -pie and -static.
199
2c175ebc
DK
2002012-02-03 Doug Kwan <dougkwan@google.com>
201
202 * arm.cc (Arm_relocate_functions::abs8,
203 Arm_relocate_functions::abs16): Use
204 Bits::has_signed_unsigned_overflow32.
205 (Arm_relocate_functions::thm_abs8): Correct range of
206 overflow check.
207 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
208 in assertions.
209
90cff06f
DK
2102012-02-02 Doug Kwan <dougkwan@google.com>
211
212 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
213 position independent outputs, not just shared objects.
214
63887f3d
L
2152012-01-30 H.J. Lu <hongjiu.lu@intel.com>
216
217 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
218 * configure: Regenerated.
219
bef2b434
ILT
2202012-01-27 Ian Lance Taylor <iant@google.com>
221
222 * reloc.h (Bits): New class with static functions, copied from
223 namespace utils in arm.cc.
224 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
225 instead.
226
c335b55d
L
2272012-01-27 H.J. Lu <hongjiu.lu@intel.com>
228
229 * incremental.cc (write_info_blocks): Correct relocation offset.
230
41194d9f
L
2312012-01-27 H.J. Lu <hongjiu.lu@intel.com>
232
233 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
234 (Relocate::tls_gd_to_le): Likewise.
235
1bae613c
L
2362012-01-27 H.J. Lu <hongjiu.lu@intel.com>
237
238 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
239
24482ca0
L
2402012-01-27 H.J. Lu <hongjiu.lu@intel.com>
241
242 * configure.ac: Check if -mcmodel=medium works.
243 * configure: Regenerated.
244
c2c7840a
CC
2452012-01-24 Cary Coutant <ccoutant@google.com>
246
247 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
248 definition and ...
249 (read_unsigned_LEB_128_x): ... this new function.
250 (read_signed_LEB_128): Replaced with inline definition and ...
251 (read_signed_LEB_128_x): ... this new function.
252 * int_encoding.h (read_unsigned_LEB_128_x): New function.
253 (read_unsigned_LEB_128): Add inline definition.
254 (read_signed_LEB_128_x): New function.
255 (read_signed_LEB_128): Add inline definition.
256 * testsuite/Makefile.am (leb128_unittest): New unit test.
257 * testsuite/Makefile.in: Regenerate.
258 * testsuite/leb128_unittest.cc: New unit test.
259
833de760 2602012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
261
262 PR gold/13617
263 * i386.cc (Target_i386::do_code_fill): When using a jmp
264 instruction, pad with nop instructions.
265 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
266
618d6666
L
2672012-01-22 H.J. Lu <hongjiu.lu@intel.com>
268
269 * x86_64.cc (gc_process_relocs): Add typename on types used in
270 template.
271 (scan_relocs): Likewise.
272 (relocate_section): Likewise.
273 (apply_relocation): Likewise.
274
3660ff06
L
2752012-01-10 H.J. Lu <hongjiu.lu@intel.com>
276
277 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
278 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
279 under x32.
280
fc51264f
L
2812012-01-09 H.J. Lu <hongjiu.lu@intel.com>
282
283 * x86_64.cc: Initial support for x32.
284
dd74ae06
CC
2852012-01-03 Cary Coutant <ccoutant@google.com>
286
287 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
288 Use abstract base class for GOT.
289 * gold/output.h (class Output_data_got_base): New abstract base class.
290 (class Output_data_got): Derive from new base class, adjust ctors.
291 (Output_data_got::reserve_slot): Make virtual; rename to
292 do_reserve_slot; Adjust callers.
293 * gold/target.h (Sized_target::init_got_plt_for_update): Return
294 pointer to abstract base class.
295 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
296
83896202
ILT
2972011-12-18 Ian Lance Taylor <iant@google.com>
298
299 * object.h (Relobj::local_symbol_value): New function.
300 (Relobj::local_plt_offset): New function.
301 (Relobj::local_has_got_offset): New function.
302 (Relobj::local_got_offset): New function.
303 (Relobj::set_local_got_offset): New function.
304 (Relobj::do_local_symbol_value): New pure virtual function.
305 (Relobj::do_local_plt_offset): Likewise.
306 (Relobj::do_local_has_got_offset): Likewise.
307 (Relobj::do_local_got_offset): Likewise.
308 (Relobj::do_set_local_got_offset): Likewise.
309 (Sized_relobj::do_local_has_got_offset): Rename from
310 local_has_got_offset.
311 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
312 (Sized_relobj::do_set_local_got_offset): Rename from
313 set_local_got_offset.
314 (Sized_relobj_file::do_local_plt_offset): Rename from
315 local_plt_offset.
316 (Sized_relobj_file::do_local_symbol_value): New function.
317 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
318 local_plt_offset.
319 * output.cc (Output_data_got::Got_entry::write): Change object to
320 Relobj. Use local_symbol_value.
321 (Output_data_got::add_global_with_rel): Change rel_dyn to
322 Output_data_reloc_generic*. Use add_global_generic.
323 (Output_data_got::add_global_with_rela): Remove. Change all
324 callers to use add_global_with_rel.
325 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
326 Output_data_reloc_generic*. Use add_global_generic.
327 (Output_data_got::add_global_pair_with_rela): Remove. Change all
328 callers to use add_global_pair_with_rel.
329 (Output_data_got::add_local): Change object to Relobj*.
330 (Output_data_got::add_local_plt): Likewise.
331 (Output_data_got::add_local_with_rel): Change object to Relobj*,
332 change rel_dyn to Output_data_reloc_generic*. Use
333 add_local_generic.
334 (Output_data_got::add_local_with_rela): Remove. Change all
335 callers to use all_local_with_rel.
336 (Output_data_got::add_local_pair_with_rel): Change object to
337 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
338 add_output_section_generic.
339 (Output_data_got::add_local_pair_with_rela): Remove. Change all
340 callers to use add_local_pair_with_rel.
341 (Output_data_got::reserve_local): Change object to Relobj*.
342 * output.h: (class Output_data_reloc_generic): Add pure virtual
343 declarations for add_global_generic, add_local_generic,
344 add_output_section_generic.
345 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
346 functions for Output_data_reloc_generic. Update declarations for
347 changes listed in output.cc.
348 (class Output_data_got): Change template parameter to got_size.
349 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
350 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
351 function.
352 (Sized_relobj_incr::do_local_plt_offset): New function.
353 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
354 add_global_generic.
355
76677ad0
CC
3562011-12-17 Cary Coutant <ccoutant@google.com>
357
358 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
359 * resolve.cc (Symbol_table::resolve): Likewise.
360 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
361 arrays.
362 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
363
8b8dd8d5
ILT
3642011-12-16 Ian Lance Taylor <iant@google.com>
365
366 * output.h (Output_data_reloc_generic::add): Only call
367 add_dynamic_reloc if this is a dynamic reloc section.
368
d55525b9
L
3692011-12-15 H.J. Lu <hongjiu.lu@intel.com>
370
371 PR gold/13505
372 * target-reloc.h (apply_relocation): Replace <64, false> with
373 <size, big_endian>.
374
ff81c7c1
NC
3752011-11-25 Nick Clifton <nickc@redhat.com>
376
377 * po/it.po: New Italian translation.
378
628f39be
SA
3792011-11-17 Sterling Augustine <saugustine@google.com>
380
381 * script.cc (script_include_directive): Implement.
382 (read_script_file): New local variables name and search_path. Update
383 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
384 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
385 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
386
98ef3ea4
SA
3872011-11-11 Sterling Augustine <saugustine@google.com>
388
389 * yyscript.y (section_cmd): Add support for INCLUDE directive.
390 (file_or_sections_cmd): Likewise.
391
f4a8b6d7
DK
3922011-11-11 Doug Kwan <dougkwan@google.com>
393
394 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
395 if --just-symbols is given.
396
29ab395d
DK
3972011-11-10 Doug Kwan <dougkwan@google.com>
398
399 PR gold/13362
400 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
401 when processing data relocs.
402 * reloc.h (Relocate_functions::rel_unaligned): New method.
403 (Relocate_functions::pcrel_unaligned): Ditto.
404 (Relocate_functions::rel32_unaligned): Ditto.
405 (Relocate_functions::pcrel32_unaligned): Ditto.
406
2c339f71
DK
4072011-11-09 Doug Kwan <dougkwan@google.com>
408
409 PR gold/13362
410 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
411 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
412 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
413 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
414 (Relocate_functions::rel_unaligned): New.
415 (Relocate_functions::rel32_unaligned): New.
416 * target-reloc.h (relocate_for_relocatable): Add code to handle
417 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
418 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
419 arm_unaligned_reloc_r): New targets.
420 * testsuite/Makefile.in: Regenerate.
421 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
422 linking.
423
3f3cddf1
ILT
4242011-11-02 Ian Lance Taylor <iant@google.com>
425
426 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
427 NATIVE_LINKER.
428 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
429 * options.cc (General_options::finalize): Use library search path
430 from configure script if specified. If not native and no sysroot,
431 only search TOOLLIBDIR.
432 * options.h (Search_directory::Search_directory): Change name to
433 const std::string&.
434 (General_options::add_to_library_path_with_sysroot): Change arg to
435 const std::string&.
436 * configure, Makefile.in, config.in: Rebuild.
437
a8e2273b
ILT
4382011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
439
440 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
441 we are working around the ARM1176 Erratum.
442 * options.h (General_options::fix_arm1176): Add option.
443 * testsuite/Makefile.am: Add testcases, and keep current ones
444 working.
445 * testsuite/Makefile.in: Regenerate.
446 * testsuite/arm_fix_1176.s: New file.
447 * testsuite/arm_fix_1176.sh: Likewise.
448
cd6eab1c
ILT
4492011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
450
451 * arm.cc (Target_arm::Target_arm): Remove initialisation of
452 may_use_blx_.
453 (Target_arm::may_use_blx): Remove method.
454 (Target_arm::set_may_use_blx): Likewise.
455 (Target_arm::may_use_v4t_interworking): New method.
456 (Target_arm::may_use_v5t_interworking): Likewise.
457 (Target_arm::may_use_blx_): Remove member variable.
458 (Arm_relocate_functions::arm_branch_common): Check for v5T
459 interworking.
460 (Arm_relocate_functions::thumb_branch_common): Likewise.
461 (Reloc_stub::stub_type_for_reloc): Likewise.
462 (Target_arm::do_finalize_sections): Correct interworking checks.
463 * testsuite/Makefile.am: Add new tests.
464 * testsuite/Makefile.in: Regenerate.
465 * testsuite/arm_farcall_arm_arm.s: New test.
466 * testsuite/arm_farcall_arm_arm.sh: Likewise.
467 * testsuite/arm_farcall_arm_thumb.s: Likewise.
468 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
469 * testsuite/arm_farcall_thumb_arm.s: Likewise.
470 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
471 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
472 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
473
286adcf4
CC
4742011-10-31 Cary Coutant <ccoutant@google.com>
475
476 PR gold/13023
477 * expression.cc (Expression::eval_with_dot): Add
478 is_section_dot_assignment parameter.
479 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
480 absolute and assigning to dot within a section.
481 * script-sections.cc
482 (Output_section_element_assignment::set_section_addresses): Pass
483 dot_section to set_if_absolute.
484 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
485 as is_section_dot_assignment flag to eval_with_dot.
486 (Output_section_element_dot_assignment::set_section_addresses):
487 Likewise.
488 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
489 parameter. Also set value if relative to dot_section; set the
490 symbol's output_section.
491 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
492 parameter. Adjust all callers.
493 (Expression::eval_maybe_dot): Likewise.
494 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
495 Adjust all callers.
496 * testsuite/script_test_2.t: Test assignment of an absolute value
497 to dot within an output section element.
498
9634ed06
CC
4992011-10-31 Cary Coutant <ccoutant@google.com>
500
501 * options.h (class General_options): Add --[no-]gnu-unique options.
502 * symtab.cc (Symbol_table::sized_write_globals): Convert
503 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
504
de4101c7
CC
5052011-10-31 Cary Coutant <ccoutant@google.com>
506
507 PR gold/13359
508 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
509 unnecessary assertion.
510 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
511
7257cc92
ST
5122011-10-31 Sriraman Tallam <tmsriram@google.com>
513
514 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
515 gc_mark_symbol.
516 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
517 gc_mark_symbol.
518 Change to just keep the section associated with symbol.
519 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
520 they are externally visible and --export-dynamic is turned on.
521 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
522
bfc34b3f
ILT
5232011-10-19 Ian Lance Taylor <iant@google.com>
524
525 PR gold/13163
526 * script-sections.cc
527 (Output_section_element_dot_assignment::needs_output_section): New
528 function.
529
ea0d8c47
ILT
5302011-10-19 Ian Lance Taylor <iant@google.com>
531
532 PR gold/13204
533 * layout.cc (Layout::segment_precedes): Don't assert failure if a
534 --section-start option was seen.
535 * options.h (General_options::any_section_start): New function.
536
abd242a9
DM
5372011-10-18 David S. Miller <davem@davemloft.net>
538
539 PR binutils/13301
540 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
541 member to track relocation locations that have moved during TLS
542 reloc optimizations.
543 (Target_sparc::Relocate::Relocate): Initialize to NULL.
544 (Target_sparc::Relocate::relocate): Adjust view down by 4
545 bytes if it matches reloc_adjust_addr_.
546 (Target_sparc::Relocate::relocate_tls): Always move the
547 __tls_get_addr call delay slot instruction forward 4 bytes when
548 performing relaxation.
549
bab9090f
CC
5502011-10-18 Cary Coutant <ccoutant@google.com>
551
552 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
553 (Output_file::map_no_anonymous): Check for non-zero
554 return code from posix_fallocate.
555
f7c5b166
CC
5562011-10-17 Cary Coutant <ccoutant@google.com>
557
558 PR gold/13245
559 * plugin.cc (is_visible_from_outside): Check for symbols
560 referenced from dynamic objects.
561 * resolve.cc (Symbol_table::resolve): Don't count references
562 from dynamic objects as references from real ELF files.
563 * testsuite/plugin_test_2.sh: Adjust expected result.
564
b490c0bb
CC
5652011-10-17 Cary Coutant <ccoutant@google.com>
566
567 * gold.cc: Include timer.h.
568 (queue_middle_tasks): Stamp time.
569 (queue_final_tasks): Likewise.
570 * main.cc (main): Store timer in parameters. Print timers
571 for each pass.
572 * parameters.cc (Parameters::Parameters): Initialize timer_.
573 (Parameters::set_timer): New function.
574 (set_parameters_timer): New function.
575 * parameters.h (Parameters::set_timer): New function.
576 (Parameters::timer): New function.
577 (Parameters::timer_): New data member.
578 (set_parameters_timer): New function.
579 * timer.cc (Timer::stamp): New function.
580 (Timer::get_pass_time): New function.
581 * timer.h (Timer::stamp): New function.
582 (Timer::get_pass_time): New function.
583 (Timer::pass_times_): New data member.
584
f475cf7b
CC
5852011-10-17 Cary Coutant <ccoutant@google.com>
586
587 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
588 task for members of lib groups.
589
cdd7e244
CC
5902011-10-17 Cary Coutant <ccoutant@google.com>
591
592 PR gold/13288
4f95c8b4 593 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
594 (File_read::make_view): Move bounds check (replace with assert)...
595 (File_read::find_or_make_view): ... to here.
596
dfb45471
CC
5972011-10-12 Cary Coutant <ccoutant@google.com>
598
4f95c8b4 599 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
600 ::read returns less than requested size.
601
53bbcc1b
CC
6022011-10-10 Cary Coutant <ccoutant@google.com>
603
4f95c8b4 604 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
605 Initialize defined_count_.
606 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
607 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
608 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
609 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
610 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 611 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
612 member.
613 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 614 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
615 Return zeroes instead of internal error.
616
397b129b
CC
6172011-10-10 Cary Coutant <ccoutant@google.com>
618
619 PR gold/13249
4f95c8b4 620 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 621 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 622 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
623 (Output_reloc::type_): Adjust size of bit field.
624 (Output_reloc::use_plt_offset_): New bit field.
625 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
626 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
627 flag. Adjust all callers.
4f95c8b4 628 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
629 creating RELATIVE relocations.
630
d5698657
NC
6312011-10-10 Nick Clifton <nickc@redhat.com>
632
633 * po/es.po: Updated Spanish translation.
634 * po/fi.po: Updated Finnish translation.
635
6a59a5c2
DN
6362011-10-03 Diego Novillo <dnovillo@google.com>
637
638 * options.cc (parse_uint): Fix dereference of RETVAL.
639
f0558624
ST
6402011-09-29 Sriraman Tallam <tmsriram@google.com>
641
642 * layout.h (section_order_map_): New member.
643 (get_section_order_map): New member function.
644 * output.cc (Output_section::add_input_section): Check for patterns
645 only when --section-ordering-file is specified.
646 * gold.cc (queue_middle_tasks): Delay updating order of sections till
647 output_sections have been formed.
648 * layout.cc (Layout_Layout): Initialize section_order_map_.
649 * plugin.cc (update_section_order): Store order in order_map. Do not
650 update the order.
651 * testsuite/Makefile.am: Add test case for plugin_final_layout.
652 * testsuite/Makefile.in: Regenerate.
653 * testsuite/plugin_section_order.c: New file.
654 * testsuite/plugin_final_layout.cc: New file.
655 * testsuite/plugin_final_layout.sh: New file.
656
a7dac153
CC
6572011-09-29 Cary Coutant <ccoutant@google.com>
658
4f95c8b4 659 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 660 Check for NULL.
4f95c8b4 661 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
662 symbols during incremental update.
663 (Symbol_table::add_from_dynobj): Likewise.
664
eebd87a5
ILT
6652011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
666 Ian Lance Taylor <iant@google.com>
667
668 * symtab.cc (Symbol_table::define_special_symbol): Always
669 canonicalize version string.
670
403a3331
CC
6712011-09-26 Cary Coutant <ccoutant@google.com>
672
4f95c8b4
CC
673 * gold.cc (queue_initial_tasks): Move option checks ...
674 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
675 some options; make others fatal.
676
235061c2
CC
6772011-09-26 Cary Coutant <ccoutant@google.com>
678
679 gcc PR lto/47247
680 * plugin.cc (get_symbols_v2): New function.
681 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
682 (is_referenced_from_outside): New function.
683 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
684 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
685 (get_symbols): Pass version parameter.
686 (get_symbols_v2): New function.
687 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
688 parameter.
689 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
690 (onload): Add LDPT_GET_SYMBOLS_V2.
691 (all_symbols_read_hook): Use get_symbols_v2; check for
692 LDPR_PREVAILING_DEF_IRONLY_EXP.
693 * testsuite/plugin_test_3.sh: Update expected results.
694
dc87f620
ILT
6952011-09-23 Simon Baldwin <simonb@google.com>
696
697 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
698 configuration options.
699 * configure: Regenerate.
700 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
701 * Makefile.in: Regenerate.
702 * testsuite/Makefile.in: Regenerate.
703
a8279f82
ST
7042011-09-19 Sriraman Tallam <tmsriram@google.com>
705
706 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
707
0c9350c8
CC
7082011-09-19 Cary Coutant <ccoutant@google.com>
709
710 * incremental.cc (can_incremental_update): Fix typo in comment.
711 * incremental.h (can_incremental_update): Likewise.
712
aa06ae28
CC
7132011-09-18 Cary Coutant <ccoutant@google.com>
714
715 * incremental.cc (can_incremental_update): New function.
716 * incremental.h (can_incremental_update): New function.
717 * layout.cc (Layout::init_fixed_output_section): Call it.
718 (Layout::make_output_section): Don't allow patch space in .eh_frame.
719 * object.cc (Sized_relobj_file::do_layout): Call
720 can_incremental_update.
721
ebb300b2
CC
7222011-09-13 Cary Coutant <ccoutant@google.com>
723
724 * configure.ac: Check for glibc support for gnu_indirect_function
725 support with static linking, setting automake conditional
726 IFUNC_STATIC.
727 * Makefile.in: Regenerate.
728 * configure: Regenerate.
729
730 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
731 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
732 for IFUNC_STATIC.
733 * testsuite/Makefile.in: Regenerate.
734
1206d0d5
CC
7352011-09-13 Cary Coutant <ccoutant@google.com>
736
737 * incremental.cc (Sized_relobj_incr::do_layout): Call
738 report_comdat_group for kept comdat sections.
739 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
740 * testsuite/Makefile.in: Regenerate.
741 * testsuite/incr_comdat_test_1.cc: New source file.
742 * testsuite/incr_comdat_test_2_v1.cc: New source file.
743 * testsuite/incr_comdat_test_2_v2.cc: New source file.
744 * testsuite/incr_comdat_test_2_v3.cc: New source file.
745
40b29874
ILT
7462011-09-13 Ian Lance Taylor <iant@google.com>
747
748 * object.cc (Sized_relobj_file::do_layout): Remove unused local
749 variable external_symbols_offset.
750
1b045aac
ILT
7512011-09-12 Ian Lance Taylor <iant@google.com>
752
753 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
754 triggered if object has no symbols.
755
24c6c55a
DM
7562011-09-09 David S. Miller <davem@davemloft.net>
757
758 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
759 (Output_fill_debug_line::do_write): Likewise.
760
66570254
CC
7612011-08-29 Cary Coutant <ccoutant@google.com>
762
763 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
764 casts to match formatting specs.
765 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
766
8ea8cd50
CC
7672011-08-26 Cary Coutant <ccoutant@google.com>
768
769 * layout.cc (Free_list::allocate): Provide guarantee of minimum
770 remaining hole size when allocating.
771 (Layout::make_output_section): Set fill methods for debug sections.
772 * layout.h (Free_list::Free_list_node): Move from private to
773 public.
774 (Free_list::set_min_hole_size): New function.
775 (Free_list::begin, Free_list::end): New functions.
776 (Free_list::min_hole_): New data member.
777 * output.cc: Include dwarf.h.
778 (Output_fill_debug_info::do_minimum_hole_size): New function.
779 (Output_fill_debug_info::do_write): New function.
780 (Output_fill_debug_line::do_minimum_hole_size): New function.
781 (Output_fill_debug_line::do_write): New function.
782 (Output_section::Output_section): Initialize new data member.
783 (Output_section::set_final_data_size): Ensure patch space is larger
784 than minimum hole size.
785 (Output_section::do_write): Fill holes in debug sections.
786 * output.h (Output_fill): New class.
787 (Output_fill_debug_info): New class.
788 (Output_fill_debug_line): New class.
789 (Output_section::set_free_space_fill): New function.
790 (Output_section::free_space_fill_): New data member.
791 * testsuite/Makefile.am (incremental_test_3): Add
792 --incremental-patch option.
793 (incremental_test_4): Likewise.
794 (incremental_test_5): Likewise.
795 (incremental_test_6): Likewise.
796 (incremental_copy_test): Likewise.
797 (incremental_common_test_1): Likewise.
798 * testsuite/Makefile.in: Regenerate.
799
7cf80422
NC
8002011-08-26 Nick Clifton <nickc@redhat.com>
801
802 * po/es.po: Updated Spanish translation.
803
c3f7b0e5
CC
8042011-08-01 Cary Coutant <ccoutant@google.com>
805
806 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
807 * gold/testsuite/Makefile.in: Regenerate.
808 * gold/testsuite/justsyms_exec.c: New source file.
809 * gold/testsuite/justsyms_lib.c: New source file.
810
9590bf25
CC
8112011-08-01 Cary Coutant <ccoutant@google.com>
812
813 * layout.cc (Layout::set_segment_offsets): Don't realign text
814 segment if -Ttext was specified.
815 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
816 file type.
817 * object.h (Sized_relobj_file::e_type): New function.
818 (Sized_relobj_file::e_type_): New data member.
819 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
820 base address for ET_EXEC files.
821 * target.cc (Target::do_make_elf_object_implementation): Allow
822 ET_EXEC files with --just-symbols option.
823
dcd8d12e
CC
8242011-07-28 Cary Coutant <ccoutant@google.com>
825
826 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
827 Add thread_number parameter.
828 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
829 * workqueue-threads.cc
830 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
831 current thread if its thread number is greater than desired thread
832 count.
833 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
834 Add thread_number parameter.
835 (Workqueue::should_cancel_thread): Likewise.
836 (Workqueue::find_runnable_or_wait): Pass thread_number to
837 should_cancel_thread.
838 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
839 parameter.
840
804eb480
ST
8412011-07-22 Sriraman Tallam <tmsriram@google.com>
842
843 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
844 only after checking if it cannot be forced local.
845 * symtab.h (is_externally_visible): Check if the symbol is not forced
846 local.
847
f1ddb600
ILT
8482011-07-15 Ian Lance Taylor <iant@google.com>
849
850 * options.h (class General_options): Add --print-output-format.
851 Move -EL next to -EB, for better --help output.
852 * target-select.cc: Include <cstdio>, "options.h", and
853 "parameters.h".
854 (Target_selector::do_target_bfd_name): New function.
855 (print_output_format): New function.
856 * target-select.h (class Target_selector): Update declarations.
857 (Target_selector::target_bfd_name): New function.
858 (print_output_format): Declare.
859 * main.cc: Include "target-select.h".
860 (main): Handle --print-output-format.
861 * gold.cc: Include "target-select.h".
862 (queue_initial_tasks): Handle --print-output-format when there are
863 no input files.
864 * parameters.cc (parameters_force_valid_target): Give a better
865 error message if -EB/-EL does not match target.
866 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
867 function.
868
7d172687
ILT
8692011-07-15 Ian Lance Taylor <iant@google.com>
870
871 * i386.cc (class Output_data_plt_i386): Add layout_ field.
872 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
873 (Output_data_plt_i386::do_write): Write address of .dynamic
874 section to first entry in .got.plt section.
875 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
876 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
877 Initialize layout_.
878 (Output_data_plt_x86_64::do_write): Write address of .dynamic
879 section to first entry in .got.plt section.
880 * layout.h (Layout::dynamic_section): New function.
881
e9552f7e
ST
8822011-07-13 Sriraman Tallam <tmsriram@google.com>
883
884 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
885 to claim_file call.
886 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
887 input_section_position_, and input_section_glob_.
888 (read_layout_from_file): Call function section_ordering_specified.
889 * layout.h (is_section_ordering_specified): New function.
890 (section_ordering_specified): New function.
891 (section_ordering_specified_): New boolean member.
892 * main.cc(main): Call load_plugins after layout object is defined.
893 * output.cc (Output_section::add_input_section): Use
894 function section_ordering_specified to check if section ordering is
895 needed.
896 * output.cc (Output_section::add_relaxed_input_section): Use
897 function section_ordering_specified to check if section ordering is
898 needed.
899 (Output_section::update_section_layout): New function.
900 (Output_section::sort_attached_input_sections): Check if input section
901 must be reordered.
902 * output.h (Output_section::update_section_layout): New function.
903 * plugin.cc (get_section_count): New function.
904 (get_section_type): New function.
905 (get_section_name): New function.
906 (get_section_contents): New function.
907 (update_section_order): New function.
908 (allow_section_ordering): New function.
909 (Plugin::load): Add the new interfaces to the transfer vector.
910 (Plugin_manager::load_plugins): New parameter.
911 (Plugin_manager::all_symbols_read): New parameter.
912 (Plugin_manager::claim_file): New parameter. Save the elf object for
913 unclaimed objects.
914 (Plugin_manager::get_elf_object): New function.
915 (Plugin_manager::get_view): Change to directly use the bool to check
916 if get_view is called from claim_file_hook.
917 * plugin.h (input_objects): New function
918 (Plugin__manager::load_plugins): New parameter.
919 (Plugin_manager::claim_file): New parameter.
920 (Plugin_manager::get_elf_object): New function.
921 (Plugin_manager::in_claim_file_handler): New function.
922 (Plugin_manager::in_claim_file_handler_): New member.
923 (layout): New function.
924 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
925 handler with an extra parameter. Make the elf object before calling
926 claim_file handler.
927 * testsuite/plugin_test.c (get_section_count): New function pointer.
928 (get_section_type): New function pointer.
929 (get_section_name): New function pointer.
930 (get_section_contents): New function pointer.
931 (update_section_order): New function pointer.
932 (allow_section_ordering): New function pointer.
933 (onload): Check if the new interfaces exist.
934
9446efde
ILT
9352011-07-13 Ian Lance Taylor <iant@google.com>
936
937 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
938 relro section.
939 * x86_64.cc (Target_x86_64::got_section): Likewise.
940 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
941 (relro_now_test_SOURCES): New variable.
942 (relro_now_test_DEPENDENCIES): New variable.
943 (relro_now_test_LDFLAGS): New variable.
944 (relro_now_test_LDADD): New variable.
945 (relro_now_test.so): New target.
946 * testsuite/Makefile.in: Rebuild.
947
07aa62f2
ILT
9482011-07-12 Ian Lance Taylor <iant@google.com>
949
950 PR gold/12980
951 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
952 GLOB_DAT relocation rather than a RELATIVE relocation for a
953 protected symbol when creating a shared library.
954 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
955 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
956 * testsuite/protected_main_1.cc (main): Test that protected
957 function has same address.
958
e2153196
ILT
9592011-07-11 Ian Lance Taylor <iant@google.com>
960
961 PR gold/12979
962 * options.h (class General_options): Add -Bgroup.
963 * options.cc (General_options::finalize): If -Bgroup is set,
964 default to --unresolved-symbols=report-all.
965 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
966 * target-reloc.h (issue_undefined_symbol_error): Handle
967 --unresolved-symbols=report-all.
968
6daf5215
ILT
9692011-07-08 Ian Lance Taylor <iant@google.com>
970
971 PR gold/11985
972 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
973 if linker script discards key sections.
974 (Layout::create_dynamic_symtab): Likewise.
975 (Layout::assign_local_dynsym_offsets): Likewise.
976 (Layout::sized_create_version_sections): Likewise.
977 (Layout::create_interp): Likewise.
978 (Layout::finish_dynamic_section): Likewise.
979 (Layout::set_dynamic_symbol_size): Likewise.
980
beabb2c6
ILT
9812011-07-08 Ian Lance Taylor <iant@google.com>
982
983 PR gold/12386
984 * options.h (class General_options): Add --unresolved-symbols.
985 * target-reloc.h (issue_undefined_symbol_error): Check
986 --unresolved-symbols. Add comments.
987
9c16daf1
ILT
9882011-07-08 Ian Lance Taylor <iant@google.com>
989
990 * testsuite/odr_violation2.cc (Ordering::operator()): Make
991 expression more complex.
992
191f1a2d
ILT
9932011-07-08 Ian Lance Taylor <iant@google.com>
994
995 PR gold/11317
996 * target-reloc.h (issue_undefined_symbol_error): New inline
997 function, broken out of relocate_section.
998 (relocate_section): Call issue_undefined_symbol_error.
999 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1000 there is no TLS segment if we are about to issue an undefined
1001 symbol error.
1002 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1003
62855347
ILT
10042011-07-08 Ian Lance Taylor <iant@google.com>
1005
1006 PR gold/12279
1007 * resolve.cc (Symbol_table::should_override): Add fromtype
1008 parameter. Change all callers. Give error when linking together
1009 TLS and non-TLS symbol.
1010 (Symbol_table::should_override_with_special): Add fromtype
1011 parameter. Change all callers.
1012 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1013 there is no TLS segment if we have reported some errors.
1014 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1015
67181c72
ILT
10162011-07-08 Ian Lance Taylor <iant@google.com>
1017
1018 PR gold/12372
1019 * target.h (Target::plt_address_for_global): New function.
1020 (Target::plt_address_for_local): New function.
1021 (Target::plt_section_for_global): Remove.
1022 (Target::plt_section_for_local): Remove.
1023 (Target::do_plt_address_for_global): New virtual function.
1024 (Target::do_plt_address_for_local): New virtual function.
1025 (Target::do_plt_section_for_global): Remove.
1026 (Target::do_plt_section_for_local): Remove.
1027 (Target::register_global_plt_entry): Add Symbol_table and Layout
1028 parameters.
1029 * output.cc (Output_data_got::Got_entry::write): Use
1030 plt_address_for_global and plt_address_for_local.
1031 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1032 address of output section.
1033 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1034 got_irelative_, and irelative_count_ fields. Update
1035 declarations.
1036 (Output_data_plt_i386::has_irelative_section): New function.
1037 (Output_data_plt_i386::entry_count): Add irelative_count_.
1038 (Output_data_plt_i386::set_final_data_size): Likewise.
1039 (class Target_i386): Add got_irelative_ and rel_irelative_
1040 fields. Update declarations.
1041 (Target_i386::Target_i386): Initialize new fields.
1042 (Target_i386::do_plt_address_for_global): New function replacing
1043 do_plt_section_for_global.
1044 (Target_i386::do_plt_address_for_local): New function replacing
1045 do_plt_section_for_local.
1046 (Target_i386::got_section): Create got_irelative_.
1047 (Target_i386::rel_irelative_section): New function.
1048 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1049 fields. Don't define __rel_iplt_{start,end}.
1050 (Output_data_plt_i386::add_entry): Add symtab and layout
1051 parameters. Change all callers. Use different PLT and GOT for
1052 IFUNC symbols.
1053 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1054 layout parameters. Change all callers. Use different PLT and
1055 GOT.
1056 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1057 (Output_data_plt_i386::rel_irelative): New function.
1058 (Output_data_plt_i386::address_for_global): New function.
1059 (Output_data_plt_i386::address_for_local): New function.
1060 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1061 IRELATIVE GOT when changing IFUNC GOT entries.
1062 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1063 reloc.
1064 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1065 if we didn't create an IRELATIVE GOT.
1066 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1067 plt_address_for_local.
1068 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1069 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1070 got_irelative_, and irelative_count_ fields. Update
1071 declarations.
1072 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1073 Initialize new fields. Remove symtab parameter. Change all
1074 callers.
1075 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1076 irelative_count_.
1077 (Output_data_plt_x86_64::has_irelative_section): New function.
1078 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1079 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1080 fields. Update declarations.
1081 (Target_x86_64::Target_x86_64): Initialize new fields.
1082 (Target_x86_64::do_plt_address_for_global): New function replacing
1083 do_plt_section_for_global.
1084 (Target_x86_64::do_plt_address_for_local): New function replacing
1085 do_plt_section_for_local.
1086 (Target_x86_64::got_section): Create got_irelative_.
1087 (Target_x86_64::rela_irelative_section): New function.
1088 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1089 all callers. Don't create __rel_iplt_{start,end}.
1090 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1091 parameters. Change all callers. Use different PLT and GOT for
1092 IFUNC symbols.
1093 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1094 layout parameters. Change all callers. Use different PLT and
1095 GOT.
1096 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1097 parameters. Change all callers. Use different PLT and GOT for
1098 IFUNC symbols.
1099 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1100 (Output_data_plt_x86_64::rela_irelative): New function.
1101 (Output_data_plt_x86_64::address_for_global): New function.
1102 (Output_data_plt_x86_64::address_for_local): New function.
1103 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1104 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1105 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1106 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1107 parameters.
1108 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1109 reloc.
1110 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1111 symbols if we didn't create an IRELATIVE GOT.
1112 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1113 plt_address_for_local.
1114 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1115 * testsuite/ifuncvar1.c: New test file.
1116 * testsuite/ifuncvar2.c: New test file.
1117 * testsuite/ifuncvar3.c: New test file.
1118 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1119 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1120 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1121 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1122 * testsuite/Makefile.in: Rebuild.
1123
33c15b45
CC
11242011-07-07 Cary Coutant <ccoutant@google.com>
1125
1126 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1127 (two_file_test_1_ndebug.o): Likewise.
1128 (two_file_test_1b_ndebug.o): Likewise.
1129 (two_file_test_2_ndebug.o): Likewise.
1130 (two_file_test_main_ndebug.o): Likewise.
1131 (incremental_test_2): Link with no-debug versions.
1132
f48b5fb7
CC
11332011-07-06 Cary Coutant <ccoutant@google.com>
1134
1135 * gold/incremental.cc
1136 (Output_section_incremental_inputs::write_info_blocks): Check for
1137 hidden and internal symbols.
1138
221597a5
CC
11392011-07-06 Cary Coutant <ccoutant@google.com>
1140
1141 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1142 Check disposition for startup file.
1143 (Incremental_inputs::report_command_line): Ignore
1144 --incremental-startup-unchanged option.
1145 * options.cc (General_options::parse_incremental_startup_unchanged):
1146 New function.
1147 (General_options::General_options): Initialize new data member.
1148 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1149 (General_options): Add --incremental-startup-unchanged option.
1150 (General_options::incremental_startup_disposition): New function.
1151 (General_options::incremental_startup_disposition_): New data member.
1152
e24719f6
CC
11532011-07-06 Cary Coutant <ccoutant@google.com>
1154
1155 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1156 input file index to Script_info ctor.
1157 (Sized_incremental_binary::do_file_has_changed): Find the
1158 command-line argument for files named in scripts.
1159 * incremental.h (Script_info::Script_info): New ctor
1160 with input file index.
1161 (Script_info::input_file_index): New function.
1162 (Script_info::input_file_index_): New data member.
1163 (Incremental_binary::get_library): Add const.
1164 (Incremental_binary::get_script_info): Add const.
1165 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1166 * testsuite/Makefile.am (incremental_test_5): New test case.
1167 (incremental_test_6): New test case.
1168 * testsuite/Makefile.in: Regenerate.
1169
8f7c81e8
CC
11702011-07-06 Cary Coutant <ccoutant@google.com>
1171
1172 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1173 debug output when command lines differ.
1174
9fbd3822
CC
11752011-07-06 Cary Coutant <ccoutant@google.com>
1176
1177 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1178 --incremental-patch option.
1179 * layout.cc (Free_list::allocate): Extend allocation beyond original
1180 end if enabled.
1181 (Layout::make_output_section): Mark sections that should get
1182 patch space.
1183 * options.cc (parse_percent): New function.
1184 * options.h (parse_percent): New function.
1185 (DEFINE_percent): New macro.
1186 (General_options): Add --incremental-patch option.
1187 * output.cc (Output_section::Output_section): Initialize new data
1188 members.
1189 (Output_section::add_input_section): Print section name when out
1190 of patch space.
1191 (Output_section::add_output_section_data): Likewise.
1192 (Output_section::set_final_data_size): Add patch space when
1193 doing --incremental-full.
1194 (Output_section::do_reset_address_and_file_offset): Remove patch
1195 space.
1196 (Output_segment::set_section_list_addresses): Print debug output
1197 only if --incremental-update.
1198 * output.h (Output_section::set_is_patch_space_allowed): New function.
1199 (Output_section::is_patch_space_allowed_): New data member.
1200 (Output_section::patch_space_): New data member.
1201 * parameters.cc (Parameters::incremental_full): New function.
1202 * parameters.h (Parameters::incremental_full): New function
1203 * testsuite/Makefile.am (incremental_test_2): Add test for
1204 --incremental-patch option.
1205 * testsuite/Makefile.in: Regenerate.
1206 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1207 (t18): Remove function body.
1208
f6cccc2c
DK
12092011-07-05 Doug Kwan <dougkwan@google.com>
1210
1211 PR gold/12771
1212 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1213 Arm_Address type for relocation result.
1214 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1215 overflow check.
1216 (Arm_relocate_functions::abs32): Use unaligned access.
1217 (Arm_relocate_functions::rel32): Ditto.
1218 (Arm_relocate_functions::prel31): Ditto.
1219 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1220 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1221 static data relocations.
1222 * testsuite/Makefile.in: Regnerate.
1223 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1224
28a13fec
ILT
12252011-07-05 Ian Lance Taylor <iant@google.com>
1226
1227 PR gold/12392
1228 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1229 symbols if necessary.
1230 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1231
24d47b34
ILT
12322011-07-05 Ian Lance Taylor <iant@google.com>
1233
1234 PR gold/12952
1235 * resolve.cc (Symbol::override_base_with_special): Simply override
1236 version with special symbol version, ignoring previous version.
1237
41f9cbbe
ILT
12382011-07-05 Ian Lance Taylor <iant@google.com>
1239
1240 * object.cc (Sized_relobj_file::include_section_group): Add
1241 information to comment about signature location.
1242
886288f1
ILT
12432011-07-02 Ian Lance Taylor <iant@google.com>
1244
1245 PR gold/12957
1246 * options.h (class General_options): Add -f and -F.
1247 * options.cc (General_options::finalize): Fatal error if -f/-F
1248 are used without -shared.
1249 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1250
ae3a6d4f
ILT
12512011-07-02 Ian Lance Taylor <iant@google.com>
1252
1253 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1254
21131061
ILT
12552011-07-01 Ian Lance Taylor <iant@google.com>
1256
1257 PR gold/12525
1258 PR gold/12952
1259 * resolve.cc (Symbol::override_base_with_special): Don't override
1260 the version if the overriding symbol has a different name.
1261 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1262 all callers. If we give an error about an undefined version,
1263 define the base version if necessary.
1264 * dynobj.h (class Versions): Update declaration.
1265 * testsuite/weak_alias_test_5.cc: New file.
1266 * testsuite/weak_alias_test.script: New file.
1267 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1268 and versioned_alias have the right value, and call t2.
1269 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1270 weak_alias_test_5.so.
1271 (weak_alias_test_LDADD): Likewise.
1272 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1273 * testsuite/Makefile.in: Rebuild.
1274
611062c0
ILT
12752011-07-01 Ian Lance Taylor <iant@google.com>
1276
1277 PR gold/12525
1278 * options.h (class General_options): Support -z notext.
1279 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1280 -Wl,-z,notext.
1281 (two_file_shared_nonpic.so): Likewise.
1282 (two_file_shared_mixed.so): Likewise.
1283 (two_file_shared_mixed_1.so): Likewise.
1284 (weak_undef_lib_nonpic.so): Likewise.
1285 (alt/weak_undef_lib_nonpic.so): Likewise.
1286 (tls_test_shared_nonpic.so): Likewise.
1287 * testsuite/Makefile.in: Rebuild.
1288
328c7c2f
ILT
12892011-07-01 Ian Lance Taylor <iant@google.com>
1290
1291 PR gold/12525
1292 * configure.ac: Test whether static linking works, setting
1293 the automake conditional HAVE_STATIC.
1294 * testsuite/Makefile.am: Disable tests using -static if
1295 HAVE_STATIC is not true.
1296 * configure, testsuite/Makefile.in: Rebuild.
1297
02d7cd44
ILT
12982011-07-01 Ian Lance Taylor <iant@google.com>
1299
1300 PR gold/12525
1301 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1302 Assert if we see DW_EH_PE_indirect.
1303 * target.h (Target::ehframe_datarel_base): New function.
1304 (Target::do_ehframe_datarel_base): New target function.
1305 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1306 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1307 function.
1308
07a60597
ILT
13092011-07-01 Ian Lance Taylor <iant@google.com>
1310
1311 PR gold/12571
1312 * options.h (class General_options): Add
1313 --ld-generated-unwind-info.
1314 * ehframe.cc (Fde::write): Add address parameter. Change all
1315 callers. If associated with PLT, fill in address and size.
1316 (Cie::set_output_offset): Only add merge mapping if there is an
1317 object.
1318 (Cie::write): Add address parameter. Change all callers.
1319 (Eh_frame::add_ehframe_for_plt): New function.
1320 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1321 input_offset_ fields into union u_, with new plt field.
1322 (Fde::Fde): Adjust for new union field.
1323 (Fde::Fde) [Output_data version]: New constructor.
1324 (Fde::add_mapping): Only add merge mapping if there is an object.
1325 (class Cie): Update declarations.
1326 (class Eh_frame): Declare add_ehframe_for_plt.
1327 * layout.cc (Layout::layout_eh_frame): Break out code into
1328 make_eh_frame_section, and call it.
1329 (Layout::make_eh_frame_section): New function.
1330 (Layout::add_eh_frame_for_plt): New function.
1331 * layout.h (class Layout): Update declarations.
1332 * merge.cc (Merge_map::add_mapping): Add assertion.
1333 * i386.cc: Include "dwarf.h".
1334 (class Output_data_plt_i386): Make first_plt_entry,
1335 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1336 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1337 and plt_eh_frame_fde.
1338 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1339 boundary. Call add_eh_frame_for_plt if appropriate.
1340 * x86_64.cc: Include "dwarf.h".
1341 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1342 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1343 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1344 and plt_eh_frame_fde.
1345 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1346 appropriate.
1347
14788a3f
ILT
13482011-06-29 Ian Lance Taylor <iant@google.com>
1349
1350 PR gold/12629
1351 * object.cc (Sized_relobj_file::layout_section): Change shdr
1352 parameter to be const.
1353 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1354 out of do_layout.
1355 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1356 appropriate. Call layout_eh_frame_section.
1357 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1358 sections.
1359 * object.h (class Sized_relobj_file): Update declarations.
1360
6c21fce1
ILT
13612011-06-29 Ian Lance Taylor <iant@google.com>
1362
37e41b03 1363 PR gold/12652
6c21fce1
ILT
1364 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1365 modifier.
1366 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1367
4d5e4e62
ILT
13682011-06-29 Ian Lance Taylor <iant@google.com>
1369
1370 PR gold/12675
1371 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1372 SHT_X86_64_UNWIND.
1373 * layout.cc (Layout::layout_eh_frame): Likewise.
1374
886f533a
ILT
13752011-06-29 Ian Lance Taylor <iant@google.com>
1376
1377 PR gold/12695
1378 * layout.cc (Layout::symtab_section_shndx): New function.
1379 * layout.h (class Layout): Declare symtab_section_shndx.
1380 * output.cc (Output_section::write_header): Call it.
1381
f3ae1b28
ILT
13822011-06-29 Ian Lance Taylor <iant@google.com>
1383
1384 PR gold/12818
1385 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1386 symbols which are not used in a relocation.
1387
aecf301f
ILT
13882011-06-28 Ian Lance Taylor <iant@google.com>
1389
1390 PR gold/12898
1391 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1392 script create indistinguishable segments.
1393 (Layout::set_segment_offsets): Use stable_sort when sorting
1394 segments. Pass this to Compare_segments constructor.
1395 * layout.h (class Layout): Make segment_precedes non-static.
1396 (class Compare_segments): Change from struct to class. Add
1397 layout_ field. Add constructor.
1398 * script-sections.cc
1399 (Script_sections::attach_sections_using_phdrs_clause): Rename
1400 local orphan to is_orphan. Don't report failure to put empty
1401 section in segment. On attachment failure, report name of
1402 section, and attach to first PT_LOAD segment.
1403
03ef7571
ILT
14042011-06-28 Ian Lance Taylor <iant@google.com>
1405
1406 PR gold/12934
1407 * target-select.cc (Target_selector::Target_selector): Add
1408 emulation parameter. Change all callers.
1409 (select_target_by_bfd_name): Rename from select_target_by_name.
1410 Change all callers.
1411 (select_target_by_emulation): New function.
1412 (supported_emulation_names): New function.
1413 * target-select.h (class Target_selector): Add emulation_ field.
1414 Update declarations.
1415 (Target_selector::recognize_by_bfd_name): Rename from
1416 recognize_by_name. Change all callers.
1417 (Target_selector::supported_bfd_names): Rename from
1418 supported_names. Change all callers.
1419 (Target_selector::recognize_by_emulation): New function.
1420 (Target_selector::supported_emulations): New function.
1421 (Target_selector::emulation): New function.
1422 (Target_selector::do_recognize_by_bfd_name): Rename from
1423 do_recognize_by_name. Change all callers.
1424 (Target_selector::do_supported_bfd_names): Rename from
1425 do_supported_names. Change all callers.
1426 (Target_selector::do_recognize_by_emulation): New function.
1427 (Target_selector::do_supported_emulations): New function.
1428 (select_target_by_bfd_name): Change name in declaration.
1429 (select_target_by_emulation): Declare.
1430 (supported_emulation_names): Declare.
1431 * parameters.cc (parameters_force_valid_target): Try to find
1432 target based on emulation from -m option.
1433 * options.h (class General_options): Change doc string for -m.
1434 * options.cc (help): Print emulations.
1435 (General_options::parse_V): Likewise.
1436 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1437 Add emulation parameter. Change all callers.
1438
200b2bb9
ILT
14392011-06-28 Ian Lance Taylor <iant@google.com>
1440
1441 * target.h (class Target): Add osabi_ field.
1442 (Target::osabi): New function.
1443 (Target::set_osabi): New function.
1444 (Target::Target): Initialize osabi_.
1445 (Target::do_adjust_elf_header): Make pure virtual.
1446 (Sized_target::do_adjust_elf_header): Declare.
1447 * target.cc (Sized_target::do_adjust_elf_header): New function.
1448 (class Sized_target): Instantiate all versions.
1449 * freebsd.h (class Target_freebsd): Remove.
1450 (Target_selector_freebsd::do_recognize): Call set_osabi on
1451 Target.
1452 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1453 (Target_selector_freebsd::set_osabi): Remove.
1454 * i386.cc (class Target_i386): Inherit from Sized_target rather
1455 than Target_freebsd.
1456 * x86_64.cc (class Target_x86_64): Likewise.
1457
b3ce541e
ILT
14582011-06-28 Ian Lance Taylor <iant@google.com>
1459
1460 * target.h (Target::can_check_for_function_pointers): Rewrite.
1461 Make non-virtual.
1462 (Target::can_icf_inline_merge_sections): Likewise.
1463 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1464 (Target::Target_info): Add can_icf_inline_merge_sections field.
1465 (Target::do_can_check_for_function_pointers): New virtual
1466 function.
1467 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1468 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1469 from can_check_for_function_pointers, move in file.
1470 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1471 section_may_have_icf_unsafe_poineters, move in file.
1472 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1473 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1474 Rename from can_check_for_function_pointers, move in file.
1475 (Target_i386::can_icf_inline_merge_sections): Remove.
1476 (Target_i386::i386_info): Initialize
1477 can_icf_inline_merge_sections.
1478 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1479 Initialize can_icf_inline_merge_sections.
1480 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1481 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1482 Rename from can_check_for_function_pointers, move in file.
1483 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1484 (Target_x86_64::x86_64_info): Initialize
1485 can_icf_inline_merge_sections.
1486 * testsuite/testfile.cc (Target_test::test_target_info):
1487 Likewise.
1488 * icf.cc (get_section_contents): Correct formatting.
1489
6d1c4efb
ILT
14902011-06-27 Ian Lance Taylor <iant@google.com>
1491
1492 * symtab.cc (Symbol::versioned_name): New function.
1493 (Symbol_table::add_to_final_symtab): Use versioned_name when
1494 appropriate.
1495 (Symbol_table::sized_write_symbol): Likewise.
1496 * symtab.h (class Symbol): Declare versioned_name.
1497 * stringpool.h (class Stringpool_template): Add variant of add
1498 which takes a std::basic_string.
1499 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1500 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1501 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1502 (ver_test_12.o): New target.
1503 * testsuite/Makefile.in: Rebuild.
1504
57eb9b50
DK
15052011-06-27 Doug Kwan <dougkwan@google.com>
1506
1507 * arm.cc (Arm_relocate_functions::thm_jump8,
1508 Arm_relocate_functions::thm_jump11): Use a wider signed
1509 type to compute offset.
1510 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1511 arm_thm_jump8.
1512 * testsuite/Makefile.in: Regenerate.
1513 * testsuite/arm_branch_in_range.sh: Check test results of
1514 arm_thm_jump11 and arm_thm_jump8.
1515 * testsuite/arm_thm_jump11.s: New test source file.
1516 * testsuite/arm_thm_jump11.t: New linker script.
1517 * testsuite/arm_thm_jump8.s: New test source file.
1518 * testsuite/arm_thm_jump8.t: New linker script.
1519
487b39df
ILT
15202011-06-24 Ian Lance Taylor <iant@google.com>
1521
1522 * layout.cc: Include "object.h".
1523 (ctors_sections_in_init_array): New static variable.
1524 (Layout::is_ctors_in_init_array): New function.
1525 (Layout::layout): Add entry to ctors_sections_in_init_array if
1526 appropriate.
1527 * layout.h (class Layout): Declare is_ctors_in_init_array.
1528 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1529 is_ctors_reverse_view is set.
1530 (Sized_relobj_file::write_sections): Add layout parameter. Change
1531 all callers. Set is_ctors_reverse_view field of View_size.
1532 (Sized_relobj_file::reverse_words): New function.
1533 * object.h (Sized_relobj_file::View_size): Add
1534 is_ctors_reverse_view field.
1535 (class Sized_relobj_file): Update declarations.
1536 * testsuite/initpri3.c: New test.
1537 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1538 initpri3b.
1539 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1540 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1541 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1542 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1543 * testsuite/Makefile.in: Rebuild.
1544
472076e4
CC
15452011-06-24 Cary Coutant <ccoutant@google.com>
1546
1547 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1548 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1549 (debug_msg_cdebug.err): New targets.
1550 * testsuite/Makefile.in: Regenerate.
1551 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1552 Fix checks for link with shared library.
1553
a60af0db
DK
15542011-06-24 Doug Kwan <dougkwan@google.com>
1555
1556 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1557 skip empty text sections.
1558 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1559
5393d741
ILT
15602011-06-22 Ian Lance Taylor <iant@google.com>
1561
1562 PR gold/12910
1563 * options.h (class General_options): Add --ctors-in-init-array.
1564 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1565 friends as SHT_PROGBITS for merging sections.
1566 (Layout::layout): Remove special handling of .init_array and
1567 friends. Don't sort if doing relocatable link. Sort for .ctors
1568 and .dtors if ctors_in_init_array.
1569 (Layout::make_output_section): Force correct section types for
1570 .init_array and friends. Don't sort if doing relocatable link,
1571 Don't sort .ctors and .dtors if ctors_in_init_array.
1572 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1573 (Layout::output_section_name): Add relobj parameter. Change all
1574 callers. Handle .ctors. and .dtors. in code rather than table.
1575 Handle .ctors and .dtors if ctors_in_init_array.
1576 (Layout::match_file_name): New function, moved from output.cc.
1577 * layout.h (class Layout): Update declarations.
1578 * output.cc: Include "layout.h".
1579 (Input_section_sort_entry::get_priority): New function.
1580 (Input_section_sort_entry::match_file_name): Just call
1581 Layout::match_file_name.
1582 (Output_section::Input_section_sort_init_fini_compare::operator()):
1583 Handle .ctors and .dtors. Sort by explicit priority rather than
1584 by name.
1585 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1586 * testsuite/initpri2.c: New test.
1587 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1588 (check_PROGRAMS): Add initpri2.
1589 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1590 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1591 * configure, testsuite/Makefile.in: Rebuild.
1592
e1f74f98
ILT
15932011-06-19 Ian Lance Taylor <iant@google.com>
1594
1595 PR gold/12880
1596 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1597 .interp section to a PT_INTERP segment even if we have seen a
1598 --dynamic-linker option. Don't do it if we have seen a PHDRS
1599 clause in a linker script.
1600 (Layout::finalize): Don't create a .interp section if we've
1601 already create a PT_INTERP segment.
1602 (Layout::create_interp): Always call choose_output_section (revert
1603 patch of 2011-06-17). Don't create PT_INTERP segment.
1604 * script-sections.cc
1605 (Script_sections::create_note_and_tls_segments): Add a .interp
1606 section to a PT_INTERP segment even if we have seen a
1607 --dynamic-linker option.
1608
766f91bb
ILT
16092011-06-18 Ian Lance Taylor <iant@google.com>
1610
1611 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1612 merely because a non-PT_LOAD segment has a dynamic reloc.
1613
0d212c3a
ILT
16142011-06-18 Ian Lance Taylor <iant@google.com>
1615
1616 * layout.cc (Layout::finish_dynamic_section): Don't create
1617 DT_FLAGS entry if not needed.
1618
911a5072
ILT
16192011-06-18 Ian Lance Taylor <iant@google.com>
1620
1621 PR gold/12745
1622 * layout.cc (Layout::layout_eh_frame): Correct handling of
1623 writable .eh_frame section.
1624
534b4e5f
ILT
16252011-06-17 Ian Lance Taylor <iant@google.com>
1626
1627 PR gold/12893
1628 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1629 symbol is redefined with the exact same object and value.
1630
10b4f102
ILT
16312011-06-17 Ian Lance Taylor <iant@google.com>
1632
1633 PR gold/12880
1634 * layout.h (class Layout): Add interp_segment_ field.
1635 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1636 (Layout::attach_allocated_section_to_segment): If making shared
1637 library, put .interp section in PT_INTERP segment.
1638 (Layout::finalize): Also call create_interp if -dynamic-linker
1639 option was used.
1640 (Layout::create_interp): Assert that there is no PT_INTERP
1641 segment. If not using a SECTIONS clause, use make_output_section.
1642 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1643 * script-sections.cc
1644 (Script_sections::create_note_and_tls_segments): If making shared
1645 library, put .interp section in PT_INTERP segment.
1646
a29b0dad
ILT
16472011-06-17 Ian Lance Taylor <iant@google.com>
1648
e588ea8d
ILT
1649 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1650 when making a shared library.
1651
16522011-06-17 Ian Lance Taylor <iant@google.com>
1653
1654 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1655 parameter. Change all callers. Don't issue warning about PC32
1656 against locally defined symbol.
a29b0dad 1657
9d3b0698
ILT
16582011-06-16 Ian Lance Taylor <iant@google.com>
1659
1660 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1661 occurs in same object.
1662
85b0f90c
AM
16632011-06-14 Alan Modra <amodra@gmail.com>
1664
1665 * po/POTFILES.in: Regenerate.
1666
a94907d9
ILT
16672011-06-09 Ian Lance Taylor <iant@google.com>
1668
1669 * script-sections.cc
1670 (Orphan_output_section::set_section_addresses): For a relocatable
1671 link set address to 0.
1672
4fb3a1c3
CC
16732011-06-09 Cary Coutant <ccoutant@google.com>
1674
1675 PR gold/12804
1676 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1677 used with --compress-debug-sections.
1678 * gold/object.cc (Sized_relobj_file::do_layout): Report
1679 uncompressed size of compressed input sections.
1680
61220854
CC
16812011-06-08 Cary Coutant <ccoutant@google.com>
1682
1683 PR gold/12804
1684 * testsuite/two_file_test_2_v1.cc: Change initialization of
1685 v2 to keep it in .data.
1686
e6455dfb
CC
16872011-06-07 Cary Coutant <ccoutant@google.com>
1688
1689 * common.cc (Symbol_table::do_allocate_commons_list): Call
1690 gold_fallback.
1691 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1692 (Errors::fallback): New function.
1693 (gold_fallback): New function.
1694 * errors.h (Errors::fallback): New function.
1695 * gold.cc (gold_exit): Change status parameter to enum; adjust
1696 all callers.
1697 (queue_initial_tasks): Call gold_fallback.
1698 * gold.h: Include cstdlib.
1699 (Exit_status): New enum type.
1700 (gold_exit): Change status parameter to enum.
1701 (gold_fallback): New function.
1702 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1703 (Layout::create_symtab_sections): Likewise.
1704 (Layout::create_shdrs): Likewise.
1705 * main.cc (main): Adjust call to gold_exit.
1706 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1707 (Output_data_got::add_got_entry_pair): Likewise.
1708 (Output_section::add_input_section): Likewise.
1709 (Output_section::add_output_section_data): Likewise.
1710 (Output_segment::set_section_list_addresses): Likewise.
1711 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1712
fb0e076f
CC
17132011-06-07 Cary Coutant <ccoutant@google.com>
1714
1715 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1716 for incremental links.
1717 * output.cc (Output_segment::set_section_list_addresses): Remove
1718 FIXME and test for TLS or BSS.
1719
a5ee4d5d
CC
17202011-06-07 Cary Coutant <ccoutant@google.com>
1721
1722 * testsuite/Makefile.am: Add incremental_copy_test,
1723 incremental_common_test_1.
1724 * testsuite/Makefile.in: Regenerate.
1725 * testsuite/common_test_1_v1.c: New source file.
1726 * testsuite/common_test_1_v2.c: New source file.
1727 * testsuite/copy_test_v1.cc: New source file.
1728
5146f448
CC
17292011-06-07 Cary Coutant <ccoutant@google.com>
1730
1731 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1732 update, allocate common from bss section's free list.
1733 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1734 linker-defined symbols.
1735 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1736 Skip GOT and PLT entries that are no longer referenced.
1737 (Output_section_incremental_inputs::write_info_blocks): Mark
1738 linker-defined symbols.
1739 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1740 * output.cc (Output_section::allocate): New function.
1741 * output.h (Output_section::allocate): New function.
1742 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1743 linker-defined symbols.
1744 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1745 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1746 (Symbol::init_base_output_data): Likewise.
1747 (Symbol::init_base_output_segment): Likewise.
1748 (Symbol::init_base_constant): Likewise.
1749 (Sized_symbol::init_output_data): Likewise.
1750 (Sized_symbol::init_output_segment): Likewise.
1751 (Sized_symbol::init_constant): Likewise.
1752 (Symbol_table::do_define_in_output_data): Likewise.
1753 (Symbol_table::do_define_in_output_segment): Likewise.
1754 (Symbol_table::do_define_as_constant): Likewise.
1755 * symtab.h (Symbol::is_predefined): New function.
1756 (Symbol::init_base_output_data): Add is_predefined parameter.
1757 (Symbol::init_base_output_segment): Likewise.
1758 (Symbol::init_base_constant): Likewise.
1759 (Symbol::is_predefined_): New data member.
1760 (Sized_symbol::init_output_data): Add is_predefined parameter.
1761 (Sized_symbol::init_output_segment): Likewise.
1762 (Sized_symbol::init_constant): Likewise.
1763 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1764
26d3c67d
CC
17652011-06-07 Cary Coutant <ccoutant@google.com>
1766
1767 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1768 instead of emit_copy_reloc.
1769 (Copy_relocs::emit_copy_reloc): Refactor.
1770 (Copy_relocs::make_copy_reloc): New function.
1771 (Copy_relocs::add_copy_reloc): Remove.
1772 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1773 section.
1774 (Copy_relocs::make_copy_reloc): New function.
1775 (Copy_relocs::add_copy_reloc): Remove.
1776 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1777 unchanged input files.
1778 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1779 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1780 Reserve BSS space for COPY relocations.
1781 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1782 (Output_section_incremental_inputs::write_info_blocks): Record
1783 whether a symbol is copied from a shared object.
1784 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1785 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1786 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1787 (Incremental_input_entry_reader::get_output_symbol_index): Add
1788 is_copy parameter.
1789 (Incremental_binary::emit_copy_relocs): New function.
1790 (Incremental_binary::do_emit_copy_relocs): New function.
1791 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1792 new data member.
1793 (Sized_incremental_binary::add_copy_reloc): New function.
1794 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1795 (Sized_incremental_binary::Copy_reloc): New struct.
1796 (Sized_incremental_binary::Copy_relocs): New typedef.
1797 (Sized_incremental_binary::copy_relocs_): New data member.
1798 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1799 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1800 * target.h (Sized_target::emit_copy_reloc): New function.
1801 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1802
7cdb37d9
CC
18032011-06-02 Cary Coutant <ccoutant@google.com>
1804
1805 PR gold/12163
1806 * gold/archive.cc (Archive::Archive): Initialize new data member.
1807 (Archive::include_all_members): Return if archive has already been
1808 included.
1809 * gold/archive.h (Archive::include_all_members_): New data member.
1810
cc643b88
NC
18112011-06-02 Nick Clifton <nickc@redhat.com>
1812
1813 * dynobj.h: Fix spelling mistake in comment.
1814 * output.cc: Likewise.
1815
f62a3ca7
DK
18162011-05-31 Doug Kwan <dougkwan@google.com>
1817 Asier Llano
1818
1819 PR gold/12826
cc643b88 1820 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1821 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1822 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1823 redundant arm_exidx_test.so.
1824 * testsuite/Makefile.in: Regenerate.
1825 (check_SCRIPTS): Add pr12826.sh
1826 (check_DATA): Add pr12826.stdout
1827 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1828 * testsuite/pr12826.sh: New file.
1829 * testsuite/pr12826_1.s: Ditto.
1830 * testsuite/pr12826_1.s: Ditto.
1831
8dbe1edc
ILT
18322011-05-30 Ian Lance Taylor <iant@google.com>
1833
1834 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1835 sections.
1836
c49875be
ILT
18372011-05-29 Ian Lance Taylor <iant@google.com>
1838
1839 PR gold/12804
1840 * testsuite/Makefile.am: Use different file name for two_file_test
1841 temporary file for each incremental test.
1842 * testsuite/Makefile.in: Rebuild.
1843
69d53f7a
ILT
18442011-05-29 Ian Lance Taylor <iant@google.com>
1845
1846 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1847 binary input file is empty.
1848
41d0ab5f
ILT
18492011-05-27 Ian Lance Taylor <iant@google.com>
1850
1851 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1852 (ver_test_9.so): Likewise.
1853 * testsuite/Makefile.in: Rebuild.
1854
89d8a36b
CC
18552011-05-26 Cary Coutant <ccoutant@google.com>
1856
1857 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1858 * incremental.cc (Incremental_inputs::report_input_section): Fix
1859 comment, indentation.
1860 (Incremental_inputs::report_comdat_group): New function.
1861 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1862 of data for incremental input file entry.
1863 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1864 group count, COMDAT group signatures.
1865 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1866 an unchanged input file.
1867 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1868 Initialize new data member.
1869 (Incremental_object_entry::add_comdat_group): New function.
1870 (Incremental_object_entry::get_comdat_group_count): New function.
1871 (Incremental_object_entry::get_comdat_signature_key): New function.
1872 (Incremental_object_entry::groups_): New data member.
1873 (Incremental_inputs::report_comdat_group): New function.
1874 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1875 data for incremental input file entry.
1876 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1877 (Incremental_input_entry_reader::get_input_section): Adjust size of
1878 data for incremental input file entry.
1879 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1880 (Incremental_input_entry_reader::get_comdat_group_signature): New
1881 function.
1882 * object.cc (Sized_relobj::include_section_group): Report kept
1883 COMDAT groups for incremental links.
1884
1706a06f
ILT
18852011-05-24 David Meyer <pdox@google.com>
1886
1887 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1888 with name parameter. Add found_name parameter.
1889 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1890 * dirsearch.h (class Dirsearch): Update declaration.
1891
a10ae760
ILT
18922011-05-24 Ian Lance Taylor <iant@google.com>
1893
1894 * archive.cc (Library_base::should_include_member): Pull in object
1895 from archive if it defines the entry symbol.
1896 * parameters.cc (Parameters::entry): New function.
1897 * parameters.h (class Parameters): Declare entry.
1898 * output.h (class Output_file_header): Remove entry_ field.
1899 * output.cc (Output_file_header::Output_file_header): Remove entry
1900 parameter. Change all callers.
1901 (Output_file_header::entry): Use parameters->entry.
1902 * gold.cc (queue_middle_tasks): Likewise.
1903 * plugin.cc (Plugin_hook::run): Likewise.
1904
aa92d6ed
CC
19052011-05-24 Cary Coutant <ccoutant@google.com>
1906
1907 * gold.cc (queue_initial_tasks): Pass incremental base filename
1908 to Output_file::open_base_file; don't print error message.
1909 * incremental-dump.cc (main): Adjust call to
1910 Output_file::open_for_modification.
1911 * incremental-dump.cc (main): Likewise.
1912 * incremental.cc (Incremental_inputs::report_command_line):
1913 Ignore --incremental-base option when comparing command lines.
1914 Ignore parameter when given as separate argument.
1915 * options.h (class General_options): Add --incremental-base.
1916 * output.cc (Output_file::Output_file):
1917 (Output_file::open_base_file): Add base_name and writable parameters;
1918 read base file into new file; print error message here.
1919 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1920 callers.
1921 * output.h (Output_file::open_for_modification): Rename to...
1922 (Output_file::open_base_file): ...this; add base_name and
1923 writable parameters; adjust all callers.
1924 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1925 callers.
1926 * testsuite/Makefile.am (incremental_test_4): Test
1927 --incremental-base.
1928 * testsuite/Makefile.in: Regenerate.
1929
2eedd706
CC
19302011-05-24 Cary Coutant <ccoutant@google.com>
1931
1932 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1933 incremental_test_4.
1934 * testsuite/Makefile.in: Regenerate.
1935 * testsuite/two_file_test_1_v1.cc: New test source file.
1936 * testsuite/two_file_test_1b_v1.cc: New test source file.
1937 * testsuite/two_file_test_2_v1.cc: New test source file.
1938
0f1c85a6
CC
19392011-05-24 Cary Coutant <ccoutant@google.com>
1940
1941 * dynobj.h (Dynobj::do_dynobj): New function.
1942 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1943 flag and soname for shared objects.
1944 * incremental.cc (Incremental_inputs::report_object): Make
1945 either Incremental_object_entry or Incremental_dynobj_entry; add
1946 soname to string table.
1947 (Incremental_inputs::report_input_section): Add assertion.
1948 (Output_section_incremental_inputs::set_final_data_size): Adjust
1949 type of input file entry for shared libraries; adjust size of
1950 shared library info entry.
1951 (Output_section_incremental_inputs::write_input_files): Write
1952 as_needed flag for shared libraries.
1953 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1954 of input file entry for shared libraries; write soname.
1955 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1956 soname from incremental info.
1957 * incremental.h (enum Incremental_input_flags): Add
1958 INCREMENTAL_INPUT_AS_NEEDED.
1959 (Incremental_input_entry::Incremental_input_entry): Initialize new
1960 data member.
1961 (Incremental_input_entry::set_as_needed): New function.
1962 (Incremental_input_entry::as_needed): New function.
1963 (Incremental_input_entry::do_dynobj_entry): New function.
1964 (Incremental_input_entry::as_needed_): New data member.
1965 (Incremental_object_entry::Incremental_object_entry): Don't check
1966 for shared library.
1967 (Incremental_object_entry::do_type): Likewise.
1968 (class Incremental_dynobj_entry): New class.
1969 (Incremental_input_entry_reader::as_needed): New function.
1970 (Incremental_input_entry_reader::get_soname): New function.
1971 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1972 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1973 size of shared library info entry.
1974 * layout.cc (Layout::finish_dynamic_section): Don't test for
1975 incremental link when adding DT_NEEDED entries.
1976 * object.h (Object::Object): Initialize new data member.
1977 (Object::dynobj): New function.
1978 (Object::set_as_needed): New function.
1979 (Object::as_needed): New function.
1980 (Object::do_dynobj): New function.
1981 (Object::as_needed_): New data member.
1982
6fa2a40b
CC
19832011-05-24 Cary Coutant <ccoutant@google.com>
1984
1985 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1986 info; adjust display of GOT entries.
1987 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1988 vector of input objects; remove file_status_.
1989 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1990 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1991 got_plt reader; call target hooks to reserve GOT entries.
1992 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1993 of input file info header and GOT info entry.
1994 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1995 relocation info.
1996 (Got_plt_view_info::got_descriptor): Remove.
1997 (Got_plt_view_info::sym_index): New data member.
1998 (Got_plt_view_info::input_index): New data member.
1999 (Local_got_offset_visitor::visit): Write input file index.
2000 (Global_got_offset_visitor::visit): Write 0 for input file index.
2001 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2002 with sym_index and input_index.
2003 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2004 incremental info GOT entry; replace got_descriptor with input_index.
2005 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2006 map from input file index to object.
2007 (Sized_relobj_incr::do_layout): Replace direct data member reference
2008 with accessor function.
2009 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2010 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2011 Adjust size of input file info header.
2012 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2013 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2014 (Incremental_input_entry_reader::get_input_section): Adjust size of
2015 input file info header.
2016 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2017 of incremental info GOT entry.
2018 (Incremental_got_plt_reader::get_got_desc): Remove.
2019 (Incremental_got_plt_reader::get_got_symndx): New function.
2020 (Incremental_got_plt_reader::get_got_input_index): New function.
2021 (Sized_incremental_binary::Sized_incremental_binary): Remove
2022 file_status_; add input_objects_.
2023 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2024 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2025 (Sized_incremental_binary::file_is_unchanged): Remove.
2026 (Sized_incremental_binary::set_input_object): New function.
2027 (Sized_incremental_binary::input_object): New function.
2028 (Sized_incremental_binary::file_status_): Remove.
2029 (Sized_incremental_binary::input_objects_): New data member.
2030 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2031 references.
2032 (Sized_relobj_incr::invalid_address): Move to base class.
2033 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2034 class.
2035 (Sized_relobj_incr::do_output_section_offset): Likewise.
2036 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2037 (Sized_relobj_incr::section_offsets_): Likewise.
2038 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2039 function.
2040 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2041 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2042 with accessor function.
2043 (Sized_relobj_file::do_layout): Likewise.
2044 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2045 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2046 (Sized_relobj_file::compute_final_local_value): Replace refs to
2047 section_offsets_ with accessor function.
2048 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2049 * object.h (Relobj::Relobj): Initialize new data members.
2050 (Relobj::add_dyn_reloc): New function.
2051 (Relobj::first_dyn_reloc): New function.
2052 (Relobj::dyn_reloc_count): New function.
2053 (Relobj::first_dyn_reloc_): New data member.
2054 (Relobj::dyn_reloc_count_): New data member.
2055 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2056 references.
2057 (Sized_relobj::Address): New typedef.
2058 (Sized_relobj::invalid_address): Move here from child class.
2059 (Sized_relobj::Sized_relobj): Initialize new data members.
2060 (Sized_relobj::sized_relobj): New function.
2061 (Sized_relobj::is_output_section_offset_invalid): Move here from
2062 child class.
2063 (Sized_relobj::get_output_section_offset): Likewise.
2064 (Sized_relobj::local_has_got_offset): Likewise.
2065 (Sized_relobj::local_got_offset): Likewise.
2066 (Sized_relobj::set_local_got_offset): Likewise.
2067 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2068 (Sized_relobj::clear_got_offsets): New function.
2069 (Sized_relobj::section_offsets): Move here from child class.
2070 (Sized_relobj::do_output_section_offset): Likewise.
2071 (Sized_relobj::do_set_section_offset): Likewise.
2072 (Sized_relobj::Local_got_offsets): Likewise.
2073 (Sized_relobj::local_got_offsets_): Likewise.
2074 (Sized_relobj::section_offsets_): Likewise.
2075 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2076 references.
2077 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2078 class.
2079 (Sized_relobj_file::sized_relobj): New function
2080 (Sized_relobj_file::local_has_got_offset): Move to base class.
2081 (Sized_relobj_file::local_got_offset): Likewise.
2082 (Sized_relobj_file::set_local_got_offset): Likewise.
2083 (Sized_relobj_file::get_output_section_offset): Likewise.
2084 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2085 (Sized_relobj_file::do_output_section_offset): Likewise.
2086 (Sized_relobj_file::do_set_section_offset): Likewise.
2087 (Sized_relobj_file::Local_got_offsets): Likewise.
2088 (Sized_relobj_file::local_got_offsets_): Likewise.
2089 (Sized_relobj_file::section_offsets_): Likewise.
2090 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2091 (all constructors).
2092 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2093 (Output_reloc::get_symbol_index): Likewise.
2094 (Output_reloc::local_section_offset): Likewise.
2095 (Output_reloc::get_address): Likewise.
2096 (Output_reloc::symbol_value): Likewise.
2097 (Output_data_got::reserve_slot): Move to class definition.
2098 (Output_data_got::reserve_local): New function.
2099 (Output_data_got::reserve_slot_for_global): Remove.
2100 (Output_data_got::reserve_global): New function.
2101 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2102 (all constructors, two instantiations).
2103 (Output_reloc::get_relobj): New function (two instantiations).
2104 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2105 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2106 (Output_data_reloc::add_global): Adjust type of relobj.
2107 (Output_data_reloc::add_global_relative): Likewise.
2108 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2109 (Output_data_reloc::add_local): Likewise.
2110 (Output_data_reloc::add_local_relative): Likewise.
2111 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2112 (Output_data_reloc::add_local_section): Likewise.
2113 (Output_data_reloc::add_output_section): Likewise.
2114 (Output_data_reloc::add_absolute): Likewise.
2115 (Output_data_reloc::add_target_specific): Likewise.
2116 (Output_data_got::reserve_slot): Move definition here.
2117 (Output_data_got::reserve_local): New function.
2118 (Output_data_got::reserve_global): New function.
2119 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2120 section_offsets_ with accessor function.
2121 (Sized_relobj_file::write_sections): Likewise.
2122 (Sized_relobj_file::do_relocate_sections): Likewise.
2123 * target.h (Sized_target::reserve_local_got_entry): New function.
2124 (Sized_target::reserve_global_got_entry): New function.
2125 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2126 (Target_x86_64::reserve_global_got_entry): New function.
2127 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2128
4829d394
CC
21292011-05-23 Cary Coutant <ccoutant@google.com>
2130
2131 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2132 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2133 bit when checking got_type.
2134 * incremental.cc (Sized_incremental_binary::setup_readers):
2135 Store symbol table and string table locations; initialize bit vector
2136 of file status flags.
2137 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2138 unchanged files.
2139 (Sized_incremental_binary::do_process_got_plt): New function.
2140 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2141 (Output_section_incremental_inputs::set_final_data_size): Record
2142 file index for each input file.
2143 (Output_section_incremental_inputs::write_got_plt): Store file index
2144 instead of input entry offset for each GOT entry.
2145 * incremental.h
2146 (Incremental_input_entry::Incremental_input_entry): Initialize new
2147 data member.
2148 (Incremental_input_entry::set_offset): Store file index.
2149 (Incremental_input_entry::get_file_index): New function.
2150 (Incremental_input_entry::file_index_): New data member.
2151 (Incremental_binary::process_got_plt): New function.
2152 (Incremental_binary::do_process_got_plt): New function.
2153 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2154 data members.
2155 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2156 (Sized_incremental_binary::set_file_is_unchanged): New function.
2157 (Sized_incremental_binary::file_is_unchanged): New function.
2158 (Sized_incremental_binary::do_process_got_plt): New function.
2159 (Sized_incremental_binary::file_status_): New data member.
2160 (Sized_incremental_binary::main_symtab_loc_): New data member.
2161 (Sized_incremental_binary::main_strtab_loc_): New data member.
2162 * output.cc (Output_data_got::Got_entry::write): Add case
2163 RESERVED_CODE.
2164 (Output_data_got::add_global): Call add_got_entry.
2165 (Output_data_got::add_global_plt): Likewise.
2166 (Output_data_got::add_global_with_rel): Likewise.
2167 (Output_data_got::add_global_with_rela): Likewise.
2168 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2169 (Output_data_got::add_global_pair_with_rela): Likewise.
2170 (Output_data_got::add_local): Call add_got_entry.
2171 (Output_data_got::add_local_plt): Likewise.
2172 (Output_data_got::add_local_with_rel): Likewise.
2173 (Output_data_got::add_local_with_rela): Likewise.
2174 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2175 (Output_data_got::add_local_pair_with_rela): Likewise.
2176 (Output_data_got::reserve_slot): New function.
2177 (Output_data_got::reserve_slot_for_global): New function.
2178 (Output_data_got::add_got_entry): New function.
2179 (Output_data_got::add_got_entry_pair): New function.
2180 (Output_section::add_output_section_data): Edit FIXME.
2181 * output.h
2182 (Output_section_data_build::Output_section_data_build): New
2183 constructor with size parameter.
2184 (Output_data_space::Output_data_space): Likewise.
2185 (Output_data_got::Output_data_got): Initialize new data member; new
2186 constructor with size parameter.
2187 (Output_data_got::add_constant): Call add_got_entry.
2188 (Output_data_got::reserve_slot): New function.
2189 (Output_data_got::reserve_slot_for_global): New function.
2190 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2191 (Output_data_got::add_got_entry): New function.
2192 (Output_data_got::add_got_entry_pair): New function.
2193 (Output_data_got::free_list_): New data member.
2194 * target.h (Sized_target::init_got_plt_for_update): New function.
2195 (Sized_target::register_global_plt_entry): New function.
2196 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2197 Initialize new data member; call init; add constructor with PLT count.
2198 (Output_data_plt_x86_64::init): New function.
2199 (Output_data_plt_x86_64::add_relocation): New function.
2200 (Output_data_plt_x86_64::reserve_slot): New function.
2201 (Output_data_plt_x86_64::free_list_): New data member.
2202 (Target_x86_64::init_got_plt_for_update): New function.
2203 (Target_x86_64::register_global_plt_entry): New function.
2204 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2205 incremental updates.
2206 (Output_data_plt_x86_64::add_relocation): New function.
2207 * testsuite/object_unittest.cc (Object_test): Set default options.
2208
ec69d6da
ILT
22092011-05-16 Ian Lance Taylor <iant@google.com>
2210
2211 * options.h (class General_options): Make -i a synonym for -r.
2212
732e31de
ILT
22132011-05-16 Ian Lance Taylor <iant@google.com>
2214
2215 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2216
403676b5
CC
22172011-05-10 Cary Coutant <ccoutant@google.com>
2218
2219 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2220 strip_all (-s).
2221
5b7b7d6e
ILT
22222011-05-06 Ian Lance Taylor <iant@google.com>
2223
2224 * layout.cc (Layout::layout): If the output section flags change,
2225 update the ordering.
2226
f0f9babf
CC
22272011-04-25 Cary Coutant <ccoutant@google.com>
2228
2229 * incremental-dump.cc (dump_incremental_inputs): Print local
2230 symbol info for each input file.
2231 * incremental.cc
2232 (Output_section_incremental_inputs::set_final_data_size): Add local
2233 symbol info to input file entries in incremental info.
2234 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2235 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2236 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2237 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2238 implementation.
2239 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2240 (Sized_incr_relobj::do_relocate): Write the local symbols.
2241 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2242 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2243 Adjust size of input file header.
2244 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2245 (Incremental_inputs_reader::get_local_symbol_count): New function.
2246 (Incremental_inputs_reader::get_input_section): Adjust size of input
2247 file header.
2248 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2249 (Sized_incr_relobj::This): New typedef.
2250 (Sized_incr_relobj::sym_size): New const data member.
2251 (Sized_incr_relobj::Local_symbol): New struct.
2252 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2253 (Sized_incr_relobj::do_local_symbol_offset): New function.
2254 (Sized_incr_relobj::local_symbol_count_): New data member.
2255 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2256 (Sized_incr_relobj::local_symbol_index_): New data member.
2257 (Sized_incr_relobj::local_symbol_offset_): New data member.
2258 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2259 (Sized_incr_relobj::local_symbols_): New data member.
2260 * object.h (Relobj::output_local_symbol_count): New function.
2261 (Relobj::local_symbol_offset): New function.
2262 (Relobj::do_output_local_symbol_count): New function.
2263 (Relobj::do_local_symbol_offset): New function.
2264 (Sized_relobj::do_output_local_symbol_count): New function.
2265 (Sized_relobj::do_local_symbol_offset): New function.
2266
d0a9ace3
ILT
22672011-04-22 Vladimir Simonov <sv@sw.ru>
2268
2269 * descriptors.cc (set_close_on_exec): New function.
2270 (Descriptors::open): Use set_close_on_exec.
2271 * output.cc (S_ISLNK): Define if not defined.
2272
94a3fc8b
CC
22732011-04-22 Cary Coutant <ccoutant@google.com>
2274
2275 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2276 global symbol map.
2277 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2278 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2279 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2280 relocations.
2281 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2282 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2283 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2284 * incremental.h
2285 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2286 function.
2287 (Incremental_binary::apply_incremental_relocs): New function.
2288 (Incremental_binary::do_apply_incremental_relocs): New function.
2289 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2290 data member.
2291 (Sized_incremental_binary::add_global_symbol): New function.
2292 (Sized_incremental_binary::global_symbol): New function.
2293 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2294 (Sized_incremental_binary::symbol_map_): New data member.
2295 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2296 * target.h (Sized_target::apply_relocation): New function.
2297 * target-reloc.h (apply_relocation): New function.
2298 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2299
c87e4302
DK
23002011-04-22 Doug Kwan <dougkwan@google.com>
2301
2302 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2303 flag of a SHT_ARM_EXIDX section.
2304 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2305 * testsuite/Makefile.in: Regenerate.
2306 * testsuite/arm_exidx_test.s: New file.
2307 * testsuite/arm_exidx_test.sh: Same.
2308
e7782cf6
CC
23092011-04-20 Cary Coutant <ccoutant@google.com>
2310
2311 PR gold/12689
2312 * archive.h (Incremental_archive_entry::Archive_member):
2313 Initialize arg_serial_ (second constructor).
2314
308ecdc7
ILT
23152011-04-17 Ian Lance Taylor <iant@google.com>
2316
2317 * object.cc (Relocate_info::location): Simplify location string.
2318 * errors.cc (Errors::error_at_location): Don't print program
2319 name.
2320 (Errors::warning_at_location): Likewise.
2321 (Errors::undefined_symbol): Likewise.
2322 * testsuite/debug_msg.sh: Update accordingly.
2323
bec5b579
CC
23242011-04-14 Cary Coutant <ccoutant@google.com>
2325
2326 * gold/layout.cc (Layout::symtab_section_offset): New function.
2327 * gold/layout.h (Layout::symtab_section_offset): New function.
2328 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2329
88597d34
ILT
23302011-04-12 Ian Lance Taylor <iant@google.com>
2331
2332 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2333 with MREMAP_MAYMOVE.
2334 * output.h (class Output_file): Add map_is_allocated_ field.
2335 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2336 not available, provide stubs. If mremap is not available, #define
2337 it to gold_mremap.
2338 (MREMAP_MAYMOVE): Define if not defined.
2339 (Output_file::Output_file): Initialize map_is_allocated_.
2340 (Output_file::resize): Check map_is_allocated_.
2341 (Output_file::map_anonymous): If mmap fails, use malloc.
2342 (Output_file::unmap): Don't do anything for an anonymous map.
2343 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2344 is not available, provide stubs.
2345 (File_read::View::~View): Use free rather than delete[].
2346 (File_read::make_view): Use malloc rather than new[]. If mmap
2347 fails, use malloc.
2348 (File_read::find_or_make_view): Use malloc rather than new[].
2349 * gold.h: Remove HAVE_REMAP code.
2350 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2351 exists. Rename mremap to gold_mremap. If mmap is not available
2352 don't do anything.
2353 * configure, config.in: Rebuild.
2354
11e361bc
ILT
23552011-04-11 Ian Lance Taylor <iant@google.com>
2356
2357 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2358 initialize local variable v.
2359
cdc29364
CC
23602011-04-11 Cary Coutant <ccoutant@google.com>
2361
2362 * archive.cc (Archive::include_member): Adjust call to
2363 report_object.
2364 (Add_archive_symbols::run): Track argument serial numbers.
2365 (Lib_group::include_member): Likewise.
2366 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2367 * archive.h (Incremental_archive_entry::Archive_member):
2368 Initialize arg_serial_.
2369 (Archive_member::arg_serial_): New data member.
2370 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2371 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2372 incremental link.
2373 (Sized_dynobj::do_for_all_local_got_entries): New function.
2374 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2375 function.
2376 * fileread.cc (get_mtime): New function.
2377 * fileread.h (get_mtime): New function.
2378 * gold.cc (queue_initial_tasks): Check for incremental update.
2379 (process_incremental_input): New function.
2380 (queue_middle_tasks): Don't force valid target for incremental
2381 update.
2382 * incremental-dump.cc (find_input_containing_global): Adjust
2383 size of symbol info entry.
2384 (dump_incremental_inputs): Dump argument serial number and
2385 in_system_directory flag; bias shndx by 1; print symbol names
2386 when dumping per-file symbol lists; use new symbol info readers.
2387 * incremental.cc
2388 (Output_section_incremental_inputs:update_data_size): New function.
2389 (Sized_incremental_binary::setup_readers): Setup input readers
2390 for each input file; build maps for files added from libraries
2391 and scripts.
2392 (Sized_incremental_binary::check_input_args): New function.
2393 (Sized_incremental_binary::do_check_inputs): Build map of argument
2394 serial numbers to input arguments.
2395 (Sized_incremental_binary::do_file_has_changed): Rename
2396 do_file_is_unchanged to this; compare file modification times.
2397 (Sized_incremental_binary::do_init_layout): New function.
2398 (Sized_incremental_binary::do_reserve_layout): New function.
2399 (Sized_incremental_binary::do_get_input_reader): Remove.
2400 (Sized_incremental_binary::get_symtab_view): New function.
2401 (Incremental_checker::can_incrementally_link_output_file): Remove.
2402 (Incremental_inputs::report_command_line): Exclude --debug options.
2403 (Incremental_inputs::report_archive_begin): Add parameter; track
2404 argument serial numbers; don't put input file entry for archive
2405 before archive members.
2406 (Incremental_inputs::report_archive_end): Put input file entry
2407 for archive after archive members.
2408 (Incremental_inputs::report_object): Add parameter; track argument
2409 serial numbers and in_system_directory flag.
2410 (Incremental_inputs::report_script): Add parameter; track argument
2411 serial numbers.
2412 (Output_section_incremental_inputs::set_final_data_size): Adjust
2413 size of symbol info entry; check for forwarding symbols.
2414 (Output_section_incremental_inputs::write_input_files): Write
2415 in_system_directory flag and argument serial number.
2416 (Output_section_incremental_inputs::write_info_blocks): Map section
2417 indices between incremental info and original input file; store
2418 input section index for each symbol.
2419 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2420 change operator() to visit().
2421 (class Global_got_offset_visitor): Likewise.
2422 (class Global_symbol_visitor_got_plt):
2423 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2424 classes.
2425 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2426 (Sized_incr_relobj::do_read_symbols): New function.
2427 (Sized_incr_relobj::do_layout): New function.
2428 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2429 (Sized_incr_relobj::do_add_symbols): New function.
2430 (Sized_incr_relobj::do_should_include_member): New function.
2431 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2432 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2433 (Sized_incr_relobj::do_section_size): New function.
2434 (Sized_incr_relobj::do_section_name): New function.
2435 (Sized_incr_relobj::do_section_contents): New function.
2436 (Sized_incr_relobj::do_section_flags): New function.
2437 (Sized_incr_relobj::do_section_entsize): New function.
2438 (Sized_incr_relobj::do_section_address): New function.
2439 (Sized_incr_relobj::do_section_type): New function.
2440 (Sized_incr_relobj::do_section_link): New function.
2441 (Sized_incr_relobj::do_section_info): New function.
2442 (Sized_incr_relobj::do_section_addralign): New function.
2443 (Sized_incr_relobj::do_initialize_xindex): New function.
2444 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2445 (Sized_incr_relobj::do_read_relocs): New function.
2446 (Sized_incr_relobj::do_gc_process_relocs): New function.
2447 (Sized_incr_relobj::do_scan_relocs): New function.
2448 (Sized_incr_relobj::do_count_local_symbols): New function.
2449 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2450 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2451 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2452 (Sized_incr_relobj::do_relocate): New function.
2453 (Sized_incr_relobj::do_set_section_offset): New function.
2454 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2455 (Sized_incr_dynobj::do_read_symbols): New function.
2456 (Sized_incr_dynobj::do_layout): New function.
2457 (Sized_incr_dynobj::do_add_symbols): New function.
2458 (Sized_incr_dynobj::do_should_include_member): New function.
2459 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2460 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2461 (Sized_incr_dynobj::do_section_size): New function.
2462 (Sized_incr_dynobj::do_section_name): New function.
2463 (Sized_incr_dynobj::do_section_contents): New function.
2464 (Sized_incr_dynobj::do_section_flags): New function.
2465 (Sized_incr_dynobj::do_section_entsize): New function.
2466 (Sized_incr_dynobj::do_section_address): New function.
2467 (Sized_incr_dynobj::do_section_type): New function.
2468 (Sized_incr_dynobj::do_section_link): New function.
2469 (Sized_incr_dynobj::do_section_info): New function.
2470 (Sized_incr_dynobj::do_section_addralign): New function.
2471 (Sized_incr_dynobj::do_initialize_xindex): New function.
2472 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2473 (make_sized_incremental_object): New function.
2474 (Incremental_library::copy_unused_symbols): New function.
2475 (Incremental_library::do_for_all_unused_symbols): New function.
2476 * incremental.h (enum Incremental_input_flags): New type.
2477 (class Incremental_checker): Remove.
2478 (Incremental_input_entry::Incremental_input_entry): Add argument
2479 serial number.
2480 (Incremental_input_entry::arg_serial): New function.
2481 (Incremental_input_entry::set_is_in_system_directory): New function.
2482 (Incremental_input_entry::is_in_system_directory): New function.
2483 (Incremental_input_entry::arg_serial_): New data member.
2484 (Incremental_input_entry::is_in_system_directory_): New data member.
2485 (class Script_info): Move here from script.h.
2486 (Script_info::Script_info): Add filename parameter.
2487 (Script_info::filename): New function.
2488 (Script_info::filename_): New data member.
2489 (Incremental_script_entry::Incremental_script_entry): Add argument
2490 serial number.
2491 (Incremental_object_entry::Incremental_object_entry): Likewise.
2492 (Incremental_object_entry::add_input_section): Build list of input
2493 sections with map to original shndx.
2494 (Incremental_object_entry::get_input_section_index): New function.
2495 (Incremental_object_entry::shndx_): New data member.
2496 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2497 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2498 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2499 serial number.
2500 (Incremental_inputs::report_archive_begin): Likewise.
2501 (Incremental_inputs::report_object): Likewise.
2502 (Incremental_inputs::report_script): Likewise.
2503 (class Incremental_global_symbol_reader): New class.
2504 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2505 and store flags and input file type.
2506 (Incremental_input_entry_reader::arg_serial): New function.
2507 (Incremental_input_entry_reader::type): Extract type from flags.
2508 (Incremental_input_entry_reader::is_in_system_directory): New function.
2509 (Incremental_input_entry_reader::get_input_section_count): Call
2510 accessor function for type.
2511 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2512 function for type; adjust size of global symbol entry.
2513 (Incremental_input_entry_reader::get_global_symbol_count): Call
2514 accessor function for type.
2515 (Incremental_input_entry_reader::get_object_count): Likewise.
2516 (Incremental_input_entry_reader::get_object_offset): Likewise.
2517 (Incremental_input_entry_reader::get_member_count): Likewise.
2518 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2519 (Incremental_input_entry_reader::get_member_offset): Likewise.
2520 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2521 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2522 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2523 (Incremental_input_entry_reader::get_global_symbol_reader): New
2524 function.
2525 (Incremental_input_entry_reader::get_output_symbol_index): New
2526 function.
2527 (Incremental_input_entry_reader::type_): Remove.
2528 (Incremental_input_entry_reader::flags_): New data member.
2529 (Incremental_inputs_reader::input_file_offset): New function.
2530 (Incremental_inputs_reader::input_file_index): New function.
2531 (Incremental_inputs_reader::input_file): Call input_file_offset.
2532 (Incremental_inputs_reader::input_file_at_offset): New function.
2533 (Incremental_relocs_reader::get_r_type): Reformat.
2534 (Incremental_relocs_reader::get_r_shndx): Reformat.
2535 (Incremental_relocs_reader::get_r_offset): Reformat.
2536 (Incremental_relocs_reader::data): New function.
2537 (Incremental_binary::Incremental_binary): Initialize new data members.
2538 (Incremental_binary::check_inputs): Add cmdline parameter.
2539 (Incremental_binary::file_is_unchanged): Remove.
2540 (Input_reader::arg_serial): New function.
2541 (Input_reader::get_unused_symbol_count): New function.
2542 (Input_reader::get_unused_symbol): New function.
2543 (Input_reader::do_arg_serial): New function.
2544 (Input_reader::do_get_unused_symbol_count): New function.
2545 (Input_reader::do_get_unused_symbol): New function.
2546 (Incremental_binary::input_file_count): New function.
2547 (Incremental_binary::get_input_reader): Change signature to use
2548 index instead of filename.
2549 (Incremental_binary::file_has_changed): New function.
2550 (Incremental_binary::get_input_argument): New function.
2551 (Incremental_binary::get_library): New function.
2552 (Incremental_binary::get_script_info): New function.
2553 (Incremental_binary::init_layout): New function.
2554 (Incremental_binary::reserve_layout): New function.
2555 (Incremental_binary::output_file): New function.
2556 (Incremental_binary::do_check_inputs): New function.
2557 (Incremental_binary::do_file_is_unchanged): Remove.
2558 (Incremental_binary::do_file_has_changed): New function.
2559 (Incremental_binary::do_init_layout): New function.
2560 (Incremental_binary::do_reserve_layout): New function.
2561 (Incremental_binary::do_input_file_count): New function.
2562 (Incremental_binary::do_get_input_reader): Change signature.
2563 (Incremental_binary::input_args_map_): New data member.
2564 (Incremental_binary::library_map_): New data member.
2565 (Incremental_binary::script_map_): New data member.
2566 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2567 new data members.
2568 (Sized_incremental_binary::output_section): New function.
2569 (Sized_incremental_binary::inputs_reader): Add const.
2570 (Sized_incremental_binary::symtab_reader): Add const.
2571 (Sized_incremental_binary::relocs_reader): Add const.
2572 (Sized_incremental_binary::got_plt_reader): Add const.
2573 (Sized_incremental_binary::get_symtab_view): New function.
2574 (Sized_incremental_binary::Inputs_reader): New typedef.
2575 (Sized_incremental_binary::Input_entry_reader): New typedef.
2576 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2577 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2578 (Sized_incremental_binary::do_file_has_changed): New function.
2579 (Sized_incremental_binary::do_init_layout): New function.
2580 (Sized_incremental_binary::do_reserve_layout): New function.
2581 (Sized_input_reader::Inputs_reader): Remove.
2582 (Sized_input_reader::Input_entry_reader): Remove.
2583 (Sized_input_reader::do_arg_serial): New function.
2584 (Sized_input_reader::do_get_unused_symbol_count): New function.
2585 (Sized_input_reader::do_get_unused_symbol): New function.
2586 (Sized_incremental_binary::do_input_file_count): New function.
2587 (Sized_incremental_binary::do_get_input_reader): Change signature;
2588 use index instead of filename.
2589 (Sized_incremental_binary::section_map_): New data member.
2590 (Sized_incremental_binary::input_entry_readers_): New data member.
2591 (class Sized_incr_relobj): New class.
2592 (class Sized_incr_dynobj): New class.
2593 (make_sized_incremental_object): New function.
2594 (class Incremental_library): New class.
2595 * layout.cc (Free_list::num_lists): New static data member.
2596 (Free_list::num_nodes): New static data member.
2597 (Free_list::num_removes): New static data member.
2598 (Free_list::num_remove_visits): New static data member.
2599 (Free_list::num_allocates): New static data member.
2600 (Free_list::num_allocate_visits): New static data member.
2601 (Free_list::init): New function.
2602 (Free_list::remove): New function.
2603 (Free_list::allocate): New function.
2604 (Free_list::dump): New function.
2605 (Free_list::print_stats): New function.
2606 (Layout_task_runner::run): Resize output file for incremental updates.
2607 (Layout::Layout): Initialize new data members.
2608 (Layout::set_incremental_base): New function.
2609 (Layout::init_fixed_output_section): New function.
2610 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2611 incremental updates.
2612 (Layout::create_gold_note): Do not create gold note section for
2613 incremental updates.
2614 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2615 for incremental updates.
2616 (Layout::set_section_offsets): For incremental updates, allocate space
2617 from free list.
2618 (Layout::create_symtab_sections): Layout with offsets relative to
2619 start of section; for incremental updates, allocate space from free
2620 list.
2621 (Layout::create_shdrs): For incremental updates, allocate space from
2622 free list.
2623 (Layout::finish_dynamic_section): For incremental updates, do not
2624 check --as-needed (fixed in subsequent patch).
2625 * layout.h (class Free_list): New class.
2626 (Layout::set_incremental_base): New function.
2627 (Layout::incremental_base): New function.
2628 (Layout::init_fixed_output_section): New function.
2629 (Layout::allocate): New function.
2630 (Layout::incremental_base_): New data member.
2631 (Layout::free_list_): New data member.
2632 * main.cc (main): Print Free_list statistics.
2633 * object.cc (Relobj::finalize_incremental_relocs): Add
2634 clear_counts parameter; clear counts only when clear_counts is set.
2635 (Sized_relobj::Sized_relobj): Initialize new base class.
2636 (Sized_relobj::do_layout): Don't report special sections.
2637 (Sized_relobj::do_for_all_local_got_entries): New function.
2638 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2639 symtab_off to all symbol table offsets.
2640 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2641 * object.h (class Got_offset_list): Move to top of file.
2642 (Object::Object): Allow case where input_file == NULL.
2643 (Object::~Object): Likewise.
2644 (Object::input_file): Assert that input_file != NULL.
2645 (Object::lock): Allow case where input_file == NULL.
2646 (Object::unlock): Likewise.
2647 (Object::is_locked): Likewise.
2648 (Object::token): Likewise.
2649 (Object::release): Likewise.
2650 (Object::is_incremental): New function.
2651 (Object::get_mtime): New function.
2652 (Object::for_all_local_got_entries): New function.
2653 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2654 (Object::set_is_in_system_directory): New function.
2655 (Object::is_in_system_directory): New function.
2656 (Object::do_is_incremental): New function.
2657 (Object::do_get_mtime): New function.
2658 (Object::do_for_all_local_got_entries): New function.
2659 (Object::is_in_system_directory_): New data member.
2660 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2661 (class Sized_relobj_base): New class.
2662 (class Sized_relobj): Derive from Sized_relobj_base.
2663 (class Sized_relobj::Symbols): Redeclare from base class.
2664 (class Sized_relobj::local_got_offset_list): Remove.
2665 (class Sized_relobj::Output_sections): Redeclare from base class.
2666 (class Sized_relobj::do_for_all_local_got_entries): New function.
2667 (class Sized_relobj::write_local_symbols): Add offset parameter.
2668 (class Sized_relobj::local_symbol_offset_): Update comment.
2669 (class Sized_relobj::local_dynsym_offset_): Update comment.
2670 * options.cc (Input_arguments::add_file): Remove const.
2671 * options.h (Input_file_argument::Input_file_argument):
2672 Initialize arg_serial_ (all constructors).
2673 (Input_file_argument::set_arg_serial): New function.
2674 (Input_file_argument::arg_serial): New function.
2675 (Input_file_argument::arg_serial_): New data member.
2676 (Input_arguments::Input_arguments): Initialize file_count_.
2677 (Input_arguments::add_file): Remove const.
2678 (Input_arguments::number_of_input_files): New function.
2679 (Input_arguments::file_count_): New data member.
2680 (Command_line::number_of_input_files): Call
2681 Input_arguments::number_of_input_files.
2682 * output.cc (Output_segment_headers::Output_segment_headers):
2683 Set current size.
2684 (Output_section::Input_section::current_data_size): New function.
2685 (Output_section::Output_section): Initialize new data members.
2686 (Output_section::add_input_section): Don't do merge sections for
2687 an incremental link; allocate space from free list for an
2688 incremental update.
2689 (Output_section::add_output_section_data): Allocate space from
2690 free list for an incremental update.
2691 (Output_section::update_data_size): New function.
2692 (Output_section::set_fixed_layout): New function.
2693 (Output_section::reserve): New function.
2694 (Output_segment::set_section_addresses): Remove const.
2695 (Output_segment::set_section_list_addresses): Remove const; allocate
2696 space from free list for an incremental update.
2697 (Output_segment::set_offset): Adjust size of RELRO segment for an
2698 incremental update.
2699 * output.h (Output_data::current_data_size): Move here from
2700 child classes.
2701 (Output_data::pre_finalize_data_size): New function.
2702 (Output_data::update_data_size): New function.
2703 (Output_section_headers::update_data_size): new function.
2704 (Output_section_data_build::current_data_size): Move to Output_data.
2705 (Output_data_strtab::update_data_size): New function.
2706 (Output_section::current_data_size): Move to Output_data.
2707 (Output_section::set_fixed_layout): New function.
2708 (Output_section::has_fixed_layout): New function.
2709 (Output_section::reserve): New function.
2710 (Output_section::update_data_size): New function.
2711 (Output_section::has_fixed_layout_): New data member.
2712 (Output_section::free_list_): New data member.
2713 (Output_segment::set_section_addresses): Remove const.
2714 (Output_segment::set_section_list_addresses): Remove const.
2715 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2716 New function.
2717 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2718 New function.
2719 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2720 parameter when calling Add_symbols constructor; store argument
2721 serial number for members of a lib group.
2722 (Add_symbols::locks): Allow case where token == NULL.
2723 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2724 (Read_member::~Read_member): New function.
2725 (Read_member::is_runnable): New function.
2726 (Read_member::locks): New function.
2727 (Read_member::run): New function.
2728 (Check_script::~Check_script): New function.
2729 (Check_script::is_runnable): New function.
2730 (Check_script::locks): New function.
2731 (Check_script::run): New function.
2732 (Check_library::~Check_library): New function.
2733 (Check_library::is_runnable): New function.
2734 (Check_library::locks): New function.
2735 (Check_library::run): New function.
2736 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2737 (Add_symbols::library_): New data member.
2738 (class Read_member): New class.
2739 (class Check_script): New class.
2740 (class Check_library): New class.
2741 * reloc.cc (Read_relocs::is_runnable): Allow case where
2742 token == NULL.
2743 (Read_relocs::locks): Likewise.
2744 (Scan_relocs::locks): Likewise.
2745 (Relocate_task::locks): Likewise.
2746 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2747 to clear counters.
2748 (Sized_relobj::incremental_relocs_scan): Fix comment.
2749 (Sized_relobj::do_relocate): Pass output file offset to
2750 write_local_symbols.
2751 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2752 from class declaration.
2753 * script.cc (read_input_script): Allocate Script_info; pass
2754 argument serial number to report_script.
2755 * script.h (class Script_info): Move to incremental.h.
2756 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2757 * symtab.h (Symbol_table::add_from_incrobj): New function.
2758 (Symbol_table::set_file_offset): New function.
2759
b961d0d7
CC
27602011-04-05 Cary Coutant <ccoutant@google.com>
2761
2762 * incremental-dump.cc (dump_incremental_inputs): Change signature
2763 to take a Sized_incremental_binary; change caller. Use readers
2764 in Sized_incremental_binary.
2765 * incremental.cc
2766 (Sized_incremental_binary::find_incremental_inputs_sections):
2767 Rename do_find_incremental_inputs_sections to this.
2768 (Sized_incremental_binary::setup_readers): New function.
2769 (Sized_incremental_binary::do_check_inputs): Check
2770 has_incremental_info_ flag; move setup code to setup_readers;
2771 use input readers.
2772 (Sized_incremental_binary::do_file_is_unchanged): New function.
2773 (Sized_incremental_binary::do_get_input_reader): New function.
2774 * incremental.h (class Incremental_binary): Move to end of file.
2775 (Incremental_binary::file_is_unchanged): New function.
2776 (Incremental_binary::do_file_is_unchanged): New function.
2777 (Incremental_binary::Input_reader): New class.
2778 (Incremental_binary::get_input_reader): New function.
2779 (class Sized_incremental_binary): Move to end of file.
2780 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2781 input section reader classes.
2782 (Sized_incremental_binary::has_incremental_info): New function.
2783 (Sized_incremental_binary::inputs_reader): New function.
2784 (Sized_incremental_binary::symtab_reader): New function.
2785 (Sized_incremental_binary::relocs_reader): New function.
2786 (Sized_incremental_binary::got_plt_reader): New function.
2787 (Sized_incremental_binary::do_file_is_unchanged): New function.
2788 (Sized_incremental_binary::Sized_input_reader): New class.
2789 (Sized_incremental_binary::get_input_reader): New function.
2790 (Sized_incremental_binary::find_incremental_inputs_sections):
2791 Rename do_find_incremental_inputs_sections to this.
2792 (Sized_incremental_binary::setup_readers): New function.
2793 (Sized_incremental_binary::has_incremental_info_): New data member.
2794 (Sized_incremental_binary::inputs_reader_): New data member.
2795 (Sized_incremental_binary::symtab_reader_): New data member.
2796 (Sized_incremental_binary::relocs_reader_): New data member.
2797 (Sized_incremental_binary::got_plt_reader_): New data member.
2798 (Sized_incremental_binary::current_input_file_): New data member.
2799
a869183f
PP
28002011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2801
2802 PR gold/12640
2803 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2804 violation.
2805
28062011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2807
2808 * archive.cc (Archive::include_member): Adjust call to report_object.
2809 (Add_archive_symbols::run): Add script_info to call to
2810 report_archive_begin.
2811 (Lib_group::include_member): Adjust call to report_object.
2812 (Add_lib_group_symbols::run): Adjust call to report_object.
2813 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2814 blocks. Add object count for script input files.
2815 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2816 script_info parameter; change all callers.
2817 (Incremental_inputs::report_object): Add script_info parameter;
2818 change all callers.
2819 (Incremental_inputs::report_script): Store backpointer to
2820 incremental info entry.
2821 (Output_section_incremental_inputs::set_final_data_size): Record
2822 additional information for scripts.
2823 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2824 * incremental.h (Incremental_script_entry::add_object): New function.
2825 (Incremental_script_entry::get_object_count): New function.
2826 (Incremental_script_entry::get_object): New function.
2827 (Incremental_script_entry::objects_): New data member; adjust
2828 constructor.
2829 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2830 (Incremental_inputs::report_object): Add script_info parameter.
2831 (Incremental_inputs_reader::get_object_count): New function.
2832 (Incremental_inputs_reader::get_object_offset): New function.
2833 * options.cc (Input_arguments::add_file): Return reference to
2834 new input argument.
2835 * options.h (Input_argument::set_script_info): New function.
2836 (Input_argument::script_info): New function.
2837 (Input_argument::script_info_): New data member; adjust all
2838 constructors.
2839 (Input_file_group::add_file): Return reference to new input argument.
2840 (Input_file_lib::add_file): Likewise.
2841 (Input_arguments::add_file): Likewise.
2842 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2843 * script.cc (Parser_closure::Parser_closure): Add script_info
2844 parameter; adjust all callers.
2845 (Parser_closure::script_info): New function.
2846 (Parser_closure::script_info_): New data member.
2847 (read_input_script): Report scripts earlier to incremental info.
2848 (script_add_file): Set script_info in Input_argument.
2849 (script_add_library): Likewise.
2850 * script.h (Script_options::Script_info): Rewrite class.
2851
a869183f 28522011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2853
2854 * archive.cc (Library_base::should_include_member): Move
2855 method here from class Archive.
2856 (Archive::Archive): Initialize base class.
2857 (Archive::should_include_member): Move to base class.
2858 (Archive::do_for_all_unused_symbols): New function.
2859 (Add_archive_symbols::run): Remove redundant access to
2860 incremental_inputs.
2861 (Lib_group::Lib_group): Initialize base class.
2862 (Lib_group::do_filename): New function.
2863 (Lib_group::include_member): Pass pointer to Lib_group to
2864 report_object.
2865 (Lib_group::do_for_all_unused_symbols): New function.
2866 (Add_lib_group_symbols::run): Report archive information for
2867 incremental links.
2868 * archive.h (class Library_base): New base class.
2869 (class Archive): Derive from Library_base.
2870 (Archive::filename): Move to base class.
2871 (Archive::set_incremental_info): Likewise.
2872 (Archive::incremental_info): Likewise.
2873 (Archive::Should_include): Likewise.
2874 (Archive::should_include_member): Likewise.
2875 (Archive::Armap_entry): Remove.
2876 (Archive::Unused_symbol_iterator): Remove.
2877 (Archive::unused_symbols_begin): Remove.
2878 (Archive::unused_symbols_end): Remove.
2879 (Archive::do_filename): New function.
2880 (Archive::do_get_mtime): New function.
2881 (Archive::do_for_all_unused_symbols): New function.
2882 (Archive::task_): Move to base class.
2883 (Archive::incremental_info_): Likewise.
2884 (class Lib_group): Derive from Library_base.
2885 (Lib_group::do_filename): New function.
2886 (Lib_group::do_get_mtime): New function.
2887 (Lib_group::do_for_all_unused_symbols): New function.
2888 (Lib_group::task_): Move to base class.
2889 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2890 function.
2891 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2892 function.
2893 * incremental.cc (Incremental_inputs::report_archive_begin):
2894 Use Library_base; call library's get_mtime; add incremental inputs
2895 entry before members.
2896 (class Unused_symbol_visitor): New class.
2897 (Incremental_inputs::report_archive_end): Use Library_base; use
2898 visitor class to record unused symbols; don't add incremental inputs
2899 entry after members.
2900 (Incremental_inputs::report_object): Use Library_base.
2901 * incremental.h
2902 (Incremental_archive_entry::Incremental_archive_entry): Remove
2903 unused Archive parameter.
2904 (Incremental_inputs::report_archive_begin): Use Library_base.
2905 (Incremental_inputs::report_archive_end): Likewise.
2906 (Incremental_inputs::report_object): Likewise.
2907 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2908 function.
2909 * object.h (Object::for_all_global_symbols): New function.
2910 (Object::do_for_all_global_symbols): New function.
2911 (Sized_relobj::do_for_all_global_symbols): New function.
2912 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2913 function.
2914 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2915 function.
2916
61ab3e40
ILT
29172011-03-27 Ian Lance Taylor <iant@google.com>
2918
2919 * archive.cc (Archive::interpret_header): Return -1 if something
2920 goes wrong. Change callers accordingly.
2921
30e1f9e6
CC
29222011-03-25 Cary Coutant <ccoutant@google.com>
2923
2924 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2925 * testsuite/Makefile.in: Regenerate.
2926
9370ce59 29272011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2928
2929 * plugin.cc (get_view): New.
2930 (Plugin::load): Pass get_view to the plugin.
2931 (Plugin_manager::get_view): New.
2932
9312bb0a
ILT
29332011-03-21 Ian Lance Taylor <iant@google.com>
2934
2935 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2936 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2937
7e12ba9e
ST
29382011-03-21 Sriraman Tallam <tmsriram@google.com>
2939
2940 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2941 Change == to -eq.
2942 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2943 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2944 Change == to -eq.
2945 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2946 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2947
fd7a005d
ILT
29482011-03-14 Ian Lance Taylor <iant@google.com>
2949
2950 * script-sections.cc (Sort_output_sections::script_compare):
2951 Rename from is_before, change return type.
2952 (Sort_output_sections::operator()): Adjust accordingly.
2953
ed16fd1b
ILT
29542011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2955
2956 PR gold/12572
2957 * testsuite/odr_violation2.cc: Add comment to make all error line
2958 numbers double digits.
2959 * testsuite/debug_msg.sh: Adjust expected errors.
2960
71ff8986
ILT
29612011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2962
2963 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2964 but mark earlier ones as non-canonical
2965 (offset_to_iterator): Update search target and example
2966 (do_addr2line): Return extra lines in a vector*
2967 (format_file_lineno): Extract from do_addr2line
2968 (one_addr2line): Add vector* out-param
2969 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2970 when a lineno entry appeared last for its instruction
2971 (Dwarf_line_info): Add vector* out-param
2972 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2973 * symtab.cc (Odr_violation_compare): Include the lineno in the
2974 comparison again.
2975 (linenos_from_loc): New. Combine the canonical line for an
2976 address with its other lines.
2977 (True_if_intersect): New. Helper functor to make
2978 std::set_intersection a query.
2979 (detect_odr_violations): Compare sets of lines instead of just
2980 one line for each function. This became less deterministic, but
2981 has fewer false positives.
2982 * symtab.h: Declarations.
2983 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2984 mix an optimized and non-optimized object in the same binary
2985 (odr_violation2.so): Same.
2986 * testsuite/Makefile.in: Regenerate from Makefile.am.
2987 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2988 * testsuite/debug_msg.sh: Update line numbers and add
2989 assertions.
2990 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2991 non-optimized context.
2992 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2993 isn't inlined, and use OdrDerived in an optimized context.
2994 * testsuite/odr_header1.h: Defines OdrDerived, where
2995 optimization will change the
2996 first-instruction-in-the-destructor's file and line number.
2997 * testsuite/odr_header2.h: Defines OdrBase.
2998
a19fefdc
ILT
29992011-03-09 Ian Lance Taylor <iant@google.com>
3000
3001 * fileread.cc (File_read::clear_views): Don't delete the whole
3002 file view.
3003
ecb351e9
ILT
30042011-03-08 Ian Lance Taylor <iant@google.com>
3005
3006 PR gold/12525
3007 * fileread.cc: #include <climits>.
3008 (GOLD_IOV_MAX): Define.
3009 (File_read::read_multiple): Limit number of entries by iov_max.
3010 * fileread.h (class File_read): Always set max_readv_entries to
3011 128.
3012
b821d13c
ILT
30132011-03-07 Ian Lance Taylor <iant@google.com>
3014
3015 PR gold/12525
3016 * options.h (class General_options): Add -dy and -dn.
3017
89243142
CC
30182011-03-02 Cary Coutant <ccoutant@google.com>
3019
3020 * testsuite/script_test_9.t: Add TLS segment.
3021
d0773f31
ILT
30222011-03-02 Simon Baldwin <simonb@google.com>
3023
3024 * configure.ac: Add check for gnu_indirect_function support in
3025 the toolchain building binutils.
3026 * configure: Rebuild.
3027
9370ce59 30282011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3029
3030 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3031 plugin only symbols.
3032 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3033 in plugin files as not needed in the symbol table.
3034
4cf7a849
ST
30352011-02-11 Sriraman Tallam <tmsriram@google.com>
3036
3037 * output.cc (Output_section::add_input_section): Delay fill
3038 generation for section ordering.
3039
b578bd7d
ILT
30402011-02-09 Ian Lance Taylor <iant@google.com>
3041
3042 PR gold/12316
3043 * object.h (class Sized_relobj): Remove clear_local_symbols.
3044 * reloc.cc (Sized_relobj::do_relocate): Don't call
3045 clear_local_symbols.
3046
9370ce59 30472011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3048
3049 * plugin.cc (is_visible_from_outside): Return true for symbols
3050 in the -u option.
3051
55382fb7
ILT
30522011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3053
3054 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3055 filename.
3056
4e271fff
ST
30572011-02-02 Sriraman Tallam <tmsriram@google.com>
3058
3059 * icf.h (is_section_foldable_candidate): Change type of parameter
3060 to std::string.
3061 * icf.cc (Icf::find_identical_sections): Change type of local variable
3062 section_name to be std::string.
3063 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3064
d433c3ac
ILT
30652011-01-25 Ian Lance Taylor <iant@google.com>
3066
3067 * script.cc (script_add_extern): Rewrite to use
3068 add_symbol_reference.
3069
880473a6
DK
30702011-01-25 Doug Kwan <dougkwan@google.com>
3071
d433c3ac 3072 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3073
f30f86fa
ILT
30742011-01-24 Ian Lance Taylor <iant@google.com>
3075
3076 * options.h (class General_options): Accept
3077 --no-detect-odr-violations.
3078
8e51a0b9
ILT
30792011-01-24 Ian Lance Taylor <iant@google.com>
3080
3081 * version.cc (version_string): Bump to 1.11.
3082
0f3b89d8
ILT
30832011-01-24 Ian Lance Taylor <iant@google.com>
3084
3085 * plugin.cc (class Plugin_rescan): Define new class.
3086 (Plugin_manager::claim_file): Set any_claimed_.
3087 (Plugin_manager::save_archive): New function.
3088 (Plugin_manager::save_input_group): New function.
3089 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3090 necessary.
3091 (Plugin_manager::new_undefined_symbol): New function.
3092 (Plugin_manager::rescan): New function.
3093 (Plugin_manager::rescannable_defines): New function.
3094 (Plugin_manager::add_input_file): Set any_added_.
3095 * plugin.h (class Plugin_manager): define new fields rescannable_,
3096 undefined_symbols_, any_claimed_, and any_added_. Declare
3097 Plugin_rescan as friend. Declare new functions.
3098 (Plugin_manager::Rescannable): Define type.
3099 (Plugin_manager::Rescannable_list): Define type.
3100 (Plugin_manager::Undefined_symbol_list): Define type.
3101 (Plugin_manager::Plugin_manager): Initialize new fields.
3102 * archive.cc (Archive::defines_symbol): New function.
3103 (Add_archive_symbols::run): Pass archive to plugins if any.
3104 * archive.h (class Archive): Declare defines_symbol.
3105 * readsyms.cc (Input_group::~Input_group): New function.
3106 (Finish_group::run): Pass input_group to plugins if any.
3107 * readsyms.h (class Input_group): Declare destructor.
3108 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3109 any.
3110
3bb951e5
ILT
31112011-01-10 Ian Lance Taylor <iant@google.com>
3112
3113 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3114 section as relro.
3115 (Layout::set_segment_offsets): Reset increase_relro before calling
3116 set_section_addresses a second time.
3117
0aa45fac
CC
31182011-01-04 Cary Coutant <ccoutant@google.com>
3119
3120 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3121 sections before NOBITS sections.
3122
0db46eb4
L
31232011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3124
3125 * version.cc (print_version): Update copyright to 2011.
3126
829c9745
CC
31272010-12-23 Cary Coutant <ccoutant@google.com>
3128
3129 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3130 of OS to this->add. Add OD parameter to second form of the function.
3131
7500420b
ILT
31322010-12-20 Ian Lance Taylor <iant@google.com>
3133
3134 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3135 second of two consecutive entries with same offset.
3136
f8e9a930
RW
31372010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3138
3139 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3140 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3141 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3142 to avoid unneeded links against $(LDADD).
3143 * testsuite/Makefile.in: Regenerate.
3144
2fbb4320
ILT
31452010-12-15 Ian Lance Taylor <iant@google.com>
3146
3147 PR gold/12324
3148 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3149 for R_X86_64_32 and R_X86_64_PC32.
3150 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3151 ver_matching_def_pic.o.
3152 (ver_matching_def_pic.o): New target.
3153
fedb228d
RW
31542010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3155
3156 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3157 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3158 Move definition before File_read::View member definitions.
3159 (File_read::View::~View): Initialize and hold lock before
3160 updating current_mapped_bytes.
3161
9b547ce6
RW
31622010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3163
3164 * dwarf_reader.cc: Remove outdated comment.
3165 * gold-threads.cc: Fix typo in error message.
3166 * archive.cc: Fix typos in comments.
3167 * archive.h: Likewise.
3168 * arm-reloc-property.cc: Likewise.
3169 * arm-reloc-property.h: Likewise.
3170 * arm-reloc.def: Likewise.
3171 * arm.cc: Likewise.
3172 * attributes.h: Likewise.
3173 * cref.cc: Likewise.
3174 * ehframe.cc: Likewise.
3175 * fileread.h: Likewise.
3176 * gold.h: Likewise.
3177 * i386.cc: Likewise.
3178 * icf.cc: Likewise.
3179 * incremental.h: Likewise.
3180 * int_encoding.cc: Likewise.
3181 * layout.h: Likewise.
3182 * main.cc: Likewise.
3183 * merge.h: Likewise.
3184 * object.cc: Likewise.
3185 * object.h: Likewise.
3186 * options.cc: Likewise.
3187 * readsyms.cc: Likewise.
3188 * reduced_debug_output.cc: Likewise.
3189 * reloc.cc: Likewise.
3190 * script-sections.cc: Likewise.
3191 * sparc.cc: Likewise.
3192 * symtab.h: Likewise.
3193 * target-reloc.h: Likewise.
3194 * target.cc: Likewise.
3195 * target.h: Likewise.
3196 * timer.cc: Likewise.
3197 * timer.h: Likewise.
3198 * x86_64.cc: Likewise.
3199
83e17bd5
CC
32002010-12-09 Cary Coutant <ccoutant@google.com>
3201
3202 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3203 stack.
3204 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3205 parameter; change all callers.
3206 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3207 * options.h (warn_execstack): New option.
3208
017257f8
DK
32092010-12-07 Doug Kwan <dougkwan@google.com>
3210
3211 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3212 like function call relocations.
3213
c20cbc06
ILT
32142010-12-07 Ian Lance Taylor <iant@google.com>
3215
3216 * archive.cc (Archive::get_elf_object_for_member): Permit
3217 punconfigured to be NULL.
3218 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3219 (Archive::include_member): Pass NULL to get_elf_object_for_member
3220 if we searched for the archive and this is the first included
3221 object.
3222
4dbfafcc
ILT
32232010-12-01 Ian Lance Taylor <iant@google.com>
3224
3225 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3226 track_relocs_type_ field.
3227 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3228 Set track_relocs_type_.
3229 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3230 contents when using RELA relocs.
3231 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3232 reloc_map_.
3233 * reloc.cc (Track_relocs::next_addend): New function.
3234 * reloc.h (class Track_relocs): Declare next_addend.
3235
e5e19edd
ILT
32362010-12-01 Ian Lance Taylor <iant@google.com>
3237
3238 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3239 virtual destructor.
3240
9a5ce24c
ILT
32412010-12-01 Ian Lance Taylor <iant@google.com>
3242
3243 * README: Update compilers known to work and fail.
3244
c7791212
NC
32452010-11-23 Matthias Klose <doko@ubuntu.com>
3246
3247 * configure.in: For --enable-gold, handle value `default' instead of
3248 `both*'. Always install ld as ld.bfd, install as ld if gold is
3249 not the default.
3250 * configure: Regenerate.
3251
0ad220c9
DK
32522010-11-18 Doug Kwan <dougkwan@google.com>
3253
3254 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3255 and right_alignment to be zero. Store result alignment only if it is
3256 greater than existing alignment.
3257
ab8056e0
CC
32582010-11-16 Cary Coutant <ccoutant@google.com>
3259
3260 PR gold/12220
3261 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3262 Check for ".zdebug_line".
3263
fd064a5b
CC
32642010-11-16 Doug Kwan <dougkwan@google.com>
3265 Cary Coutant <ccoutant@google.com>
3266
3267 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3268 by reference; adjust all callers.
3269 * output.cc (Output_segment::set_section_addresses): Adjust references
3270 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3271 list is empty.
3272 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3273 end at page boundary.
3274
6fc6ea19
CC
32752010-11-16 Cary Coutant <ccoutant@google.com>
3276
3277 PR gold/12220
3278 * layout.cc (Layout::choose_output_section): Transform names of
3279 compressed sections even when using a script with a SECTIONS clause.
3280 (Layout::output_section_name): Remove code to transform
3281 compressed debug section names.
3282 * output.cc (Output_section::add_input_section): Use uncompressed
3283 section size when tracking input sections.
3284
95a2c8d6
RS
32852010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3286
3287 * symtab.h (Symbol::NON_PIC_REF): Remove.
3288 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3289 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3290 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3291 (Symbol::use_plt_offset): Take a flags argument and pass it
3292 directly to needs_dynamic_reloc. Restrict check for undefined
3293 weak symbols to function calls.
3294 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3295 (Target_arm::Scan::global): Use it.
3296 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3297 (Target_arm::Relocate::relocate): Likewise.
3298 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3299 parameter with an r_type parameter. Use get_reference_flags
3300 to get the flags.
3301 (Target_arm::Relocate::relocate): Update accordingly.
3302 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3303 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3304 (Target_i386::Scan::global): Likewise.
3305 (Target_i386::Relocate::relocate): Likewise.
3306 (Target_i386::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_i386::Relocate::relocate): Update accordingly.
3310 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3311 (Target_powerpc::Scan::global): Use it.
3312 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3313 (Target_powerpc::Relocate::relocate): Likewise.
3314 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3315 (Target_sparc::Scan::global): Use it.
3316 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3317 (Target_sparc::Relocate::relocate): Likewise.
3318 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3319 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3320 (Target_x86_64::Scan::global): Likewise.
3321 (Target_x86_64::Relocate::relocate): Likewise.
3322
f625ae50
DK
33232010-11-08 Doug Kwan <dougkwan@google.com>
3324 Cary Coutant <ccoutant@google.com>
3325
3326 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3327 (Arm_exidx_merge_section::section_contents_): New data member.
3328 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3329 (Arm_input_section::~Arm_input_section): De-allocate memory.
3330 (Arm_input_section::original_contents_): New data member.
3331 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3332 in parameters instead of calling Object::section_contents without
3333 locking.
3334 (Arm_output_section::group_section): New parameter TASK. Pass it
3335 to callees that need locking objects.
3336 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3337 to lock EXIDX input sections. Fix a formatting issue. Call
3338 Arm_exidx_merged_section::build_contents to create merged section
3339 contents.
3340 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3341 to lock object of stub table owner.
3342 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3343 TEXT_SIZE to initialize data member TEXT_SIZE_.
3344 (Arm_exidx_input_section::addralign): Fix typo in comment.
3345 (Arm_exidx_input_section::text_size): New method.
3346 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3347 that require locking objects. Lock objects before scanning for stubs
3348 and updating local symbols.
3349 (Arm_input_section<big_endian>::init): Copy contents of original
3350 input section.
3351 (Arm_input_section<big_endian>::do_write): Use saved contents of
3352 original input section instead of calling Object::section_contents
3353 without locking.
3354 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3355 size without calling Object::section_size().
3356 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3357 for size. Allocate a buffer for merged EXIDX entries.
3358 (Arm_exidx_merged_section::build_contents): New method.
3359 (Arm_exidx_merged_section::do_write): Move merge section contents
3360 building code to Arm_exidx_merged_section::build_contetns. Write
3361 out contetns in buffer instead of building it on the fly.
3362 (Arm_relobj::make_exidx_input_section): Also pass text section size
3363 to Arm_exidx_input_section constructor.
3364 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3365 (Arm_dynobj::do_read_symbols): Fix memory leak.
3366 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3367 * target.h: (class Task): Add forward declaration.
3368 (Target::relax): Add new parameter TASK and pass it to
3369 Target::do_relax().
3370 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3371
5f9bcf58
CC
33722010-11-05 Cary Coutant <ccoutant@google.com>
3373
3374 PR gold/10708
3375 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3376 object when reading from the file.
3377 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3378 second layout pass.
3379 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3380 when reading section contents.
3381 (get_section_contents): Likewise.
3382 (icf::find_identical_sections): Likewise.
3383 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3384 object when reading from the file.
3385 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3386 the object when doing deferred section layout.
3387
e597fa08
NC
33882010-11-03 Nick Clifton <nickc@redhat.com>
3389
3390 PR gold/12001
3391 * script.h (class Symbol_assignment: name): New member. Returns
3392 the name of the symbol.
3393 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3394 Returns true if the given symbol name is on the list of
3395 assignments wating to be processed.
3396 * archive.cc (should_incldue_member): If the symbol is undefined,
3397 check to see if it is on the list of symbols pending assignment.
3398
3f9a3278
ILT
33992010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3400
3401 * script-sections.cc (Script_sections::find_memory_region): Check
3402 for a NULL output section pointer.
3403
d06fb4d1
DK
34042010-10-29 Doug Kwan <dougkwan@google.com>
3405
3406 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3407 Output_section::add_relaxed_input_section.
3408 * output.cc (Output_section::add_relaxed_input_section): Add new
3409 arguments LAYOUT and NAME. Set section order index.
3410 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3411 Copy section order index.
3412 * output.h (Output_section::add_relaxed_input_section): Add new
3413 arguments LAYOUT and NAME.
3414
90e24de5
ILT
34152010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3416
3417 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3418 NATIVE_OR_CROSS_LINKER.
3419 * testsuite/Makefile.in: Regenerate.
3420
c9484ea5
DK
34212010-10-20 Doug Kwan <dougkwan@google.com>
3422
3423 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3424 without SHF_LINK_ORDER flags.
3425 * layout.cc (Layout::choose_output_section): Do not filter
3426 SHF_LINK_ORDER flag in a relocatable link.
3427
5bc2f5be
CC
34282010-10-17 Cary Coutant <ccoutant@google.com>
3429
3430 * output.h (Output_segment::set_section_addresses): Change function
3431 signature. Update all callers.
3432 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3433 sections.
3434 (Output_segment::set_section_addresses): Align after last TLS
3435 section. Add padding before last relro section instead of after.
3436
0c91cf04
DK
34372010-10-17 Doug Kwan <dougkwan@google.com>
3438
3439 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3440 GOT output section to be writable.
3441
8c21d9d3
CC
34422010-10-14 Cary Coutant <ccoutant@google.com>
3443
3444 * debug.h (DEBUG_INCREMENTAL): New flag.
3445 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3446 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3447 mode.
3448 * incremental.cc (report_command_line): Ignore all forms of
3449 --incremental.
3450 * layout.cc (Layout::Layout): Check parameters for incremental link
3451 mode.
3452 * options.cc (General_options::parse_incremental): New function.
3453 (General_options::parse_no_incremental): New function.
3454 (General_options::parse_incremental_full): New function.
3455 (General_options::parse_incremental_update): New function.
3456 (General_options::incremental_mode_): New data member.
3457 (General_options::finalize): Check incremental_mode_.
3458 * options.h (General_options): Update help text for --incremental.
3459 Add --no-incremental, --incremental-full, --incremental-update.
3460 (General_options::Incremental_mode): New enum type.
3461 (General_options::incremental_mode): New function.
3462 (General_options::incremental_mode_): New data member.
3463 * parameters.cc (Parameters::incremental_mode_): New data member.
3464 (Parameters::set_options): Set incremental_mode_.
3465 (Parameters::set_incremental_full): New function.
3466 (Parameters::incremental): New function.
3467 (Parameters::incremental_update): New function.
3468 (set_parameters_incremental_full): New function.
3469 * parameters.h (Parameters::set_incremental_full): New function.
3470 (Parameters::incremental): New function.
3471 (Parameters::incremental_update): New function.
3472 (Parameters::incremental_mode_): New data member.
3473 (set_parameters_incremental_full): New function.
3474 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3475 incremental link mode.
3476 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3477 (Sized_relobj::do_relocate_sections): Likewise.
3478 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3479 option.
3480 * testsuite/Makefile.in: Regenerate.
3481 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3482
bb32aa18 34832010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3484
3485 * script-sections.h (class Script_sections): Make
3486 Sections_elements typedef public.
3487 * script-sections.cc (class Sort_output_sections): Add elements_
3488 field. Add constructor which sets it; change all callers.
3489 (Sort_output_sections::is_before): New function.
3490 (Sort_output_sections::operator()): Call is_before.
3491 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3492 conditional.
3493 * testsuite/script_test_10.sh: New test. Test script section
3494 order.
3495 * testsuite/script_test_10.t: Likewise.
3496 * testsuite/script_test_10.s: Likewise.
3497 * testsuite/Makefile.am: Wrap the cross linker tests and the
3498 common tests into NATIVE_OR_CROSS_LINKER.
3499 (check_SCRIPTS): Add script_test_10.sh.
3500 (check_DATA): Add script_test_10.stdout.
3501 (script_test_10.o, script_test_10): New targets.
3502 (script_test_10.stdout): New target.
3503 * configure, testsuite/Makefile.in: Regenerate.
3504
3cef7179
ILT
35052010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3506
3507 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3508 error for the deprecated relocations.
3509 (Target_arm::Scan::global): Likewise.
3510 (Target_arm::Relocate::relocate): Likewise.
3511
7411e9a8
RS
35122010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3513
3514 * fileread.cc (Input_file::find_file): Initialize *found_name
3515 and *namep when using the fallback search for case 4.
3516
6a9da32a
CC
35172010-10-11 Cary Coutant <ccoutant@google.com>
3518
3519 * options.h (class General_options): Redefine -z lazy as an alias for
3520 the negation of -z now.
3521
ac897c20
ILT
35222010-10-11 Ian Lance Taylor <iant@google.com>
3523
3524 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3525 binding.
3526
ea5cae92
NC
35272010-10-06 Nick Clifton <nickc@redhat.com>
3528
3529 * script-sections.cc(class Memory_region): Remove
3530 current_lma_offset_ field. Rename current_vma_offset_ to
3531 current_offset_. Add last_section_ field.
3532 (Memory_region::get_current_vma_address): Rename to
3533 get_current_address.
3534 (Memory_region::get_current_lma_address): Delete.
3535 (Memory_region::increment_vma_offset): Rename to
3536 increment_offset.
3537 (Memory_region::increment_lma_offset): Delete.
3538 (Memory_region::attributes_compatible): New method. Returns
3539 true if the provided section is compatible with the region.
3540 (Memory_region::get_last_section): New method. Returns the last
3541 section to use the region.
3542 (Memory_region::set_last_section): New method. Stores the last
3543 section to use the region.
3544 (Script_sections::block_in_region): New method. Returns true if
3545 a block of memory is contained within a region.
3546 (Script_sections::find_memory_region): New method. Locates a
3547 memory region to be used to set a VMA or LMA address.
3548 (Output_section_definition::set_section_addresses): Add code to
3549 check for addresses set by memory regions.
3550 (Output_segment::set_section_addresses): Remove memory region
3551 walking code.
3552 (Script_sections::create_segment): Add a warning if a header
3553 segment is created outside of any region.
3554 * script-sections.h (class Script_sections): Add prototypes for
3555 find_memory_region and block_in_region methods.
3556 * testsuite/memory_test.s: Use .long instead of .word.
3557 * testsuite/memory_test.t: Add some more output sections.
3558 * testsuite/memory_test.sh: Update expected output.
3559
a9bfd952
DK
35602010-10-02 Doug Kwan <dougkwan@google.com>
3561
3562 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3563 defintion to symtab.h
3564 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3565 declaration to defintion.
3566
bacff3ab
NC
35672010-10-01 Nick Clifton <nickc@redhat.com>
3568
3569 * expression.cc (eval): Replace dummy argument with NULL.
3570 (eval_maybe_dot): Check for a NULL result section pointer.
3571 (Symbol_expression::value): Likewise.
3572 (Dot_expression::value): Likewise.
3573 (BINARY_EXPRESSION): Likewise.
3574 (Max_expression::value): Likewise.
3575 (Min_expression::value): Likewise.
3576 (Absolute_expression::value): Likewise.
3577 (Addr_expression::value_from_output_section): Likewise.
3578 (Loaddddr_expression::value_from_output_section): Likewise.
3579 (Segment_start_expression::value): Likewise.
3580 * script-sections.cc
3581 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3582 argument with NULL.
3583 (Sections_elememt_dot_assignment::set_section_addresses):
3584 Likewise.
3585 (Output_data_expression::do_write_to_buffer): Likewise.
3586 (Output_section_definition::finalize_symbols): Likewise.
3587 (Output_section_definition::set_section_addresses): Likewise.
3588
f81bc8b5
DK
35892010-09-30 Doug Kwan <dougkwan@google.com>
3590
3591 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3592
c95e9f27
ST
35932010-09-28 Sriraman Tallam <tmsriram@google.com>
3594
3595 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 3596 function.
c95e9f27
ST
3597 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3598 virtual function.
3599 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3600 virtual function.
3601 * icf.cc (get_section_contents): Inline merge sections only when
3602 target allows it.
3603
3cac54d2
RW
36042010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3605
3606 * configure: Regenerate.
3607
2904037a
ILT
36082010-09-17 Ian Lance Taylor <iant@google.com>
3609
3610 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
3611 * testsuite/Makefile.am (memory_test.o): New target.
3612 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3613 memory_test.t.
3614 * testsuite/Makefile.in: Rebuild.
2904037a 3615
bca7fb63
DK
36162010-09-17 Doug Kwan <dougkwan@google.com>
3617
3618 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3619 defintion if relocation uses GOT entries of the symbol.
3620 * testsuite/icf_safe_test.sh: Fix test.
3621 * testsuite/icf_safe_so_test.sh: Fix test.
3622
4ef28648
CC
36232010-09-16 Cary Coutant <ccoutant@google.com>
3624
3625 * script_sections.cc (class Memory_region): Remove "NULL" from
3626 vector initializations.
3627
793990de
CC
36282010-09-15 Cary Coutant <ccoutant@google.com>
3629
3630 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3631 Resolve forwarding symbols.
3632
81e015e2
DK
36332010-09-15 Doug Kwan <dougkwan@google.com>
3634
3635 * gold/testsuite/script_test_3.t: Add ARM special sections.
3636 * gold/testsuite/script_test_4.t: Same.
3637 * gold/testsuite/script_test_5.t: Same.
3638 * gold/testsuite/script_test_6.t: Same.
3639 * gold/testsuite/script_test_7.t: Same.
3640 * gold/testsuite/script_test_7.t: Same.
3641 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3642
36171d64
CC
36432010-09-14 Cary Coutant <ccoutant@google.com>
3644
3645 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3646 (Target_x86_64::Relocate::relocate_tls): Replace check for
3647 saw_tls_block_reloc_ with test for executable section.
3648
d89051bd
CC
36492010-09-12 Cary Coutant <ccoutant@google.com>
3650
3651 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3652 position-independent executables to shared libraries need dynamic
3653 relocations.
3654 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3655 position-independent executables.
3656 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3657 * testsuite/Makefile.in: Regenerate.
3658
fca41f0f
NC
36592010-09-10 Nick Clifton <nickc@redhat.com>
3660
3661 PR gold/11997
3662 * testsuite/memory_test.t: Discard any sections that are not
3663 needed.
3664
6695e4b3
L
36652010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3666
3667 PR gold/11996
3668 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3669 "This::" to work around a bug in gcc 4.2.
3670
3671 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3672
0f72bf6f
RÁE
36732010-09-09 Rafael Espindola <espindola@google.com>
3674
3675 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3676 sections with different PF_X flags in the same segment.
3677 (Layout::find_first_load_seg): Search all segments to find the first
3678 one.
3679 * options.h (rosegment): New.
3680
36812010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3682
05a79166 3683 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3684
aa98ff75
DK
36852010-09-08 Doug Kwan <dougkwan@google.com>
3686
3687 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3688 (Arm_relobj::do_relocate_sections): Add new parameter for output
3689 file to match the parent.
3690 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3691 of local symbols instead of input values. Update code to track
3692 changes in gold::relocate_section.
3693 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3694 (Sized_relobj::compute_final_local_value_internal): New methods.
3695 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3696 body into private version of Sized_relobj::compute_final_local_value.
3697 Call the inline method.
3698 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3699 merged symbol value if there is one.
3700 (Symbol_value::has_output_value): New method defintiion.
3701 (Sized_relobj::Compute_final_local_value_status): New enum type.
3702 (Sized_relobj::compute_final_local_value): New methods.
3703 (Sized_relobj::compute_final_local_value_internal): New methods.
3704 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3705 and arm_cortex_a8.sh.
3706 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3707 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3708 New tests.
3709 * Makefile.in: Regenerate.
3710 * testsuite/arm_bl_out_of_range.s: Update test.
3711 * testsuite/thumb_bl_out_of_range.s: Ditto.
3712 * testsuite/thumb_blx_out_of_range.s: Ditto.
3713 * testsuite/arm_branch_out_of_range.sh: New file.
3714 * testsuite/arm_cortex_a8.sh: Ditto.
3715 * testsuite/arm_cortex_a8_b.s: Ditto.
3716 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3717 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3718 * testsuite/arm_cortex_a8_bl.s: Ditto.
3719 * testsuite/arm_cortex_a8_blx.s: Ditto.
3720 * testsuite/arm_cortex_a8_local.s: Ditto.
3721 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3722 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3723
05a79166
L
37242010-09-08 Rafael Espindola <espindola@google.com>
3725
3726 * Makefile.am (memory_test.stdout): Run readelf with -W.
3727 * Makefile.in: Regenerate.
3728 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3729 64 bit output.
3730
33dbc701
RÁE
37312010-09-08 Rafael Espindola <espindola@google.com>
3732
3733 * script-sections.cc (Script_sections::add_memory_region): Convert
3734 field precision to int.
3735 * script.cc (script_set_section_region, script_set_section_region):
3736 Convert field precision to int.
3737
731ca54a
RÁE
37382010-09-08 Rafael Espindola <espindola@google.com>
3739
3740 * arm.cc (do_finalize_sections): Create the __exidx_start and
3741 __exdix_end symbols even when the section is missing.
3742
7f8cd844
NC
37432010-09-08 Nick Clifton <nickc@redhat.com>
3744
3745 * README: Remove claim that MEMORY is not supported.
3746 * expression.cc (script_exp_function_origin)
3747 (script_exp_function_length): Move from here to ...
3748 * script.cc: ... here.
3749 (script_set_section_region, script_add_memory)
3750 (script_parse_memory_attr, script_include_directive): New
3751 functions.
3752 * script-sections.cc
3753 (class Memory_region): New class.
3754 (class Output_section_definition): Add set_memory_region,
3755 set_section_vma, set_section_lma and get_section_name methods.
3756 (class Script_Sections): Add add_memory_region,
3757 find_memory_region, find_memory_region_origin,
3758 find_memory_region_length and set_memory_region methods.
3759 Have set_section_addresses method walk the list of set memory
3760 regions.
3761 Extend the print methos to display memory regions.
3762 * script-sections.h: Add prototypes for new methods.
3763 Add enum for MEMORY region attributes.
3764 * yyscript.y: Add support for parsing MEMORY regions.
3765 * script-c.h: Add prototypes for new functions.
3766 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3767 * testsuite/Makefile.in: Regenerate.
3768 * testsuite/memory_test.sh: New script.
3769 * testsuite/memory_test.s: New assembler source file.
3770 * testsuite/memory_test.t: New linker script.
3771
a4649286
DK
37722010-08-27 Doug Kwan <dougkwan@google.com>
3773
3774 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3775 reference override an existing dynamic weak reference.
3776 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3777 * testsuite/Makefile.in: Regenerate.
3778 * testsuite/dyn_weak_ref.sh: New file.
3779 * testsuite/dyn_weak_ref_1.c: Ditto.
3780 * testsuite/dyn_weak_ref_2.c: Ditto.
3781
b56648ad
ILT
37822010-08-27 Ian Lance Taylor <iant@google.com>
3783
3784 * incremental.h (class Incremental_input_entry): Add virtual
3785 destructor.
3786
809313cb
ILT
37872010-08-27 Ian Lance Taylor <iant@google.com>
3788
3789 * testsuite/start_lib_test_3.c: Mark t3 as used.
3790
11e32464
NC
37912010-08-27 Nick Clifton <nickc@redhat.com>
3792
3793 * options.cc (version_script): Fix small typo in previous
3794 whitespace tidyup.
3795
ca09d69a
NC
37962010-08-25 Nick Clifton <nickc@redhat.com>
3797
3798 * archive.cc: Formatting fixes: Remove whitespace between
3799 typename and following asterisk. Remove whitespace between
3800 function name and opening parenthesis.
3801 * archive.h: Likewise.
3802 * arm.cc: Likewise.
3803 * attributes.cc: Likewise.
3804 * attributes.h: Likewise.
3805 * common.cc: Likewise.
3806 * copy-relocs.cc: Likewise.
3807 * dirsearch.h: Likewise.
3808 * dynobj.cc: Likewise.
3809 * ehframe.cc: Likewise.
3810 * ehframe.h: Likewise.
3811 * expression.cc: Likewise.
3812 * fileread.cc: Likewise.
3813 * fileread.h: Likewise.
3814 * gc.h: Likewise.
3815 * gold-threads.cc: Likewise.
3816 * gold.cc: Likewise.
3817 * i386.cc: Likewise.
3818 * icf.h: Likewise.
3819 * incremental-dump.cc: Likewise.
3820 * incremental.cc: Likewise.
3821 * layout.cc: Likewise.
3822 * layout.h: Likewise.
3823 * main.cc: Likewise.
3824 * merge.cc: Likewise.
3825 * merge.h: Likewise.
3826 * object.cc: Likewise.
3827 * object.h: Likewise.
3828 * options.cc: Likewise.
3829 * options.h: Likewise.
3830 * output.cc: Likewise.
3831 * output.h: Likewise.
3832 * plugin.cc: Likewise.
3833 * plugin.h: Likewise.
3834 * powerpc.cc: Likewise.
3835 * reloc.cc: Likewise.
3836 * script-c.h: Likewise.
3837 * script-sections.cc: Likewise.
3838 * script.cc: Likewise.
3839 * stringpool.cc: Likewise.
3840 * symtab.cc: Likewise.
3841 * symtab.h: Likewise.
3842 * target.cc: Likewise.
3843 * timer.cc: Likewise.
3844 * timer.h: Likewise.
3845 * version.cc: Likewise.
3846 * x86_64.cc: Likewise.
3847
b8fa8750
NC
38482010-08-24 Nick Clifton <nickc@redhat.com>
3849
3850 PR 11899
3851 * layout.cc (segment_precedes): Sort segments by their physical
3852 addresses, if they have been set.
3853
9919d93b
CC
38542010-08-23 Cary Coutant <ccoutant@google.com>
3855
3856 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3857 symbols data.
3858 (Lib_group::include_member): Unlock object after deleting its
3859 symbols data.
3860 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3861 the bug fixed here.
3862
97b4be1c
CC
38632010-08-19 Neil Vachharajani <nvachhar@google.com>
3864 Cary Coutant <ccoutant@google.com>
3865
3866 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3867 constructor, and set_blocker.
3868 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3869 readsyms_blocker_.
3870 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3871 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3872 * testsuite/Makefile.am (start_lib_test): New test case.
3873 * testsuite/Makefile.in: Regenerate.
3874 * testsuite/start_lib_test_main.c: New file.
3875 * testsuite/start_lib_test_1.c: New file.
3876 * testsuite/start_lib_test_2.c: New file.
3877 * testsuite/start_lib_test_3.c: New file.
3878
dd0b1884
ILT
38792010-08-19 Ian Lance Taylor <iant@google.com>
3880
3881 * Makefile.in: Rebuild with automake 1.11.1.
3882 * aclocal.m4: Likewise.
3883 * testsuite/Makefile.in: Likewise.
3884
7223e9ca
ILT
38852010-08-19 Ian Lance Taylor <iant@google.com>
3886
3887 PR 10893
3888 * i386.cc (class Output_data_plt_i386): Update declarations.
3889 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3890 local_ifuncs_ fields.
3891 (Target_i386::do_plt_section_for_global): New function.
3892 (Target_i386::do_plt_section_for_local): New function.
3893 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3894 parameter; change all callers. Initialize global_ifuncs_ and
3895 local_ifuncs_. If doing a static link define __rel_iplt_start and
3896 __rel_iplt_end.
3897 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3898 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3899 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3900 symbols.
3901 (Target_i386::make_plt_section): New function, broken out of
3902 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3903 (Target_i386::make_plt_entry): Call make_plt_section.
3904 (Target_i386::make_local_ifunc_plt_entry): New function.
3905 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3906 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3907 R_386_IRELATIVE to switch.
3908 (Target_i386::Scan::global): Likewise.
3909 (Target_i386::Relocate::relocate): Likewise.
3910 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3911 switch.
3912 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3913 (Target_x86_64::do_plt_section_for_global): New function.
3914 (Target_x86_64::do_plt_section_for_local): New function.
3915 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3916 parameter; change all callers. If doing a static link define
3917 __rela_iplt_start and __rela_iplt_end.
3918 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3919 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3920 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3921 to point to .plt.
3922 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3923 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3924 switch.
3925 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3926 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3927 R_X86_64_IRELATIVE to switch.
3928 (Target_x86_64::Scan::global): Likewise.
3929 (Target_x86_64::Relocate::relocate): Likewise.
3930 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3931 switch.
3932 * target.h (class Target): Add plt_section_for_global and
3933 plt_section_for_local functions. Add do_plt_section_for_global
3934 and do_plt_section_for_local virtual functions.
3935 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3936 clarifying comments.
3937 (Symbol::use_plt_offset): Handle IFUNC symbol.
3938 * object.cc (Sized_relobj::Sized_relobj): Initialize
3939 local_plt_offsets_.
3940 (Sized_relobj::local_has_plt_offset): New function.
3941 (Sized_relobj::local_plt_offset): New function.
3942 (Sized_relobj::set_local_plt_offset): New function.
3943 (Sized_relobj::do_count): Handle IFUNC symbol.
3944 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3945 a bit away from input_shndx_ field. Add set_is_func_symbol and
3946 is_ifunc_symbol functions.
3947 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3948 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3949 local_plt_offsets_ field.
3950 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3951 * output.h (class Output_section_data): Add non-const
3952 output_section function.
3953 (class Output_data_got): Update declarations.
3954 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3955 Add use_plt_offset parameter to global and local constructors.
3956 Change all callers. Change local_sym_index_ field to 31 bits.
3957 Change GSYM_CODE and CONSTANT_CODE accordingly.
3958 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3959 doing a static link don't set sh_link field.
3960 (Output_data_got::Got_entry::write): Use PLT offset if
3961 appropriate.
3962 (Output_data_got::add_global_plt): New function.
3963 (Output_data_got::add_local_plt): New function.
3964 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3965 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3966 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3967 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3968 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3969 IFUNC conditional.
3970 * testsuite/ifunc-sel.h: New file.
3971 * testsuite/ifuncmain1.c: New file.
3972 * testsuite/ifuncmain1vis.c: New file.
3973 * testsuite/ifuncmod1.c: New file.
3974 * testsuite/ifuncdep2.c: New file.
3975 * testsuite/ifuncmain2.c: New file.
3976 * testsuite/ifuncmain3.c: New file.
3977 * testsuite/ifuncmod3.c: New file.
3978 * testsuite/ifuncmain4.c: New file.
3979 * testsuite/ifuncmain5.c: New file.
3980 * testsuite/ifuncmod5.c: New file.
3981 * testsuite/ifuncmain6pie.c: New file.
3982 * testsuite/ifuncmod6.c: New file.
3983 * testsuite/ifuncmain7.c: New file.
3984 * configure, testsuite/Makefile.in: Rebuild.
3985
56f75c03
ILT
39862010-08-18 Ian Lance Taylor <iant@google.com>
3987
3988 * incremental.cc
3989 (Output_section_incremental_inputs::write_input_files): Add cast
3990 to avoid signed/unsigned comparison warning.
3991 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3992
55455f89
CC
39932010-08-12 Cary Coutant <ccoutant@google.com>
3994
3995 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3996
e2054bcb
ILT
39972010-08-13 Ian Lance Taylor <iant@google.com>
3998
3999 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4000
74f67560
DK
40012010-08-12 Cary Coutant <ccoutant@google.com>
4002 Doug Kwan <dougkwan@google.com>
4003
4004 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4005 defintion overrides non-weak undef, remember that the original undef
4006 is not weak.
4007 * symtab.cc (Symbol_table::sized_write_global): For undef without
4008 an original weak binding, set binding to global in output.
4009 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4010 * testsuite/Makefile.in: Regenerate.
4011 * testsuite/strong_ref_weak_def.sh: New file.
4012 * testsuite/strong_ref_weak_def_1.c: Ditto.
4013 * testsuite/strong_ref_weak_def_2.c: Ditto.
4014
d1238d12
CC
40152010-08-12 Cary Coutant <ccoutant@google.com>
4016
4017 * testsuite/incremental_test.sh: Rewrite.
4018 * testsuite/incremental_test_1.c: Rewrite.
4019 * testsuite/incremental_test_2.c: Rewrite.
4020
0e70b911
CC
40212010-08-12 Cary Coutant <ccoutant@google.com>
4022
4023 * arm.cc (Target_arm::got_size): Add const.
4024 (Target_arm::got_entry_count): New function.
4025 (Target_arm::plt_entry_count): New function.
4026 (Target_arm::first_plt_entry_offset): New function.
4027 (Target_arm::plt_entry_size): New function.
4028 (Output_data_plt_arm::entry_count): New function.
4029 (Output_data_plt_arm::first_plt_entry_offset): New function.
4030 (Output_data_plt_arm::get_plt_entry_size): New function.
4031 * i386.cc (Target_i386::got_size): Add const.
4032 (Target_i386::got_entry_count): New function.
4033 (Target_i386::plt_entry_count): New function.
4034 (Target_i386::first_plt_entry_offset): New function.
4035 (Target_i386::plt_entry_size): New function.
4036 (Output_data_plt_i386::entry_count): New function.
4037 (Output_data_plt_i386::first_plt_entry_offset): New function.
4038 (Output_data_plt_i386::get_plt_entry_size): New function.
4039 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4040 find_incremental_inputs_sections. Dump incremental_got_plt section.
4041 * incremental.cc: Include target.h.
4042 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4043 parameter. Adjust all callers. Find incremental_got_plt section.
4044 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4045 section.
4046 (Output_section_incremental_inputs::set_final_data_size): Calculate
4047 size of incremental_got_plt section.
4048 (Output_section_incremental_inputs::do_write): Write the
4049 incremental_got_plt section.
4050 (Got_plt_view_info): New struct.
4051 (Local_got_offset_visitor): New class.
4052 (Global_got_offset_visitor): New class.
4053 (Global_symbol_visitor_got_plt): New class.
4054 (Output_section_incremental_inputs::write_got_plt): New function.
4055 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4056 Add parameter. Adjust all callers.
4057 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4058 (Incremental_inputs::got_plt_section): New function.
4059 (Incremental_inputs::got_plt_section_): New data member.
4060 (Incremental_got_plt_reader): New class.
4061 * layout.cc (Layout::create_incremental_info_sections): Add the
4062 incremental_got_plt section.
4063 * object.h (Got_offset_list::get_list): New function.
4064 (Got offset_list::for_all_got_offsets): New function.
4065 (Sized_relobj::local_got_offset_list): New function.
4066 * powerpc.cc (Target_powerpc::got_size): Add const.
4067 (Target_powerpc::got_entry_count): New function.
4068 (Target_powerpc::plt_entry_count): New function.
4069 (Target_powerpc::first_plt_entry_offset): New function.
4070 (Target_powerpc::plt_entry_size): New function.
4071 (Output_data_plt_powerpc::entry_count): New function.
4072 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4073 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4074 * sparc.cc (Target_sparc::got_size): Add const.
4075 (Target_sparc::got_entry_count): New function.
4076 (Target_sparc::plt_entry_count): New function.
4077 (Target_sparc::first_plt_entry_offset): New function.
4078 (Target_sparc::plt_entry_size): New function.
4079 (Output_data_plt_sparc::entry_count): New function.
4080 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4081 (Output_data_plt_sparc::get_plt_entry_size): New function.
4082 * symtab.h (Symbol::got_offset_list): New function.
4083 (Symbol_table::for_all_symbols): New function.
4084 * target.h (Sized_target::got_entry_count): New function.
4085 (Sized_target::plt_entry_count): New function.
4086 (Sized_target::plt_entry_size): New function.
4087 * x86_64.cc (Target_x86_64::got_size): Add const.
4088 (Target_x86_64::got_entry_count): New function.
4089 (Target_x86_64::plt_entry_count): New function.
4090 (Target_x86_64::first_plt_entry_offset): New function.
4091 (Target_x86_64::plt_entry_size): New function.
4092 (Output_data_plt_x86_64::entry_count): New function.
4093 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4094 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4095
09ec0418
CC
40962010-08-12 Cary Coutant <ccoutant@google.com>
4097
4098 * archive.cc: Include incremental.h.
4099 (Archive::Archive): Initialize incremental_info_.
4100 (Archive::include_member): Record archive members in incremental info.
4101 (Add_archive_symbols::run): Record begin and end of an archive in
4102 incremental info.
4103 (Lib_group::include_member): Record objects in incremental info.
4104 * archive.h (Incremental_archive_entry): Forward declaration.
4105 (Archive::set_incremental_info): New member function.
4106 (Archive::incremental_info): New member function.
4107 (Archive::Unused_symbol_iterator): New class.
4108 (Archive::unused_symbols_begin): New member function.
4109 (Archive::unused_symbols_end): New member function.
4110 (Archive::incremental_info_): New data member.
4111 * incremental-dump.cc (find_input_containing_global): New function.
4112 (dump_incremental_inputs): Dump new incremental info sections.
4113 * incremental.cc: Include symtab.h.
4114 (Output_section_incremental_inputs): New class.
4115 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4116 new incremental info sections.
4117 (Sized_incremental_binary::do_check_inputs): Likewise.
4118 (Incremental_inputs::report_archive): Remove.
4119 (Incremental_inputs::report_archive_begin): New function.
4120 (Incremental_inputs::report_archive_end): New function.
4121 (Incremental_inputs::report_object): New function.
4122 (Incremental_inputs::finalize_inputs): Remove.
4123 (Incremental_inputs::report_input_section): New function.
4124 (Incremental_inputs::report_script): Rewrite.
4125 (Incremental_inputs::finalize): Do nothing but finalize string table.
4126 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4127 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4128 (Incremental_inputs::create_data_sections): New function.
4129 (Incremental_inputs::relocs_entsize): New function.
4130 (Output_section_incremental_inputs::set_final_data_size): New function.
4131 (Output_section_incremental_inputs::do_write): New function.
4132 (Output_section_incremental_inputs::write_header): New function.
4133 (Output_section_incremental_inputs::write_input_files): New function.
4134 (Output_section_incremental_inputs::write_info_blocks): New function.
4135 (Output_section_incremental_inputs::write_symtab): New function.
4136 * incremental.h (Incremental_script_entry): Forward declaration.
4137 (Incremental_object_entry): Forward declaration.
4138 (Incremental_archive_entry): Forward declaration.
4139 (Incremental_inputs): Forward declaration.
4140 (Incremental_inputs_header_data): Remove.
4141 (Incremental_inputs_header): Remove.
4142 (Incremental_inputs_header_write): Remove.
4143 (Incremental_inputs_entry_data): Remove.
4144 (Incremental_inputs_entry): Remove.
4145 (Incremental_inputs_entry_write): Remove.
4146 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4147 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4148 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4149 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4150 Likewise.
4151 (Incremental_input_entry): New class.
4152 (Incremental_script_entry): New class.
4153 (Incremental_object_entry): New class.
4154 (Incremental_archive_entry): New class.
4155 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4156 (Incremental_inputs::report_inputs): Remove.
4157 (Incremental_inputs::report_archive): Remove.
4158 (Incremental_inputs::report_archive_begin): New function.
4159 (Incremental_inputs::report_archive_end): New function.
4160 (Incremental_inputs::report_object): Change prototype.
4161 (Incremental_inputs::report_input_section): New function.
4162 (Incremental_inputs::report_script): Change prototype.
4163 (Incremental_inputs::get_reloc_count): New function.
4164 (Incremental_inputs::set_reloc_count): New function.
4165 (Incremental_inputs::create_data_sections): New function.
4166 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4167 (Incremental_inputs::inputs_section): New function.
4168 (Incremental_inputs::symtab_section): New function.
4169 (Incremental_inputs::relocs_section): New function.
4170 (Incremental_inputs::get_stringpool): Add const.
4171 (Incremental_inputs::command_line): Add const.
4172 (Incremental_inputs::inputs): Remove.
4173 (Incremental_inputs::command_line_key): New function.
4174 (Incremental_inputs::input_file_count): New function.
4175 (Incremental_inputs::input_files): New function.
4176 (Incremental_inputs::relocs_entsize): New function.
4177 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4178 (Incremental_inputs::finalize_inputs): Remove.
4179 (Incremental_inputs::Input_info): Remove.
4180 (Incremental_inputs::lock_): Remove.
4181 (Incremental_inputs::inputs_): Change type.
4182 (Incremental_inputs::inputs_map_): Remove.
4183 (Incremental_inputs::current_object_entry_): New data member.
4184 (Incremental_inputs::inputs_section_): New data member.
4185 (Incremental_inputs::symtab_section_): New data member.
4186 (Incremental_inputs::relocs_section_): New data member.
4187 (Incremental_inputs::reloc_count_): New data member.
4188 (Incremental_inputs_reader): New class.
4189 (Incremental_symtab_reader): New class.
4190 (Incremental_relocs_reader): New class.
4191 * layout.cc (Layout::finalize): Move finalization of incremental info
4192 and creation of incremental info sections to follow finalization of
4193 symbol table. Set offsets for postprocessing sections.
4194 (Layout::create_incremental_info_sections): Call
4195 Incremental_inputs::create_data_sections. Add incremental symtab
4196 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4197 sections to layout after input sections.
4198 * layout.h (struct Timespec): Forward declaration.
4199 (Layout::incremental_inputs): Add const.
4200 (Layout::create_incremental_info_sections): Add parameter.
4201 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4202 * object.cc: Include incremental.h.
4203 (Relobj::finalize_incremental_relocs): New function.
4204 (Sized_relobj::do_layout): Record input sections in incremental info.
4205 * object.h (Object::output_section): New function.
4206 (Object::output_section_offset): Moved from Relobj.
4207 (Object::get_incremental_reloc_base): New function.
4208 (Object::get_incremental_reloc_count): New function.
4209 (Object::do_output_section): New function.
4210 (Object::do_output_section_offset): Moved from Relobj.
4211 (Object::do_get_incremental_reloc_base): New function.
4212 (Object::do_get_incremental_reloc_count): New function.
4213 (Object::Object): Initialize new data members.
4214 (Relobj::output_section): Renamed do_output_section and moved to
4215 protected.
4216 (Relobj::output_section_offset): Moved to Object.
4217 (Relobj::do_get_incremental_reloc_base): New function.
4218 (Relobj::do_get_incremental_reloc_count): New function.
4219 (Relobj::allocate_incremental_reloc_counts): New function.
4220 (Relobj::count_incremental_reloc): New function.
4221 (Relobj::finalize_incremental_relocs): New function.
4222 (Relobj::next_incremental_reloc_index): New function.
4223 (Relobj::reloc_counts_): New data member.
4224 (Relobj::reloc_bases_): New data member.
4225 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4226 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4227 (Sized_relobj::incremental_relocs_scan): New function.
4228 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4229 (Sized_relobj::incremental_relocs_write): New function.
4230 (Sized_relobj::incremental_relocs_write_reltype): New function.
4231 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4232 incremental link.
4233 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4234 archives and object files elsewhere.
4235 (Add_symbols::run): Report object files here.
4236 (Finish_group::run): Report end of archive at end of group.
4237 * reloc.cc: Include layout.h, incremental.h.
4238 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4239 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4240 (Sized_relobj::incremental_relocs_scan): New function.
4241 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4242 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4243 (Sized_relobj::incremental_relocs_write): New function.
4244 (Sized_relobj::incremental_relocs_write_reltype): New function.
4245 * script.cc (read_input_script): Rewrite test for incremental link.
4246 Change call to Incremental_inputs::report_script.
4247 * symtab.h (Symbol_table::first_global_index): New function.
4248 (Symbol_table::output_count): New function.
4249
ce0d1972
DK
42502010-08-12 Doug Kwan <dougkwan@google.com>
4251
4252 * arm.cc (Target_arm::merge_object_attributes): Check command line
4253 options --no-wchar-size-warning and --no-enum-size-warning.
4254 * options.h (General_options): Add ld-compatible options
4255 --no-enum-size-warning and --no-wchar-size-warning.
4256
6e5710ce
ILT
42572010-08-04 Ian Lance Taylor <iant@google.com>
4258
4259 * x86_64.cc (Target_x86_64::Scan::local): Use
4260 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4261 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4262 (Target_x86_64::Scan::global): Likewise.
4263 (Target_x86_64::Relocate::relocate): Likewise.
4264 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4265 Likewise.
4266
fef830db
CC
42672010-08-03 Cary Coutant <ccoutant@google.com>
4268
4269 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4270 to reserve space in merged_strings vector. Keep total input size
4271 for stats.
4272 (Output_merge_string::do_print_merge_stats): Print total input size.
4273 * merge.h (Output_merge_string): Add input_size_ field.
4274 * stringpool.cc (Stringpool_template::string_length): Move
4275 implementations out of Stringpool_template class and place in
4276 stringpool.h.
4277 * stringpool.h (string_length): Move out of Stringpool_template.
4278
1e3811b0
ILT
42792010-08-03 Ian Lance Taylor <iant@google.com>
4280
4281 PR 11712
4282 * layout.cc (relaxation_loop_body): If address of load segment is
4283 set, adjust address to include headers if possible.
4284
7af0c620
ILT
42852010-08-03 Ian Lance Taylor <iant@google.com>
4286
4287 * version.cc (version_string): Bump to 1.10.
4288
22f0da72
ILT
42892010-08-03 Ian Lance Taylor <iant@google.com>
4290
4291 PR 11805
4292 * layout.h (enum Output_section_order): Define.
4293 (class Layout): Update declarations.
4294 * layout.cc (Layout::get_output_section): Add order parameter.
4295 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4296 is_first_non_relro parameters. Change all callers.
4297 (Layout::choose_output_section): Likewise.
4298 (Layout::add_output_section_data): Likewise.
4299 (Layout::make_output_section): Likewise. Set order.
4300 (Layout::default_section_order): New function.
4301 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4302 * output.cc (Output_section::Output_section): Initialize order_.
4303 Don't initialize deleted fields.
4304 (Output_segment::Output_segment): Don't initialize deleted
4305 fields.
4306 (Output_segment::add_output_section_to_load): New function
4307 replacing add_output_section. Change all callers to call this or
4308 add_output_section_to_nonload.
4309 (Output_segment::add_output_section_to_nonload): New function.
4310 (Output_segment::remove_output_section): Rewrite.
4311 (Output_segment::add_initial_output_data): Likewise.
4312 (Output_segment::has_any_data_sections): Likewise.
4313 (Output_segment::is_first_section_relro): Likewise.
4314 (Output_segment::maximum_alignment): Likewise.
4315 (Output_segment::has_dynamic_reloc): New function replacing
4316 dynamic_reloc_count. Change all callers.
4317 (Output_segment::has_dynamic_reloc_list): New function replacing
4318 dynamic_reloc_count_list. Change all callers.
4319 (Output_segment::set_section_addresses): Rewrite.
4320 (Output_segment::set_offset): Rewrite.
4321 (Output_segment::find_first_and_last_list): Remove.
4322 (Output_segment::set_tls_offsets): Rewrite.
4323 (Output_segment::first_section_load_address): Likewise.
4324 (Output_segment::output_section_count): Likewise.
4325 (Output_segment::section_with_lowest_load_address): Likewise.
4326 (Output_segment::write_section_headers): Likewise.
4327 (Output_segment::print_sections_to_map): Likewise.
4328 * output.h (class Output_data): Remove dynamic_reloc_count_
4329 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4330 (Output_data::add_dynamic_reloc): Rewrite.
4331 (Output_data::has_dynamic_reloc): New function.
4332 (Output_data::dynamic_reloc_count): Remove.
4333 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4334 is_last_relro_, is_first_non_relro_, is_interp_,
4335 is_dynamic_linker_section_ fields. Add order and set_order
4336 functions. Remove is_relro_local, set_is_relro_local,
4337 is_last_relro, set_is_last_relro, is_first_non_relro,
4338 set_is_first_non_relro functions, is_interp, set_is_interp,
4339 is_dynamic_linker_section, and set_is_dynamic_linker_section
4340 functions.
4341 (class Output_segment): Change Output_data_list from std::list to
4342 std:;vector. Add output_lists_ field. Remove output_data_ and
4343 output_bss_ fields. Update declarations.
4344
3ff2ccb0
ILT
43452010-08-02 Ian Lance Taylor <iant@google.com>
4346
4347 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4348 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4349 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4350
88a4108b
ILT
43512010-08-02 Ian Lance Taylor <iant@google.com>
4352
4353 PR 11855
4354 * script.cc (Script_options::Script_options): Initialize
4355 symbol_definitions_ and symbol_references_.
4356 (Script_options::add_symbol_assignment): Update
4357 symbol_definitions_ and symbol_references_.
4358 (Script_options::add_symbol_reference): New function.
4359 (script_symbol): New function.
4360 * script.h (class Script_options): Add symbol_definitions_ and
4361 symbol_references_ fields.
4362 (Script_options::referenced_const_iterator): New type.
4363 (Script_options::referenced_begin): New function.
4364 (Script_options::referenced_end): New function.
4365 (Script_options::is_referenced): New function.
4366 (Script_options::any_unreferenced): New function.
4367 * script-c.h (script_symbol): Declare.
4368 * yyscript.y (exp): Call script_symbol.
4369 * symtab.cc: Include "script.h".
4370 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4371 Change all callers. Check symbols referenced by scripts.
4372 (Symbol_table::add_undefined_symbols_from_command_line): Add
4373 layout parameter. Change all callers.
4374 (Symbol_table::do_add_undefined_symbols_from_command_line):
4375 Likewise. Break out loop body. Check symbols referenced by
4376 scripts.
4377 (Symbol_table::add_undefined_symbol_from_command_line): New
4378 function broken out of
4379 do_add_undefined_symbols_from_command_line.
4380 * symtab.h (class Symbol_table): Update declarations.
4381 * archive.cc: Include "layout.h".
4382 (Archive::should_include_member): Add layout parameter. Change
4383 all callers. Check for symbol mentioned in expression.
4384 * archive.h (class Archive): Update declaration.
4385 * object.cc (Sized_relobj::do_should_include_member): Add layout
4386 parameter.
4387 * object.h (Object::should_include_member): Add layout parameter.
4388 Change all callers.
4389 (Object::do_should_include_member): Add layout parameter.
4390 (class Sized_relobj): Update declaration.
4391 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4392 parameter.
4393 * dynobj.h (class Sized_dynobj): Update declaration.
4394 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4395 layout parameter.
4396 * plugin.h (class Sized_pluginobj): Update declaration.
4397
5f1ab67a
ILT
43982010-08-02 Ian Lance Taylor <iant@google.com>
4399
4400 PR 11866
4401 * output.cc (Output_segment::set_offset): Search for the first and
4402 last sections rather than assuming that the list is in order.
4403 (Output_segment::find_first_and_last_list): New function.
4404 * output.h (class Output_segment): Update declarations.
4405 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4406 (relro_strip_test_SOURCES): New variable.
4407 (relro_strip_test_DEPENDENCIES): New variable.
4408 (relro_strip_test_LDFLAGS): New variable.
4409 (relro_strip_test_LDADD): New variable.
4410 (relro_strip_test.so): New target.
4411
a8df5856
ILT
44122010-08-02 Ian Lance Taylor <iant@google.com>
4413
4414 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4415 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4416 (Target_i386::got_tlsdesc_section): New function.
4417 (Target_i386::got_section): Create space for GOT entries for
4418 TLSDESC relocations.
4419 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4420 R_386_TLS_GOTDESC.
4421 (Target_i386::Scan::global): Likewise.
4422 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4423 using TLSDESC GOT.
4424 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4425 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4426 (Target_x86_64::got_tlsdesc_section): New function.
4427 (Target_x86_64::got_section): Create space for GOT entries for
4428 TLSDESC relocations.
4429 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4430 R_386_TLS_GOTDESC.
4431 (Target_x86_64::Scan::global): Likewise.
4432 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4433 using TLSDESC GOT.
4434
0c10a0a6
ILT
44352010-08-02 Ian Lance Taylor <iant@google.com>
4436
4437 * testsuite/final_layout.sh: Use dc to convert from hex to
4438 decimal.
4439
41cbeecc
ST
44402010-07-29 Sriraman Tallam <tmsriram@google.com>
4441
4442 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4443 paramter to the call to gold::gc_process_relocs.
4444 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4445 paramter to the call to gold::gc_process_relocs.
4446 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4447 parameter to the call to gold::gc_process_relocs.
4448 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4449 template parameter to the call to gold::gc_process_relocs.
4450 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4451 paramter to the call to gold::gc_process_relocs.
4452 * gc.h (get_embedded_addend_size): New function.
4453 (gc_process_relocs): Save the size of the reloc for use by ICF.
4454 * icf.cc (get_section_contents): Get the addend from the text section
4455 for SHT_REL relocation sections.
4456 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4457 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4458 * int_encoding.h (read_from_pointer): New overloaded function.
4459 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4460 * testsuite/icf_sht_rel_addend_test.sh: New file.
4461 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4462 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4463
6ea55b82
RW
44642010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4465
4466 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4467 * Makefile.in: Regenerate.
4468 * testsuite/Makefile.in: Regenerate.
4469
9691462b
ILT
44702010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4471
4472 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4473 * gold/testsuite/debug_msg.cc: Likewise.
4474 * gold/testsuite/odr_violation1.cc
4475 * gold/testsuite/odr_violation2.cc
4476
76897331
CC
44772010-07-21 Cary Coutant <ccoutant@google.com>
4478
4479 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4480 string, and length fields.
4481 (Output_merge_string::Merged_strings_list): New type.
4482 (Output_merge_string::Merged_strings_lists): New typedef.
4483 (Output_merge_string): Replace merged_strings_ with
4484 merged_strings_lists_.
4485 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4486 Merged_strings_list per input object and section. Don't store pointer
4487 to the string. Don't store length with each merged string entry.
4488 (Output_merge_string::finalize_merged_data): Loop over list of merged
4489 strings lists. Recompute length of each merged string.
4490
78384e8f
CC
44912010-07-15 Cary Coutant <ccoutant@google.com>
4492
4493 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4494 here.
4495
783659f9
ILT
44962010-07-14 Ian Lance Taylor <iant@google.com>
4497
4498 * descriptors.cc (Descriptors::open): Report correct name in error
4499 message.
4500
131687b4
DK
45012010-07-13 Doug Kwan <dougkwan@google.com>
4502
4503 * arm.cc (Arm_input_section::Arm_input_section): For a
4504 SHT_ARM_EXIDX section, always keeps the input sections.
4505 (Arm_input_section::set_exidx_section_link): New method.
4506 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4507 has_errors_ to false.
4508 (Arm_exidx_input_section::has_errors,
4509 Arm_exidx_input_section::set_has_errors): New methods.
4510 (Arm_exidx_input_section::has_errors_): New data member.
4511 (Arm_relobj::get_exidx_shndx_list): New method.
4512 (Arm_output_section::append_text_sections_to_list): Do not skip
4513 section without SHF_EXECINSTR.
4514 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4515 errors.
4516 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4517 section header. Make error messages more verbose. Check for
4518 a non-executable section linked to an EXIDX section.
4519 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4520 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4521 check that there is no deferred EXIDX section if we exit early.
4522 Instead of not making an EXIDX section in case of an error, make one
4523 and set the has_errors flag of it.
4524 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4525 in a relocatable link.
4526 (Target_arm::do_relax): Look for the EXIDX output section instead of
4527 assuming that it is called .ARM.exidx.
4528 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4529 section list. Do not check for SHF_EXECINSTR section flags but
4530 skip any input section with errors.
4531 * output.cc (Output_section::Output_section): Initialize
4532 always_keeps_input_sections_ to false.
4533 (Output_section::add_input_section): Check for
4534 always_keeps_input_sections_.
4535 * output.h (Output_section::always_keeps_input_sections,
4536 Output_section::set_always_keeps_input_sections): New methods.
4537 (Output_section::always_keeps_input_sections): New data member.
4538
69517287
RÁE
45392010-07-13 Rafael Espindola <espindola@google.com>
4540
4541 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4542 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4543
82742395
ILT
45442010-07-13 Philip Herron <herron.philip@googlemail.com>
4545 Ian Lance Taylor <iant@google.com>
4546
4547 * output.h (Output_section_lookup_maps::add_merge_section):
4548 Correct check of whether value was inserted.
4549 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4550 (Output_section_lookup_maps::add_relaxed_input_section):
4551 Likewise.
4552 * arm.cc (Target_arm::got_section): Remove used local os.
4553 * i386.cc (Target_i386::got_section): Likewise.
4554 * x86_64.cc (Target_x86_64::got_section): Likewise.
4555 * sparc.cc (Target_sparc::got_section): Likewise.
4556 (Target_sparc::relocate): Remove unused local have_got_offset.
4557 * powerpc.cc (Target_powerpc::relocate): Likewise.
4558
f2d707b5
ILT
45592010-07-13 Ian Lance Taylor <iant@google.com>
4560
241531d6
ILT
4561 * compressed_output.cc (zlib_decompress): Fix signature in
4562 !HAVE_ZLIB_H case.
4563
f2d707b5
ILT
4564 * archive.cc (Archive::include_member): Unlock an external member
4565 of a thin archive. Don't bother to delete an object we know is
4566 NULL.
4567
a2e47362
CC
45682010-07-12 Cary Coutant <ccoutant@google.com>
4569
4570 * compressed_output.cc (zlib_decompress): New function.
4571 (get_uncompressed_size): New function.
4572 (decompress_input_section): New function.
4573 * compressed_output.h (get_uncompressed_size): New function.
4574 (decompress_input_section): New function.
4575 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4576 Handle compressed debug sections.
4577 * layout.cc (is_compressed_debug_section): New function.
4578 (Layout::output_section_name): Map compressed section names to
4579 canonical names.
4580 * layout.h (is_compressed_debug_section): New function.
4581 (is_debug_info_section): Recognize compressed debug sections.
4582 * merge.cc: Include compressed_output.h.
4583 (Output_merge_data::do_add_input_section): Handle compressed
4584 debug sections.
4585 (Output_merge_string::do_add_input_section): Handle compressed
4586 debug sections.
4587 * object.cc: Include compressed_output.h.
4588 (Sized_relobj::Sized_relobj): Initialize new data members.
4589 (build_compressed_section_map): New function.
4590 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4591 * object.h (Object::section_is_compressed): New method.
4592 (Object::do_section_is_compressed): New method.
4593 (Sized_relobj::Compressed_section_map): New type.
4594 (Sized_relobj::do_section_is_compressed): New method.
4595 (Sized_relobj::compressed_sections_): New data member.
4596 * output.cc (Output_section::add_input_section): Handle compressed
4597 debug sections.
4598 * reloc.cc: Include compressed_output.h.
4599 (Sized_relobj::write_sections): Handle compressed debug sections.
4600
ce279a62
CC
46012010-07-08 Cary Coutant <ccoutant@google.com>
4602
4603 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4604 weak when resolving to a dynamic def.
4605 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4606 for weak undef/dynamic def cases. Adjust callers.
4607 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4608 undef_binding_weak_.
4609 (Symbol_table::sized_write_globals): Adjust symbol binding.
4610 (Symbol_table::sized_write_symbol): Add binding parameter.
4611 * symtab.h (Symbol::set_undef_binding): New method.
4612 (Symbol::is_undef_binding_weak): New method.
4613 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4614 (Symbol_table::should_override): Add new parameter.
4615 (Symbol_table::sized_write_symbol): Add new parameter.
4616
4617 * testsuite/weak_undef_file1.cc: Add new test case.
4618 * testsuite/weak_undef_file2.cc: Fix header comment.
4619 * testsuite/weak_undef_test.cc: Add new test case.
4620
b2286c10
DK
46212010-06-29 Doug Kwan <dougkwan@google.com>
4622
4623 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4624 Initialize USE_SYMBOL_.
4625 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4626 definition.
4627 (Arm_reloc_property::uses_symbol_): New data member declaration.
4628 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4629 uses symbol value and symbol is undefined but not weakly undefined.
4630
4802450a
RÁE
46312010-06-28 Rafael Espindola <espindola@google.com>
4632
4633 * plugin.cc (Plugin::load): Use dlerror.
4634
e5ca47ba
ILT
46352010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4636
4637 * symtab.cc (detect_odr_violations): When reporting an ODR
4638 violation, report an object where the symbol is defined.
4639
8a75a161
DK
46402010-06-25 Doug Kwan <dougkwan@google.com>
4641
4642 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4643 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4644 definition.
4645 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4646 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4647 target hook to detect function points.
4648 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4649 * icf.h (Icf::check_section_for_function_pointers): Change type of
4650 parameter SECTION_NAME to const reference to std::string. Use
4651 target hook to determine if section may have unsafe pointers.
4652 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4653 method definition.
4654
42218b9f
RÁE
46552010-06-21 Rafael Espindola <espindola@google.com>
4656
4657 * fileread.cc (Input_file::find_fie): New
4658 (Input_file::open): Use Input_file::find_fie.
4659 * fileread.h (Input_file::find_fie): New
4660 * plugin.cc (set_extra_library_path): New.
4661 (Plugin::load): Add set_extra_library_path to the transfer vector.
4662 (Plugin_manager::set_extra_library_path): New.
4663 (Plugin_manager::add_input_file): Use the extra search path if set.
4664 (set_extra_library_path(): New.
4665 * plugin.h (Plugin_manager): Add set_extra_library_path and
4666 extra_search_path_.
4667
a0506cca
CC
46682010-06-19 Cary Coutant <ccoutant@google.com>
4669
4670 * layout.cc (gdb_sections): Add .debug_types.
4671 (lines_only_debug_sections): Likewise.
4672
6508b958
RÁE
46732010-06-18 Rafael Espindola <espindola@google.com>
4674
4675 * plugin.cc (add_input_file,add_input_library)
4676 (Plugin_manager::add_input_file): Make filename arguments const.
4677 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4678 const.
4679
3e235302
DK
46802010-06-16 Doug Kwan <dougkwan@google.com>
4681
4682 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4683 .ARM.attributes section if we have not merged any input
4684 attributes sections.
4685
106e8a6c
DK
46862010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4687
4688 * arm.cc: Allow combining objects with no EABI version
4689 information.
4690
91ff43fe
RÁE
46912010-06-15 Rafael Espindola <espindola@google.com>
4692
4693 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4694
68ed838c
ILT
46952010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4696
4697 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4698 (struct iovec): Correct !HAVE_READV definition.
4699
f3a2388f
CC
47002010-06-10 Cary Coutant <ccoutant@google.com>
4701
4702 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4703 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4704 reloc sections.
4705 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4706
4707 PR 11683
4708 * symtab.h (Symbol::is_placeholder): New member function.
4709 * target-reloc.h (relocate_section): Check for placeholder symbols.
4710
4711 * testsuite/Makefile.am (plugin_test_8): New test.
4712 (plugin_test_9): New test.
4713 * testsuite/Makefile.in: Regenerate.
4714
e1df38aa
NC
47152010-06-09 Nick Clifton <nickc@redhat.com>
4716
4717 * yyscript.y (input_list_element): Allow strings prefixed with
4718 the '-' character. Treat these as libraries.
4719 * script.cc (script_add_library): New function. Adds a library
4720 specified by "-l<name>" found in an input script.
4721 * script-c.h: Add prototype for script_add_library.
4722
25bbe950
DK
47232010-06-07 Doug Kwan <dougkwan@google.com>
4724
4725 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4726 Restrict stub-group size to be within long conditional branch
4727 range when working around cortex-A8 erratum.
4728
0f32ea4c
ILT
47292010-06-07 Damien Diederen <dd@crosstwine.com>
4730
4731 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4732 #ifdef typo.
4733
8fe2a369
ST
47342010-06-03 Sriraman Tallam <tmsriram@google.com>
4735
4736 PR gold/11658
4737 * output.cc
4738 (Output_section::Input_section_sort_entry::compare_section_ordering):
4739 Change to return non-zero correctly.
4740 (Output_section::Input_section_sort_section_order_index_compare
4741 ::operator()): Change to fix ambiguity in comparisons.
4742
6e9ba2ca
ST
47432010-06-01 Sriraman Tallam <tmsriram@google.com>
4744
4745 * gold.h (is_wildcard_string): New function.
4746 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4747 (Layout::layout_eh_frame): Ditto.
4748 (Layout::find_section_order_index): New method.
4749 (Layout::read_layout_from_file): New method.
4750 * layout.h (Layout::find_section_order_index): New method.
4751 (Layout::read_layout_from_file): New method.
4752 (Layout::input_section_position_): New private member.
4753 (Layout::input_section_glob_): New private member.
4754 * main.cc (main): Call read_layout_from_file here.
4755 * options.h (--section-ordering-file): New option.
4756 * output.cc (Output_section::input_section_order_specified_): New
4757 member.
4758 (Output_section::Output_section): Initialize new member.
4759 (Output_section::add_input_section): Add new parameter.
4760 Keep input sections when --section-ordering-file is used.
4761 (Output_section::set_final_data_size): Sort input sections when
4762 section ordering file is specified.
4763 (Output_section::Input_section_sort_entry): Add new parameter.
4764 Check sorting type.
4765 (Output_section::Input_section_sort_entry::compare_section_ordering):
4766 New method.
4767 (Output_section::Input_section_sort_compare::operator()): Change to
4768 consider section_order_index.
4769 (Output_section::Input_section_sort_init_fini_compare::operator()):
4770 Change to consider section_order_index.
4771 (Output_section::Input_section_sort_section_order_index_compare
4772 ::operator()): New method.
4773 (Output_section::sort_attached_input_sections): Change to sort
4774 according to section order when specified.
e1df38aa
NC
4775 (Output_section::add_input_section<32, true>): Add new parameter.
4776 (Output_section::add_input_section<64, true>): Add new parameter.
4777 (Output_section::add_input_section<32, false>): Add new parameter.
4778 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4779 * output.h (Output_section::add_input_section): Add new parameter.
4780 (Output_section::input_section_order_specified): New
4781 method.
4782 (Output_section::set_input_section_order_specified): New method.
4783 (Input_section::Input_section): Initialize section_order_index_.
4784 (Input_section::section_order_index): New method.
4785 (Input_section::set_section_order_index): New method.
4786 (Input_section::section_order_index_): New member.
4787 (Input_section::Input_section_sort_section_order_index_compare): New
4788 struct.
4789 (Output_section::input_section_order_specified_): New member.
4790 * script-sections.cc (is_wildcard_string): Delete and move modified
4791 method to gold.h.
4792 (Output_section_element_input::Output_section_element_input): Modify
4793 call to is_wildcard_string.
4794 (Output_section_element_input::Input_section_pattern
4795 ::Input_section_pattern): Ditto.
4796 (Output_section_element_input::Output_section_element_input): Ditto.
4797 * testsuite/Makefile.am (final_layout): New test case.
4798 * testsuite/Makefile.in: Regenerate.
4799 * testsuite/final_layout.cc: New file.
4800 * testsuite/final_layout.sh: New file.
4801
3537c84b
RÁE
48022010-06-01 Rafael Espindola <espindola@google.com>
4803
4804 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4805
105b6afd
RÁE
48062010-06-01 Rafael Espindola <espindola@google.com>
4807
4808 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4809 visibility of symbols.
4810
29e11421
DK
48112010-05-27 Doug Kwan <dougkwan@google.com>
4812
4813 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4814 from start of output section instead of address for a local symbol
4815 in a merged or relaxed section when doing a relocatable link.
4816
5e0f337e
RÁE
48172010-05-26 Rafael Espindola <espindola@google.com>
4818
4819 PR 11604
4820 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4821 adding sections the garbage collector removed.
4822 * gold/testsuite/Makefile.am: Add test.
4823 * gold/testsuite/Makefile.in: Regenerate.
4824 * gold/testsuite/plugin_test_7.sh: New.
4825 * gold/testsuite/plugin_test_7_1.c: New.
4826 * gold/testsuite/plugin_test_7_2.c: New.
4827
f4187277
RÁE
48282010-05-26 Rafael Espindola <espindola@google.com>
4829
4830 * script-sections.cc (Output_section_definition::set_section_addresses):
4831 Check for --section-start.
4832
5c388529
DK
48332010-05-26 Doug Kwan <dougkwan@google.com>
4834
4835 * arm.cc (Arm_scan_relocatable_relocs): New class.
4836 (Target_arm::relocate_special_relocatable): New method.
4837 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4838 (Arm_relocate_functions::thumb_branch_common): Same.
4839 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4840 instead of Default_scan_relocatable_relocs.
4841 * target-reloc.h (relocate_for_relocatable): Let target handle
4842 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4843 * target.h (Sized_target::relocate_special_relocatable): New method.
4844
bca1c3ae
ILT
48452010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4846
4847 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4848
0439c796
DK
48492010-05-23 Doug Kwan <dougkwan@google.com>
4850
4851 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4852 instead of a cast.
4853 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4854 with a direct branch, not a conditional branch, to a stub.
4855 * merge.cc (Output_merge_base::record_input_section): New method
4856 defintion.
4857 (Output_merge_data::do_add_input_section): Record input section if
4858 keeps-input-sections flag is set.
4859 (Output_merge_string::do_add_input_section): Ditto.
4860 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4861 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4862 INPUT_SECTIONS_.
4863 (Output_merge_base::keeps_input_sections,
4864 Output_merge_base::set_keeps_input_sections,
4865 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4866 method definitions.
4867 (Output_merge_base::Input_sections): New type declaration.
4868 (Output_merge_base::input_sections_begin,
4869 Output_merge_base::input_sections_end,
4870 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4871 (Output_merge_base::bool keeps_input_sections_,
4872 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4873 Output_merge_base::input_sections_): New data members.
4874 (Output_merge_data::do_set_keeps_input_sections): New method
4875 defintion.
4876 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4877 * output.cc (Output_section::Input_section::relobj): Move method
4878 defintion from class declaration to here and handle merge sections.
4879 (Output_section::Input_section::shndx): Ditto.
4880 (Output_section::Output_section): Remove initializations of removed
4881 data members and initialize new data member LOOKUP_MAPS_.
4882 (Output_section::add_input_section): Set keeps-input-sections flag
4883 for a newly created merge output section as appropriate. Adjust code
4884 to use Output_section_lookup_maps class.
4885 (Output_section::add_relaxed_input_section): Adjst code for lookup
4886 maps code refactoring.
4887 (Output_section::add_merge_input_section): Add a new parameter
4888 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4889 class. If adding input section to a newly created merge output
4890 section fails, remove the new merge section.
4891 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4892 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4893 (Output_section::find_merge_section): Ditto.
4894 (Output_section::build_lookup_maps): New method defintion.
4895 (Output_section::find_relaxed_input_section): Adjust code to use
4896 Output_section_lookup_maps class.
4897 (Output_section::get_input_sections): Export merge sections. Adjust
4898 code to use Output_section_lookup_maps class.
4899 (Output_section:::add_script_input_section): Adjust code to use
4900 Output_section_lookup_maps class. Update lookup maps for merge
4901 sections also.
4902 (Output_section::discard_states): Use Output_section_lookup_maps.
4903 (Output_section::restore_states): Same.
4904 * output.h (Merge_section_properties): Move class defintion out of
4905 Output_section.
4906 (Output_section_lookup_maps): New class.
4907 (Output_section::Input_section::is_merge_section): New method
4908 defintion.
4909 (Output_section::Input_section::relobj): Move defintion out of class
4910 defintion. Declare method only.
4911 (Output_section::Input_section::shndx): Ditto.
4912 (Output_section::Input_section::output_merge_base): New method defintion.
4913 (Output_section::Input_section::u2_.pomb): New union field.
4914 (Output_section::Merge_section_by_properties_map,
4915 Output_section::Output_section_data_by_input_section_map,
4916 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4917 Remove types.
4918 (Output_section::add_merge_input_section): Add new parameter
4919 KEEPS_INPUT_SECTIONS.
4920 (Output_section::build_lookup_maps): New method declaration.
4921 (Output_section::merge_section_map_,
4922 Output_section::merge_section_by_properties_map_,
4923 Output_section::relaxed_input_section_map_,
4924 Output_section::is_relaxed_input_section_map_valid_): Remove data
4925 members.
4926 (Output_section::lookup_maps_): New data member.
4927
76295588
L
49282010-05-21 Doug Kwan <dougkwan@google.com>
4929
4930 PR gold/11619
4931 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4932 avoid a compilation error.
4933
d103a984
RÁE
49342010-05-19 Rafael Espindola <espindola@google.com>
4935
4936 * script-sections.cc (Output_section_definition::allocate_to_segment):
4937 Update the phdrs_list even when the output section is NULL.
4938 * testsuite/Makefile.am: Add test.
4939 * testsuite/Makefile.in: Regenerate.
4940 * testsuite/script_test_9.cc: New.
4941 * testsuite/script_test_9.sh: New.
4942 * testsuite/script_test_9.t: New.
4943
6625d24e
DK
49442010-05-19 Doug Kwan <dougkwan@google.com>
4945
4946 * arm.cc (Arm_input_section::original_size): New method.
4947 (Arm_input_section::do_addralign): Add a cast.
4948 (Arm_input_section::do_output_offset): Remove static cast.
4949 (Arm_input_section::original_addralign,
4950 Arm_input_section::original_size_): Change type to uint32_t.
4951 (Arm_input_section::init): Add safe casts for section alignment
4952 and size.
4953 (Arm_input_section::set_final_data_size): Do not set address and
4954 offset of stub table.
4955 (Arm_output_section::fix_exidx_coverage): Change use of of
4956 Output_section::Simple_input_section to that of
4957 Output_section::Input_section.
4958 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4959 except for the first pass.
4960 * output.cc (Output_section::get_input_sections): Change type of
4961 input_sections to std::list<Input_section>.
4962 (Output_section::add_script_input_section): Rename from
4963 Output_section::add_simple_input_section. Change type of SIS
4964 parameter from Simple_input_section to Input_section.
4965 * output.h (Output_section::Simple_input_section): Remove class.
4966 (Output_section::Input_section): Change class visibility to public.
4967 (Output_section::Input_section::addralign): Use stored alignments
4968 for special input sections if set.
4969 (Output_section::Input_section::set_addralign): New method.
4970 (Output_section::get_input_sections): Change parameter type from
4971 list of Simple_input_section to list of Input_section.
4972 (Output_section::add_script_input_section): Rename from
4973 Output_section::add_simple_input_section. Change first parameter's
4974 type from Simple_input_section to Input_section and remove the
4975 second and third parameters.
4976 * script-sections.cc (Input_section::Input_section_list): Change
4977 type to list of Output_section::Input_section/
4978 (Input_section_info::Input_section_info): Change parameter type of
4979 INPUT_SECTION to Output_section::Input_section.
4980 (Input_section_info::input_section): Change return type.
4981 (Input_section_info::input_section_): Change type to
4982 Output_section::Input_section.
4983 (Output_section_element_input::set_section_addresses): Adjust code
4984 to use Output_section::Input_section instead of
4985 Output_section::Simple_input_section. Adjust code for renaming
4986 of Output_section::add_simple_input_section.
4987 (Orphan_output_section::set_section_addresses): Ditto.
4988
e1e82ea4
RW
49892010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4990
4991 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4992 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4993
91e75c8a
RÁE
49942010-05-18 Rafael Espindola <espindola@google.com>
4995
4996 * options.cc (General_options::finalize): Handle -nostdlib.
4997 * options.h (nostdlib): New option.
4998 * script.cc (script_add_search_dir): Handle -nostdlib.
4999
da59ad79
DK
50002010-05-12 Doug Kwan <dougkwan@google.com>
5001
5002 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5003 attributes section only if there no attributes section after merging.
5004 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5005 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5006 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5007 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5008 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5009 and arm_attr_merge_7.stdout.
5010 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5011 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5012 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5013 arm_attr_merge_7b.o): New rules.
5014 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5015 arm_attr_merge_7
5016 * testsuite/Makefile.in: Regenerate.
5017 * testsuite/arm_attr_merge.sh: New file.
5018 * testsuite/arm_attr_merge_[67][ab].s: Same.
5019
3e01a7fd
NC
50202010-05-05 Nick Clifton <nickc@redhat.com>
5021
5022 * po/es.po: Updated Spanish translation.
5023
7ad2014a
L
50242010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5025
5026 * Makefile.am (install-exec-local): Properly install gold as
5027 default cross linker.
5028 * Makefile.in: Regenerated.
5029
4fda8867
NC
50302010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5031 Nick Clifton <nickc@redhat.com>
5032
5033 * configure.ac (install_as_default): Define and set to false
5034 unless --enable-gold or --enable-gold=both/gold has been
5035 specified.
5036 * configure: Regenerate.
5037
5038 * Makefile.am (install-exec-local): Install the executable as
5039 'ld.gold'. If install_as_default is true then also install it as
5040 'ld'.
5041 * Makefile.in: Regenerated.
5042
bd288ea2
ILT
50432010-04-24 Ian Lance Taylor <iant@google.com>
5044
5045 * layout.cc (Layout::layout_reloc): In relocatable link don't
5046 combine reloc sections for grouped sections.
5047
ef38fd8a
ST
50482010-04-23 Sriraman Tallam <tmsriram@google.com>
5049
5050 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5051 sections that are not ordinary to icf.
5052 * icf.cc (get_section_contents): Handle relocation pointing to section
5053 with no object or shndx information.
5054 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5055 * testsuite/Makefile.in: Regenerate.
5056 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5057 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5058
f6973bdc
ILT
50592010-04-22 Ian Lance Taylor <iant@google.com>
5060
5061 * expression.cc (Expression::Expression_eval_info): Add
5062 result_alignment_pointer field.
5063 (Expression::eval_with_dot): Add result_alignment_pointer
5064 parameter. Change all callers.
5065 (Expression::eval_maybe_dot): Likewise.
5066 (class Binary_expression): Add alignment_pointer parameter to
5067 left_value and right_value. Change all callers.
5068 (BINARY_EXPRESSION): Set result alignment.
5069 (class Trinary_expression): Add alignment_pointer parameter to
5070 arg2_value and arg3_value. Change all callers.
5071 (Trinary_cond::value): Set result alignment.
5072 (Max_expression::value, Min_expression::value): Likewise.
5073 (Align_expression::value): Likewise.
5074 * script-sections.cc (class Sections_element): Add dot_alignment
5075 parameter to set_section_addresses virtual function. Update
5076 instantiations.
5077 (class Output_section_element): Likewise.
5078 (Script_sections::create_segments): Add dot_alignment parameter.
5079 Change all callers.
5080 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5081 (Script_sections::set_phdrs_clause_addresses): Likewise.
5082 * script-sections.h: Update declarations.
5083 * script.h: Update declarations.
5084 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5085 min_p_align.
5086 * testsuite/script_test_3.t: Set large alignment.
5087 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5088 segment has expected alignment.
5089
9c9c98a5
NC
50902010-04-22 Nick Clifton <nickc@redhat.com>
5091
5092 * po/gold.pot: Updated by the Translation project.
5093 * po/vi.po: Updated Vietnamese translation.
5094
2253bfba
L
50952010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5096
5097 * testsuite/Makefile.am (check_PROGRAMS): Add
5098 icf_virtual_function_folding_test.
5099 * testsuite/Makefile.in: Regenerated.
5100
85fdf906
AH
51012010-04-15 Andrew Haley <aph@redhat.com>
5102
5103 * options.h (merge_exidx_entries): New option.
5104 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5105 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5106 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5107 (Target_arm::merge_exidx_entries): New function.
5108 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5109 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5110 to Arm_exidx_fixup constructor.
5111 Add new arg, merge_exidx_entries.
5112 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5113 Arm_output_section::fix_exidx_coverage.
5114
ce97fa81
ST
51152010-04-18 Sriraman Tallam <tmsriram@google.com>
5116
5117 * icf.cc (get_section_contents): Check for preemptible functions.
5118 Ignore addend when appropriate.
5119 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5120 section folded.
5121 (add_from_relobj): Check for section folded.
5122 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5123 * symtab.h (should_add_dynsym_entry): Add new parameter.
5124 * target-reloc.h (scan_relocs): Check for section folded.
5125 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5126 Check reloc types for function pointers in shared objects.
5127 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5128 case.
5129 (icf_preemptible_functions_test): New test case.
5130 (icf_string_merge_test): New test case.
5131 * testsuite.Makefile.in: Regenerate.
5132 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5133 bar_glob. Refactor code.
5134 * testsuite/icf_preemptible_functions_test.cc: New file.
5135 * testsuite/icf_preemptible_functions_test.sh: New file.
5136 * testsuite/icf_string_merge_test.cc: New file.
5137 * testsuite/icf_string_merge_test.sh: New file.
5138 * testsuite/icf_virtual_function_folding_test.cc: New file.
5139 * testsuite/icf_virtual_function_folding_test.sh: New file.
5140
04ceb17c
DK
51412010-04-14 Doug Kwan <dougkwan@google.com>
5142
5143 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5144 for local symbol recounting if we remove a section due to ICF.
5145 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5146 there are no regular objects in input.
5147
153e7da4
DK
51482010-04-13 Doug Kwan <dougkwan@google.com>
5149
5150 * arm.cc (Arm_input_section::set_final_data_size): Compute
5151 accurate final data size instead of using current data size.
5152
4dbd9faf
DK
51532010-04-09 Doug Kwan <dougkwan@google.com>
5154
5155 * layout.cc (Layout::choose_output_section): Handle script section
5156 types.
5157 (Layout::make_output_section_for_script): Add section type parameter.
5158 Handle script section types.
5159 * layout.h (Layout::make_output_section_for_script): Add section
5160 type parameter.
5161 * output.cc (Output_section::Output_section): Initialize data member
5162 is_noload_.
5163 (Output_section::do_reset_address_and_file_offset): Do not set address
5164 to 0 if section is a NOLOAD section.
5165 * output.h (Output_section::is_noload): New method.
5166 (Output_section::set_is_noload): Ditto.
5167 (Output_section::is_noload_): New data member.
5168 * script-c.h (Script_section_type): New enum type.
5169 (struct Parser_output_section_header): Add new file section_type.
5170 * script-sections.cc (Sections_element::output_section_name): Add
5171 parameter for returning script section type.
5172 (Output_section_definition::output_section_name): Ditto.
5173 (Output_section_definition::section_type)P; New method.
5174 (Output_section_definiton::script_section_type_name): Ditto.
5175 (Output_section_definition::script_section_type_): New data member.
5176 (Output_section_definition::Output_section_definition): Initialize
5177 data member Output_section_definition::script_section_type_.
5178 (Output_section_definition::create_sections): Pass script section type
5179 to Layout::make_output_section_for_script.
5180 (Output_section_definition::output_section_name): Return script
5181 section type to caller.
5182 (Output_section_definition::set_section_address): Do not advance
5183 dot value and load address if section type is NOLOAD. Set address
5184 of NOLOAD sections regardless of section flags.
5185 (Output_section_definition::print): Print section type if it is
5186 not SCRIPT_SECTION_TYPE_NONE.
5187 (Output_section_definition::section_type): New method.
5188 (Output_section_definition::script_section_type_name): Ditto.
5189 (Script_sections::output_section_name): Add new parameter
5190 PSECTION_TYPE for returning script section type. Pass it to
5191 section elements. Handle discard sections.
5192 (Sort_output_sections::operator()): Handle NOLOAD sections.
5193 * script-sections.h (Script_sections::Section_type): New enum type.
5194 (Script_sections::output_section_name): Add a new parameter for
5195 returning script section type.
5196 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5197 INFO and NOLOAD.
5198 * yyscript.y (union): Add new field SECTION_TYPE.
5199 (COPY, DSECT, INFO, NOLOAD): New tokens.
5200 (opt_address_and_section_type): Change type to output_section_header.
5201 (section_type): New non-terminal
5202 (section_header): Handle section type.
2253bfba 5203 (opt_address_and_section_type): Return section type value.
4dbd9faf 5204
721ea635
L
52052010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5206
5207 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5208 * testsuite/plugin_common_test_2.c (foo): Likewise.
5209
6bf924b0
DK
52102010-04-08 Doug Kwan <dougkwan@google.com>
5211
5212 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5213 Output_merge_data.
5214 * output.cc (Output_section::add_merge_input_section): Simplify
5215 code and return status of Output_merge_base::add_input_section.
e1df38aa 5216 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5217 returns true.
5218
24af6f92
DK
52192010-04-07 Doug Kwan <dougkwan@google.com>
5220
5221 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5222 if section is marked as containing instructions but has no mapping
5223 symbols.
5224 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5225 correct section index.
5226 (Arm_relobj::find_linked_text_section): Ditto.
5227
00698fc5
CC
52282010-04-07 Cary Coutant <ccoutant@google.com>
5229
5230 * archive.cc (include_member): Destroy Read_symbols_data object before
5231 releasing file.
5232 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5233 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5234 (Read_symbols_data::~Read_symbols_data) New destructor.
5235 (Section_relocs::Section_relocs) New constructor.
5236 (Section_relocs::~Section_relocs) New destructor.
5237 (Read_relocs_data::Read_relocs_data) New constructor.
5238 (Read_relocs_data::~Read_relocs_data) New destructor.
5239 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5240 pointers to NULL after deleting.
5241
7296d933
DK
52422010-04-07 Doug Kwan <dougkwan@google.com>
5243
5244 * arm.cc: Replace "endianity" with "endianness" in comments.
5245 (Arm_exidx_cantunwind): Ditto.
5246 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5247 (Arm_relobj::merge_flags_and_attributes): New method.
5248 (Arm_relobj::merge_flags_and_attributes_): New data member.
5249 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5250 (Arm_relobj::scan_sections_for_stubs): Ditto.
5251 (Arm_relobj::do_read_symbols): Check to see if we really want to
5252 merge processor-specific flags and attributes. Exit early if
5253 an object is empty except for section names and the undefined symbol.
5254 (Target_arm::do_finalize_sections): Move check for ELF format to
5255 Arm_relobj::do_read_symbols. Merge processor specific flags and
5256 attributes from a regular object only when we have determined that
5257 it is aapropriate. Do not create an .ARM.attributes section in
5258 output if there is no regular input object.
5259 (Target_arm::merge_processor_specific_flags): Check
5260 --warn-mismatch before printing any error.
5261 (Target_arm::merge_object_attributes): Ditto.
5262 * gold.cc (queue_middle_tasks): Handle the case in which there is
5263 no regular object in input.
5264 * options.cc (General_options::parse_EB): New method.
5265 (General_options::parse_EL): Same.
5266 (General_options::General_options): Initialize endianness_.
5267 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5268 New options.
5269 (General_options::Endianness): New enum.
5270 (General_options::endianness): New method.
5271 (General_options::endianness_): New data member.
5272 * parameters.cc (Parameters::set_options): Check target endianness.
5273 (Parameters::set_target_once): Ditto.
5274 (Parameters::check_target_endianness): New method.
5275 (parameters_force_valid_target): If either -EL or -EB is specified,
5276 use it to define endianness of default target.
5277 * parameters.h (Parameters::check_target_endianness): New method
5278 declaration.
5279 * target.h (class Target): Change "endianity" to "endianness"
5280 in comments.
5281
efc8d4f2
RW
52822010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5283
5284 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5285 * configure: Regenerate.
5286 * Makefile.in: Regenerate.
5287 * testsuite/Makefile.in: Regenerate.
5288
be234d88
CC
52892010-04-06 Cary Coutant <ccoutant@google.com>
5290
5291 gcc PR lto/42757
5292 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5293 prevailing definitions of common symbols.
5294 * testsuite/plugin_test_6.sh: New test case.
5295 * testsuite/plugin_common_test_1.c: New test case.
5296 * testsuite/plugin_common_test_2.c: New test case.
5297 * testsuite/Makefile.am (plugin_test_6): New test case.
5298 * testsuite/Makefile.in: Regenerate.
5299
bd32c6bd
NC
53002010-04-06 Nick Clifton <nickc@redhat.com>
5301
5302 * po/vi.po: New Vietnamese translation.
5303
323c532f
DK
53042010-03-30 Doug Kwan <dougkwan@google.com>
5305
5306 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5307
4fcd97eb
DK
53082010-03-25 Doug Kwan <dougkwan@google.com>
5309
5310 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5311 to avoid a conversion warning on a 32-bit host.
5312
4ebf39db
ILT
53132010-03-24 Ian Lance Taylor <iant@google.com>
5314
5315 * testsuite/script_test_3.t: Add a TLS segment.
5316 * testsuite/Makefile.am (check_PROGRAMS): Add
5317 tls_phdrs_script_test.
5318 (tls_phdrs_script_test_SOURCES): Define.
5319 (tls_phdrs_script_test_DEPENDENCIES): Define.
5320 (tls_phdrs_script_test_LDFLAGS): Define.
5321 (tls_phdrs_script_test_LDADD): Define.
5322 * testsuite/Makefile.in: Rebuild.
5323
4a599bdd
CC
53242010-03-23 Cary Coutant <ccoutant@google.com>
5325
5326 * fileread.cc (find_or_make_view): Fix comment.
5327
6c93b22c
ILT
53282010-03-23 Ian Lance Taylor <iant@google.com>
5329
5330 * script-sections.cc (class Orphan_section_placement): Define
5331 PLACE_TLS and PLACE_TLS_BSS.
5332 (Orphan_section_placement::Orphan_section_placement): Initialize
5333 new places.
5334 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5335 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5336 (tls_script_test_SOURCES): Define.
5337 (tls_script_test_DEPENDENCIES): Define.
5338 (tls_script_test_LDFLAGS): Define.
5339 (tls_script_test_LDADD): Define.
5340 * testsuite/Makefile.in: Rebuild.
5341
a2c7281b
DK
53422010-03-22 Doug Kwan <dougkwan@google.com>
5343
5344 * arm.cc (Arm_relocate_functions::abs8,
5345 Arm_relocate_functions::abs16): Use correct check for overflow
5346 specified in the ARM ELF specs.
5347 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5348 target of a BLX instruction specially.
5349 (Reloc_stub::stub_type_for_reloc): Ditto.
5350 (Relocate::relocate): Use symbolic names instead of numeric relocation
5351 codes to report error.
5352 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5353 workaround.
5354 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5355 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5356 thumb2_blx_out_of_range.stdout
5357 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5358 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5359 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5360 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5361 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5362 thumb2_blx_in_range, thumb2_blx_in_range.o,
5363 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5364 thumb2_blx_out_of_range.o): New rules.
5365 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5366 thumb2_blx_in_range and thumb2_blx_out_of_range.
5367 * testsuite/Makefile.in: Regenerate.
5368 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5369 * testsuite/thumb_blx_in_range.s: New file.
5370 * testsuite/thumb_blx_out_of_range.s: New file.
5371
b0193076
RÁE
53722010-03-22 Rafael Espindola <espindola@google.com>
5373
5374 * archive.cc (Should_include): Move to archive.h.
5375 (should_include_member): Make it a member of Archive.
5376 (Lib_group): New.
5377 (Add_lib_group_symbols): New.
5378 * archive.h: Include options.h.
5379 (Archive_member): Moved from Archive.
5380 (Should_include): Moved from archive.cc.
5381 (Lib_group): New.
5382 (Add_lib_group_symbols): New.
5383 * dynobj.cc (do_should_include_member): New.
5384 * dynobj.h (do_should_include_member): New.
5385 * gold.cc (queue_initial_tasks): Update call to queue.
5386 * main.cc (main): Print lib group stats.
5387 * object.cc (do_should_include_member): New.
5388 * object.h: Include archive.h.
5389 (Object::should_include_member): New.
5390 (Object::do_should_include_member): New.
5391 (Sized_relobj::do_should_include_member): New.
5392 * options.cc (General_options::parse_start_lib): New.
5393 (General_options::parse_end_lib): New.
5394 (Input_arguments::add_file): Handle lib groups.
5395 (Input_arguments::start_group): Check we are not in a lib.
5396 (Input_arguments::start_lib): New.
5397 (Input_arguments::end_lib): New.
5398 * options.h (General_options): Add start_lib and end_lib.
5399 (Input_argument::lib_): New.
5400 (Input_argument::lib): New.
5401 (Input_argument::is_lib): New.
5402 (Input_file_lib): New.
5403 (Input_arguments::in_lib_): New.
5404 (Input_arguments::in_lib): New.
5405 (Input_arguments::start_lib): New.
5406 (Input_arguments::end_lib_): New.
5407 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5408 in unused members as preempted.
5409 (Sized_pluginobj::do_should_include_member): New.
5410 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5411 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5412 return the blocker.
5413 (Read_symbols::do_whole_lib_group): New.
5414 (Read_symbols::do_lib_group): New.
5415 (Read_symbols::do_read_symbols): Handle lib groups.
5416 (Read_symbols::get_name): Handle lib groups.
5417 * readsyms.h (Read_symbols): Add an archive member pointer.
5418 (Read_symbols::do_whole_lib_group): New.
5419 (Read_symbols::do_lib_group): New.
5420 (Read_symbols::member_): New.
5421 * script.cc (read_input_script): Update call to queue_soon.
5422
d099120c
DK
54232010-03-19 Doug Kwan <dougkwan@google.com>
5424
5425 * arm.cc (Stub_table::Stub_table): Initialize new data members
5426 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5427 (Stub_table::add_reloc_stub): Assign stub offset and update
5428 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5429 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5430 New data members.
5431 (Stub_table::update_data_size_and_addralign): Use
5432 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5433 instead of going over all reloc stubs.
5434 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5435 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5436 Stringpool_template::offset_ to size of Stringpool_char.
5437 (Stringpool_template::new_key_offset): Remove code to initialize
5438 Stringpool_template::offset_.
5439 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5440 Stringpool_template::offset_ to zero.
5441
1aa37384
DK
54422010-03-15 Doug Kwan <dougkwan@google.com>
5443
5444 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5445 offset_.
5446 (Stringpool_template::new_key_offset): New method.
5447 (Stringpool_template::add_string): Assign offsets when adding new
5448 strings.
5449 (Stringpool_template::set_string_offsets): Do not set string offsets
5450 when not optimizing.
5451 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5452 member size_.
5453 (Chunked_vector::clear): Clear size_.
5454 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5455 (Chunked_vector::size): Return size_.
5456 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5457 (Chunked_vector::size_): New data member.
1aa37384
DK
5458 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5459 (Stringpool_template::new_key_offset): New method declaration.
5460 (Stringpool_template::offset_): New data member.
5461
b672b057
RÁE
54622010-03-15 Rafael Espindola <espindola@google.com>
5463
5464 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5465 Add_symbols' constructor.
5466 * readsyms.h (Add_symbols): Remove the input_group member.
5467
b6848d3c
ILT
54682010-03-10 Ian Lance Taylor <iant@google.com>
5469
5470 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5471 target to ask whether a reference to a symbol requires a stack
5472 split.
5473 * target.h (Target::is_call_to_non_split): New function.
5474 (Target::do_is_call_to_non_split): Declare virtual function.
5475 * target.cc: Include "symtab.h".
5476 (Target::do_is_call_to_non_split): New function.
5477 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5478
a2a5469e
CC
54792010-03-10 Cary Coutant <ccoutant@google.com>
5480
5481 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5482 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5483 (File_read::open[2]): Add whole_file_view_ to list of views.
5484 (File_read::make_view): Remove test of whole_file_view_.
5485 (File_read::find_or_make_view): Create whole_file_view_ if
5486 necessary.
5487 (File_read::clear_views): Replace bool parameter with enum;
5488 adjust all callers. Don't delete views with permanent data;
5489 do delete cached views and views from archives if
5490 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5491 if clearing the corresponding view.
5492 * fileread.h (File_read::Clear_views_mode): New enum.
5493 (File_read::View::is_permanent_view): New method.
5494 (File_read::clear_views): Replace bool parameter
5495 with enum; adjust all callers.
5496 * options.h (General_options): Change keep_files_mapped option;
5497 add map_whole_files.
5498 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5499 releasing the file.
5500 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5501 the file.
5502
8861f32b
DM
55032010-03-10 David S. Miller <davem@davemloft.net>
5504
5505 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5506
d62d0f5f
ST
55072010-03-09 Sriraman Tallam <tmsriram@google.com>
5508
5509 * icf.cc (get_section_contents): Add '@' marker after processing the
5510 merge reloc.
5511
9177756d
DK
55122010-03-08 Doug Kwan <dougkwan@google.com>
5513
5514 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5515 due to a conversion warning.
5516 (Arm_relobj::update_output_local_symbol_count): Check for local
5517 symbol with unset output index.
5518
9e9e071b
ILT
55192010-03-05 Ian Lance Taylor <iant@google.com>
5520
5521 * options.h (class General_options): Add --spare-dynamic-tags.
5522 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5523 --spare-dynamic-tags.
5524
a81ee015
ILT
55252010-03-05 Ian Lance Taylor <iant@google.com>
5526
5527 * incremental.cc: Include "libiberty.h".
5528
44ec90b9
RO
55292010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5530
5531 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5532 function, is_info_ member.
5533 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5534 (Versions::Versions): Update caller.
5535 (Versions::define_base_version): Likewise.
5536 (Versions::add_def): Likewise.
5537
0897ed3b
ST
55382010-03-03 Sriraman Tallam <tmsriram@google.com>
5539
5540 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5541 (Scan::possible_function_pointer_reloc): New function.
5542 (Scan::local_reloc_may_be_function_pointer): Change to call
5543 possible_function_pointer_reloc.
5544 (Scan::global_reloc_may_be_function_pointer): Ditto.
5545 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5546 relocations in ".data.rel.ro._ZTV" section.
5547 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5548 * testsuite/icf_safe_so_test.cc: Ditto.
5549 * testsuite/icf_safe_test.cc: Ditto.
5550 * testsuite/icf_safe_test.sh: Ditto.
5551
d3bbad62
ILT
55522010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5553 Ian Lance Taylor <iant@google.com>
5554
5555 * target-reloc.h (relocate_section): Check the symbol table index
5556 for -1U before setting the local symbol index.
5557 (scan_relocatable_relocs): If copying the relocation, record that
5558 the local symbol is required.
5559 * object.h (Symbol_value::is_output_symtab_index_set): New
5560 function.
5561 (Symbol_value::may_be_discarded_from_output_symtab): New
5562 function.
5563 (Symbol_value::has_output_symtab_entry): New function.
5564 (Symbol_value::needs_output_symtab_entry): Remove.
5565 (Symbol_value::output_symtab_index): Make sure the symbol index is
5566 set.
5567 (Symbol_value::set_output_symtab_index): Make sure the symbol
5568 index is not set. Make sure the new index is valid.
5569 (Symbol_value::set_must_have_output_symtab_entry): New function.
5570 (Symbol_value::has_output_dynsym_entry): New function.
5571 (Symbol_value::set_output_dynsym_index): Make sure the new index
5572 is valid.
5573 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5574 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5575 local symbol if permitted.
5576 (Sized_relobj::do_finalize_local_symbols): Call
5577 is_output_symtab_index_set rather than needs_output_symtab_entry.
5578 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5579 rather than needs_output_symtab_entry. Call
5580 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5581 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5582 is_output_symtab_index_set rather than needs_output_symtab_entry.
5583 * testsuite/discard_locals_relocatable_test.c: New file.
5584 * testsuite/discard_locals_test.sh: Test -r.
5585 * testsuite/Makefile.am (check_DATA): Add
5586 discard_locals_relocatable_test1.syms,
5587 discard_local_relocatable_test2.syms.
5588 (MOSTLYCLEANFILES): Likewise. Also add
5589 discard_locals_relocatable_test1.lout and
5590 discard_locals_relocatable_test2.out.
5591 (discard_locals_relocatable_test1.syms): New target.
5592 (discard_locals_relocatable_test.o): New target.
5593 (discard_locals_relocatable_test1.out): New target.
5594 (discard_locals_relocatable_test2.syms): New target.
5595 (discard_locals_relocatable_test2.out): New target.
5596 (various): Add missing ../ld-new dependencies.
5597 * testsuite/Makefile.in: Rebuild.
5598
7e8ccf26
NC
55992010-03-03 Nick Clifton <nickc@redhat.com>
5600
5601 * po/fi.po: New Finnish translation.
5602
2a0ff005
DK
56032010-03-01 Doug Kwan <dougkwan@google.com>
5604
5605 * layout.cc (Layout::Layout): Force section types of .init_array*,
5606 .preinit_array* and .fini_array* sections.
5607 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5608 Fix check of return value of std::string::find.().
5609 (Output_section::Input_section_sort_compare::operator()): Remove
5610 comment about .init_array.
5611 (Output_section::Input_section_sort_init_fini_compare::operator()):
5612 New method.
5613 (Output_section::sort_attached_input_sections): Handle .init_array
5614 and .fini_array specially.
5615 * output.h (Output_section::Inut_section_sort_compare): Update
5616 comment.
5617 (Output_section::Input_section_sort_init_fini_compare): New struct.
5618
c3e4ae29
DK
56192010-02-26 Doug Kwan <dougkwan@google.com>
5620
5621 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5622 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5623 * testsuite/debug_msg.sh: Avoid matching source line number for
5624 use of global variable undef_int.
5625
2fd9ae7a
DK
56262010-02-26 Doug Kwan <dougkwan@google.com>
5627
5628 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5629 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5630 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5631 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5632 * options.cc (General_options::General_options): Initialize member
5633 fix_v4bx_.
5634 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5635 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5636 and rm_no_fix_v4bx.stdout
5637 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5638 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5639 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5640 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5641 and arm_no_fix_v4bx.
5642 * Makefile.in: Regenerate.
5643 * testsuite/arm_fix_v4bx.s: New file.
5644 * testsuite/arm_fix_v4bx.sh: Ditto.
5645
67ec7d0b
DK
56462010-02-24 Doug Kwan <dougkwan@google.com>
5647
5648 * arm.cc (Target_arm::got_section): Make the .got section the first
5649 non RELRO section in the data segment.
5650 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5651 suffixes of section names.
5652
10165461
DK
56532010-02-24 Doug Kwan <dougkwan@google.com>
5654
5655 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5656 flags and attributes merging if an input file is a binary file.
5657 * fileread.cc (Input_file::open): Record format of original file.
5658 * fileread.h (Input_file::Format): New enum type.
5659 (Input_file::Input_file): Initialize data member format_.
5660 (Input_file::format): New method definition.
5661 (Input_file::format_):: New data member.
5662
4a54abbb
DK
56632010-02-24 Doug Kwan <dougkwan@google.com>
5664
5665 * arm.cc (Arm_output_data_got): New class.
5666 (ARM_TCB_SIZE): New constant
5667 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5668 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5669 If user uses a script with a SECTIONS clause, issue only a warning
5670 for a misplaced EXIDX input section. Otherwise, issue an error.
5671 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5672 garbage collection.
5673 (Target_arm::got_mode_index_entry): Handle static linking.
5674 (Target_arm::Scan::local): Ditto.
5675 (Target_arm::Scan::global): Ditto.
5676 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5677 all incorrectly implemented relocations.
e1df38aa 5678 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5679 Arm_output_section::fix_exidx_coverage.
5680 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5681 from ".ARM.exidx." and ".ARM.extab.".
5682
ca419a6f
ILT
56832010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5684
5685 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5686 section if it does not already exist.
5687 * attributes.cc (Attributes_section_data::Attributes_section_data):
5688 Don't crash if size is zero.
5689
135b9c78
ILT
56902010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5691 Ian Lance Taylor <iant@google.com>
5692
5693 * gold.cc (queue_middle_tasks): If no input files were opened,
5694 exit.
5695 * workqueue.h (Task_function::Task_function): Assert that there is
5696 a blocker.
5697
bb0bfe4f
DK
56982010-02-22 Doug Kwan <dougkwan@google.com>
5699
5700 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5701 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5702 types to avoid warnings due to different uint64_t implementations
5703 on different hosts.
5704
2a2b6d42
DK
57052010-02-21 Doug Kwan <dougkwan@google.com>
5706
5707 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5708 handling of the maximum backward branch offset.
5709 (Arm_relocate_functions::thumb_branch_common): Ditto.
5710 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5711 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5712 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5713 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5714 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5715 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5716 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5717 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5718 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5719 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5720 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5721 thumb2_bl_out_of_range.o): New rules.
5722 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5723 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5724 thumb2_bl_out_of_range
5725 * testsuite/Makefile.in: Regenerate.
5726 * testsuite/arm_bl_in_range.s: New file.
5727 * testsuite/arm_bl_out_of_range.s: Ditto.
5728 * testsuite/arm_branch_in_range.sh: Ditto.
5729 * testsuite/arm_branch_range.t: Ditto.
5730 * testsuite/thumb2_branch_range.t: Ditto.
5731 * testsuite/thumb_bl_in_range.s: Ditto.
5732 * testsuite/thumb_bl_out_of_range.s: Ditto.
5733 * testsuite/thumb_branch_range.t: Ditto.
5734
b487ad64
ST
57352010-02-20 Sriraman Tallam <tmsriram@google.com>
5736
5737 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5738 Add reloc offset information.
5739 * icf.cc (get_section_contents): Change iterators to point to the new
5740 vectors. Add reloc offset information to the contents.
5741 * icf.h (Icf::Sections_reachable_info): New typedef.
5742 (Icf::Sections_reachable_list): New typedef.
5743 (Icf::Offset_info): New typedef.
5744 (Icf::Reloc_info): New struct typedef.
5745 (Icf::Reloc_info_list): New typedef.
5746 (Icf::symbol_reloc_list): Delete method.
5747 (Icf::addend_reloc_list): Delete method.
5748 (Icf::section_reloc_list): Delete method.
5749 (Icf::reloc_info_list): New method.
5750 (Icf::reloc_info_list_): New member.
5751
f96accdf
DK
57522010-02-19 Doug Kwan <dougkwan@google.com>
5753
5754 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5755 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5756 * arm.cc (Arm_relocation_functions): New forward declaration.
5757 (Target_arm::Target_arm): Initialize new data members
5758 got_mod_index_offset_ and tls_base_symbol_defined_.
5759 (Target_arm::Relocate::relocate_tls): New method.
5760 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5761 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5762 New methods.
5763 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5764 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5765 (Target_arm::got_mod_index_offset_,
5766 Target_arm::tls_base_symbol_defined_): New data members.
5767 (Target_arm::Scan::local, Target::Scan::global,
5768 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5769 relocations.
5770
c8761b9a
DK
57712010-02-18 Doug Kwan <dougkwan@google.com>
5772
5773 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5774 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5775 text section as a parameter becuase some broken tools may not set
5776 the link in section header.
5777 (Target_arm::has_got_section): New method.
5778 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5779 without any mapping symbol as data only. Remove warning.
5780 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5781 link in its section header, try to discover the link by inspecting the
5782 REL31 relocation at the beginning of the section.
5783 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5784 in error message.
5785 (Target_arm::Scan::global): Treat any reference to the symbol
5786 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5787
21bb3914
ST
57882010-02-12 Sriraman Tallam <tmsriram@google.com>
5789
5790 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5791 (Scan::global_reloc_may_be_function_pointer): New function.
5792 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5793 (Scan::global_reloc_may_be_function_pointer): New function.
5794 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5795 (Scan::global_reloc_may_be_function_pointer): New function.
5796 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5797 (Scan::global_reloc_may_be_function_pointer): New function.
5798 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5799 (Scan::global_reloc_may_be_function_pointer): New function.
5800 (Scan::possible_function_pointer_reloc): New function.
5801 (Target_x86_64::can_check_for_function_pointers): New function.
5802 * gc.h (gc_process_relocs): Scan relocation types to determine if
5803 function pointers were taken for targets that support it.
5804 * icf.cc (Icf::find_identical_sections): Include functions for
5805 folding in safe ICF whose pointer is not taken.
5806 * icf.h (Secn_fptr_taken_set): New typedef.
5807 (fptr_section_id_): New member.
5808 (section_has_function_pointers): New function.
5809 (set_section_has_function_pointers): New function.
5810 (check_section_for_function_pointers): New function.
5811 * options.h: Fix comment for safe ICF option.
5812 * target.h (can_check_for_function_pointers): New function.
5813 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5814 Modify icf_safe_test for X86-64.
5815 * testsuite/Makefile.in: Regenerate.
5816 * testsuite/icf_safe_so_test.cc: New file.
5817 * testsuite/icf_safe_so_test.sh: New file.
5818 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5819 (main): Change to take pointer to function kept_func_3.
5820 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5821 folding is done correctly for X86-64.
5822
0da6fa6c
DM
58232010-02-12 David S. Miller <davem@davemloft.net>
5824
5825 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5826 is_symbolless parameter.
5827 (Output_reloc<SHT_REL>::is_symbolless): New.
5828 (Output_reloc<SHT_REL>::is_symbolless_): New.
5829 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5830 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5831 (Output_reloc<SHT_RELA>::is_symbolless): New.
5832 (Output_data_reloc::add_global): Handle is_symbolless.
5833 (Output_data_reloc::add_global_relative): Likewise.
5834 (Output_data_reloc::add_local): Likewise.
5835 (Output_data_reloc::add_local_relative): Likewise.
5836 (Output_data_reloc::add_symbolless_global_addend): New.
5837 (Output_data_reloc::add_symbolless_local_addend): New.
5838 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5839 is_symbolless.
5840 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5841 instead of ->is_relative_
5842 (Output_reloc::write): Likewise.
5843 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5844 (Output_reloc::write_rel): Simplify.
5845
5846 * sparc.cc (Target_sparc::Scan::local): Use
5847 ->add_symbolless_local_addend as needed.
5848 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5849 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5850 based upon relocation offset.
5851
e4782e83
DK
58522010-02-11 Doug Kwan <dougkwan@google.com>
5853
5854 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5855 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5856 beginning of function.
5857 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5858 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5859 parameter is_32bit in calls to should_apply_static_reloc.
5860 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5861 (check_DATA): Add arm_abs_global.stdout.
5862 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5863 arm_abs_global.stdout): New rules.
5864 (MOSTLLYCLEANFILES): Add arm_abs_global
5865 * Makefile.in: Regenerate.
5866 * testsuite/arm_abs_global.s: New file.
5867 * testsuite/arm_abs_global.sh: Ditto.
5868 * testsuite/arm_abs_lib.s: Ditto.
5869
93ceb764
ILT
58702010-02-11 Ian Lance Taylor <iant@google.com>
5871
5872 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5873 Read_relocs task.
5874 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5875 Allocate_commons_task first.
5876 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5877 task, rather than symtab_lock_.
5878 (Gc_process_relocs::~Gc_process_relocs): New function.
5879 (Gc_process_relocs::is_runnable): Check this_blocker_.
5880 (Gc_process_relocs::locks): Use next_blocker_ rather than
5881 blocker_.
5882 (Scan_relocs::~Scan_relocs): New function.
5883 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5884 symtab_lock_.
5885 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5886 next_blocker_.
5887 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5888 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5889 constructor accordingly.
5890 (class Gc_process_relocs): Likewise.
5891 (class Scan_relocs): Likewise.
5892 * common.h (class Allocate_commons_task): Remove symtab_lock_
5893 field, and corresponding constructor parameter.
5894 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5895 symtab_lock_.
5896 (Allocate_commons_task::locks): Likewise.
5897
114dfbe1
ILT
58982010-02-11 Ian Lance Taylor <iant@google.com>
5899
5900 * gold-threads.h (class Once): Define.
5901 (class Initialize_lock): Rewrite as child of Once.
5902 * gold-threads.cc (class Once_initialize): Define.
5903 (once_pointer_control): New static variable.
5904 (once_pointer, once_arg): New static variables.
5905 (c_run_once): New static function.
5906 (Once::Once, Once::run_once, Once::internal_run): New functions.
5907 (class Initialize_lock_once): Remove.
5908 (initialize_lock_control): Remove.
5909 (initialize_lock_pointer): Remove.
5910 (initialize_lock_once): Remove.
5911 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5912 (Initialize_lock::initialize): Rewrite.
5913 (Initialize_lock::do_run_once): New function.
5914 * archive.cc (Archive::interpret_header): Only clear name if it is
5915 not already empty.
5916 * fileread.cc: Include "gold-threads.h"
5917 (file_counts_lock): New static variable.
5918 (file_counts_initialize_lock): Likewise.
5919 (File_read::release): Only increment counts when using --stats.
5920 Use a lock around the increment.
5921 * parameters.cc (class Set_parameters_target_once): Define.
5922 (set_parameters_target_once): New static variable.
5923 (Parameters::Parameters): Move here from parameters.h.
5924 (Parameters::set_target): Rewrite.
5925 (Parameters::set_target_once): New function.
5926 (Parameters::clear_target): Move here and rewrite.
5927 * parameters.h (class Parameters): Update declarations. Add
5928 set_parameters_target_once_ field.
5929 (Parameters::Parameters): Move to parameters.cc.
5930 (Parameters::clear_target): Likewise.
5931 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5932 task.
5933 (Start_group::~Start_group): New function.
5934 (Start_group::is_runnable): New function.
5935 (Start_group::locks, Start_group::run): New functions.
5936 (Finish_group::run): Change saw_undefined to size_t.
5937 * readsyms.h (class Start_group): Define.
5938 (class Finish_group): Change saw_undefined_ field to size_t.
5939 (Finish_group::Finish_group): Remove saw_undefined and
5940 this_blocker parameters. Change all callers.
5941 (Finish_group::set_saw_undefined): New function.
5942 (Finish_group::set_blocker): New function.
5943 * symtab.h (class Symbol_table): Change saw_undefined to return
5944 size_t. Change saw_undefined_ field to size_t.
5945 * target-select.cc (Set_target_once::do_run_once): New function.
5946 (Target_selector::Target_selector): Initialize set_target_once_
5947 field. Don't initialize lock_ and initialize_lock_ fields.
5948 (Target_selector::instantiate_target): Rewrite.
5949 (Target_selector::set_target): New function.
5950 * target-select.h (class Set_target_once): Define.
5951 (class Target_selector): Update declarations. Make
5952 Set_target_once a friend. Remove lock_ and initialize_lock_
5953 fields. Add set_target_once_ field.
5954
fa17a3f4
ILT
59552010-02-10 Ian Lance Taylor <iant@google.com>
5956
5957 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5958 queueing any tasks.
5959 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5960 (queue_middle_tasks): Add all blockers before queueing any tasks.
5961 (queue_final_tasks): Likewise.
5962 * token.h (Task_token::add_blockers): New function.
5963 * object.h (Input_objects::number_of_relobjs): New function.
5964
c7177d31
ILT
59652010-02-10 Ian Lance Taylor <iant@google.com>
5966
5de0e392
ILT
5967 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5968 shared, not if not position independent.
5969 * x86_64.cc (Relocate::relocate_tls): Likewise.
5970 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5971 (tls_pie_pic_test): New target.
5972 * testsuite/Makefile.in: Rebuild.
5973
c7177d31
ILT
5974 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5975 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5976 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5977 * testsuite/Makefile.in: Rebuild.
5978
684b268a
DM
59792010-02-09 David S. Miller <davem@davemloft.net>
5980
5981 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5982 R_SPARC_RELATIVE using ->add_local_relative().
5983 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5984
612a8d3d
DM
5985 * output.h (Output_data_dynamic::add_section_size): New method
5986 that takes two Output_data objects.
5987 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5988 entry param. Handle it in initializers.
5989 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5990 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5991 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5992 arg.
5993 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5994 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5995 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5996 for dynrel_includes_plt.
5997 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5998 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5999 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6000 before .rela.plt
6001 (Target_sparc::do_finalize_sections): Update to pass true for
6002 dynrel_includes_plt.
6003 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6004 output before .rela.plt
6005 (Target_powerpc::do_finalize_sections): Update to pass true for
6006 dynrel_includes_plt when 32-bit.
6007
cb1be87e
DK
60082010-02-08 Doug Kwan <dougkwan@google.com>
6009
6010 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6011 method.
6012 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6013 Arm_relobj::scan_section_for_cortex_a8_stubs,
6014 Arm_relobj::do_relocation_section): Instead of calling
6015 Output_section::output_address, use faster
6016 Arm_relobj::simple_input_section_output_address.
6017
705b5121
DM
60182010-02-08 David S. Miller <davem@davemloft.net>
6019
6020 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6021 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6022 relocation helper function.
6023
024c4466
DM
6024 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6025 just like R_SPARC_GOT{10,13,22}.
6026 (Target_sparc::Scan::local): Likewise.
6027 (Target_sparc::Relocate:relocate): Likewise.
6028
9109c078
ILT
60292010-02-06 Ian Lance Taylor <iant@google.com>
6030
6031 * configure.ac: Rewrite targetobjs duplicate removal code to use
6032 only shell constructs.
6033 * configure: Rebuild.
6034
cf846138
DK
60352010-02-05 Doug Kwan <dougkwan@google.com>
6036
6037 PR 11247
6038 * arm.cc (Arm_relobj::section_is_scannable): New method.
6039 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6040 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6041
6cfaf60b
DK
60422010-02-04 Doug Kwan <dougkwan@google.com>
6043
6044 PR 11247
6045 * arm-reloc-property.cc (cstdio): Include.
6046 * configure.ac (targetobjs): Remove duplicates.
6047 * configure: Regenerate.
6048 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6049 big and little endian version for a given address size.
6050
5c57f1be
DK
60512010-02-03 Doug Kwan <dougkwan@google.com>
6052
6053 * arm-reloc-property.cc
6054 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6055 definition.
6056 * arm-reloc-property.h
6057 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6058 New method definition.
6059 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6060 declaration.
6061 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6062 overflow to N.
6063 (GOT_PREL): Change implemented to Y.
6064 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6065 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6066 (Arm_relocate_functions::movw_abs_nc): Remove method.
6067 (Arm_relocate_functions::movt_abs): Ditto.
6068 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6069 (Arm_relocate_functions::thm_movt_abs): Ditto.
6070 (Arm_relocate_functions::movw_rel_nc): Ditto.
6071 (Arm_relocate_functions::movw_rel): Ditto.
6072 (Arm_relocate_functions::movt_rel): Ditto.
6073 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6074 (Arm_relocate_functions:thm_movw_rel): Ditto.
6075 (Arm_relocate_functions:thm_movt_rel): Ditto.
6076 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6077 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6078 New method definitions.
6079 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6080 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6081 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6082 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6083 (Target_arm::Relocate::relocate): Check for non-static or
6084 unimplemented relocation code and exit early. Change calls to
6085 Target_arm::reloc_uses_thumb_bit and
6086 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6087 instead. Refactor code to handle similar relocations to increase
6088 code sharing. Remove check for unsupported relocation code in switch
6089 statement.
6090 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6091 relocation property table to find out size. Change error message to
6092 print out the name of a relocation code instead of the numeric value.
6093 (Target_arm::scan_reloc_for_stub): Use relocation property table
6094 instead of calling Target_arm::reloc_uses_thumb_bit().
6095
218c5831
DK
60962010-02-02 Doug Kwan <dougkwan@google.com>
6097
6098 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6099 types of relaxed input section.
6100
0d31c79d
DK
61012010-02-02 Doug Kwan <dougkwan@google.com>
6102
6103 * Makefile.am (HFILES): Add arm-reloc-property.h.
6104 (DEFFILES): New.
6105 (TARGETSOURCES): Add arm-reloc-property.cc
6106 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6107 (libgold_a_SOURCES): $(DEFFILES)
6108 * Makefile.in: Regenerate.
6109 * arm-reloc-property.cc: New file.
6110 * arm-reloc-property.h: New file.
6111 * arm-reloc.def: New file.
6112 * arm.cc: Update comments.
6113 (arm-reloc-property.h): New included header.
6114 (arm_reloc_property_table): New global variable.
6115 (Target_arm::do_select_as_default_target): New method definition.
6116 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6117 arm-reloc-property to targ_extra_obj.
6118 * parameters.cc (set_parameters_target): Call
6119 Target::select_as_default_target().
6120 * target.h (Target::select_as_default_target): New method definition.
6121 (Target::do_select_as_default_target): Same.
6122
546c7457
DK
61232010-02-01 Doug Kwan <dougkwan@google.com>
6124
6125 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6126 first_output_text_section_.
6127 (Arm_exidx_fixup::first_output_text_section): New method definition.
6128 (Arm_exidx_fixup::first_output_text_section_): New data member.
6129 (Arm_exidx_fixup::process_exidx_section): Record the first text
6130 output section seen.
6131 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6132 and entsize in output section header.
6133
11b861d5
DK
61342010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6135
6136 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6137 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6138 (Arm_relocate_functions::thm_alu11): New Method.
6139 (Arm_relocate_functions::thm_pc8): New Method.
6140 (Arm_relocate_functions::thm_pc12): New Method.
6141 (Target_arm::Scan::local): Handle the relocations.
6142 (Target_arm::Scan::global): Likewise.
6143 (Target_arm::Relocate::relocate): Likewise.
6144 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6145
c9a2c125
DK
61462010-01-29 Doug Kwan <dougkwan@google.com>
6147
6148 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6149 of relocation types as ld.
6150
1521477a
DK
61512010-01-29 Doug Kwan <dougkwan@google.com>
6152
6153 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6154 to public.
6155 (Arm_relocate_functions::thumb_branch_common): Ditto.
6156 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6157 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6158 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6159 Arm_relocate_functions::jump24): Remove.
6160 (Target_arm::Relocate::relocate): Adjust code to call
6161 Arm_relocation_functions::arm_branch_common and
6162 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6163 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6164
e7eca48c
DK
61652010-01-29 Doug Kwan <dougkwan@google.com>
6166
6167 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6168 output_local_symbol_count_needs_update_.
6169 (Arm_relobj::output_local_symbol_count_needs_update,
6170 Arm_relobj::set_output_local_symbol_count_needs_update,
6171 Arm_relobj::update_output_local_symbol_count): New methods.
6172 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6173 member.
6174 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6175 of pointed function as in a R_ARM_PREL31 relocation.
6176 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6177 for output local symbol count updating.
6178 (Target_arm::do_relax): Update output local symbol counts in objects
6179 if necessary.
6180 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6181
02961d7e
ILT
61822010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6183
6184 * arm.cc: Added support for the ARM relocations:
6185 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6186 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6187 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6188 movw_prel_nc).
6189 (Arm_relocate_functions::movw_rel): New method.
6190 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6191 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6192 thm_movw_prel_nc).
6193 (Arm_relocate_functions::thm_movw_rel): New method.
6194 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6195 thm_movt_prel).
6196 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6197 relocations.
6198 (Target_arm::Scan::global): Likewise.
6199 (Target_arm::Relocate::relocate): Likewise.
6200 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6201 Likewise.
6202
b10d2873
ILT
62032010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6204
6205 * arm.cc: Added support for ARM group relocations.
6206 (Target_arm::reloc_needs_sym_origin): New method.
6207 (Arm_relocate_functions::calc_grp_kn): New method.
6208 (Arm_relocate_functions::calc_grp_residual): New method.
6209 (Arm_relocate_functions::calc_grp_gn): New method.
6210 (Arm_relocate_functions::arm_grp_alu): New Method.
6211 (Arm_relocate_functions::arm_grp_ldr): New Method.
6212 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6213 (Arm_relocate_functions::arm_grp_ldc): New Method.
6214 (Target_arm::Scan::local): Handle the ARM group relocations.
6215 (Target_arm::Scan::global): Likewise.
6216 (Target_arm::Relocate::relocate): Likewise.
6217 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6218 Likewise.
6219
2b328d4e
DK
62202010-01-26 Doug Kwan <dougkwan@google.com>
6221
6222 * arm.cc (set): Include.
6223 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6224 pointer type.
6225 (Arm_output_section::Text_section_list): New type.
6226 (Arm_output_section::append_text_sections_to_list): New method.
6227 (Arm_output_section::fix_exidx_coverage): Ditto.
6228 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6229 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6230 Relobj::set_section_offset() instead of
6231 Sized_relobj::invalidate_section_offset().
6232 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6233 parameter for section headers. Ignore relocation sections for
6234 unallocated sections and EXIDX sections.
6235 (Target_arm::fix_exidx_coverage): New method.
6236 (Target_arm::output_section_address_less_than): New type.
6237 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6238 linked text section instead of the EXIDX section.
6239 (Arm_output_section::create_stub_group): Add an assertion to check
6240 that this is not an EXIDX output section.
6241 (Arm_output_section::append_text_sections_to_list): New method.
6242 (Arm_output_section::fix_exidx_coverage): Ditto.
6243 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6244 Arm_relobj::section_needs_reloc_stub_scanning.
6245 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6246 first pass.
6247 (Target_arm::fix_exidx_coverage): New method.
6248 * object.h (Relobj::set_output_section): New method.
6249 (Sized_relobj::invalidate_section_offset): Remove method.
6250 (Sized_relobj::do_invalidate_section_offset): Remove method.
6251 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6252
c7f3c371
DK
62532010-01-25 Doug Kwan <dougkwan@google.com>
6254
6255 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6256 Fix warning due to signed and unsigned comparison on a 32-bit host.
6257
8923b24c
DK
62582010-01-22 Doug Kwan <dougkwan@google.com>
6259
6260 * arm.cc (Target_arm::do_relax): Record an output section for section
6261 offset adjustment it contains any stub table that has changed.
6262 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6263 offsets in an output section if necessary.
6264 * output.cc (Output_section::Output_section): Initialize
6265 section_offsets_need_adjustments_.
6266 (Output_section::add_input_section_for_script): Renamed to
6267 Output_section::add_simple_input_section.
6268 (Output_section::save_states): Add a comment.
6269 (Output_section::discard_states): New method defintion.
6270 (Output_section::adjust_section_offsets): Same.
6271 * output.h (Output_section::add_input_section_for_script): Renamed to
6272 Output_section::add_simple_input_section.
6273 (Output_section::discard_states): New method declaration.
6274 (Output_section::adjust_section_offsets): Same.
6275 (Output_section::section_offsets_need_adjustment,
6276 Output_section::set_section_offsets_need_adjustment): New method
6277 definitions.
6278 (Output_section::section_offsets_need_adjustment_): New data member.
6279 * script-sections.cc
6280 (Output_section_element_input::set_section_address): Adjust code for
6281 renaming of Output_section::add_input_section_for_script.
6282 (Orphan_output_section::set_section_address): Same.
6283
9b2fd367
DK
62842010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6285
6286 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6287 Fix_v4bx enum values .
6288 * gold/options.h (General_options): New option definitions.
6289 (General_options::fix_v4bx): New method.
6290 (General_options::Fix_v4bx): New enum.
6291 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6292 (General_options::parse_fix_v4bx_interworking): New method.
6293
80d0d023
DK
62942010-01-22 Doug Kwan <dougkwan@google.com>
6295
6296 * arm.cc (Arm_exidx_fixup): New class.
6297
af2cdeae
DK
62982010-01-21 Doug Kwan <dougkwan@google.com>
6299
6300 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6301 classes.
6302 (Arm_exidx_section_offset_map): New type.
6303
993d07c1
DK
63042010-01-21 Doug Kwan <dougkwan@google.com>
6305
6306 * arm.cc (Arm_exidx_input_section): New class.
6307 (Arm_relobj::exidx_input_section_by_link,
6308 Arm_relobj::exidx_input_section_by_shndx,
6309 Arm_relobj::make_exidx_input_section): New methods.
6310 (read_arm_attributes_section): Remove.
6311 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6312 information about them.
6313 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6314 to here.
6315
5ac169d4
DK
63162010-01-20 Doug Kwan <dougkwan@google.com>
6317
6318 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6319 Input_section_specifier to Section_id.
6320 (Target_arm::new_arm_input_section: Adjust code for change of key
6321 type.
6322 (Target_arm::find_arm_input_section): Ditto.
6323 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6324 (Section_id): Remove.
6325 (Garbage_collection::Section_id_hash): Remove.
6326 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6327 (Section_id): Remove.
6328 (Icf::Section_id_hash): Remove.
6329 * object.h (Section_id, Const_section_id, Section_id_hash,
6330 Const_section_id_hash): New type definitions.
6331 * output.cc (Output_section::add_relaxed_input_section): Change to
6332 use Const_section_id instead of Input_section_specifier as key type.
6333 (Output_section::add_merge_input_section): Ditto.
6334 (Output_section::build_relaxation_map): Change to use Section_id
6335 instead of Input_section_specifier as key type.
6336 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6337 Ditto.
6338 (Output_section::convert_input_sections_to_relaxed_sections): Change
6339 to use Const_section_id instead of Input_section_specifier as key type.
6340 (Output_section::find_merge_section): Ditto.
6341 (Output_section::find_relaxed_input_section): Ditto.
6342 * output.h (Input_section_specifier): Remove class.
6343 (Output_section::Output_section_data_by_input_section_map): Change
6344 key type to Const_section_id.
6345 (Output_section::Output_relaxed_input_section_by_input_section_map):
6346 Ditto.
6347 (Output_section::Relaxation_map): Change key type to Section_id.
6348
a2162063
ILT
63492010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6350
6351 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6352 (class Arm_v4bx_stub): New class.
6353 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6354 (Stub_factory::make_arm_v4bx_stub): New method.
6355 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6356 (Stub_table::empty): Handle v4bx stubs.
6357 (Stub_table::add_arm_v4bx_stub): New method.
6358 (Stub_table::find_arm_v4bx_stub): New method.
6359 (Arm_relocate_functions::v4bx): New method.
6360 (Target_arm::fix_v4bx): New method.
6361 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6362 (Stub_table::relocate_stubs): Likewise.
6363 (Stub_table::do_write): Likewise.
6364 (Stub_table::update_data_size_and_addralign): Likewise.
6365 (Stub_table::finalize_stubs): Likewise.
6366 (Target_arm::Scan::local): Likewise.
6367 (Target_arm::Scan::global): Likewise.
6368 (Target_arm::do_finalize_sections): Likewise.
6369 (Target_arm::Relocate::relocate): Likewise.
6370 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6371 Likewise.
6372 (Target_arm::scan_reloc_for_stub): Likewise.
6373 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6374
5696ab0b
ILT
63752010-01-19 Ian Lance Taylor <iant@google.com>
6376
6377 * output.cc (Output_section_headers::do_sized_write): Write large
6378 segment count to sh_info field.
6379 (Output_file_header::do_sized_write): For large segment count,
6380 write PN_XNUM to e_phnum field.
6381
800d0f56
ILT
63822010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6383
6384 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6385 (Arm_relocate_functions::thm_jump8): New function.
6386 (Arm_relocate_functions::thm_jump11): New function.
6387 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6388 R_ARM_THM_JUMP11.
6389 (Target_arm::Scan::global): Likewise.
6390 (Target_arm::Relocate::relocate): Likewise.
6391 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6392 Likewise.
6393
41263c05
DK
63942010-01-14 Doug Kwan <dougkwan@google.com>
6395
6396 * arm.cc (map, utility): Include headers.
6397 (Target_arm::apply_cortex_a8_workaround): New method.
6398 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6399 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6400 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6401 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6402 the --[no-]fix-cortex-a8 command line options.
6403 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6404 (Target_arm::relocate_stub): Use addend in instruction template.
6405 * options.h (DEFINE_bool): Set the user-set flag.
6406 (General_options): Add --[no-]-fix-cortex options.
6407 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6408 : Update fast look-up map after conversion.
41263c05 6409
459e9b03
ST
64102010-01-14 Sriraman Tallam <tmsriram@google.com>
6411
6412 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6413 in the first pass of do_layout.
6414
b521dfe4
DK
64152010-01-13 Doug Kwan <dougkwan@google.com>
6416
6417 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6418 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6419 apparent compiler problem of not folding static constant integral
6420 data members of elfcpp::Elf_sizes<32>.
6421
44272192
DK
64222010-01-13 Doug Kwan <dougkwan@google.com>
6423
6424 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6425 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6426 Arm_relobj::scan_section_for_cortex_a8_erratum,
6427 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6428 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6429 sections to scan for relocation stubs into a new method
6430 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6431 relocation and Cortex-A8 stub scanning.
6432 (Target_arm::do_relax): Force stubs to be after stubbed sections
6433 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6434 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6435 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6436
44b71ece
ILT
64372010-01-12 Ian Lance Taylor <iant@google.com>
6438
6439 * target-reloc.h (visibility_error): New inline function.
6440 (relocate_section): Call visibility_error.
6441 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6442 (MOSTLYCLEANFILES): Likewise.
6443 (protected_4_pic.o, protected_3.err): New targets.
6444 * testsuite/protected_4.cc: New file.
6445
a120bc7f
DK
64462010-01-12 Doug Kwan <dougkwan@google.com>
6447
6448 * arm.cc (Cortex_a8_reloc): New class.
6449 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6450 and cortex_a8_relocs_info_.
6451 (Target_arm::fix_cortex_a8): New method definition.
6452 (Target_arm::Cortex_a8_relocs_info): New type.
6453 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6454 New data member declarations.
6455 (Target_arm::scan_reloc_for_stub): Record information about
6456 relocations for THUMB branches that might be exempted from the
6457 Cortex-A8 workaround.
6458 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6459 at the beginning of a relaxation pass.
6460
20138696
DK
64612010-01-12 Doug Kwan <dougkwan@google.com>
6462
6463 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6464 (Arm_relobj::Mapping_symbol_position,
6465 Arm_reloj::Mapping_symbol_position_less,
6466 Arm_relobj::Mapping_symbols_info): New types.
6467 (Target_arm::is_mapping_symbol_name): New method definition.
6468 (Arm_relobj::do_count_local_symbols): Save information about mapping
6469 symbols.
6470
089d69dc
DK
64712010-01-11 Doug Kwan <dougkwan@google.com>
6472
6473 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6474 Arm_relocate_functions::thumb32_branch_upper,
6475 Arm_relocate_functions::thumb32_branch_lower,
6476 Arm_relocate_functions::thumb32_cond_branch_offset,
6477 Arm_relocate_functions::thumb32_cond_branch_upper,
6478 Arm_relocate_functions::thumb32_cond_branch_lower,
6479 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6480 branch offset encoding.
6481 (Arm_relocate_functions::thumb_branch_common): Use new branch
6482 offset encoding methods to avoid code duplication.
6483 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6484 (Stub_addend_reader::operator()): Use new branch encoding method
6485 to avoid code duplication.
6486
99e5bff2
DK
64872010-01-11 Doug Kwan <dougkwan@google.com>
6488
6489 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6490 (Target_arm::do_finalize_sections): Define special EXIDX section
6491 symbols only if referenced.
6492 * gc.h (Garbage_collection::add_reference): New method.
6493 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6494 code duplication.
6495
98e090bd
ILT
64962010-01-11 Ian Lance Taylor <iant@google.com>
6497
d0a91bd8
ILT
6498 * script.cc (Version_script_info::build_expression_list_lookup):
6499 Change complaing about duplicate wildcard match from error to
6500 warning.
6501
98e090bd
ILT
6502 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6503 of 2009-12-30.
6504 (Version_script_info::Version_script_info): Initialize globs_,
6505 default_version_, default_is_global_, and exact_. Don't
6506 initialize globals_ or locals_.
6507 (Version_script_info::build_lookup_tables): Build local symbols
6508 first.
6509 (Version_script_info::unquote): New function.
6510 (Version_script_info::add_exact_match): New function.
6511 (Version_script_info::build_expression_list_lookup): Remove lookup
6512 parameter. Add is_global parameter. Change all callers. Handle
6513 wildcard pattern specially. Unquote pattern. Call
6514 add_exact_match.
6515 (Version_script_info::get_name_to_match): New function.
6516 (Version_script_info::get_symbol_version): New function.
6517 (Version_script_info::get_symbol_version_helper): Remove.
6518 (Version_script_info::check_unmatched_names): Call unquote.
6519 * script.h (class Version_script_info): Change get_symbol_version
6520 to be non-inline and add is_global parameter; change all callers.
6521 Rewrite symbol_is_local. Update declarations. Define struct
6522 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6523 Remove globals_ and locals_ members. Add exact_, globs_,
6524 default_version_, is_global_.
6525 (Version_script_info::Glob): Remove pattern, add expression and
6526 is_global. Update constructor. Change all callers.
6527 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6528 default version.
6529 (Versions::symbol_section_contents): If a symbol is undefined, or
6530 defined in a dynamic object, set the version index to
6531 VER_NDX_LOCAL.
6532 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6533 symbol_is_local.
6534 (Symbol_table::add_from_pluginobj): Likewise.
6535 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6536
d56962d3
DK
65372010-01-11 Doug Kwan <dougkwan@google.com>
6538
6539 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6540 (incremental_dump_LDADD): Add linking option for libintl.
6541 * Makefile.in: Regenerate.
6542
94e6ee91
L
65432010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6544
6545 PR gold/11144
6546 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6547 instead of -Ds.
6548 * testsuite/Makefile.in: Regenerated.
6549
e96c574b
DK
65502010-01-10 Doug Kwan <dougkwan@google.com>
6551
6552 * options.h (DEFINE_var): Use parentheses around argument varname__
6553 in macro body to avoid any unintended subsequent substitutions.
6554
7198066b
ILT
65552010-01-10 Ian Lance Taylor <iant@google.com>
6556
ba4d53bf
ILT
6557 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6558 candidates before doing symbol resolution.
6559
7198066b
ILT
6560 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6561 ODR candidates if only one is weak.
6562
a2beed37
ILT
65632010-01-08 Ian Lance Taylor <iant@google.com>
6564
6565 * script.cc (Version_script_info::build_expression_list_lookup):
6566 Don't warn about ambiguous version, just record the ambiguity.
6567 (Version_script_info::get_symbol_version_helper): Give error if
6568 version is ambiguous.
6569
2fb7225c
DK
65702010-01-08 Doug Kwan <dougkwan@google.com>
6571
6572 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6573 prev_data_size_ and prev_addralign_. Remove initializer for
6574 deleted data member has_been_changed_.
6575 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6576 to determine if the table is empty.
6577 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6578 Remove.
6579 (Stub_table::add_reloc_stub): Define method in class definition
6580 instead of just declaring it there.
6581 (Stub_table::add_cortex_a8_stub): New method definition.
6582 (Stub_table::update_data_size_and_addralign): Ditto.
6583 (Stub_table::finalize_stubs): Ditto.
6584 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6585 (Stub_table::do_addralign_): Return address alignment in the
6586 (Stub_table::do_reset_address_and_file_offset): Define method in
6587 class definition instead of declaring it there. Set current data
6588 size to be the data size of the previous pass.
6589 (Stub_table::set_final_data_size): Use current data size as the
6590 final data size.
6591 (Stub_table::relocate_stub): Change parameter type of stub from
6592 Reloc_stub pointer to Stub pointer.
6593 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6594 (Stub_table::Cortex_a8_stub_list): New typedef.
6595 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6596 Stub_table::prev_addralign_): New data member.
6597 (Arm_relobj::Arm_relobj): Initialize data member
6598 section_has_cortex_a8_workaround_.
6599 (Arm_relobj::section_has_cortex_a8_workaround,
6600 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6601 definitions.
6602 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6603 declarations.
6604 (Target_arm::relocate_stub): Change parameter type of stub from
6605 Reloc_stub pointer to Stub pointer.
6606 (Insn_template::size, Insn_template::alignment): Handle
6607 THUMB16_SPECIAL_TYPE.
6608 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6609 Stub_table::update_data_size_and_addralign,
6610 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6611 definitions.
6612 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6613 (Stub_table::do_write): Ditto.
6614 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6615
880cd20d
ILT
66162010-01-08 Ian Lance Taylor <iant@google.com>
6617
6618 PR 11108
6619 * symtab.h (class Symbol): Remove fields is_target_special_ and
6620 has_plt_offset_. Add field is_defined_in_discarded_section_.
6621 (Symbol::is_defined_in_discarded_section): New function.
6622 (Symbol::set_is_defined_in_discarded_section): New function.
6623 (Symbol::has_plt_offset): Rewrite.
6624 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6625 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6626 Don't initialize is_target_special_ or has_plt_offset_.
6627 Initialize is_defined_in_discarded_section_.
6628 (Symbol_table::add_from_relobj): If appropriate, set
6629 is_defined_in_discarded_section.
6630 * resolve.cc (Symbol::override_base_with_special): Don't test
6631 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6632 * target-reloc.h (relocate_section): Do special handling for
6633 symbols defined in discarded sections for global symbols as well
6634 as local symbols.
6635
2703e3eb
ILT
66362010-01-08 Ian Lance Taylor <iant@google.com>
6637
6638 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6639 the SHT_SYMTAB case.
6640
339d40a3
ILT
66412010-01-08 Ian Lance Taylor <iant@google.com>
6642
6643 * object.cc (Sized_relobj::do_layout): Don't get confused if
6644 layout_eh_frame returns NULL.
6645
abecea76
ILT
66462010-01-08 Ian Lance Taylor <iant@google.com>
6647
6648 PR 11084
6649 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6650 dynamic symbol table, use the normal symbol table.
6651 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6652 symbol table.
6653
6b7dd3f3
ILT
66542010-01-08 Ian Lance Taylor <iant@google.com>
6655
6656 PR 11072
6657 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6658 sections.
6659
36c50e63
L
66602010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6661
6662 * version.cc (print_version): Change to "Copyright 2010".
6663
e291e7b9
ILT
66642010-01-08 Ian Lance Taylor <iant@google.com>
6665
6666 PR 10287
6667 PR 11063
6668 * i386.cc (class Target_i386): Change return type of plt_section
6669 to be non-const.
6670 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6671 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6672 tls_desc_rel_ field.
6673 (Output_data_plt_i386::rel_tls_desc): New function.
6674 (Target_i386::rel_tls_desc_section): New function.
6675 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6676 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6677 R_386_TLS_DESC reloc in rel_tls_desc_section.
6678 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6679 Define struct Tlsdesc_info.
6680 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6681 (Target_x86_64::do_reloc_symbol_index): New function.
6682 (Target_x86_64::add_tlsdesc_info): New function.
6683 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6684 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6685 tlsdesc_rel_ field.
6686 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6687 all callers.
6688 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6689 (Target_x86_64::rela_tlsdesc_section): New function.
6690 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6691 handling.
6692 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6693 (Target_x86_64::do_reloc_addend): New function.
6694 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6695 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6696 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6697 (Output_reloc::type): New function.
6698 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6699 (Output_reloc::is_target_specific): New function.
6700 (Output_reloc::target_arg): New function.
6701 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6702 absolute relocs and target specific relocs.
6703 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6704 add_target_specific.
6705 (class Output_data_reloc) [SHT_RELA]: Likewise.
6706 * output.cc (Output_reloc::Output_reloc): Add four new versions
6707 for absolute relocs and target specific relocs.
6708 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6709 (Output_reloc::get_symbol_index): Likewise.
6710 (Output_reloc::local_section_offset): Check that local_sym_index_
6711 is not TARGET_CODE or 0.
6712 (Output_reloc::symbol_value): Likewise.
6713 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6714 reloc.
6715 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6716 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6717 functions.
6718 * layout.cc (add_target_dynamic_tags): Use output section for
6719 DT_PLTRELSZ and DT_JMPREL.
6720
3a44184e
ILT
67212010-01-07 Ian Lance Taylor <iant@google.com>
6722
6723 PR 11061
6724 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6725 function.
6726 (class Output_data_reloc_generic): Define.
6727 (class Output_data_reloc_base): Change base class to
6728 Output_data_reloc_generic. Change add() method to call
6729 bump_relative_reloc_count for a relative reloc. Remove
6730 sort_relocs_ field.
6731 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6732 to sort_relocs().
6733 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6734 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6735 appropriate.
6736 * layout.h (class Layout): Update declaration.
6737
ea715a34
ILT
67382010-01-07 Ian Lance Taylor <iant@google.com>
6739
6740 * output.h (class Output_data): Add const version of
6741 output_section and do_output_section.
6742 (class Output_section_data): Add const version of
6743 do_output_section.
6744 (class Output_section): Likewise.
6745 * layout.cc (Layout::add_target_dynamic_tags): New function.
6746 * layout.h (class Layout): Update declarations.
6747 * arm.cc (Target_arm::do_finalize_sections): Use
6748 add_target_dynamic_tags.
6749 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6750 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6751 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6752 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6753
659948a4
ILT
67542010-01-07 Ian Lance Taylor <iant@google.com>
6755
6756 PR 11042
6757 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6758 object as needed.
6759
9d3b86f6
ILT
67602010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6761 Ian Lance Taylor <iant@google.com>
6762
6763 PR 11019
6764 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6765 Xindex::read_symtab_xindex.
6766
bb0d3eb0
DK
67672010-01-07 Doug Kwan <dougkwan@google.com>
6768
6769 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6770 (Insn_template::thumb16_bcond_insn): New method declaration.
6771 (Insn_template): Fix spelling.
6772 (Stub::thumb16_special): New method declaration.
6773 (Stub::do_write): Define virtual method which was previously pure
6774 virtual.
6775 (Stub::do_thumb16_special): New method declaration.
6776 (Stub::do_fixed_endian_write): New template member.
6777 (Reloc_stub::do_write): Remove.
6778 (Reloc_stub::do_fixed_endian_write): Remove.
6779 (Cortex_a8_stub): New class definition.
6780 (Stub_factory::make_cortex_a8_stub): New method definition.
6781 (Stub_factory::Stub_factory): Add missing static storage class
6782 qualifier for elf32_arm_stub_a8_veneer_blx.
6783
ffeef7df
ILT
67842010-01-07 Ian Lance Taylor <iant@google.com>
6785
dc3f80fe
ILT
6786 PR 10980
6787 * options.h (class General_options): Add --warn-unresolved-symbols
6788 and --error-unresolved-symbols.
6789 * errors.cc (Errors::undefined_symbol): Implement
6790 --warn-unresolved-symbols.
6791
ffeef7df
ILT
6792 * options.h (class General_options): Add -z text and -z textoff.
6793 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6794
f1ec9ded
ST
67952010-01-06 Sriraman Tallam <tmsriram@google.com>
6796
6797 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6798 (Garbage_collection::cident_sections): New function.
6799 (Garbage_collection::add_cident_section): New function.
6800 (Garbage_collection::cident_sections_): New member.
6801 (gc_process_relocs): Add references to sections whose names are C
6802 identifiers.
6803 * gold.h (cident_section_start_prefix): New constant.
6804 (cident_section_stop_prefix): New constant.
6805 (is_cident): New function.
6806 * layout.cc (Layout::define_section_symbols): Replace string constants
6807 with the newly defined constants.
6808 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6809 C identifiers.
6810 * testsuite/Makefile.am: Add gc_orphan_section_test.
6811 * testsuite/Makefile.in: Regenerate.
6812 * testsuite/gc_orphan_section_test.cc: New file.
6813 * testsuite/gc_orphan_section_test.sh: New file.
6814
6eda8c29
ILT
68152010-01-06 Ian Lance Taylor <iant@google.com>
6816
b9674e17
ILT
6817 PR 10980
6818 * options.h (class General_options): Add --warn-shared-textrel.
6819 * layout.cc (Layout::finish_dynamic_section): Implement
6820 --warn-shared-textrel.
6821
6eda8c29
ILT
6822 PR 10980
6823 * options.h (class General_options): Add --warn-multiple-gp.
6824
32dcd44e
ILT
68252010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6826
6827 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6828 $(THREADSLIB) and $(LIBDL).
6829 * Makefile.in: Rebuild.
6830
a192ba05
ILT
68312010-01-06 Ian Lance Taylor <iant@google.com>
6832
6833 PR 10980
6834 * options.cc (General_options::parse_section_start): New function.
6835 (General_options::section_start): New function.
6836 (General_options::General_options): Initialize all members.
6837 * options.h: Include <map>
6838 (class General_options): Add --section-start. Add section_starts_
6839 member.
6840 * layout.cc (Layout::attach_allocated_section_to_segment): If
6841 --section-start was used, set the address of the segment. Remove
6842 local sort_sections.
6843 (Layout::relaxation_loop_body): If the address of the load segment
6844 has been set by --section-start, don't use it.
6845 * output.h (Output_segment::update_flags_for_output_section): New
6846 function.
6847 * output.cc (Output_segment::add_output_section): Call
6848 update_flags_for_output_section.
6849
dde3f402
ILT
68502010-01-05 Ian Lance Taylor <iant@google.com>
6851
62dfdd4d
ILT
6852 PR 10980
6853 * options.h (class General_options): Add --undefined-version.
6854 * script.cc (struct Version_expression): Add was_matched_by_symbol
6855 field.
6856 (Version_script_info::matched_symbol): New function.
6857 (Version_script_info::get_symbol_version_helper): Call
6858 matched_symbol.
6859 (Version_script_info::check_unmatched_names): New function.
6860 * script.h (class Version_script_info): Update declarations.
6861 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6862
9c4ae156
ILT
6863 * options.h (class General_options): Use DEFINE_bool_alias for
6864 allow_multiple_definition.
6865 * resolve.cc (Symbol_table::should_override): Don't test
6866 allow_multiple_definition.
6867
dde3f402
ILT
6868 PR 10980
6869 * options.h (class General_options): Add --cref.
6870 * main.cc (main): Print cref table if --cref. Don't close mapfile
6871 until after printing cref table.
6872 * cref.cc: Include "symtab.h".
6873 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6874 (Cref_table_compare::operator()): New function.
6875 (Cref_inputs::gather_cref): New function.
6876 (filecol): New static const.
6877 (Cref_inputs::print_cref): New function.
6878 (Cref::print_cref): New function.
6879 * cref.h: Include <cstdio>.
6880 (class Cref): Update declarations.
6881 * mapfile.h (Mapfile::file): New function.
6882 * object.h (class Object): Define Symbols. Declare virtual
6883 do_get_global_symbols.
6884 (Object::get_global_symbols): New function.
6885 * object.cc (Input_objects::add_object): Pass object to cref_ if
6886 --cref.
6887 (Input_objects::archive_start): Likewise.
6888 (Input_objects::archive_stop): Likewise.
6889 (Input_objects::print_cref): New function.
6890 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6891 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6892 --cref.
6893 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6894 function.
6895 * plugin.h (class Sized_pluginobj): Update declarations.
6896
8781f709
ILT
68972010-01-05 Ian Lance Taylor <iant@google.com>
6898
6899 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6900 to is_default_version. Rename insdef to insdefault.
6901 (Symbol_table::add_from_relobj): Rename def to is_default_version
6902 and local to is_forced_local.
6903 (Symbol_table::add_from_pluginobj): Likewise.
6904 (Symbol_table::add_from_dynobj): Likewise.
6905 (Symbol_table::define_special_symbol): Rename insdef to
6906 insdefault.
6907
fe35d28d
ILT
69082010-01-04 Ian Lance Taylor <iant@google.com>
6909
30bc8c46
ILT
6910 PR 10980
6911 * options.h (class General_options): Add
6912 --allow-multiple-definition and -z muldefs.
6913 * resolve.cc (Symbol_table::should_override): Don't warn about a
6914 multiple symbol definition if --allow-multiple-definition or -z
6915 muldefs.
6916
7eaea549
ILT
6917 PR 10980
6918 * options.h (class General_options): Add --add-needed and
6919 --copy-dt-needed-entries. Tweak --as-needed help entry.
6920 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6921 error if --copy-dt-needed-entries aka --add-needed is used and
6922 would cause a change in behaviour.
6923
fe35d28d
ILT
6924 PR 10980
6925 * options.h (class General_options): Add -G as a short version of
6926 --shared. Add no-op options -assert, -g, and -i.
6927
55a2bb35
ST
69282010-01-04 Sriraman Tallam <tmsriram@google.com>
6929
6930 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6931 check for .text or .gnu.linkonce.t sections.
6932 * icf.cc (Icf::find_identical_sections): Ditto.
6933 Change the detection for mangled function name within the section
6934 name.
6935 * icf.h (is_section_foldable_candidate): New function.
6936
719328e1
ILT
69372009-12-30 Ian Lance Taylor <iant@google.com>
6938
6939 PR 10980
6940 * options.h (class General_options): Permit two dashes with
6941 --retain-symbols-file.
6942
d7bb5745
ILT
69432009-12-30 Ian Lance Taylor <iant@google.com>
6944
403a15dd
ILT
6945 PR 10979
6946 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6947 don't put the file header and segment headers in the text
6948 segment.
6949
eda294df
ILT
6950 PR 10979
6951 * common.cc (Sort_commons::operator()): Stabilize sort when both
6952 entries are NULL.
6953 (Symbol_table::do_allocate_commons_list): When allocating common
6954 symbols, skip a symbol which is no longer common.
6955 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6956 an object before checking its type.
6957 * testsuite/common_test_2.c: New file.
6958 * testsuite/common_test_3.c: New file.
6959 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6960 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6961 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6962 (common_test_2_pic.o, common_test_2.so): New targets.
6963 (common_test_3_pic.o, common_test_3.so): New targets.
6964 * testsuite/Makefile.in: Rebuild.
6965
d7bb5745
ILT
6966 PR 10979
6967 * script.cc (read_input_script): If we see a new SECTIONS clause,
6968 and we have added an input section, give an error.
6969 * layout.h (class Layout): Add have_added_input_section function.
6970 Add have_added_input_section_ field.
6971 * layout.cc (Layout::Layout): Initialize
6972 have_added_input_section_.
6973 (Layout::layout): Set have_added_input_section_.
6974 (Layout::layout_eh_frame): Likewise.
6975
fc59c572
ILT
69762009-12-30 Ian Lance Taylor <iant@google.com>
6977
6978 PR 10931
6979 * options.h (class General_options): Add --sort-common option.
6980 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6981 * common.cc (Sort_common): Add sort_order parameter to
6982 constructor. Add sort_order_ field.
6983 (Sort_commons::operator): Check sort_order_.
6984 (Symbol_table::allocate_commons): Determine the sort order.
6985 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6986 Change all callers.
6987 (Symbol_table::do_allocate_commons_list): Likewise.
6988
1c74fab0
ILT
69892009-12-30 Ian Lance Taylor <iant@google.com>
6990
6991 PR 10916
6992 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6993 symbols from this object, don't change the visibility of an
6994 undefined symbol.
6995 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6996
6affe781
ILT
69972009-12-30 Ian Lance Taylor <iant@google.com>
6998
6999 PR 10861
7000 * script.h (class Version_script_info): Define Language enum.
7001 Update declarations. Define Glob, Exact, and Lookup types. Add
7002 new fields globals_, locals_, and is_finalized_.
7003 * script.cc: Various formatting fixes.
7004 (class Parser_closure): Change language_stack_ from a vector of
7005 std::string to one of Version_script_info::Language. Adjust all
7006 uses accordingly.
7007 (class Lazy_demangler): Remove.
7008 (struct Version_expression): Change language from std::string to
7009 Version_script_info::Language.
7010 (Version_script_info::Version_script_info): New function.
7011 (Version_script_info::~Version_script_info): Don't call clear.
7012 (Version_script_info::finalize): New function.
7013 (Version_script_info::build_lookup_tables): New function.
7014 (Version_script_info::build_expression_list_lookup): New
7015 function.
7016 (Version_script_info::get_symbol_version_helper): Rewrite to use
7017 lookup tables.
7018 (Version_script_info::print_expression_list): Adjust to use
7019 Version_script_info::Language.
7020 (script_push_lex_into_version_mode): Check that the version script
7021 has not been finalized.
7022 (version_script_push_lang): Change language string to
7023 Version_script_info::Language.
7024 * options.cc (Command_line::version_script): New function.
7025 * options.h (class General_options): Add finalize_dynamic_list
7026 function. Change version_script from declaration to definition.
7027 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7028 * testsuite/version_script.map: Remove duplicate def of foo.
7029 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7030 version_script.map.
7031 * testsuite/Makefile.in: Rebuild.
7032
818bf354
ILT
70332009-12-30 Ian Lance Taylor <iant@google.com>
7034
7035 PR 10843
7036 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7037 if the input symbol index is 0, make the output symbol index 0.
7038
ebcc8304
ILT
70392009-12-30 Ian Lance Taylor <iant@google.com>
7040
7041 PR 10670
7042 * options.h (class General_options): Add -x/--discard-all.
7043 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7044 --discard-all. If the local symbol needs a dynamic entry, check
7045 that before handling --discard-locals.
7046
176fe33f
ILT
70472009-12-30 Ian Lance Taylor <iant@google.com>
7048
bb321bb1
ILT
7049 PR 10450
7050 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7051 flags to PF_R.
7052 (Output_segment::add_output_section): Don't change the flags if
7053 the type is PT_TLS.
7054
176fe33f
ILT
7055 PR 10450
7056 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7057 GNU hash table if they need a dynamic value. Otherwise, don't add
7058 them if they are defined in a dynamic object or are forced local.
7059
e8cd95c7
ILT
70602009-12-29 Ian Lance Taylor <iant@google.com>
7061
1b81fb71
ILT
7062 PR 10450
7063 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7064 .gnu.hash table for a 32-bit target.
7065
8d6d383d
ILT
7066 PR 10450
7067 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7068 regular and a dynamic object only needs a dynamic symbol table
7069 entry if it is externally visible.
7070
e785ec03
ILT
7071 PR 10450
7072 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7073 constructor. Add global_offset_table_ field.
7074 (Target_i386::got_section): Set global_offset_table_.
7075 (Target_i386::do_finalize_sections): Set global_offset_table_
7076 size.
7077 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7078 in constructor. Add global_offset_table_ field.
7079 (Target_x86_64::got_section): Set global_offset_table_.
7080 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7081 size.
7082
1a2dff53
ILT
7083 * layout.cc (Layout::Layout): Initialize increase_relro_.
7084 (Layout::get_output_section): Add is_relro, is_last_relro, and
7085 is_first_non_relro parameters. Change all callers.
7086 (Layout::choose_output_section): Likewise.
7087 (Layout::add_output_section_data): Likewise.
7088 (Layout::make_output_section): Likewise.
7089 (Layout::set_segment_offsets): Clear increase_relro when using a
7090 linker script.
7091 * layout.h (class Layout): Add increase_relro method. Add
7092 increase_relro_ field. Update declarations.
7093 * output.cc (Output_section::Output_section): Initialize
7094 is_last_relro_ and is_first_non_relro_.
7095 (Output_segment::add_output_section): Group relro sections is
7096 do_sort is true. Handle is_last_relro and is_first_non_relro.
7097 (Output_segment::maximum_alignment): Remove relro handling.
7098 (Output_segment::set_section_addresses): Add increase_relro
7099 parameter. Change all callers. Add initial alignment to align
7100 relro sections on separate page. Remove old relro handling.
7101 (Output_segment::set_section_list_addresses): Remove in_relro
7102 parameter. Change all callers.
7103 (Output_segment::set_offset): Add increase parameter. Change all
7104 callers. Remove old relro handling.
7105 * output.h (class Output_section): Add new methods: is_last_relro,
7106 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7107 Add is_last_relro_ and is_first_non_relro_ fields.
7108 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7109 Create separate .got.plt section. Call increase_relro.
7110 * x86_64.cc (Target_x86_64::got_section): Likewise.
7111 * testsuite/relro_script_test.t: Add .got.plt.
7112
f0ba79e2
ILT
7113 PR 10450
7114 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7115 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7116 (Layout::finalize): Call set_dynamic_symbol_size.
7117 (Layout::set_dynamic_symbol_size): New function.
7118 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7119 set_dynamic_symbol_size.
7120
e8cd95c7
ILT
7121 PR 10450
7122 * output.h (class Output_section): Add is_entsize_zero_ field.
7123 * output.cc (Output_section::Output_section): Initialize
7124 is_entsize_zero_.
7125 (Output_section::set_entsize): If two different entsizes are
7126 requested, force it to zero.
7127 (Output_section::add_input_section): Set flags for .debug_str
7128 before updating section flags. Set entsize.
7129 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7130 and SHF_STRING if all input sections have those flags.
7131
3e1b9a8a
RÁE
71322009-12-29 Rafael Espindola <espindola@google.com>
7133
7134 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7135 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7136 reporting.
3e1b9a8a 7137
3dcad376
ST
71382009-12-29 Sriraman Tallam <tmsriram@google.com>
7139
7140 * options.cc (General_options::parse_version): Allow -v to exit
7141 without an error if there is nothing to link.
7142
084e2665
ILT
71432009-12-29 Ian Lance Taylor <iant@google.com>
7144
7145 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7146 using a version of gcc before 4.1.
7147 * configure: Rebuild.
7148
250acde3
CD
71492009-12-28 Chris Demetriou <cgd@google.com>
7150
7151 * attributes.cc (Output_attributes_section_data::do_write): Use
7152 std::vector::front rather than std::vector::data.
7153
99fff23b
ILT
71542009-12-28 Ian Lance Taylor <iant@google.com>
7155
7156 * symtab.h (class Symbol_table): Add enum Defined.
7157 * resolve.cc (Symbol_table::should_override): Add defined
7158 parameter. Change all callers. Test whether object is NULL
7159 before calling a method on it.
7160 (Symbol_table::report_resolve_problem): Add defined parameter.
7161 Change all callers.
7162 (Symbol_table::should_override_with_special): Likewise.
7163 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7164 parameter. Change all callers.
7165 (Symbol_table::do_define_in_output_data): Likewise.
7166 (Symbol_table::define_in_output_segment): Likewise.
7167 (Symbol_table::do_define_in_output_segment): Likewise.
7168 (Symbol_table::define_as_constant): Likewise.
7169 (Symbol_table::do_define_as_constant): Likewise.
7170 * script.h (class Symbol_assignment): Add is_defsym parameter to
7171 constructor; change all callers.
7172 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7173 parameter. Change all callers. Add is_defsym_ field.
7174 (class Parser_closure): Add parsing_defsym parameter to
7175 constructor; change all callers. Add parsing_defsym accessor
7176 function. Add parsing_defsym_ field.
7177
556bd683
ILT
71782009-12-28 Ian Lance Taylor <iant@google.com>
7179
7180 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7181 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7182
1782c879
ILT
71832009-12-23 Ian Lance Taylor <iant@google.com>
7184
7185 * i386.cc (Target_i386::do_calls_non_split): Recognize
7186 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7187 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7188 -fsplit-stack prologue when using %r11.
1782c879 7189
329ca2b1
ST
71902009-12-21 Sriraman Tallam <tmsriram@google.com>
7191
7192 * options.cc (General_options::parse_version): Make -v continue and do
7193 the link like GNU ld does.
7194
d675ff46
RÁE
71952009-12-17 Rafael Avila de Espindola <espindola@google.com>
7196
7197 * Makefile.am (CCFILES): Add timer.cc.
7198 (HFILES): Add timer.h.
7199 * configure.ac: Check for sysconf and times.
7200 * main.cc: include timer.h.
7201 (main): Use Timer instead of get_run_time.
7202 * timer.cc: New.
7203 * timer.h: New.
7204 * workqueue.cc: include timer.h.
7205 (Workqueue::find_and_run_task):
7206 Report user, sys and wall time.
7207 * Makefile.in: Regenerate.
7208 * config.in: Regenerate.
7209 * configure: Regenerate.
7210
d6344fb5
DK
72112009-12-16 Doug Kwan <dougkwan@google.com>
7212
7213 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7214 sections.
7215 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7216 relaxed input sections.
7217 * output.cc (Output_section::find_relaxed_input_section): Change
7218 return type to Output_relaxed_input_section pointer. Adjust code
7219 for new type of relaxed_input_section_map_.
7220 * output.h (Output_section::find_relaxed_input_section): Change
7221 return type to Output_relaxed_input_section pointer.
7222 (Output_section::Output_relaxed_input_section_by_input_section_map):
7223 New type.
7224 (Output_section::relaxed_input_section_map_): Change type to
7225 Output_section::Output_relaxed_input_section_by_input_section_map.
7226 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7227 input section.
7228
0e0d5469
ILT
72292009-12-15 Ian Lance Taylor <iant@google.com>
7230
7231 * layout.cc (Layout::create_shstrtab): Only write out after input
7232 sections if we are compressing debug sections.
7233
0649a889
ILT
72342009-12-15 Ian Lance Taylor <iant@google.com>
7235
7236 * archive.cc (Archive::add_symbols): Only look up a symbol without
7237 a version if there is, in fact, a version.
7238
2ea97941
ILT
72392009-12-14 Ian Lance Taylor <iant@google.com>
7240
7241 Revert -Wshadow changes, all changes from:
7242 2009-12-11 Doug Kwan <dougkwan@google.com>
7243 2009-12-11 Nick Clifton <nickc@redhat.com>
7244 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7245
b0eec2cc
DK
72462009-12-11 Doug Kwan <dougkwan@google.com>
7247
7248 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7249 due to -Wshadow.
7250 * attributes.cc (Object_attribute::size): Ditto.
7251 (Attributes_section_data::size): Ditto.
7252 (Attributes_section_data::Attributes_section_data): Ditto.
7253 (Output_attributes_section_data::do_write): Ditto.
7254 * attributes.h (Object_attribute::set_type): Ditto.
7255 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7256
91d6fa6a
NC
72572009-12-11 Nick Clifton <nickc@redhat.com>
7258
7259 * archive.cc: Fix shadowed variable warnings.
7260 * arm.cc: Likewise.
7261 * compressed_output.cc: Likewise.
7262 * compressed_output.h: Likewise.
7263 * configure: Likewise.
7264 * dwarf_reader.cc: Likewise.
7265 * dynobj.cc: Likewise.
7266 * dynobj.h: Likewise.
7267 * ehframe.cc: Likewise.
7268 * ehframe.h: Likewise.
7269 * errors.cc: Likewise.
7270 * expression.cc: Likewise.
7271 * fileread.cc: Likewise.
7272 * fileread.h: Likewise.
7273 * freebsd.h: Likewise.
7274 * i386.cc: Likewise.
7275 * icf.cc: Likewise.
7276 * incremental.h: Likewise.
7277 * layout.cc: Likewise.
7278 * layout.h: Likewise.
7279 * mapfile.cc: Likewise.
7280 * merge.cc: Likewise.
7281 * merge.h: Likewise.
7282 * object.cc: Likewise.
7283 * object.h: Likewise.
7284 * options.h: Likewise.
7285 * output.cc: Likewise.
7286 * output.h: Likewise.
7287 * parameters.cc: Likewise.
7288 * plugin.cc: Likewise.
7289 * powerpc.cc: Likewise.
7290 * reduced_debug_output.cc: Likewise.
7291 * reduced_debug_output.h: Likewise.
7292 * reloc.cc: Likewise.
7293 * reloc.h: Likewise.
7294 * resolve.cc: Likewise.
7295 * script-sections.cc: Likewise.
7296 * script.cc: Likewise.
7297 * script.h: Likewise.
7298 * sparc.cc: Likewise.
7299 * symtab.cc: Likewise.
7300 * symtab.h: Likewise.
7301 * target-select.cc: Likewise.
7302 * target-select.h: Likewise.
7303 * token.h: Likewise.
7304 * workqueue.cc: Likewise.
7305 * workqueue.h: Likewise.
7306 * x86_64.cc: Likewise.
7307
a0351a69
DK
73082009-12-10 Doug Kwan <dougkwan@google.com>
7309
7310 * arm.cc (attributes.h): New include.
7311 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7312 (Arm_relobj::~Arm_relobj): Delete object pointed by
7313 attributes_section_data_.
7314 (Arm_relobj::attributes_section_data): New method definition.
7315 (Arm_relobj::attributes_section_data_): New data member declaration.
7316 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7317 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7318 attributes_section_data_.
7319 (Arm_dynobj::attributes_section_data): New method definition.
7320 (Arm_dynobj::attributes_section_data_): New data member declaration.
7321 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7322 initialization value of may_use_blx_ to false.
7323 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7324 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7325 object attributes to compute results instead of hard-coding.
7326 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7327 Target_arm::get_secondary_compatible_arch,
7328 Target_arm::set_secondary_compatible_arch
7329 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7330 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7331 New method declarations.
7332 (Target_arm::get_aeabi_object_attribute): New method definition.
7333 (Target_arm::attributes_section_data_): New data member declaration.
7334 (read_arm_attributes_section): New template definition.
7335 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7336 (Arm_dynobj::do_read_symbols): Ditto.
7337 (Target_arm::do_finalize_sections): Merge attributes sections from
7338 input. Check for BLX use after attributes section merging.
7339 Fix __exidx_start and __exidx_end visibility. Create an
7340 .ARM.attributes section if necessary.
7341 (Target_arm::get_secondary_compatible_arch,
7342 Target_arm::set_secondary_compatible_arch,
7343 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7344 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7345 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7346 New method definitions.
7347
b59befec
ILT
73482009-12-09 Ian Lance Taylor <iant@google.com>
7349
7350 * plugin.cc (Plugin::load): Don't cast from void* to a function
7351 pointer.
7352
1276bc89
ILT
73532009-12-09 Ian Lance Taylor <iant@google.com>
7354
7355 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7356 information fields.
7357
2f2de248
L
73582009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7359
7360 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7361 Replace two_file_shared_1.so with two_file_shared_2.so.
7362 * testsuite/Makefile.in: Regenerated.
7363
4f787271
DK
73642009-12-08 Doug Kwan <dougkwan@google.com>
7365
7366 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7367 (HFILES): Add attributes.h and int_encoding.h.
7368 * Makefile.in: Regenerate.
7369 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7370 function definitions to int_encoding.cc
7371 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7372 prototypes to int_encoding.h
7373 * reduced_debug_output.cc (int_encoding.h): New include.
7374 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7375 function definitions to int_encoding.cc
7376 (insert_into_vector, read_from_pointer): Move template definitions to
7377 int_encoding.h
7378 * attributes.cc: New file.
7379 * attributes.h: New file.
7380 * int_encoding.cc: New file.
7381 * int_encoding.h: New file.
7382
20b52f1a
RÁE
73832009-12-07 Rafael Avila de Espindola <espindola@google.com>
7384
7385 PR gold/11055
7386 * incremental-dump.cc (dump_incremental_inputs): New.
7387 (main): Use dump_incremental_inputs.
7388
53d7974c
L
73892009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7390
7391 PR gold/10893
7392 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7393 checking elfcpp::STT_FUNC.
7394 (Target_i386::Relocate::relocate): Likewise.
7395 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7396
7397 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7398 symbols from shared libraries into normal FUNC symbols.
7399
7400 * symtab.h (Symbol): Add is_func and use it.
7401
05a352e6
DK
74022009-12-05 Doug Kwan <dougkwan@google.com>
7403
7404 * arm.cc (Target_arm::arm_info): Initialize new fields
7405 attributes_section and attributes_vendor.
7406 * i386.cc (Target_i386::i386_info): Same.
7407 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7408 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7409 fields attributes_section and attributes_vendor.
53d7974c 7410 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7411 * target.h (Target::attributes_section, Target::attributes_vendor,
7412 Target::is_attributes_section, Target::attribute_arg_type,
7413 Target::attributes_order): New method definitions.
7414 (Target::Target_info::attributes_section,
7415 Target::Target_info::attributes_vendor): New fields.
7416 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7417 virtual method definitions.
7418 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7419 attributes_section and attributes_vendor.
7420 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7421
f4e5969c
DK
74222009-12-05 Doug Kwan <dougkwan@google.com>
7423
7424 * arm.cc: Update comments about interworking and stub generation.
7425 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7426 considered as non-PIC.
7427 (Arm_relocate_functions::base_abs): Fix formatting.
7428 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7429 of function to use GOT entry address instead of offset.
7430 (Target_arm::Scan::global): Issue an error if a symbol would need a
7431 PLT does not get one because it is untyped. Remove code to create
7432 dynamic symbols for relative branches.
7433 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7434 takes unsigned integer instead of boolean.
7435
1abce4a6
L
74362009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7437
7438 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7439 (two_file_test_LDADD): Likewise.
7440 (common_test_1_LDADD): Likewise.
7441 (exception_test_LDADD) Likewise.
7442 (weak_test_LDADD): Likewise.
7443 (many_sections_test_LDADD): Likewise.
7444 (initpri1_LDADD): Likewise.
7445 (script_test_1_LDADD): Likewise.
7446 (script_test_2_LDADD): Likewise.
7447 (justsyms_LDADD): Likewise.
7448 (binary_test_LDADD): Likewise.
7449 (large_LDADD): Likewise.
7450 * testsuite/Makefile.in: Regenerated.
7451
adcf2816 74522009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7453
adcf2816
L
7454 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7455 (Symbol_table::override_with_special): Likewise.
7456 (Symbol_table::add_from_object): Likewise.
7457
28e67f5d
RÁE
74582009-12-04 Rafael Avila de Espindola <espindola@google.com>
7459
7460 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7461 Don't set the data_offset twice.
7462
ae10a101
RÁE
74632009-12-04 Rafael Avila de Espindola <espindola@google.com>
7464
7465 * testsuite/Makefile.in: Regenerate.
7466
f59f41f3
DK
74672009-12-03 Doug Kwan <dougkwan@google.com>
7468
7469 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7470 (Target_arm::do_finalize_sections): Add parameter for symbol table
7471 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7472 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7473 parameter for symbol table pointer.
7474 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7475 an additional parameter for a pointer to symbol table.
7476 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7477 parameter for a symbol table pointer.
7478 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7479 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7480 Ditto.
7481 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7482 parameter for a symbol table pointer.
7483
ca55d848
RÁE
74842009-12-03 Rafael Avila de Espindola <espindola@google.com>
7485
7486 * incremental.cc (Incremental_inputs_header)
7487 (Incremental_inputs_header_write, Incremental_inputs_entry)
7488 (Incremental_inputs_entry_write): Move ...
7489 * incremental.h (Incremental_inputs_header)
7490 (Incremental_inputs_header_write, Incremental_inputs_entry)
7491 (Incremental_inputs_entry_write): here.
7492
3aec4f9c
RÁE
74932009-12-02 Rafael Avila de Espindola <espindola@google.com>
7494
7495 * incremental.cc (make_sized_incremental_binary): Set the target.
7496 Error if it is incompatible.
7497 * output.h (Output_file): Add filename method.
7498
9c0ae74d
RÁE
74992009-12-02 Rafael Avila de Espindola <espindola@google.com>
7500
7501 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7502 from the get_* methods.
7503
a45500ae
RÁE
75042009-12-02 Rafael Avila de Espindola <espindola@google.com>
7505
7506 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7507 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7508 Write 0 for the data_offset of scripts.
7509
325e6408
RÁE
75102009-12-02 Rafael Avila de Espindola <espindola@google.com>
7511
7512 * testsuite/Makefile.am: Add the incremental_test.sh test.
7513 * testsuite/incremental_test.sh: New.
7514 * testsuite/incremental_test_1.c: New.
7515 * testsuite/incremental_test_2.c: New.
7516
954c3e2e
RÁE
75172009-12-01 Rafael Avila de Espindola <espindola@google.com>
7518
7519 * incremental-dump.cc (main): Fix typos.
7520
f8086623
RÁE
75212009-11-27 Rafael Avila de Espindola <espindola@google.com>
7522
7523 PR gold/11025
7524 * incremental-dump.cc (main): Use llu to print 64 bit values.
7525
3b0dd6ac
L
75262009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7527 H.J. Lu <hongjiu.lu@intel.com>
7528
7529 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7530 $(LIBDL).
7531 (incremental_dump_LDADD): Likewise.
7532 * Makefile.in: Regenerated.
7533
a6d1ef57 75342009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7535
a6d1ef57
DK
7536 Revert:
7537
7538 2009-11-25 Doug Kwan <dougkwan@google.com>
7539
7540 * arm.cc (Target_arm::Target_arm): Move method definition
7541 outside of class definition. Add code to handle
7542 --target1-rel, --target1-abs and --target2= options.
7543 (Target_arm::get_reloc_reloc_type): Change method to be
7544 non-static and const.
7545 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7546 New data member declaration.
7547 (Target_arm::Scan::local, Target_arm::Scan::global,
7548 Target_arm::Relocate::relocate,
7549 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7550 Adjust call to Target_arm::get_real_reloc_type.
7551 (Target_arm::get_real_reloc_type): Use command line options
7552 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7553 * options.h (--target1-rel, --target1-abs, --target2): New
7554 ARM-only options.
7555
50aeb7d4
DK
75562009-11-25 Doug Kwan <dougkwan@google.com>
7557
7558 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7559 class definition. Add code to handle --target1-rel, --target1-abs
7560 and --target2= options.
7561 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7562 and const.
7563 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7564 member declaration.
7565 (Target_arm::Scan::local, Target_arm::Scan::global,
7566 Target_arm::Relocate::relocate,
7567 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7568 call to Target_arm::get_real_reloc_type.
7569 (Target_arm::get_real_reloc_type): Use command line options to
7570 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7571 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7572 options.
7573
51938283
DK
75742009-11-25 Doug Kwan <dougkwan@google.com>
7575
7576 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7577 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7578 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7579 formatting.
7580 (Arm_relocate_functions::thm_call): Replace body with a call to
7581 Arm_relocate_functions::thumb_branch_common.
7582 (Arm_relocate_functions::thm_jump24,
7583 Arm_relocate_functions::thm_xpc22): New method definitions.
7584 (Arm_relocate_functions::thumb_branch_common): New method definition.
7585 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7586 operator.
7587 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7588 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7589
e2b8f3c4
RÁE
75902009-11-24 Rafael Avila de Espindola <espindola@google.com>
7591
7592 * Makefile.am: Build incremental-dump
7593 * Makefile.in: Regenerate.
7594 * incremental-dump.cc: New.
7595 * incremental.cc (Incremental_inputs_header_data,
7596 Incremental_inputs_entry_data): Move to incremental.h
7597 * incremental.h: (Incremental_inputs_header_data,
7598 Incremental_inputs_entry_data): Move from incremental.cc
7599
bcba9aec
RÁE
76002009-11-24 Rafael Avila de Espindola <espindola@google.com>
7601
7602 * incremental.cc (Incremental_inputs_header,
7603 Incremental_inputs_header_write, Incremental_inputs_entry,
7604 Incremental_inputs_entry_write): Add a typedef with the data type.
7605
7c3afe08
RÁE
76062009-11-24 Rafael Avila de Espindola <espindola@google.com>
7607
7608 * incremental.cc (Incremental_inputs_header,
7609 Incremental_inputs_header_write, Incremental_inputs_entry,
7610 Incremental_inputs_entry_write): Update comment about which
7611 type has the filed descriptions.
7612
d204b6e9
DK
76132009-11-15 Doug Kwan <dougkwan@google.com>
7614
7615 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7616 (Arm_relocate_functions::arm_branch_common): Change method defintion
7617 in class definition to a method declaration and update list of formal
7618 parameters.
7619 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7620 Arm_relocation_functions::jump24): Adjust call to
7621 Arm_relocate_functions::arm_branch_common. Update list of formal
7622 parameters.
7623 (Arm_relocate_functions::xpc25): New method definition.
7624 (Arm_relocate_functions::arm_branch_common): Move method defintion
7625 out from class definition. Use stubs for mode-switching and extending
7626 branch ranges.
7627 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7628 specially. Change code to enable use of stubs in ARM branches.
7629
43d12afe
DK
76302009-11-10 Doug Kwan <dougkwan@google.com>
7631
7632 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7633 in method declaration.
7634 (Target_arm::relocate_stub): New method declaration.
7635 (Target_arm::default_target): Change to return a pointer instead of
7636 a const reference.
7637 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7638 Target_arm::default_target.
7639 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7640 method definition.
7641 (Target_arm::relocate_section): Adjust view.
7642 (Target_arm::relocate_stub): New method definition.
7643
ac33a407
DK
76442009-11-10 Doug Kwan <dougkwan@google.com>
7645
7646 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7647 a format warning.
7648 * incremental.cc (open_incremental_binary): Initialized local
7649 variables to avoid warnings.
7650 * object.cc (make_elf_object): Ditto.
7651 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7652 a format warning.
e1df38aa 7653
88ee28e9
L
7654009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7655
7656 PR gold/10930
7657 * testsuite/plugin_test.c: Include "config.h".
7658
2daedcd6
DK
76592009-11-09 Doug Kwan <dougkwan@google.com>
7660
7661 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7662 (arm_symbol_value): Remove.
7663 (Arm_relocate_functions::arm_branch_common,
7664 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7665 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7666 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7667 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7668 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7669 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7670 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7671 Arm_relocate_functions::thm_mobw_abs_nc,
7672 Arm_relocate_functions::thm_mov_abs,
7673 Arm_relocate_functions::movw_prel_nc,
7674 Arm_relocate_functions::thm_movt_abs,
7675 Arm_relocate_functions::movt_prel,
7676 Arm_relocate_functions::thm_movw_prel_nc,
7677 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7678 (Target_arm::Relocate::relocate): Only decompose address into two
7679 parts if relocation type uses the thumb-bit and pass the actual
7680 bit instead of a flag indicating that the thumb-bit is used. Adjust
7681 calls to methods in Arm_relocate_functions for this change.
7682
1276bc89 76832009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7684
7685 PR 10925
7686 * reloc.cc: Instantiate
7687 Sized_relobj::initialize_input_to_output_maps and
7688 Sized_relobj:free_input_to_output_maps.
7689
e53ad1b5
ILT
76902009-11-06 Ian Lance Taylor <iant@google.com>
7691
7692 PR 10876
7693 * defstd.cc (in_segment): Set only_if_ref true for "end".
7694
eb44217c
DK
76952009-11-06 Doug Kwan <dougkwan@google.com>
7696
7697 * arm.cc (class Reloc_stub): Correct a comment.
7698 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7699 (Target_arm::scan_section_for_stubs): New method declaration.
7700 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7701 Change methods from private to protected.
7702 (Target_arm::do_may_relax): New method definition.
7703 (Target_arm::do_relax, Target_arm::group_sections,
7704 Target_arm::scan_reloc_for_stub,
7705 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7706 (Target_arm::arm_input_section_map_): New data member declaration.
7707 (Target_arm::scan_reloc_for_stub,
7708 Target_arm::scan_reloc_section_for_stubs,
7709 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7710 Target_arm::do_relax): New method definitions.
7711
5d329b7d
ILT
77122009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7713
7714 * configure.ac: Check for (struct stat)::st_mtim
7715 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7716 * config.in: Regenerate.
7717 * configure: Regenerate.
7718
96a0d71b
ILT
77192009-11-05 Ian Lance Taylor <iant@google.com>
7720
7721 PR 10910
7722 * output.cc (Output_segment::add_output_section): Add missing
7723 return statement.
7724
594c8e5e
ILT
77252009-11-04 Ian Lance Taylor <iant@google.com>
7726
7727 PR 10880
7728 * object.h (class Object): Add is_needed and set_is_needed
7729 methods. Add is_needed_ field. Make bool fields into bitfields.
7730 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7731 defined in a dynamic object and referenced by a regular object,
7732 set is_needed for the dynamic object.
7733 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7734 if the file is marked with as_needed and it is not needed.
7735
22b127cc
ILT
77362009-11-04 Ian Lance Taylor <iant@google.com>
7737
7738 PR 10887
7739 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7740 tags if data is discarded by linker script.
7741 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7742 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7743 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7744 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7745
f5c870d2
ILT
77462009-11-04 Ian Lance Taylor <iant@google.com>
7747
7748 * layout.cc (Layout::get_output_section): Add is_interp and
7749 is_dynamic_linker_section parameters. Change all callers.
7750 (Layout::choose_output_section): Likewise.
7751 (Layout::make_output_section): Likewise.
7752 (Layout::add_output_section_data): Add is_dynamic_linker_section
7753 parameter. Change all callers.
7754 * layout.h (class Layout): Update declarations.
7755 * output.h (class Output_section): Add is_interp, set_is_interp,
7756 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7757 Add is_interp_, is_dynamic_linker_section_ fields. Change
7758 generate_code_fills_at_write_ to a bitfield.
7759 * output.cc (Output_section::Output_sections): Initialize new
7760 fields.
7761 (Output_segment::add_output_section): Add do_sort parameter.
7762 Change all callers.
7763
1ae4d23b
ILT
77642009-11-03 Ian Lance Taylor <iant@google.com>
7765
7766 PR 10860
7767 * options.h (class General_options): Add --warn-common.
7768 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7769 merging two common symbols.
7770 (Symbol_table::should_override): Handle --warn-common when merging
7771 a common symbol with a defined symbol. Use report_resolve_problem
7772 for multiple definitions.
7773 (Symbol_table::report_resolve_problem): New function.
7774 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7775
55da9579
DK
77762009-11-03 Doug Kwan <dougkwan@google.com>
7777
7778 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7779 stub_factory_.
7780 (Target_arm::stub_factory): New method definition.
7781 (Target_arm::new_arm_input_section,
7782 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7783 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7784 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7785 New type definitions.
7786 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7787 member declarations.
7788 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7789 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7790 New method definitions.
7791
37a9ac43
ILT
77922009-11-03 Ian Lance Taylor <iant@google.com>
7793
7794 * options.h (class General_options): Add --warn_constructors.
7795
b3d6a3d4
ILT
77962009-11-03 Ian Lance Taylor <iant@google.com>
7797
7798 PR 10893
7799 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7800 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7801
934b01dd
ILT
78022009-11-03 Ian Lance Taylor <iant@google.com>
7803
7804 PR 10895
7805 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7806 --msgid-bugs-address.
7807 (install-pdf): New target.
7808 (install-data_yes): Look up one directory to find mkinstalldirs.
7809
03c1939b
L
78102009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7811
7812 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7813 tree.
7814
ebd95253
DK
78152009-10-30 Doug Kwan <dougkwan@google.com>
7816
7817 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7818
e9bbb538
DK
78192009-10-30 Doug Kwan <dougkwan@google.com>
7820
7821 * arm.cc (Stub_addend_reader): New struct template definition
7822 and partial specializations.
7823 (Stub_addend_reader::operator()): New method definition for a
7824 partially specialized template.
7825
d5b40221
DK
78262009-10-30 Doug Kwan <dougkwan@google.com>
7827
7828 * arm.cc (Arm_relobj::processor_specific_flags): New method
7829 definition.
7830 (Arm_relobj::do_read_symbols): New method declaration.
7831 (Arm_relobj::processor_specific_flags_): New data member declaration.
7832 (Arm_dynobj): New class definition.
7833 (Target_arm::do_finalize_sections): Add input_objects parameter.
7834 (Target_arm::do_adjust_elf_header): New method declaration.
7835 (Target_arm::are_eabi_versions_compatible,
7836 (Target_arm::merge_processor_specific_flags): New method declaration.
7837 (Target_arm::do_make_elf_object): New overloaded method definitions
7838 and declaration.
7839 (Arm_relobj::do_read_symbols): New method definition.
7840 (Arm_dynobj::do_read_symbols): Ditto.
7841 (Target_arm::do_finalize_sections): Add input_objects parameters.
7842 Merge processor-specific flags from all input objects.
7843 (Target_arm::are_eabi_versions_compatible,
7844 Target_arm::merge_processor_specific_flags,
7845 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7846 New method definitions.
7847 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7848 Input_objects pointer type parameter.
7849 * layout.cc (Layout::finalize): Pass input objects to target's.
7850 finalize_sections function.
7851 * output.cc (Output_file_header::do_sized_write): Set ELF file
7852 header's processor-specific flags.
7853 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7854 Input_objects pointer type parameter.
7855 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7856 * target.h (Input_objects): New forward class declaration.
7857 (Target::processor_specific_flags,
7858 Target::are_processor_specific_flags_sect): New method definitions.
7859 (Target::finalize_sections): Add input_objects parameter.
7860 (Target::Target): Initialize processor_specific_flags_ and
7861 are_processor_specific_flags_set_.
7862 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7863 parameter.
7864 (Target::set_processor_specific_flags): New method definition.
7865 (Target::processor_specific_flags_,
7866 Target::are_processor_specific_flags_set_): New data member
7867 declarations.
7868 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7869 Input_objects pointer type parameter.
7870
ebabffbd
DK
78712009-10-30 Doug Kwan <dougkwan@google.com>
7872
7873 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7874
ad0f2072
ILT
78752009-10-28 Ian Lance Taylor <iant@google.com>
7876
7877 * object.h (class Relobj): Drop options parameter from
7878 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7879 do_scan_relocs, do_relocate. Change all callers.
7880 (class Sized_relobj): Drop options parameters from
7881 do_gc_process_relocs, do_scan_relocs, do_relocate,
7882 do_relocate_sections, relocate_sections, emit_relocs_scan,
7883 emit_relocs_scan_reltype. Change all callers.
7884 (struct Relocate_info): Remove options field and all references to
7885 it.
7886 * reloc.h (class Read_relocs): Remove options constructor
7887 parameter and options_ field. Change all callers.
7888 (class Gc_process_relocs, class Scan_relocs): Likewise.
7889 (class Relocate_task): Likewise.
7890 * target-reloc.h (scan_relocs): Remove options parameter. Change
7891 all callers.
7892 (scan_relocatable_relocs): Likewise.
7893 * target.h (class Sized_target): Remove options parameter from
7894 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7895 all callers.
7896 * gc.h (gc_process_relocs): Remove options parameter. Change all
7897 callers.
7898 * arm.cc: Update functions to remove options parameters.
7899 * i386.cc: Likewise.
7900 * powerpc.cc: Likewise.
7901 * sparc.cc: Likewise.
7902 * x86_64.cc: Likewise.
7903 * testsuite/testfile.cc: Likewise.
7904
8ffa3667
DK
79052009-10-28 Doug Kwan <dougkwan@google.com>
7906
7907 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7908 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7909 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7910 New method definitions.
7911
40f36857
CC
79122009-10-28 Cary Coutant <ccoutant@google.com>
7913
7914 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7915 (Plugin::cleanup_done_): New member.
7916 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7917 (Plugin_manager::cleanup_done_): Remove.
7918 (Plugin_manager::add_input_file): Edit error message.
7919 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7920 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7921
2c849493
ILT
79222009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7923
7924 * fileread.cc: (File_read::View::~View): Use the new
7925 data_ownership_ filed.
7926 (File_read::~File_read): Dispose the new whole_file_view_.
7927 (File_read::open): Mmap the whole file if needed.
7928 (File_read::open): Use whole_file_view_ instead of contents_.
7929 (File_read::find_view): Use whole_file_view_ if applicable.
7930 (File_read::do_read): Use whole_file_view_ instead of contents_.
7931 (File_read::make_view): Use whole_file_view_ instead of contents_,
7932 update File_read::View::View call.
7933 (File_read::find_or_make_view): Update File_read::View::View
7934 call.
7935 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7936 remove contents_
7937 (File_read::View::Data_ownership): New enum.
7938 (File_read::View::View): Replace bool mapped_ with Data_ownership
7939 argument.
7940 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7941 (File_read::View::data_ownership_): New field.
7942 (File_read::contents_): Remove (replaced by whole_file_view_).
7943 (File_read::whole_file_view_): New field.
7944 * options.h (class General_options): Add --keep-files-mapped.
7945
24998053
CC
79462009-10-27 Cary Coutant <ccoutant@google.com>
7947
7948 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7949 * testsuite/Makefile.am (plugin_test_5): New test case.
7950 * testsuite/Makefile.in: Regenerate.
7951
72adc4fa
DK
79522009-10-25 Doug Kwan <dougkwan@google.com>
7953
7954 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7955 from private to protected to allow access by child class.
7956 (Sized_relobj::do_relocate_sections): New method declaration.
7957 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 7958 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
7959 Sized_relobj::relocate_sections. Instantiate template explicitly
7960 for different target sizes and endianity.
7961
07f508a2
DK
79622009-10-24 Doug Kwan <dougkwan@google.com>
7963
7964 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7965 (Arm_input_section::as_arm_input_section): New method.
7966 (Arm_output_section): New class definition.
7967 (Arm_output_section::create_stub_group,
7968 Arm_output_section::group_sections): New method definitions.
7969
10ad9fe5
DK
79702009-10-22 Doug Kwan <dougkwan@google.com>
7971
7972 * arm.cc (Arm_input_section): New class definition.
7973 (Arm_input_section::init, Arm_input_section:do_write,
7974 Arm_input_section::set_final_data_size,
7975 Arm_input_section::do_reset_address_and_file_offset): New method
7976 definitions.
7977
56ee5e00
DK
79782009-10-21 Doug Kwan <dougkwan@google.com>
7979
7980 * arm.cc (Stub_table, Arm_input_section): New forward class
7981 declarations.
7982 (Stub_table): New class defintion.
7983 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7984 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7985 New method definition.
7986
b569affa
DK
79872009-10-21 Doug Kwan <dougkwan@google.com>
7988
7989 * arm.cc: Update copyright comments.
7990 (Target_arm): New forward class template declaration.
7991 (Arm_address): New type.
7992 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7993 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7994 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7995 constants.
7996 (Insn_template): Same.
7997 (DEF_STUBS): New macro.
7998 (Stub_type): New enum type.
7999 (Stub_template): New class definition.
8000 (Stub): Same.
8001 (Reloc_stub): Same.
8002 (Stub_factory): Same.
8003 (Target_arm::Target_arm): Initialize may_use_blx_ and
8004 should_force_pic_veneer_.
8005 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8006 Target_arm::should_force_pic_veneer,
8007 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8008 Target_arm::using_thumb_only, Target_arm:;default_target): New
8009 method defintions.
8010 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8011 New data member declarations.
8012 (Insn_template::size, Insn_template::alignment): New method defintions.
8013 (Stub_template::Stub_template): New method definition.
8014 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8015 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8016 (Stub_factory::Stub_factory): New method definition.
8017 * gold.h (string_hash): New template.
8018 * output.h (Input_section_specifier::hash_value): Use
8019 gold::string_hash.
8020 (Input_section_specifier::string_hash): Remove.
8021 * stringpool.cc (Stringpool_template::string_hash): Use
8022 gold::string_hash.
8023
6c172549
DK
80242009-10-20 Doug Kwan <dougkwan@google.com>
8025
8026 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8027 symbols of relaxed input sections.
8028 * output.h (Output_section::find_relaxed_input_section): Make
8029 method public.
8030
c5617f2f
DK
80312009-10-16 Doug Kwan <dougkwan@google.com>
8032
8033 * dynobj.cc (Versions::Versions): Initialize version_script_.
8034 Only insert base version symbol definition for a shared object
8035 if version script defines any version versions.
8036 (Versions::define_base_version): New method definition.
8037 (Versions::add_def): Check that base version is not needed.
8038 (Versions::add_need): Define base version lazily.
8039 * dynobj.h (Versions::define_base_version): New method declaration.
8040 (Versions::needs_base_version_): New data member declaration.
8041 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8042 (check_DATA): Add no_version_test.stdout.
8043 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8044 New make rules.
8045 * testsuite/Makefile.in: Regenerate.
8046 * testsuite/no_version_test.c: New file.
8047 * testsuite/no_version_test.sh: Ditto.
8048
3c12dcdb
DK
80492009-10-16 Doug Kwan <dougkwan@google.com>
8050
8051 * expression.cc (class Segment_start_expression): New class definition.
8052 (Segment_start_expression::value): New method definition.
8053 (script_exp_function_segment_start): Return a new
8054 Segment_start_expression.
8055 * gold/script-c.h (script_saw_segment_start_expression): New function
8056 prototype.
8057 * script-sections.cc (Script_sections::Script_sections): Initialize
8058 SAW_SEGMENT_START_EXPRESSION_ to false.
8059 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8060 and -Tbbs options to specify section addresses if given in
8061 command line and no SEGMENT_START expression is seen in a script.
8062 * script-sections.h (Script_sections::saw_segment_start_expression,
8063 Script_sections::set_saw_segment_start_expression): New method
8064 definition.
8065 (Script_sections::saw_segment_start_expression_): New data member
8066 declaration.
8067 * script.cc (script_saw_segment_start_expression): New function.
8068 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8069 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8070 script_test_7.sh and script_test_8.sh.
8071 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8072 script_test_8.stdout.
8073 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8074 (script_test_6, script_test_6.stdout, script_test_7,
8075 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8076 * Makefile.in: Regenerate.
8077 * testsuite/script_test_6.sh: New file.
8078 * testsuite/script_test_6.t: Same.
8079 * testsuite/script_test_7.sh: Same.
8080 * testsuite/script_test_7.t: Same.
8081 * testsuite/script_test_8.sh: Same.
8082
64b1ae37
DK
80832009-10-16 Doug Kwan <dougkwan@google.com>
8084
8085 * output.cc (Output_segment::set_section_list_address): Cast
8086 expressions to unsigned long long type to avoid format warnings.
8087
661be1e2
ILT
80882009-10-15 Ian Lance Taylor <iant@google.com>
8089
12edd763 8090 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8091 dot assignment to script_sections_.
12edd763
ILT
8092 * script-sections.cc (Script_sections::add_dot_assignment):
8093 Initialize if necessary.
8094
68b6574b
ILT
8095 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8096 program headers with no load segment if there is a linker script.
8097
661be1e2
ILT
8098 * layout.cc (Layout::set_segment_offsets): Align the file offset
8099 to the segment aligment for -N or -n with no load segment.
8100 * output.cc (Output_segment::add_output_section): Don't crash if
8101 the first section is a TLS section.
8102 (Output_segment::set_section_list_addresses): Print an error
8103 message if the address moves backward in a linker script.
8104 * script-sections.cc
8105 (Output_section_element_input::set_section_addresses): Don't
8106 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8107 (Orphan_output_section::set_section_addresses): Likewise.
8108
f15f61a7
DK
81092009-10-15 Doug Kwan <dougkwan@google.com>
8110
8111 * layout.cc (Layout::finish_dynamic_section): Generate tags
8112 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8113 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8114 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8115
82bb573a
ILT
81162009-10-14 Ian Lance Taylor <iant@google.com>
8117
8118 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8119 fields.
8120 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8121 data_shdr fields of relinfo.
8122 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8123 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8124 R_386_TLS_LDO_32, adjust based on section flags.
8125 (Target_i386::Relocate::fix_up_ldo): Remove.
8126
374ad285
ILT
81272009-10-13 Ian Lance Taylor <iant@google.com>
8128
8129 Add support for -pie.
8130 * options.h (class General_options): Add -pie and
8131 --pic-executable.
8132 (General_options::output_is_position_independent): Test -pie.
8133 (General_options::output_is_executable): Return true if not shared
8134 and not relocatable.
8135 (General_options::output_is_pie): Remove.
8136 * options.cc (General_options::finalize): Reject incompatible uses
8137 of -pie.
8138 * gold.cc (queue_middle_tasks): A -pie link is not static.
8139 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8140 * symtab.cc (Symbol::final_value_is_known): Return false if
8141 output_is_position_independent.
8142 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8143 output_is_position_independent.
8144 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8145 output_is_position_independent.
8146 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8147 output_is_position_independent.
8148 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8149 two_file_pie_test.
8150 (basic_pie_test.o, basic_pie_test): New targets.
8151 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8152 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8153 (two_file_pie_test): New target.
8154 * testsuite/Makefile.in: Rebuild.
8155 * README: Remove note saying that -pie is not supported.
8156
c6585162
ILT
81572009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8158
8159 * options.h (class General_options): Add -init and -fini.
8160 * layout.cc (Layout::finish_dynamic_section): Emit
8161 given init and fini functions.
8162
032ce4e9
ST
81632009-10-13 Sriraman Tallam <tmsriram@google.com>
8164
8165 * gc.h (gc_process_relocs): Check if icf is enabled using new
8166 function.
8167 * gold.cc (queue_initial_tasks): Likewise.
8168 (queue_middle_tasks): Likewise.
8169 * object.cc (do_layout): Likewise.
8170 * symtab.cc (is_section_folded): Likewise.
8171 * main.cc (main): Likewise.
8172 * reloc.cc (Read_relocs::run): Likewise.
8173 (Sized_relobj::do_scan_relocs): Likewise.
8174 * icf.cc (is_function_ctor_or_dtor): New function.
8175 (Icf::find_identical_sections): Check if function is ctor or dtor when
8176 safe icf is chosen.
8177 * options.h (General_options::icf): Change option to be an enum.
8178 (Icf_status): New enum.
8179 (icf_enabled): New method.
8180 (icf_safe_folding): New method.
8181 (set_icf_status): New method.
8182 (icf_status_): New variable.
8183 * (options.cc) (General_options::finalize): Set icf_status_.
8184 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8185 icf_test and icf_keep_unique_test to use the --icf enum flag.
8186 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8187 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8188
f345227a
ST
81892009-10-12 Sriraman Tallam <tmsriram@google.com>
8190
8191 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8192 includes to gc.h and icf.h.
8193 * arm.cc: Include gc.h.
8194 * gold.cc: Likewise.
8195 * i386.cc: Likewise.
8196 * powerpc.cc: Likewise.
8197 * sparc.cc: Likewise.
8198 * x86_64.cc: Likewise.
8199 * gc.h: Include icf.h.
8200
1c7814ed
ILT
82012009-10-11 Ian Lance Taylor <iant@google.com>
8202
8203 * plugin.cc: Include "gold.h" before other header files.
8204
ae3b5189
CD
82052009-10-10 Chris Demetriou <cgd@google.com>
8206
8207 * options.h (Input_file_argument::Input_file_type): New enum.
8208 (Input_file_argument::is_lib_): Replace with...
8209 (Input_file_argument::type_): New member.
8210 (Input_file_argument::Input_file_argument): Take Input_file_type
8211 'type' rather than boolean 'is_lib' as second argument.
8212 (Input_file_argument::is_lib): Use type_.
8213 (Input_file_argument::is_searched_file): New function.
8214 (Input_file_argument::may_need_search): Handle is_searched_file.
8215 * options.cc (General_options::parse_library): Support -l:filename.
8216 (General_options::parse_just_symbols): Update for Input_file_argument
8217 changes.
8218 (Command_line::process): Likewise.
8219 * archive.cc (Archive::get_file_and_offset): Likewise.
8220 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8221 * script.cc (read_script_file, script_add_file): Likewise.
8222 * fileread.cc (Input_file::Input_file): Likewise.
8223 (Input_file::will_search_for): Handle is_searched_file.
8224 (Input_file::open): Likewise.
8225 * readsyms.cc (Read_symbols::get_name): Likewise.
8226 * testsuite/Makefile.am (searched_file_test): New test.
8227 * testsuite/Makefile.in: Regenerate.
8228 * testsuite/searched_file_test.cc: New file.
8229 * testsuite/searched_file_test_lib.cc: New file.
8230
f3048a1d
ILT
82312009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8232 Ian Lance Taylor <iant@google.com>
8233
8234 * descriptor.cc: Include <cstdio> and "binary-io.h".
8235 (Descriptors::open): Open the files in binary mode always.
8236 * script.cc (Lex::get_token): Treat \r as whitespace.
8237
d4780e57
ILT
82382009-10-09 Ian Lance Taylor <iant@google.com>
8239
8240 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8241
d9a893b8
ILT
82422009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8243 Ian Lance Taylor <iant@google.com>
8244
8245 * configure.ac: Check for readv function also.
8246 * fileread.cc (readv): Define if not HAVE_READV.
8247 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8248 does not exist.
8249 * config.in: Regenerate.
8250 * configure: Regenerate.
8251
c0a62865
DK
82522009-10-09 Doug Kwan <dougkwan@google.com>
8253
8254 * layout.cc (Layout::make_output_section): Call target hook to make
8255 ordinary output section.
8256 (Layout::finalize): Adjust parameter list of call the
8257 Target::may_relax().
8258 * layout.h (class Layout::section_list): New method.
8259 * merge.h (Output_merge_base::entsize): Change visibility to public.
8260 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8261 New methods.
8262 (Output_merge_string::do_is_string): New method.
8263 * object.cc (Sized_relobj::do_setup): renamed from
8264 Sized_relobj::set_up.
8265 * object.h (Sized_relobj::adjust_shndx,
8266 Sized_relobj::initializ_input_to_output_maps,
8267 Sized_relobj::free_input_to_output_maps): Change visibilities to
8268 protected.
8269 (Sized_relobj::setup): Virtualize.
8270 (Sized_relobj::do_setup): New method declaration.
8271 (Sized_relobj::invalidate_section_offset,
8272 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8273 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8274 * options.cc (parse_int): New function.
8275 * options.h (parse_int): New declaration.
8276 (DEFINE_int): New macro.
8277 (stub_group_size): New option.
8278 * output.cc (Output_section::Output_section): Initialize memebers
8279 merge_section_map_, merge_section_by_properties_map_,
8280 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8281 (Output_section::add_input_section): Handled deferred code-fill
8282 generation and remove an old comment.
8283 (Output_section::add_relaxed_input_section): New method definition.
8284 (Output_section::add_merge_input_section): Use merge section by
8285 properties map to speed to search. Update merge section maps
8286 as appropriate.
8287 (Output_section::build_relaxation_map): New method definition.
8288 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8289 Same.
8290 (Output_section::relax_input_section): Renamed to
8291 Output_section::convert_input_sections_to_relaxed_sections and change
8292 interface to take a vector of pointers to relaxed sections.
8293 (Output_section::find_merge_section,
8294 Output_section::find_relaxed_input_section): New method definitions.
8295 (Output_section::is_input_address_mapped,
8296 Output_section::output_offset, Output_section::output_address):
8297 Use output section data maps to speed up searching.
8298 (Output_section::find_starting_output_address): Add comments.
8299 (Output_section::do_write,
8300 Output_section::write_to_postprocessing_buffer): Do code-fill
8301 generation as appropriate.
8302 (Output_section::get_input_sections): Invalidate relaxed input section
8303 map.
8304 (Output_section::restore_states): Adjust type of checkpoint .
8305 Invalidate relaxed input section map.
8306 * output.h (Output_merge_base): New class declaration.
8307 (Input_section_specifier): New class defintion.
8308 (class Output_relaxed_input_section) Change base class to
8309 Output_section_data_build.
8310 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8311 base class initializer.
8312 (Output_section::add_relaxed_input_section): New method declaration.
8313 (Output_section::Input_section): Change visibility to protected.
8314 (Output_section::Input_section::relobj,
8315 Output_section::Input_section::shndx): Handle relaxed input sections.
8316 Output_section::input_sections) Change visibility to protected. Also
8317 define overload to return a non-const pointer.
8318 (Output_section::Merge_section_properties): New class defintion.
8319 (Output_section::Merge_section_by_properties_map,
8320 Output_section::Output_section_data_by_input_section_map,
8321 Output_section::Relaxation_map): New types.
8322 (Output_section::relax_input_section): Rename method to
8323 Output_section::convert_input_sections_to_relaxed_sections and change
8324 interface to take a vector of relaxed section pointers.
8325 (Output_section::find_merge_section,
8326 Output_section::find_relaxed_input_section,
8327 Output_section::build_relaxation_map,
8328 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8329 New method declarations.
8330 (Output_section::merge_section_map_
8331 Output_section::merge_section_by_properties_map_,
8332 Output_section::relaxed_input_section_map_,
8333 Output_section::is_relaxed_input_section_map_valid_,
8334 Output_section::generate_code_fills_at_write_): New data members.
8335 * script-sections.cc
8336 (Output_section_element_input::set_section_addresses): Call
8337 current_data_size and addralign methods of relaxed input sections.
8338 (Orphan_output_section::set_section_addresses): Call current_data_size
8339 and addralign methods of relaxed input sections.
8340 * symtab.cc (Symbol_table::compute_final_value): Extract template
8341 from the body of Symbol_table::sized_finalize_symbol.
8342 (Symbol_table::sized_finalized_symbol): Call
8343 Symbol_table::compute_final_value.
8344 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8345 (Symbol_table::compute_final_value): New templated method declaration.
8346 * target.cc (Target::do_make_output_section): New method defintion.
8347 * target.h (Target::make_output_section): New method declaration.
8348 (Target::relax): Add more parameters for input objects, symbol table
8349 and layout. Adjust call to do_relax.
8350 (Target::do_make_output_section): New method declaration.
8351 (Target::do_relax): Add parameters for input objects, symbol table
8352 and layout.
8353
d446d6c4
ILT
83542009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8355
8356 * pread.c: Include stdio.h.
8357
bc06c745
ILT
83582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8359
8360 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8361 defined.
8362
75aea3d0
ILT
83632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8364
8365 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8366 Change read_shndx type to unsigned int.
8367 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8368 int.
8369 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8370 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8371 Change read_shndx type to unsigned int.
8372 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8373 int.
8374 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8375 * layout.cc (Layout::create_symtab_sections): Cast the result of
8376 local_symcount * symsize to off_t in the gold_assert.
8377
be8fcb75
ILT
83782009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8379
8380 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8381 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8382 R_ARM_BASE_ABS.
8383 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8384 (Arm_relocate_functions::thm_abs5): New function.
8385 (Arm_relocate_functions::abs12): New function.
8386 (Arm_relocate_functions::abs16): New function.
8387 (Arm_relocate_functions::base_abs): New function.
8388 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8389 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8390 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8391 R_ARM_BASE_ABS.
8392 (Scan::global): Likewise.
8393 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8394 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8395 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8396 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8397 R_ARM_BASE_ABS.
8398
c2a122b6
ILT
83992009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8400
8401 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8402 (Arm_relocate_functions::movt_prel): New function.
8403 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8404 (Arm_relocate_functions::thm_movt_prel): New function.
8405 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8406 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8407 (Scan::global, Relocate::relocate): Likewise.
8408 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8409
c4aa1e2d
ILT
84102009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8411
8412 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8413 Incremental_checker.
8414 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8415 unsigned int.
8416 (class Incremental_inputs_header): New class.
8417 (Incremental_inputs_header_writer): Edit comment.
8418 (Incremental_inputs_entry): New class.
8419 (Incremental_inputs_entry_writer): Edit comment.
8420 (Sized_incremental_binary::do_find_incremental_inputs_section):
8421 Add *strtab_shndx parameter, fill it.
8422 (Sized_incremental_binary::do_check_inputs): New method.
8423 (Incremental_checker::can_incrementally_link_output_file): Use
8424 Sized_incremental_binary::check_inputs.
8425 (Incremental_inputs::report_command_line): Save command line in
8426 command_line_.
8427 * incremental.h:
8428 (Incremental_binary::find_incremental_inputs_section): New
8429 method.
8430 (Incremental_binary::do_find_incremental_inputs_section): Add
8431 strtab_shndx parameter.
8432 (Incremental_binary::do_check_inputs): New pure virtual method.
8433 (Sized_incremental_binary::do_check_inputs): Declare.
8434 (Incremental_checker::Incremental_checker): Add incremental_inputs
8435 parameter, use it to initialize incremental_inputs_.
8436 (Incremental_checker::incremental_inputs_): New field.
8437 (Incremental_checker::command_line): New method.
8438 (Incremental_checker::inputs): New method.
8439 (Incremental_checker::command_line_): New field.
8440
c549a694
ILT
84412009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8442
8443 * incremental.cc: Include <cstdarg> and "target-select.h".
8444 (vexplain_no_incremental): New function.
8445 (explain_no_incremental): New function.
8446 (Incremental_binary::error): New method.
8447 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8448 method.
8449 (make_sized_incremental_binary): New function.
8450 (open_incremental_binary): New function.
8451 (can_incrementally_link_file): Add checks if output is ELF and has
8452 inputs section.
8453 * incremental.h: Include "elfcpp_file.h" and "output.h".
8454 (Incremental_binary): New class.
8455 (Sized_incremental_binary): New class.
8456 (open_incremental_binary): Declare.
8457 * object.cc (is_elf_object): Use
8458 elfcpp::Elf_recognizer::is_elf_file.
8459 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8460 * output.h (Output_file::filesize): New method.
8461
fd3c5f0b
ILT
84622009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8463
8464 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8465 New function.
8466 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8467 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8468 function.
8469 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8470 function.
8471 (Arm_relocate_functions::movw_abs_nc): New function.
8472 (Arm_relocate_functions::movt_abs): New function.
8473 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8474 (Arm_relocate_functions::thm_movt_abs): New function.
8475 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8476 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8477 (Scan::global): Likewise.
8478 (Relocate::relocate): Likewise.
8479 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8480
7f5309a5
ILT
84812009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8482
8483 * arm.cc (Arm_relocate_functions::got_prel) New function.
8484 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8485 (Relocate::relocate): Likewise.
8486 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8487
364c7fa5
ILT
84882009-10-06 Ian Lance Taylor <iant@google.com>
8489
8490 * options.h (class General_options): Define
8491 split_stack_adjust_size parameter.
8492 * object.h (class Object): Add uses_split_stack_ and
8493 has_no_split_stack_ fields. Add uses_split_stack and
8494 has_no_split_stack accessor functions. Declare
8495 handle_split_stack_section.
8496 (class Reloc_symbol_changes): Define.
8497 (class Sized_relobj): Define Function_offsets. Declare
8498 split_stack_adjust, split_stack_adjust_reltype, and
8499 find_functions.
8500 * object.cc (Object::handle_split_stack_section): New function.
8501 (Sized_relobj::do_layout): Call handle_split_stack_section.
8502 * dynobj.cc (Sized_dynobj::do_layout): Call
8503 handle_split_stack_section.
8504 * reloc.cc (Sized_relobj::relocate_sections): Call
8505 split_stack_adjust for executable sections in split_stack
8506 objects. Pass reloc_map to relocate_section.
8507 (Sized_relobj::split_stack_adjust): New function.
8508 (Sized_relobj::split_stack_adjust_reltype): New function.
8509 (Sized_relobj::find_functions): New function.
8510 * target-reloc.h: Include "object.h".
8511 (relocate_section): Add reloc_symbol_changes parameter. Change
8512 all callers.
8513 * target.h (class Target): Add calls_non_split method. Declare
8514 do_calls_non_split virtual method. Declare match_view and
8515 set_view_to_nop.
8516 * target.cc: Include "elfcpp.h".
8517 (Target::do_calls_non_split): New function.
8518 (Target::match_view): New function.
8519 (Target::set_view_to_nop): New function.
8520 * gold.cc (queue_middle_tasks): Give an error if mixing
8521 split-stack and non-split-stack objects with -r.
8522 * i386.cc (Target_i386::relocate_section): Add
8523 reloc_symbol_changes parameter.
8524 (Target_i386::do_calls_non_split): New function.
8525 * x86_64.cc (Target_x86_64::relocate_section): Add
8526 reloc_symbol_changes parameter.
8527 (Target_x86_64::do_calls_non_split): New function.
8528 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8529 parameter.
8530 * powerpc.cc (Target_powerpc::relocate_section): Add
8531 reloc_symbol_changes parameter.
8532 * sparc.cc (Target_sparc::relocate_section): Add
8533 reloc_symbol_changes parameter.
8534 * configure.ac: Call AM_CONDITIONAL for the default target.
8535 * configure: Rebuild.
8536 * testsuite/Makefile.am (TEST_AS): New variable.
8537 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8538 (check_DATA): Add split_i386 and split_x86_64 files.
8539 (SPLIT_DEFSYMS): Define.
8540 (split_i386_[1234n].o): New targets.
8541 (split_i386_[124]): New targets.
8542 (split_i386_[1234r].stdout): New targets.
8543 (split_x86_64_[1234n].o): New targets.
8544 (split_x86_64_[124]): New targets.
8545 (split_x86_64_[1234r].stdout): New targets.
8546 (MOSTLYCLEANFILES): Add new executables.
8547 * testsuite/split_i386.sh: New file.
8548 * testsuite/split_x86_64.sh: New file.
8549 * testsuite/split_i386_1.s: New file.
8550 * testsuite/split_i386_2.s: New file.
8551 * testsuite/split_i386_3.s: New file.
8552 * testsuite/split_i386_4.s: New file.
8553 * testsuite/split_i386_n.s: New file.
8554 * testsuite/split_x86_64_1.s: New file.
8555 * testsuite/split_x86_64_2.s: New file.
8556 * testsuite/split_x86_64_3.s: New file.
8557 * testsuite/split_x86_64_4.s: New file.
8558 * testsuite/split_x86_64_n.s: New file.
8559 * testsuite/testfile.cc (Target_test): Update relocation_section
8560 function.
8561 * testsuite/Makefile.in: Rebuild.
8562
e8a9fcda
ILT
85632009-10-06 Ian Lance Taylor <iant@google.com>
8564
8565 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8566 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8567 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8568 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8569 the address on ldo_addrs_.
8570 (Target_i386::Relocate::fix_up_ldo): New function.
8571
e99daf92
ILT
85722009-10-06 Rafael Espindola <espindola@google.com>
8573
8574 * plugin.cc (add_input_library): New.
8575 (Plugin::load): Add add_input_library to tv.
8576 (Plugin_manager::add_input_file): Add the is_lib argument.
8577 (add_input_file): Update call to Plugin_manager::add_input_file.
8578 (add_input_library): New.
8579 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8580
966d4097
DK
85812009-09-30 Doug Kwan <dougkwan@google.com>
8582
8583 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8584 symbol and call Symbol::may_need_copy_reloc to determine if
8585 a copy reloc is needed.
8586 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8587 nocopyreloc is given in command line.
8588 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8589 given in command line.
8590 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8591 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8592 of the removed Target_i386::may_need_copy_reloc.
8593 * options.h (copyreloc): New option with default value false.
8594 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8595 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8596 instead of the removed Target_powerpc::may_need_copy_reloc.
8597 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8598 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8599 instead of the removed Target_sparc::may_need_copy_reloc.
8600 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8601 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8602 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8603 instead of the removed Target_x86_64::may_need_copy_reloc.
8604
029ba973
ILT
86052009-09-30 Ian Lance Taylor <iant@google.com>
8606
8607 * object.h (class Object): Remove target_ field, and target,
8608 sized_target, and set_target methods.
8609 (Object::sized_target): Remove.
8610 (class Sized_relobj): Update declarations. Remove sized_target.
8611 * object.cc (Sized_relobj::setup): Remove target parameter.
8612 Change all callers.
8613 (Input_objects::add_object): Don't do anything with the target.
8614 (make_elf_sized_object): Add punconfigured parameter. Change all
8615 callers. Set or test parameter target.
8616 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8617 Change all callers.
8618 * parameters.cc (Parameters::set_target): Change parameter type to
8619 be non-const.
8620 (Parameters::default_target): Remove.
8621 (set_parameters_target): Change parameter type to be non-const.
8622 (parameters_force_valid_target): New function.
8623 (parameters_clear_target): New function.
8624 * parameters.h (class Parameters): Update declarations. Remove
8625 default_target method. Add sized_target and clear_target
8626 methods. Change target_ to be non-const.
8627 (set_parameters_target): Update declaration.
8628 (parameters_force_valid_target): Declare.
8629 (parameters_clear_target): Declare.
8630 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8631 as NULL if we aren't searching.
8632 (Add_symbols::run): Don't check for compatible target.
8633 * fileread.cc (Input_file::open_binary): Call
8634 parameters_force_valid_target.
8635 * gold.cc (queue_middle_tasks): Likewise.
8636 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8637 set_target on object.
8638 * dynobj.h (class Sized_dynobj): Update declarations.
8639 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8640 make_elf_object returns NULL.
8641 (Archive::include_member): Don't check whether object target is
8642 compatible.
8643 * output.cc (Output_section::add_input_section): Get target from
8644 parameters.
8645 (Output_section::relax_input_section): Likewise.
8646 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8647 parameters.
8648 (Sized_relobj::do_scan_relocs): Likewise.
8649 (Sized_relobj::relocate_sections): Likewise.
8650 * resolve.cc (Symbol_table::resolve): Likewise.
8651 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8652 parameter. Change all callers.
8653 (Symbol_table::add_from_object): Get target from parameters.
8654 (Symbol_table::add_from_relobj): Don't check object target.
8655 (Symbol_table::add_from_dynobj): Likewise.
8656 (Symbol_table::define_special_symbol): Get target from
8657 parameters.
8658 * symtab.h (class Symbol_table): Update declaration.
8659 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8660 parameter. Change all callers. Clear parameter target.
8661 (Binary_test): Test target here.
8662 * testsuite/object_unittest.cc (gold_testsuite): Remove
8663 target_test_pointer parameter. Change all callers.
8664 (Object_test): Test target here.
8665
a6a22b83
ILT
86662009-09-26 Ian Lance Taylor <iant@google.com>
8667
8668 * testsuite/initpri1.c: Don't try to use constructor priorities if
8669 compiling with gcc before 4.3.
8670
6a8f49fe
ILT
86712009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8672
8673 * testsuite/retain_symbols_file_test.sh (check_present): Change
8674 output file name to retain_symbols_file_test.stdout.
8675 (check_absent): Likewise.
8676
8c604651
CS
86772009-09-18 Craig Silverstein <csilvers@google.com>
8678
8679 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8680 * options.cc: Include <cerrno> and <fstream>.
8681 (General_options::finalize): Parse -retain-symbols-file tag.
8682 * options.h: New flag.
8683 (General_options): New method should_retain_symbol, new
8684 variable symbols_to_retain.
8685 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8686 should_retain_symbol map.
8687 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8688 * testsuite/Makefile.in: Regenerate.
8689 * testsuite/retain_symbols_file_test.sh: New file.
8690
ca58b19f
NC
86912009-09-18 Nick Clifton <nickc@redhat.com>
8692
8693 * po/es.po: Updated Spanish translation.
8694
20e6d0d6
DK
86952009-09-17 Doug Kwan <dougkwan@google.com>
8696
8697 * debug.h (DEBUG_RELAXATION): New constant.
8698 (DEBUG_ALL): Add DEBUG_RELAXATION.
8699 (debug_string_to_enum): Add relaxation debug option.
8700 * layout.cc
8701 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8702 Layout::Relaxation_debug_check::read_sections,
8703 Layout::Relaxation_debug_check::read_sections): New method definitions.
8704 (Layout::Layout): Initialize data members
8705 record_output_section_data_from_scrips_,
8706 script_output_section_data_list_ and relaxation_debug_check_.
8707 (Layout::save_segments, Layout::restore_segments,
8708 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8709 Layout::relaxation_loop_body): New method definitions.
8710 (Layout::finalize): Support relaxation. Move section layout code to
8711 Layout::relaxation_loop_body.
8712 (Layout::set_asection_address_from_script): Move code for orphan
8713 section placement out.
8714 (Layout::place_orphan_sections_in_script): New method definition.
8715 * layout.h (Output_segment_headers, Output_file_header):
8716 New forward class declarations.
8717 (Layout::~Layout): Define.
8718 (Layout::new_output_section_data_from_script): New method definition.
8719 (Layout::place_orphan_sections_in_script): New method declaration.
8720 (Layout::Segment_states): New type declaration.
8721 (Layout::save_segments, Layout::restore_segments,
8722 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8723 Layout::relaxation_loop_body): New method declarations.
8724 (Layout::Output_section_data_list): New type declaration.
8725 (Layout::Relaxation_debug_check): New class definition.
8726 (Layout::record_output_section_data_from_script_,
8727 Layout::script_output_section_data_list_, Layout::segment_states_,
8728 Layout::relaxation_debug_check_): New data members.
8729 * output.cc: (Output_section_headers::do_size): New method definition.
8730 (Output_section_headers::Output_section_headers): Move size
8731 computation to Output_section_headers::do_size.
8732 (Output_segment_headers::do_size): New method definition.
e1df38aa 8733 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8734 Output_file_header::do_size and call it.
8735 (Output_file_header::do_size): New method definition.
8736 (Output_data_group::Output_data_group): Adjust call to
8737 Output_section_data.
8738 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8739 (Output_symtab_xindex::do_write): Add array bound check.
8740 (Output_section::Input_section::print_to_mapfile): Handle
8741 RELAXED_INPUT_SECTION_CODE.
8742 (Output_section::Output_section): Initialize data member checkpoint_.
8743 (Output_section::~Output_section): Delete checkpoint object pointed
8744 by checkpoint_.
8745 (Output_section::add_input_section): Always add an Input_section if
8746 relaxing.
8747 (Output_section::add_merge_input_section): Add assert.
8748 (Output_section::relax_input_section): New method definition.
8749 (Output_section::set_final_data_size): Set load address to zero for
8750 an unallocated section.
8751 (Output_section::do_address_and_file_offset_have_reset_values):
8752 New method definition.
8753 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8754 Handle relaxed input section.
8755 (Output_section::sort_attached_input_sections): Checkpoint input
8756 section list lazily.
8757 (Output_section::get_input_sections): Change type of input_sections to
8758 list of Simple_input_section pointers. Checkpoint input section list
8759 lazily. Also handle relaxed input sections.
8760 (Output_section::add_input_section_for_script): Take a reference to
8761 a Simple_input_section object instead of Relobj pointer and section
8762 index as parameter. Handle relaxed input sections.
8763 (Output_section::save_states, Output_section::restore_states): New
8764 method definitions.
8765 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8766 (Output_data::is_data_size_fixed): New method definition.
8767 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8768 if it is fixed.
8769 (Output_data::address_and_file_offset_have_reset_values): New method
8770 definition.
8771 (Output_data::do_address_and_file_offset_have_reset_values): New method
8772 definition.
8773 (Output_data::set_data_size): Check that data size is not fixed.
8774 (Output_data::fix_data_size): New method definition.
8775 (Output_data::is_data_size_fixed_): New data member.
8776 (Output_section_headers::set_final_data_size): New method definition.
8777 (Output_section_headers::do_size): New method declaration.
8778 (Output_segment_headers::set_final_data_size): New method definition.
8779 (Output_segment_headers::do_size): New method declaration.
8780 (Output_file_header::set_final_data_size)::New method definition.
8781 (Output_file_header::do_size)::New method declaration.
8782 (Output_section_data::Output_section_data): Add new parameter
8783 is_data_size_fixed and use it to fix data size.
8784 (Output_data_const::Output_data_const): Adjust call to base class
8785 constructor and fix data size.
8786 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8787 base class constructor and fix data size.
8788 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8789 base class constructor and fix data size.
8790 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8791 class constructor and fix data size.
8792 (Output_data_group::set_final_data_size): New method definition.
8793 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8794 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8795 class constructor and fix data size.
8796 (Output_relaxed_input_section): New class definition.
8797 (Output_section::Simple_input_section): New class definition.
8798 (Output_section::get_input_sections): Adjust parameter list.
8799 (Output_section::add_input_section_for_script): Same.
8800 (Output_section::save_states, Output_section::restore_states,
8801 Output_section::do_address_and_file_offset_have_reset_values,
8802 (Output_section::Input_section::Input_section): Handle
8803 RELAXED_INPUT_SECTION_CODE. Add new overload for
8804 Output_relaxed_input_section.
8805 (Output_section::Input_section::is_input_section,
8806 Output_section::Input_section::set_output_section): Handle relaxed
8807 input section.
8808 (Output_section::Input_section::is_relaxed_input_section,
8809 Output_section::Input_section::output_section_data,
8810 Output_section::Input_section::relaxed_input_section): New method
8811 definitions.
8812 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8813 value.
8814 (Output_section::Input_section::u1_): Update comments.
8815 (Output_section::Input_section::u2_): Add new union member poris.
8816 (Output_section::Checkpoint_output_section): New classs definition.
8817 (Output_section::relax_input_section): New method declaration.
8818 (Output_section::checkpoint_): New data member.
8819 (Output_segment): Update comments.
8820 (Output_segment::Output_segment): Un-privatize copy constructor.
8821 (Output_segment::operator=): Un-privatize.
8822 * script-sections.cc (Output_section_element::Input_section_list):
8823 Change element type to Output_section::Simple_input_section.
8824 (Output_section_element_dot_assignment::set_section_addresses):
8825 Register output section data for relaxation clean up.
8826 (Output_data_exression::Output_data_expression): Adjust call to base
8827 constructor to fix data size.
8828 (Output_section_element_data::set_section_addresses): Register
8829 Output_data_expression object for relaxation clean up.
8830 (struct Input_section_info): Replace Relobj pointer and section index
8831 pair with Output_section::Simple_input_section and Convert struct to a
8832 class.
8833 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8834 Input_section_info data member to use accessors.
20e6d0d6
DK
8835 (Output_section_element_input::set_section_addresses): Use layout
8836 parameter. Adjust code to use Output_section::Simple_input_section
8837 and Input_secction_info classes. Register filler for relaxation
8838 clean up.
8839 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8840 and section index pair with Output_section::Simple_input_section
8841 class. Adjust code accordingly.
8842 (Phdrs_element::release_segment): New method definition.
8843 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8844 segment list.
8845 (Script_sections::release_segments): New method definition.
8846 * gold/script-sections.h (Script_sections::release_segments): New
8847 method declaration.
8848 * gold/target.h (Target::may_relax, Target::relax,
8849 Target::do_may_relax, Target::do_relax): New method definitions.
8850
5e445df6
ILT
88512009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8852
8853 * arm.cc (has_signed_unsigned_overflow): New function.
8854 (Arm_relocate_functions::abs8): New function.
8855 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8856 (Target_arm::Scan::global): Likewise.
8857 (Target_arm::relocate::relocate): Likewise.
8858 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8859 Likewise.
8860
8c604651 88612009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8862
8863 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8864 * testsuite/Makefile.in: Regenerate.
8865
1e9cc1c2
NC
88662009-09-11 Nick Clifton <nickc@redhat.com>
8867
8868 * po/gold.pot: Updated by the Translation project.
8869
6a89f575
CC
88702009-09-08 Cary Coutant <ccoutant@google.com>
8871
8872 * output.cc (Output_file::open): Add execute permission to empty file.
8873 * testsuite/Makefile.am (permission_test): New test.
8874 * testsuite/Makefile.in: Regenerate.
8875
fdcac5af
ILT
88762009-09-02 Ian Lance Taylor <iant@google.com>
8877
8878 * output.cc (Output_file::resize): Call map_no_anonymous rather
8879 than map.
8880
44453f85
ILT
88812009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8882
8883 * gold.cc: Include "incremental.h".
8884 (queue_initial_tasks): Call Incremental_checker methods.
8885 * incremental.cc: Include "output.h".
8886 (Incremental_checker::can_incrementally_link_output_file): New
8887 method.
8888 * incremental.h (Incremental_checker): New class.
8889
8890 * output.cc (Output_file::open_for_modification): New method.
8891 (Output_file::map_anonymous): Changed return type to bool. Record
8892 map in base_ field.
8893 (Output_file::map_no_anonymous): New method, broken out of map.
8894 (Output_file::map): Use map_no_anonymous and map_anonymous.
8895 * output.h (class Output_file): Update declarations.
8896
293c1386
CC
88972009-08-24 Cary Coutant <ccoutant@google.com>
8898
8899 * options.h (Command_line::Pre_options): New class.
8900 (Command_line::pre_options): New member.
8901 * options.cc (gold::options::ready_to_register): New variable.
8902 (One_option::register_option): Do nothing if not registering options.
8903 Assert if same short option registered twice.
8904 (General_options::General_options): Turn off option registration when
8905 done constructing.
8906 (Command_line::Pre_options::Pre_options): New constructor.
8907
f773f3d2
CC
89082009-08-24 Cary Coutant <ccoutant@google.com>
8909
06a73cfe
CC
8910 * options.h (General_options::no_keep_memory): Remove incorrect
8911 short option.
f773f3d2 8912
a15af8e2
RW
89132009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8914
8915 * Makefile.am (am__skiplex, am__skipyacc): New.
8916 * Makefile.in: Regenerate.
8917
c462b41b
RW
89182009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8919
14ec8efd
RW
8920 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8921 (INCLUDES): ... this.
8922 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8923 (AM_CPPFLAGS): Renamed from ...
8924 (INCLUDE): ... this.
8925 * Makefile.in, testsuite/Makefile.in: Regenerate.
8926
81ecdfbb
RW
8927 * Makefile.in: Regenerate.
8928 * aclocal.m4: Likewise.
8929 * config.in: Likewise.
8930 * configure: Likewise.
8931 * testsuite/Makefile.in: Likewise.
8932
c462b41b
RW
8933 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8934 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8935 * Makefile.in: Regenerate.
8936 * testsuite/Makefile.in: Regenerate.
8937
2da73f13
CC
89382009-08-19 Cary Coutant <ccoutant@google.com>
8939
8940 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8941 symbols in shared libraries overridden by hidden or internal symbols
8942 in the main program.
8943
2db70501
CD
89442009-08-19 Chris Demetriou <cgd@google.com>
8945
8946 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8947 checking source file names in error messages.
8948
f733487b
DK
89492009-08-18 Doug Kwan <dougkwan@google.com>
8950
8951 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8952 an elcpp::Ehdr as parameter. Adjust call to set_target.
8953 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8954 an elfcpp::Ehdr as parameter.
8955 * object.cc (Object::set_target): Remove the version that looks up
8956 a target and sets it.
8957 (Sized_relobj::setup): Take a Target object instead of
8958 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8959 (make_elf_sized_object): Find target and ask target to
8960 make an ELF object.
8961 * object.h: (Object::set_target): Remove the version that looks up
8962 a target and sets it.
8963 (Sized_relobj::setup): Take a Target object instead of
8964 an elfcpp:Ehdr as parameter.
8965 * target.cc: Include dynobj.h.
8966 (Target::do_make_elf_object_implementation): New.
8967 (Target::do_make_elf_object): New.
8968 * target.h (Target::make_elf_object): New template declaration.
8969 (Target::do_make_elf_object): New method declarations.
8970 (Target::do_make_elf_object_implementation): New template declaration.
8971
cc70f101
ILT
89722009-08-14 Ian Lance Taylor <iant@google.com>
8973
8974 * gold.h (FUNCTION_NAME): Define.
8975 (gold_unreachable): Use FUNCTION_NAME.
8976
ef5e0cb1
ST
89772009-08-12 Sriraman Tallam <tmsriram@google.com>
8978
8979 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8980 symbol in the --keep-unique list is not found.
8981
48c187ce
ST
89822009-08-12 Sriraman Tallam <tmsriram@google.com>
8983
8984 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8985 been maked as --keep-unique.
8986 (Icf::unfold_section): New function.
8987 * icf.h (Icf::unfold_section): New function.
8988 * options.h (General_options::keep_unique): New option.
8989 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8990 * testsuite/Makefile.in: Regenerate.
8991 * testsuite/icf_keep_unique_test.sh: New file.
8992 * testsuite/icf_keep_unique_test.cc: New file.
8993
645afe0c
CC
89942009-08-12 Cary Coutant <ccoutant@google.com>
8995
8996 PR 10471
8997 * resolve.cc (Symbol_table::resolve): Check for references from
8998 dynamic objects to hidden and internal symbols.
8999 * testsuite/Makefile.am (hidden_test.sh): New test.
9000 * testsuite/Makefile.in: Regenerate.
9001 * testsuite/hidden_test.sh: New script.
9002 * testsuite/hidden_test_1.c: New test source.
9003 * testsuite/hidden_test_main.c: New test source.
9004
11af873f
DK
90052009-08-11 Doug Kwan <dougkwan@google.com>
9006
9007 * arm.cc: Update comments.
9008 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9009 segment to locate the .ARM.exidx section if present.
9010
b9f7d72d
DK
90112009-08-09 Doug Kwan <dougkwan@google.com>
9012
9013 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9014 patch.
9015
ddd3c53c
ST
90162009-08-07 Sriraman Tallam <tmsriram@google.com>
9017 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9018 compiler warnings.
9019
27721062
ST
90202009-08-06 Sriraman Tallam <tmsriram@google.com>
9021
9022 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9023 valid tls_segment only for non-debug-section relocations.
9024 * testsuite/Makefile.am: Add gc_tls_test.
9025 * testsuite/Makefile.in: Regenerate.
9026 * testsuite/gc_tls_test.cc: New file.
9027 * testsuite/gc_tls_test.sh: New file.
9028
ef15dade 90292009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9030
ef15dade
ST
9031 * icf.cc: New file.
9032 * icf.h: New file.
9033 * Makefile.am (CCFILES): Add icf.cc.
9034 (HFILES): Add icf.h
9035 * Makefile.in: Regenerate.
9036 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9037 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9038 section, symbol and addend information for the relocs.
9039 * gold.cc (queue_middle_tasks): Call identical code folding.
9040 * gold.h: Add defines for multimap.
9041 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9042 to the call of finalize_local_symbols.
9043 * main.cc (main): Create object of class Icf.
9044 * object.cc (Sized_relobj::do_layout): Allow this function to be
9045 called twice during icf.
9046 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9047 to sections marked as identical by icf.
9048 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9049 when available.
9050 (Sized_relobj::do_section_entsize): New function.
9051 * object.h (Object::section_entsize): New function.
9052 (Object::do_section_entsize): New pure virtual function.
9053 (Relobj::finalize_local_symbols): Add new parameter.
9054 (Relobj::do_section_entsize): New function.
9055 * options.h (General_options::icf): New option.
9056 (General_options::icf_iterations): New option.
9057 (General_options::print_icf_sections): New option.
9058 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9059 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9060 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9061 icf.
9062 * symtab.cc (Symbol_table::is_section_folded): New function.
9063 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9064 to sections marked as identical by icf.
9065 * symtab.h (Symbol_table::set_icf): New function.
9066 (Symbol_table::icf): New function.
9067 (Symbol_table::is_section_folded): New function.
9068 (Symbol_table::icf_): New data member.
9069 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9070 * testsuite/Makefile.am: Add commands to build icf_test.
9071 * testsuite/Makefile.in: Regenerate.
9072 * testsuite/icf_test.sh: New file.
9073 * testsuite/icf_test.cc: New file.
9074
c3b65ac4
CD
90752009-07-24 Chris Demetriou <cgd@google.com>
9076
9077 * layout.cc (is_compressible_debug_section): Fix incorrect
9078 comment about compressed section names.
9079
1caf2c51
ILT
90802009-07-20 Ian Lance Taylor <ian@airs.com>
9081
9082 PR 10419
9083 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9084
1ef4d87f
ILT
90852009-07-16 Ian Lance Taylor <iant@google.com>
9086
9087 PR 10400
9088 * layout.h: #include <map>.
9089 (class Kept_section): Change from struct to class. Add accessors
9090 and setters. Add section size to Comdat_group mapping. Change
9091 Comdat_group to std::map. Add is_comdat_ field. Add
9092 linkonce_size field in union.
9093 (class Layout): Update declaration of find_or_add_kept_section.
9094 Don't declare find_kept_object.
9095 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9096 parameter. Add object, shndx, is_comdat, and is_group_name
9097 parameters. Change all callers. Adjust for new Kept_section.
9098 (Layout::find_kept_object): Remove.
9099 * object.cc (Sized_relobj::include_section_group): Update use of
9100 Kept_section. Rename secnum to shndx. Only record
9101 Kept_comdat_section if sections are the same size.
9102 (Sized_relobj::include_linkonce_section): Update use of
9103 Kept_section. Only record Kept_comdat_section if sections are the
9104 same size. Set size of linkonce section.
9105 (Sized_relobj::map_to_kept_section): Update call to
9106 get_kept_comdat_section.
9107 * object.h (class Sized_relobj): Rename fields in
9108 Kept_comdat_section to drop trailing underscores; change object
9109 field to Relobj*. Change Kept_comdat_section_table to store
9110 struct rather than pointer.
9111 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9112 Add kept_object and kept_shndx parameters. Change all callers.
9113 (Sized_relobj::get_kept_comdat_section): Change return type to
9114 bool. Add kept_object and kept_shndx parameters. Change all
9115 callers.
9116 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9117 Layout::find_or_add_kept_section.
9118
37c3b7b0
ILT
91192009-07-09 Ian Lance Taylor <iant@google.com>
9120
9121 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9122 Reserve space in the hash table.
9123
98fa85cb
ILT
91242009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9125
9126 * fileread.cc (File_read::get_mtime): New method.
9127 * fileread.h (Timespec): New structure.
9128 (File_read::get_mtime): New method.
9129 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9130 Renamed from timestamp_nsec.
9131 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9132 Elf_Xword.
e1df38aa 9133 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9134 timestamp_nsec.
e1df38aa 9135 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9136 (Incremental_inputs::report_obejct): Save mtime; style fix.
9137 (Incremental_inputs::report_script): Save mtime; style fix.
9138 (Incremental_inputs::finalize_inputs): Style fix.
9139 (Incremental_inputs::finalize): Style fix.
9140 (Incremental_inputs::create_input_section_data): Store inputs
9141 mtime.
9142 * incremental.h (Incremental_inputs::report_script): Add mtime
9143 argument.
9144 (Incremental_inputs::Input_info::Input_info): Intialize only one
9145 union member.
9146 (Incremental_inputs::Input_info::archive): Move to nameless
9147 union.
9148 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9149 (Incremental_inputs::Input_info::script): Move to nameless union.
9150 (Incremental_inputs::mtime): New field.
9151 * script.cc (read_input_script): Pass file mtime to
9152 Incremental_input.
9153 * script.h (Script_info::inputs): Style fix.
9154
c9d70757
ILT
91552009-07-01 Ian Lance Taylor <ian@airs.com>
9156
9157 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9158 instead of 32.
9159
9c547ec3
ILT
91602009-06-24 Ian Lance Taylor <iant@google.com>
9161
9162 PR 10156
9163 * layout.cc (Layout::choose_output_section): If we find an
9164 existing section, update the flags.
9165 (Layout::create_notes): New function, broken out of
9166 Layout::finalize.
9167 (Layout::finalize): Don't create note sections.
9168 (Layout::create_note): Don't crash if linker script discards
9169 section.
9170 (Layout::create_gold_note): Likewise.
9171 (Layout::create_build_id): Likewise. Don't set
9172 after_input_sections on the section.
9173 (Layout::create_executable_stack_info): Remove target parameter.
9174 Change caller.
9175 * layout.h (class Layout): Declare create_notes. Update
9176 declaration of create_executable_stack_info.
9177 * gold.cc (queue_middle_tasks): Call create_notes.
9178 * output.cc (Output_section::update_flags_for_input_section): Move
9179 here from output.h. If SHF_ALLOC flag is newly set, mark address
9180 invalid.
9181 * output.h (Output_data::mark_address_invalid): New function.
9182 (class Output_section): Only declare, not define,
9183 update_flags_for_input_section. Remove set_flags.
9184
55458500
ILT
91852009-06-24 Ian Lance Taylor <iant@google.com>
9186
9187 * script-sections.cc (Output_section_definition::
9188 set_section_addresses): Rename shadowing local load_address to
9189 laddr.
9190
1307d6cd
ILT
91912009-06-24 Ian Lance Taylor <iant@google.com>
9192
9193 PR 10244
9194 * reloc.cc (relocate_sections): Skip empty relocation sections.
9195
ec3f783e
ILT
91962009-06-23 Ian Lance Taylor <iant@google.com>
9197
9198 PR 10156
9199 * layout.cc (Layout::create_note): Use choose_output_section
9200 rather than make_output_section.
9201
459c9f1c
ILT
92022009-06-23 Ian Lance Taylor <iant@google.com>
9203
9204 PR 10237
9205 * options.cc (General_options::parse_V): Set printed_version_.
9206 (General_options::General_options): Initialize printed_version_.
9207 * options.h (class General_options): Add printed_version_ field.
9208 * gold.cc (queue_initial_tasks): If there are no input files,
9209 don't give a fatal error if we printed the version information.
9210 (queue_middle_tasks): If using -r with a shared object, give a
9211 fatal error rather than an ordinary error.
9212
1518dc8f
ILT
92132009-06-23 Ian Lance Taylor <iant@google.com>
9214
9215 PR 10219
9216 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9217 (Layout::make_output_section): Set have_stabstr_section_ if we see
9218 a .stab*str section.
9219 (Layout::finalize): Call link_stabs_sections.
9220 (Layout::link_stabs_sections): New file.
9221 * layout.h (class Layout): Add have_stabstr_section_ field.
9222 Declare link_stabs_sections.
9223
3d857b98
DK
92242009-06-23 Doug Kwan <dougkwan@google.com>
9225
9226 * Makefile.am (libgold_a_LIBADD): New.
9227 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9228 * Makefile.in: Regenerate.
9229 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9230 * configure: Regenerate.
9231 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9232 * fileread.cc: Include sys/state.h
9233 * gold.h: Declare memmem and strndup if found missing.
9234 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9235
0639a6f6
ILT
92362009-06-23 Ian Lance Taylor <iant@google.com>
9237
9238 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9239 * configure: Rebuild.
9240
8d63875c
ILT
92412009-06-23 Ian Lance Taylor <iant@google.com>
9242
9243 PR 10147
9244 * object.cc (Object::section_contents): Don't try to get a view if
9245 the section has length zero.
9246 (Object::handle_gnu_warning_section): If the section is empty, use
9247 the name of the section as the warning.
9248
f7c8a183
ILT
92492009-06-23 Ian Lance Taylor <iant@google.com>
9250
9251 PR 10133
9252 * stringpool.h (class Stringpool_template): Add optimize_ field.
9253 (Stringpool_template::set_optimize): New function.
9254 * stringpool.cc (Stringpool_template::Stringpool_template):
9255 Initialize optimize_ field.
9256 (Stringpool_template::set_string_offsets): Test local optimize
9257 fild rather than parameter.
9258 * layout.cc (Layout::Layout): Call set_optimize on the section
9259 name stringpool.
9260
e6a307ba
ILT
92612009-06-22 Ian Lance Taylor <iant@google.com>
9262
9263 PR 10030
9264 * yyscript.y: Parse TARGET.
9265 * script.cc (script_set_target): New function.
9266 * script-c.h (script_set_target): Declare.
9267 * options.cc (General_options::string_to_object_format): Rename
9268 from string_to_object_format in anonymous namespace. Change
9269 callers.
9270 * options.h (class General_options): Declare
9271 string_to_object_format.
9272
3ee173de
ILT
92732009-06-22 Ian Lance Taylor <iant@google.com>
9274
9275 * script-sections.cc (Script_sections::create_segments): Don't put
9276 program headers in a PT_LOAD segment if -n or -N.
9277
92782009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9279
9280 PR 10141
9281 * options.h (class General_options): Add -z lazy and -z now. Sort
9282 -z options into alphabetical order.
9283 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9284
cd6739a1 92852009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9286
9287 * layout.cc (Layout::make_output_section): Call
9288 Target::new_output_section.
9289 (Layout::attach_allocated_section_to_segment): Put large section
9290 sections in a separate load segment with the large segment flag
9291 set.
9292 (Layout::segment_precedes): Sort large data segments after other
9293 load segments.
9294 (align_file_offset): New static function.
9295 (Layout::set_segment_offsets): Use align_file_offset.
9296 * output.h (class Output_section): Add is_small_section_ and
9297 is_large_section_ fields.
9298 (Output_section::is_small_section): New function.
9299 (Output_section::set_is_small_section): New function.
9300 (Output_section::is_large_section): New function.
9301 (Output_section::set_is_large_section): New function.
9302 (Output_section::is_large_data_section): New function.
9303 (class Output_segment): Add is_large_data_segment_ field.
9304 (Output_segment::is_large_data_segment): New function.
9305 (Output_segment::set_is_large_data_segment): New function.
9306 * output.cc (Output_section::Output_section): Initialize new
9307 fields.
9308 (Output_segment::Output_segment): Likewise.
9309 (Output_segment::add_output_section): Add assertion that large
9310 data sections always go in large data segments. Force small data
9311 sections to the end of the list of data sections. Force small BSS
9312 sections to the start of the list of BSS sections. For large BSS
9313 sections to the end of the list of BSS sections.
9314 * symtab.h (class Symbol): Declare is_common_shndx.
9315 (Symbol::is_defined): Check Symbol::is_common_shndx.
9316 (Symbol::is_common): Likewise.
9317 (class Symbol_table): Define enum Commons_section_type. Update
9318 declarations. Add small_commons_ and large_commons_ fields.
9319 * symtab.cc (Symbol::is_common_shndx): New function.
9320 (Symbol_table::Symbol_table): Initialize new fields.
9321 (Symbol_table::add_from_object): Put small and large common
9322 symbols in the right list.
9323 (Symbol_table::sized_finalized_symbol): Check
9324 Symbol::is_common_shndx.
9325 (Symbol_table::sized_write_globals): Likewise.
9326 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9327 common symbol lists. Don't call do_allocate_commons_list if the
9328 list is empty.
9329 (Symbol_table::do_allocate_commons_list): Remove is_tls
9330 parameter. Add comons_section_type parameter. Change all
9331 callers. Handle small and large common symbols.
9332 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9333 Symbol::is_common_shndx.
9334 * resolve.cc (symbol_to_bits): Likewise.
9335 * target.h (Target::small_common_shndx): New function.
9336 (Target::small_common_section_flags): New function.
9337 (Target::large_common_shndx): New function.
9338 (Target::large_common_section_flags): New function.
9339 (Target::new_output_section): New function.
9340 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9341 small_common_section_flags, and large_common_section_flags
9342 fields.
9343 (Target::do_new_output_section): New virtual function.
9344 * arm.cc (Target_arm::arm_info): Initialize new fields.
9345 * i386.cc (Target_i386::i386_info): Likewise.
9346 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9347 Likewise.
9348 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9349 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9350 (Target_x86_64::do_new_output_section): New function.
9351 * configure.ac: Define conditional MCMODEL_MEDIUM.
9352 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9353 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9354 (large_LDFLAGS): Define.
9355 * testsuite/large.c: New file.
9356 * testsuite/testfile.cc (Target_test::test_target_info):
9357 Initialize new fields.
9358 * configure, testsuite/Makefile.in: Rebuild.
9359
bb04269c
DK
93602009-06-05 Doug Kwan <dougkwan@google.com>
9361
9362 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9363 * Makefile.in: Regenerate.
bb04269c
DK
9364 * i386.cc (class Target_i386): Define new virtual method to
9365 override do_is_local_label_name in parent.
9366 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9367 local symbols if --discard-locals or -X is given.
9368 * options.h (class General_options): Declare new options
9369 '--discard-locals' and '-X' for discarding locals.
9370 * target.h (class Target): Define new methods is_local_label_name.
9371 Declare new virtual method do_is_local_label_name.
9372 * target.cc: New file.
9373 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9374 (check_SCRIPTS): Add discard_locals_test.sh.
9375 (check_DATA): Add discard_local_tests.syms.
9376 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9377 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9378 * testsuite/Makefile.in: Regenerate.
9379 * testsuite/discard_locals_test.c: New file.
9380 * testsuite/discard_locals_test.sh: Same.
9381
805bb01c
DK
93822009-06-05 Doug Kwan <dougkwan@google.com>
9383
9384 * object.cc (Sized_relobj::Sized_relobj): Initialize
9385 discarded_eh_frame_shndx_ to -1U.
9386 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9387 section.
9388 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9389 a discarded .eh_frame section.
9390 (Sized_relobj::do_finalize_local_symbols): Ditto.
9391 * object.h (class Sized_relobj): Declare new member
9392 discarded_eh_frame_shndx_.
9393 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9394 (local_labels_test.o, local_labels_test): New rules.
9395 * testsuite/Makefile.in: Regenerate.
9396
1dcd334d
DK
93972009-06-04 Doug Kwan <dougkwan@google.com>
9398
9399 * layout.cc (Layout::section_name_mapping): Add mapping for
9400 special ARM sections.
9401
96d49306
DK
94022009-06-03 Doug Kwan <dougkwan@google.com>
9403
9404 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9405 (utils::has_overflow): Same.
9406
dff16297
ILT
94072009-06-03 Ian Lance Taylor <iant@google.com>
9408
9409 * layout.cc (Layout::section_name_mapping): New array, replacing
9410 Layout::linkonce_mapping.
9411 (Layout::section_name_mapping_count): New variable, replacing
9412 Layout::linkonce_mapping_count.
9413 (Layout::linkonce_output_name): Remove.
9414 (Layout::output_section_name): Rewrite.
9415 * layout.h (class Layout): Rename Linkonce_mapping to
9416 Section_name_mapping, linkonce_mapping to section_name_mapping,
9417 linkonce_mapping_count to section_name_mapping_count. Don't
9418 declare linkonce_output_name.
9419
c121c671
DK
94202009-06-03 Doug Kwan <dougkwan@google.com>
9421
9422 * gold/arm.cc (namespace utils): New.
9423 (Target_arm::reloc_is_non_pic): Define new method.
9424 (class Arm_relocate_functions): New.
9425 (Target_arm::Relocate::relocate): Handle relocation types used by
9426 Android.
9427
07800fab
ILT
94282009-06-03 Ian Lance Taylor <iant@google.com>
9429
9430 * arm.cc (Target_arm::scan::global): Use || instead of |.
9431
c121c671
DK
94322009-06-02 Doug Kwan <dougkwan@google.com>
9433
9434 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9435 issued_non_pic_error_.
9436 (class Target_arm::Scan): Declare new method check_non_pic.
9437 Define new method symbol_needs_plt_entry.
9438 Declare new data member issued_non_pic_error_.
9439 (class Target_arm::Relocate): Declare new method
9440 should_apply_static_reloc.
9441 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9442 (Target_arm::Scan::check_non_pic): Define new method.
9443 (Target_arm::Scan::local): Handle a small subset of reloc types used
9444 by Android.
9445 (Target_arm::Scan::local): Same.
9446 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9447
b19b0c6d
ILT
94482009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9449
9450 * incremental.cc (Incremental_inputs::report_command_line): Filter
9451 out --incremental-* options.
9452
94cdfcff
DK
94532009-05-29 Doug Kwan <dougkwan@google.com>
9454
9455 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9456 template class.
9457 (class Target_arm): Update comment.
9458 (Target_arm::Target_arm): Initialize new data members GOT_,
9459 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9460 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9461 and Target_arm::rel_dyn_section.
9462 Declare new_enum Target_arm::Got_type.
9463 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9464 and DYNBSS_.
9465 Update commments for member do_dynsym_value.
9466 (Target_arm::got_size, Target_arm::plt_section,
9467 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9468 new methods inside class defintion.
9469 (Target_arm::got_section): Define new method.
9470 (Target_arm::rel_dyn_section): Same.
9471 (Output_data_plt_arm): New template class.
9472 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9473 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9474 (Output_data_plt_arm::add_entry): Same.
9475 (Output_data_plt_arm::first_plt_entry): Define new
9476 static data member for PLT instruction template.
9477 (Output_data_plt_arm::plt_entry): Same.
9478 (Output_data_plt_arm::do_write): Define new method.
9479 (Target_arm::make_plt_entry): Same.
9480 (Target_arm::do_finalize_sections): Same.
9481 (Target_arm::do_dynsym_value): Same.
9482
4a657b0d
DK
94832009-05-28 Doug Kwan <dougkwan@google.com>
9484
9485 * Makefile.am (TARGETSOURCES): Add arm.cc.
9486 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9487 * Makefile.in: Regenerate.
9488 * arm.cc: New file.
9489 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9490
e7ae8c36
DK
94912009-05-26 Doug Kwan <dougkwan@google.com>
9492
9493 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9494 (General_options::check_excluded_libs): Strip off directories in
9495 archive name before matching like GNU ld does.
9496 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9497 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9498 (exclude_libs_test_LDFLAGS): Add linker option
9499 -Wl,--exclude-libs,libexclude_libs_test_3
9500 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9501 an explicit archive without using -l.
9502 (alt/libexclude_libs_test_3.a): New make rule.
9503 * testsuite/Makefile.in: Regenerate.
9504 * testsuite/exclude_libs_test.c : Declare lib3_default().
9505 (main): Call it.
9506 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9507 * exclude_libs_test_3.c: New file.
9508
f12e7348
NC
95092009-05-26 Nick Clifton <nickc@redhat.com>
9510
9511 * po/id.po: New Indonesian translation.
9512 * po/gold.pot: Updated template file.
9513
4daadc0d
ST
95142009-05-22 Sriraman Tallam <tmsriram@google.com>
9515
e1df38aa 9516 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9517 gc_comdat_test files. Add -Wl,--gc-sections to build
9518 gc_comdat_test.
9519 * testsuite/Makefile.in: Regenerate.
9520 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9521
531813ad
ST
95222009-05-21 Sriraman Tallam <tmsriram@google.com>
9523
9524 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9525 kept comdat section was garbage collected.
9526 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9527 * testsuite/Makefile.in: Regenerate.
9528 * testsuite/gc_comdat_test.sh: New file.
9529 * testsuite/gc_comdat_test_1.cc: New file.
9530 * testsuite/gc_comdat_test_2.cc: New file.
9531
65514900
CC
95322009-05-19 Doug Kwan <dougkwan@google.com>
9533
9534 * archive.cc (Archive::Archive): Move constructor from archive.h
9535 to here. Initialize no_export_.
9536 (Archive::get_elf_object_for_member): Set no_export flag of object.
9537 * archive.h (Archive::Archive): Move constructor body to
9538 archive.cc.
9539 (Archive::no_export): New method.
9540 (Archive::no_export_): New field.
9541 * object.h (Object::Object): Initialize no_export_ to false.
9542 (Object::no_export, Object::set_no_export): New methods.
9543 (Object::no_export_): New field.
9544 * options.cc (General_options::parse_exclude_libs): New method.
9545 (General_options::check_excluded_libs) Same.
9546 * options.h (exclude_libs): New option.
9547 (General_options::check_excluded_libs): New method declaration.
9548 (General_options::excluded_libs_): New field.
9549 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9550 default or protected visibility if an object has no-export flag set.
9551 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9552 (check_SCRIPTS): Add exclude_libs_test.sh.
9553 (check_DATA): Add exclude_libs_test.syms.
9554 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9555 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9556 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9557 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9558 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9559 libexclude_libs_test_2.a): New rules.
9560 * testsuite/Makefile.in: Regenerate.
9561 * testsuite/exclude_libs_test.c: New file.
9562 * testsuite/exclude_libs_test.sh: Ditto.
9563 * testsuite/exclude_libs_test_1.c: Ditto.
9564 * testsuite/exclude_libs_test_2.c: Ditto.
9565
1b77ea50
ILT
95662009-05-15 Ian Lance Taylor <iant@google.com>
9567
9568 * configure.ac: Check for declarations for cases where libiberty.h
9569 checks HAVE_DECL_xxx.
9570 * configure, config.in: Rebuild.
9571
072fe7ce
ILT
95722009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9573
9574 * gold.h (Incremental_argument_list): Remove (invalid) forward
9575 declaration.
9576 * incremental.cc (Incremental_inputs::report_achive): New method.
9577 (Incremental_inputs::report_object): New method.
9578 (Incremental_inputs::report_script): New method.
9579 (Incremental_inputs::finalize_inputs): New method.
9580 (Incremental_inputs::finalize): Call finalize_inputs().
9581 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9582 Create inputs entries.
9583 * incremental.h (Incremental_input_type): New enum.
9584 (Incremental_inputs::Incremental_input): Initialize new fields.
9585 (Incremental_inputs::report_inputs): New method.
9586 (Incremental_inputs::report_achive): New method.
9587 (Incremental_inputs::report_object): New method.
9588 (Incremental_inputs::report_script): New method.
9589 (Incremental_inputs::finalize_inputs): New method.
9590 (Incremental_inputs::Input_info): New struct.
9591 (Incremental_inputs::Input_info_map): New typedef.
9592 (Incremental_inputs::lock_): New field.
9593 (Incremental_inputs::Inputs_): New field.
9594 (Incremental_inputs::Inputs_map): New field.
9595 * main.cc (main): Call Incremental_input::report_inputs.
9596 * options.h (Input_argument_list): Typedef moved from
9597 Input_arguments.
9598 (Input_file_group::Files): Remove, use ::Input_argument_list.
9599 (Input_file_group::Input_argument_list): Remove, use
9600 ::Input_argument_list.
9601 * plugin.cc (Plugin_manager::add_input_file): Add error in
9602 incremental build.
9603 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9604 functions.
9605 * script.cc (read_input_script): Call
9606 Incremental_input::report_script.
9607 * script.h (Script_info): New class.
9608
b0481b0b
ILT
96092009-04-27 Ian Lance Taylor <iant@google.com>
9610
9611 * x86_64.cc (do_adjust_output_section): Set entsize to
9612 plt_entry_size.
9613
b22a5a41 96142009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
9615
9616 * output.cc (Output_file::close): After short writes, continue
9617 writing from the correct offset in the buffer being written.
9618
40fde488
CD
96192009-04-23 Chris Demetriou <cgd@google.com>
9620
9621 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9622 * configure: Regenerate.
9623 * config.in: Regenerate.
9624 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9625 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9626
3ce2c28e
ILT
96272009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9628
9629 * incremental.cc (Incremental_inputs_header_data): Renamed from
9630 Incremental_input_header_data.
9631 (Incremental_inputs_header_data::data_size): New field.
9632 (Incremental_inputs_header_data::put_input_file_count): Renamed
9633 from input_file_count.
9634 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9635 from command_line_offset.
9636 (Incremental_inputs_header_data::put_reserved): Renamed from
9637 put_reserved.
9638 (Incremental_inputs_entry_data): Renamed from
9639 Incremental_input_entry_data.
9640 (Incremental_inputs_entry_data::data_size): New field.
9641 (Incremental_inputs::report_command_line): New method.
9642 (Incremental_inputs::finalize): New method.
9643 (Incremental_inputs::create_incremental_inputs_data): New method.
9644 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9645 * incremental.h: New file.
9646 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9647 (Layout::finalize): Create incremental inputs section in
9648 incremental builds.
9649 (Layout::create_incremental_info_sections): New method.
9650 * layout.h (Layout::incremental_inputs): New method.
9651 (Layout::create_incremental_info_sections): New method.
9652 (Layout::incremental_inputs_): New field.
9653 * main.cc (main): Notify Incremental_input of the command line.
9654
e55bde5e
ILT
96552009-04-01 Ian Lance Taylor <iant@google.com>
9656 Mikolaj Zalewski <mikolajz@google.com>
9657
9658 * gold.h (reserve_unordered_map): Define, three versions, one for
9659 each version of Unordered_map.
9660 * layout.cc (Layout::Layout): Remove options parameter. Add
9661 number_of_input_files parameter. Don't initialize options_.
9662 Initialize number_of_input_files_ and resized_signatures_. Move
9663 sections_are_attached_.
9664 (Layout::layout_group): Reserve space for group_signatures_.
9665 (Layout::find_or_add_kept_section): Change name parameter to be a
9666 reference. Resize signatures_ map when it gets large enough.
9667 (Layout::layout_eh_frame): Use parameters->options() instead of
9668 this->options_.
9669 (Layout::make_output_section): Likewise.
9670 (Layout::attach_allocated_section_to_segment): Likewise.
9671 (Layout::finalize, Layout::create_executable_stack): Likewise.
9672 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9673 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9674 * layout.h (class Layout): Update declarations. Remove options_
9675 field. Add number_of_input_files_ and resized_signatures_
9676 fields. Move sections_are_attached_ field.
9677 * main.cc (main): Pass number of input files to Layout
9678 constructor. Don't pass options.
9679
154b857c
ILT
96802009-03-30 Ian Lance Taylor <iant@google.com>
9681
9682 * ffsll.c (ffsll): Correct implementation.
9683
2f35ab9b
ILT
96842009-03-27 Ian Lance Taylor <iant@google.com>
9685
fd03461a
ILT
9686 * ffsll.c: New file.
9687 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9688 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9689 * ftruncate.c (ftruncate): Declare before definition.
9690 * mremap.c (mremap): Likewise.
9691 * pread.c (pread): Likewise.
9692 * configure, Makefile.in, config.in: Rebuild.
9693
2f35ab9b
ILT
9694 * mremap.c: New file.
9695 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9696 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9697 (mremap): Declare if HAVE_MREMAP is not defined.
9698 * configure, Makefile.in, config.in: Rebuild.
9699
33aea2fd
CC
97002009-03-27 Cary Coutant <ccoutant@google.com>
9701
9702 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9703 position independent.
9704 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9705 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9706
6d479619
CC
97072009-03-24 Cary Coutant <ccoutant@google.com>
9708
9709 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9710 an executable.
9711 (needs_dynamic_reloc): Likewise.
9712
afc06bb8
ILT
97132009-03-24 Ian Lance Taylor <iant@google.com>
9714
9715 * yyscript.y (file_cmd): Recognize EXTERN.
9716 (extern_name_list, extern_name_list_body): New nonterminals.
9717 * script.cc (script_add_extern): Define.
9718 * script-c.h (script_add_extern): Declare.
9719
f6060a4d
ILT
97202009-03-24 Rafael Avila de Espindola <espindola@google.com>
9721
9722 * object.cc (is_elf_object): Define.
9723 * object.h (is_elf_object): Declare.
9724 * archive.cc (Archive::get_elf_object_for_member): Call
9725 is_elf_object.
33aea2fd 9726 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9727
26736d8e
ILT
97282009-03-24 Elliott Hughes <enh@google.com>
9729
9730 * output.cc (Output_file::map_anonymous): Define.
9731 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9732 try an anonymous one. Report the size if the mmap fails.
9733 * output.h (class Output_file): Declare map_anonymous.
9734
22fd9730
ILT
97352009-03-24 Ian Lance Taylor <iant@google.com>
9736
9737 * target-select.cc (instantiate_target): Don't acquire the lock if
9738 the instantiated_target_ field has already been set.
9739
cb010894
ILT
97402009-03-23 Ian Lance Taylor <iant@google.com>
9741
7f055c20
ILT
9742 * gold-threads.h (class Initialize_lock): Define.
9743 * gold-threads.cc (class Initialize_lock_once): Define.
9744 (initialize_lock_control): New static variable.
9745 (initialize_lock_pointer): New static variable.
9746 (initialize_lock_once): New static function.
9747 (Initialize_lock::Initialize_lock): Define.
9748 (Initialize_lock::initialize): Define.
9749 * target-select.h: Include "gold-threads.h".
9750 (class Target_selector): Add lock_ and initialize_lock_ fields.
9751 Don't define instantiate_target, just declare it.
9752 * target-select.cc (Target_selector::Target_selector): Initialize
9753 new fields.
9754 (Target_selector::instantiate_target): Define.
9755 * descriptors.h: Include "gold-threads.h".
9756 (class Descriptors): Add initialize_lock_ field.
9757 * descriptors.cc (Descriptors::Descriptors): Initialize new
9758 field.
9759 (Descriptors::open): Use initialize_lock_ field
9760 * errors.h (class Errors): Add initialize_lock_ field.
9761 * errors.cc (Errors::Errors): Initialize new field.
9762 (Errors::initialize_lock): Use initialize_lock_ field.
9763 * powerpc.cc (class Target_selector_powerpc): Remove
9764 instantiated_target_ field. In do_recognize call
9765 instantiate_target rather than do_instantiate_target. In
9766 do_instantiate_target just allocate a new target.
9767 * sparc.cc (class Target_selector_sparc): Likewise.
9768
36959681
ILT
9769 * freebsd.h: New file.
9770 * i386.cc: Include "freebsd.h".
9771 (Target_i386): Derive from Target_freebsd rather than
9772 Sized_target.
9773 (Target_selector_i386): Derive from Target_selector_freebsd rather
9774 than Target_selector.
9775 * x86_64.cc: Include "freebsd.h".
9776 (Target_x86_64): Derive from Target_freebsd rather than
9777 Sized_target.
9778 (Target_selector_x86_64): Derive from Target_selector_freebsd
9779 rather than Target_selector.
9780 * target.h (class Target): Add adjust_elf_header and
9781 do_adjust_elf_header.
9782 * output.cc (Output_file_header:: do_sized_write): Call target
9783 adjust_elf_header routine.
9784 * configure.tgt: Set targ_osabi.
9785 * configure.ac: Define GOLD_DEFAULT_OSABI.
9786 * parameters.cc (Parameters::default_target): Pass
9787 GOLD_DEFAULT_OSABI to select_target.
9788 * target-select.h (class Target_selector): Make instantiate_target
9789 protected rather than private.
9790 * Makefile.am (HFILES): Add freebsd.h.
9791 * configure, Makefile.in, config.in: Rebuild.
9792
cb010894
ILT
9793 * merge.cc (do_add_input_section): Correct pend value. Change
9794 message about last entry not being null terminated from error to
9795 warning.
9796
0e879927
ILT
97972009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9798
9799 * incremental.cc: New file.
9800 * Makefile.am (CCFILES): Add incremental.cc.
9801 * Makefile.in: Rebuild.
9802
41105937
PP
98032009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9804
9805 * layout.cc (Layout::output_section_name): Preserve names
9806 of '.note.' sections.
e1df38aa 9807
60439920
ILT
98082009-03-19 Ian Lance Taylor <iant@google.com>
9809
9810 * descriptors.cc (Descriptors::open): Check that the options are
9811 valid before using them.
9812
0d371ad3
ILT
98132009-03-18 Ian Lance Taylor <iant@google.com>
9814
9815 * script-sections.h: Include <list>.
9816 (class Script_sections): Change Sections_elements from std::vector
9817 to std::list. Typedef public Elements_iterator. Add
9818 orphan_section_placement_, data_segment_align_start_, and
9819 saw_data_segment_align_ fields. Remove data_segment_align_index_
9820 field.
9821 * script-sections.cc (class Orphan_section_placement): New class.
9822 (class Sections_element): Add virtual functions is_relro and
9823 orphan_section_init. Remove virtual function place_orphan_here.
9824 (class Output_section_definition): Add is_relro and
9825 orphan_section_init. Remove place_orphan_here.
9826 (class Orphan_output_section): Likewise.
9827 (Script_sections::Script_sections): Update for field changes.
9828 (Script_sections::data_segment_align): Set saw_data_segment_align_
9829 and data_segment_align_start_, not data_segment_align_index.
9830 (Script_sections::data_segment_relro_end): Check
9831 saw_data_segment_align_. Use data_segment_align_start_ rather
9832 than data_segment_align_index_.
9833 (Script_sections::place_orphan): Rewrite to use
9834 Orphan_section_placement.
9835
9201d894
ILT
98362009-03-17 Ian Lance Taylor <iant@google.com>
9837
9c5b8369
ILT
9838 * archive.cc (Archive::add_symbols): Check for a version attached
9839 to the symbol name in the archive map.
9840 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9841 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9842 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9843 (ver_test_11.a): New target.
9844 * testsuite/Makefile.in: Rebuild.
9845
9201d894
ILT
9846 * configure.ac: Check for chsize and posix_fallocate. Replace
9847 ftruncate.
9848 * ftruncate.c: New file, from gnulib.
9849 * output.cc (posix_fallocate): Define dummy version if not
9850 HAVE_POSIX_FALLOCATE.
9851 (Output_file::map): Call posix_fallocate rather than lseek and
9852 write.
9853 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9854 * configure, Makefile.in, config.in: Rebuild.
9855
ef4ab7a8 98562009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9857
ef4ab7a8
PP
9858 * layout.h (Layout::create_note): Add section_name parameter.
9859 * layout.cc (Layout::create_note): Likewise.
9860 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9861
8c500701
ILT
98622009-03-17 Ian Lance Taylor <iant@google.com>
9863
e85b18e1
ILT
9864 * descriptors.cc: Include "options.h".
9865 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9866 (Descriptors::open): Always use O_CLOEXEC when opening a new
9867 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9868 then set FD_CLOEXEC.
9869
9efe6174
ILT
9870 * sparc.cc (class Target_sparc): Add has_got_section.
9871 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9872 make sure we have a GOT section.
9873
9874 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9875 (Target_sparc::Scan::local): Likewise.
9876 (Target_sparc::Scan::global): Likewise.
9877 (Target_sparc::Relocate::relocate): Likewise.
9878 (Target_sparc::Relocate::relocate_tls): Likewise.
9879
8c500701
ILT
9880 * symtab.cc (Symbol_table::define_default_version): New function,
9881 broken out of add_from_object.
9882 (Symbol_table::add_from_object): Call define_default_version.
9883 (Symbol_table::define_special_symbol): Add resolve_oldsym
9884 parameter. Change all callers. If the version for a symbol comes
9885 from a version script, resolve it with the symbol with the same
9886 name with no version. Also add the symbol without a version if
9887 appropriate.
9888 (do_define_in_output_data): If resolving with oldsym, don't delete
9889 sym.
9890 (do_define_in_output_segment): Likewise.
9891 (do_define_as_constant): Likewise.
9892 * symtab.h (class Symbol_table): Update declarations.
9893
f1ed28fb
ILT
98942009-03-13 Ian Lance Taylor <iant@google.com>
9895
15f8229b
ILT
9896 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9897 (Read_symbols::requeue): New function.
9898 (Read_symbols::do_read_symbols): If make_elf_object fails because
9899 the target type is not configured, and the file was searched for,
9900 issue a warning and retry with the next directory.
9901 (Add_symbols::run): If the file has an incompatible format, and
9902 it was searched for, requeue the Read_symbols task. On error,
9903 release the object.
9904 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9905 dirindex parameter to constructor. Change all callers. Declare
9906 incompatible_warning and requeue.
9907 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9908 input_argument_ and input_group_ fields. Add them to
9909 constructor. Change all callers.
9910 (class Read_script): Add dirindex_ field. Add it to constructor.
9911 Change all callers.
9912 * archive.cc (Archive::setup): Remove input_objects parameter.
9913 Change all callers.
9914 (Archive::get_file_and_offset): Likewise.
9915 (Archive::read_all_symbols): Likewise.
9916 (Archive::read_symbols): Likewise.
9917 (Archive::get_elf_object_for_member): Remove input_objects
9918 parameter. Add punconfigured parameter. Change all callers.
9919 (Archive::add_symbols): Change return type to bool. Check return
9920 value of include_member.
9921 (Archive::include_all_members): Likewise.
9922 (Archive::include_member): Change return type to bool. Return
9923 false if first included object has incompatible target. Set
9924 included_member_ field.
9925 (Add_archive_symbols::run): If add_symbols returns false, requeue
9926 Read_symbols task.
9927 * archive.h (class Archive): Add included_member_ field.
9928 Initialize it in constructor. Add input_file and searched_for
9929 methods. Update declarations.
9930 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9931 input_argument_ fields. Add them to constructor. Change all
9932 callers.
9933 * script.cc: Include "target-select.h".
9934 (class Parser_closure): Add skip_on_incompatible_target_ and
9935 found_incompatible_target_ fields. Add
9936 skip_on_incompatible_target parameter to constructor. Change all
9937 callers. Add methods skip_on_incompatible_target,
9938 clear_skip_on_incompatible_target, found_incompatible_target, and
9939 set_found_incompatible_target.
9940 (read_input_script): Add dirindex parameter. Change all callers.
9941 If parser finds an incompatible target, requeue Read_symbols
9942 task.
9943 (script_set_symbol): Clear skip_on_incompatible_target in
9944 closure.
9945 (script_add_assertion, script_parse_option): Likewise.
9946 (script_start_sections, script_add_phdr): Likewise.
9947 (script_check_output_format): New function.
9948 * script.h (read_input_script): Update declaration.
9949 * script-c.h (script_check_output_format): Declare.
9950 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9951 (ignore_cmd): Remove OUTPUT_FORMAT.
9952 * fileread.cc (Input_file::Input_file): Add explicit this.
9953 (Input_file::will_search_for): New function.
9954 (Input_file::open): Add pindex parameter. Change all callers.
9955 * fileread.h (class Input_file): Add input_file_argument method.
9956 Declare will_search_for. Update declarations.
9957 * object.cc (make_elf_object): Add punconfigured parameter.
9958 Change all callers.
9959 * object.h (class Object): Make input_file public. Add
9960 searched_for method.
9961 (make_elf_object): Update declaration.
9962 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9963 restart search.
9964 * dirsearch.h (class Dirsearch): Update declaration.
9965 * options.h (class General_options): Add --warn-search-mismatch.
9966 * parameters.cc (Parameters::is_compatible_target): New function.
9967 * parameters.h (class Parameters): Declare is_compatible_target.
9968 * workqueue.cc (Workqueue::add_blocker): New function.
9969 * workqueue.h (class Workqueue): Declare add_blocker.
9970
f1ed28fb
ILT
9971 * fileread.cc (Input_file::open): Remove options parameter.
9972 Change all callers.
9973 (Input_file::open_binary): Likewise.
9974 * script.cc (read_input_script): Likewise.
9975 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9976 options parameter from constructor. Change all callers.
9977 (class Read_script): Likewise.
9978 * fileread.h (class Input_file): Update declarations.
9979 * script.h (read_input_script): Update declaration.
9980
34dd024a
NC
99812009-03-10 Nick Clifton <nickc@redhat.com>
9982
9983 * po/es.po: New Spanish translation.
9984
6d71b17c
CC
99852009-03-06 Cary Coutant <ccoutant@google.com>
9986
9987 * options.cc (parse_short_option): Keep dash_z from registering itself.
9988
031cdbed
ILT
99892009-03-03 Ian Lance Taylor <iant@google.com>
9990
9991 PR 9918
9992 * target-reloc.h (relocate_section): Pass output_section to
9993 relocate.
9994 * i386.cc (Target_i386::should_apply_static_reloc): Add
9995 output_section parameter. Change all callers.
9996 (Target_i386::Relocate::relocate): Add output_section parameter.
9997 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9998 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9999 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10000 * testsuite/two_file_shared.sh: New script.
10001 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10002 (check_DATA): Add two_file_shared.dbg.
10003 (two_file_shared.dbg): New target.
10004 * testsuite/Makefile.in: Rebuild.
10005
15d5fa16
ILT
100062009-03-01 Ian Lance Taylor <iant@google.com>
10007
10008 * configure.ac: Check for byteswap.h.
10009 * configure: Rebuild.
10010 * config.in: Rebuild.
10011
8a4c0b0d
ILT
100122009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10013
10014 * layout.cc (Layout::find_or_add_kept_section): New function.
10015 (Layout::add_comdat): Removed.
10016 * layout.h (struct Kept_section): Move out of class Layout.
10017 Remove trailing underscores from field names. Add group_sections
10018 field. Rename group_ field to is_group. Change all uses.
10019 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10020 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10021 comdat_groups_ field.
10022 (Sized_relobj::include_section_group): Use
10023 find_or_add_kept_section and Kept_section::group_sections.
10024 (Sized_relobj::include_linkonce_section): Likewise.
10025 * object.cc (class Sized_relobj): Don't define Comdat_group or
10026 Comdat_group_table. Remove find_comdat_group and
10027 add_comdat_group. Remove comdat_groups_ field.
10028 * plugin.cc (include_comdat_group): Use
10029 Layout::find_or_add_kept_section.
10030
b4ecf66b
ILT
100312009-02-28 Ian Lance Taylor <iant@google.com>
10032
14359ca0
ILT
10033 * README: --gc-sections and map files are now supported. Document
10034 some build requirements.
10035
b4ecf66b
ILT
10036 PR 6992
10037 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10038 relocatable link set the value of the section symbol to zero.
10039 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10040 relocatable link don't include the section address in the local
10041 symbol value.
10042
0602e05a
ILT
100432009-02-27 Ian Lance Taylor <iant@google.com>
10044
fd9d194f
ILT
10045 PR 6811
10046 * options.h (class Search_directory): Add is_system_directory.
10047 (class General_options): Declare is_in_system_directory.
10048 * options.cc (get_relative_sysroot): Make static.
10049 (get_default_sysroot): Make static.
10050 (General_optoins::is_in_system_directory): New function.
10051 * fileread.cc (Input_file::is_in_system_directory): New function.
10052 * fileread.h (class Input_file): Declare is_in_system_directory.
10053 * object.h (class Object): Add is_in_system_directory.
10054 (class Input_objects): Remove system_library_directory_ field.
10055 * object.cc (Input_objects::add_object): Don't set
10056 system_library_directory_.
10057 (input_objects::found_in_system_library_directory): Remove.
10058 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10059 parameter. Change all callers.
10060 (Symbol_table::sized_write_globals): Likewise.
10061 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10062 Call Object::is_in_system_directory.
10063 * symtab.h (class Symbol_table): Update declarations.
10064
61edd21f
ILT
10065 PR 5990
10066 * descriptors.h (Open_descriptor): Add is_on_stack field.
10067 * descriptors.cc (Descriptors::open): If the descriptor is on the
10068 top of the stack, remove it. Initialize is_on_stack field.
10069 (Descriptors::release): Only add pod to stack if it is not on the
10070 stack already.
10071 (Descriptors::close_some_descriptor): Clear stack_next and
10072 is_on_stack fields.
10073
e29e076a
ILT
10074 PR 7091
10075 * output.cc (Output_section::find_starting_output_address): Rename
10076 from starting_output_address; add PADDR parameter; change return
10077 type.
10078 * output.h (class Output_section): Declare
10079 find_starting_output_address instead of starting_output_address.
10080 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10081 section symbol for which we can't find a merge section.
10082
0602e05a
ILT
10083 PR 9836
10084 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10085 hidden or internal, force the symbol to be local.
10086 * resolve.cc (Symbol::override_visibility): Define.
10087 (Symbol::override_base): Use override_visibility.
10088 (Symbol_table::resolve): Likewise.
10089 (Symbol::override_base_with_special): Likewise.
10090 (Symbol_table::override_with_special): If the visibility is hidden
10091 or internal, force the symbol to be local.
10092 * symtab.h (class Symbol): Add set_visibility and
10093 override_visibility.
10094 * testsuite/ver_test_1.sh: New file.
10095 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10096 (check_DATA): Add ver_test_1.syms.
10097 (ver_test_1.syms): New target.
10098 * testsuite/Makefile.in: Rebuild.
10099
401a9a73
CC
101002009-02-25 Cary Coutant <ccoutant@google.com>
10101
10102 * layout.cc (Layout::choose_output_section): Don't rename sections
10103 when using a linker script that has a SECTIONS clause.
10104 * Makefile.in: Regenerate.
10105
10106 * testsuite/Makefile.am (script_test_5.sh): New test case.
10107 * testsuite/Makefile.in: Regenerate.
10108 * testsuite/script_test_5.cc: New file.
10109 * testsuite/script_test_5.sh: New file.
10110 * testsuite/script_test_5.t: New file.
10111
f488e4b0
CC
101122009-02-13 Rafael Avila de Espindola <espindola@google.com>
10113
10114 * archive.cc (Archive::include_member): Update calls to add_symbols.
10115 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10116 the Layout argument.
10117 * dynobj.h (do_add_symbols): Add the Layout argument.
10118 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10119 Layout argument.
10120 * object.h (Object::add_symbols): Add the Layout argument.
10121 (Object::do_add_symbols): Add the Layout argument.
10122 (Sized_relobj::do_add_symbols): Add the Layout argument.
10123 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10124 Unify the two versions.
10125 (Add_plugin_symbols): Remove.
10126 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10127 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10128 (Add_plugin_symbols): Remove.
10129 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10130 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10131 (Add_symbols::run): Make it work with Pulginobj.
10132
89dd1680
ILT
101332009-02-06 Ian Lance Taylor <iant@google.com>
10134
10135 * object.cc (Sized_relobj::do_layout): Make info message start
10136 with lower case letter.
10137
266d0a74
ILT
101382009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10139
602b464e
ILT
10140 * binary.cc: Fix file comment.
10141
266d0a74
ILT
10142 * options.h (enum Incremental_disposition): Define.
10143 (class General_options): Add new options: --incremental,
10144 --incremental_changed, --incremental_unchanged,
10145 --incremental_unknown. Add incremental_disposition_ and
10146 implicit_incremental_ fields.
10147 (General_options::incremental_disposition): New function.
10148 (class Position_dependent_options): Add incremental_disposition
10149 option.
10150 (Position_dependent_options::copy_from_options): Set incremental
10151 dispositions.
10152 * options.cc (General_options::parse_incremental_changed): New
10153 function.
10154 (General_options::parse_incremental_unchanged): New function.
10155 (General_options::parse_incremental_unknown): New function.
10156 (General_options::General_options): Initialize new fields
10157 incremental_disposition_ and implicit_incremental_.
10158 (General_options::finalize): Check for uasge of --incremental-*
10159 without --incremental.
10160
f073bbf7
CD
101612009-02-06 Chris Demetriou <cgd@google.com>
10162
10163 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10164 pointer and to report location as the file name associated with
10165 the symbol.
10166 (gold_undefined_symbol_at_location): New function to replace the
10167 old gold_undefined_symbol functionality.
10168 * target-reloc.h (relocate_section): Update to use
10169 gold_undefined_symbol_at_location.
10170 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10171 Call gold_undefined_symbol function rather than gold_error.
10172 * errors.h (Errors::undefined_symbol): Take location as a
10173 string, rather than calculating it from a relocation.
10174 * errors.cc (Errors::fatal): Print "fatal error:" before the
10175 formatted message.
10176 (Errors::error, Errors::error_at_location): Print "error: "
10177 before the formatted message.
10178 (Errors::undefined_symbol): Take location as a string, rather
10179 than calculating it from a relocation.
10180 (gold_undefined_symbol_at_location): New function akin to
10181 old gold_undefined_symbol, calculates location from relocation.
10182 (gold_undefined_symbol): Change to take only a Symbol pointer
10183 and to report location as the file name associated with the symbol.
10184 * testsuite/debug_msg.sh: Update for changed error messages.
10185 * testsuite/undef_symbol.sh: Likewise.
10186
8e94a90c
ILT
101872009-02-04 Duncan Sands <baldrick@free.fr>
10188
10189 PR 9812
10190 * reduced_debug_output.h
10191 (Output_reduced_debug_abbrev_section::failed): Use format for
10192 gold_warning.
10193 (Output_reduced_debug_info_section::faild): Likewise.
10194
88a0e15b
ILT
101952009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10196
10197 * script.cc (Lazy_demangler): New class.
10198 (Version_script_info::get_symbol_version_helper): Demangle a
10199 symbol only once.
10200
5efc7cd2
CC
102012009-01-29 Cary Coutant <ccoutant@google.com>
10202
10203 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10204 to __tls_get_addr.
10205 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10206
e0ebcf42
ILT
102072009-01-28 Ian Lance Taylor <iant@google.com>
10208
5efc7cd2 10209 * version.cc (version_string): Bump to 1.9.
75fe7426 10210
e0ebcf42
ILT
10211 * gold.h: Include <cstring> and <stdint.h>.
10212 * version.cc: Include <cstdio>.
10213 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10214 warning.
10215 * reduced_debug_output.cc (insert_into_vector): Rename from
10216 Insert_into_vector; change all callers. Use Swap_unaligned to
10217 avoid aliasing issue; remove union since it is unnecessary.
10218
8e2813be 102192009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10220
10221 * Makefile.am (CCFILES): Add gc.cc.
10222 (HFILES): Add gc.h.
10223 * Makefile.in: Regenerate.
10224 * gold.cc (Gc_runner): New class.
10225 (queue_initial_tasks): Call garbage collection related tasks
10226 when corresponding options are invoked.
10227 (queue_middle_gc_tasks): New function.
10228 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10229 processed early before laying out sections during garbage collection.
10230 * gold.h (queue_middle_gc_tasks): New function.
10231 (is_prefix_of): Move from "layout.cc".
10232 * i386.cc (Target_i386::gc_process_relocs): New function.
10233 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10234 * main.cc (main): Create object of class "Garbage_collection".
10235 * object.cc (Relobj::copy_symbols_data): New function.
10236 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10237 (Sized_relobj::do_layout): Allow this function to be called twice
10238 during garbage collection and defer layout of section during the
6d03d481
ST
10239 first call.
10240 * object.h (Relobj::get_symbols_data): New function.
10241 (Relobj::is_section_name_included): New function.
10242 (Relobj::copy_symbols_data): New function.
10243 (Relobj::set_symbols_data): New function.
10244 (Relobj::get_relocs_data): New function.
10245 (Relobj::set_relocs_data): New function.
10246 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10247 (Relobj::gc_process_relocs): New function.
10248 (Relobj::do_gc_process_relocs): New pure virtual function.
10249 (Relobj::sd_): New data member.
10250 (Sized_relobj::is_output_section_offset_invalid): New function.
10251 (Sized_relobj::do_gc_process_relocs): New function.
10252 * options.h (General_options::gc_sections): Modify to not be a no-op.
10253 (General_options::print_gc_sections): New option.
10254 * plugin.cc (Plugin_finish::run): Remove function call to
10255 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10256 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10257 * reloc.cc (Read_relocs::run): Add task to process relocs and
10258 determine unreferenced sections when doing garbage collection.
10259 (Gc_process_relocs): New class.
10260 (Sized_relobj::do_gc_process_relocs): New function.
10261 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10262 sections that are garbage collected.
10263 * reloc.h (Gc_process_relocs): New class.
10264 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10265 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10266 symbols whose corresponding sections are garbage collected.
10267 (Symbol_table::Symbol_table): Add new parameter for the garbage
10268 collection object.
10269 (Symbol_table::gc_mark_undef_symbols): New function.
10270 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10271 (Symbol_table::gc_mark_dyn_syms): New function.
10272 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10273 as garbage.
10274 (Symbol_table::add_from_object): Likewise.
10275 (Symbol_table::add_from_relobj): When building shared objects, do not
10276 treat externally visible symbols as garbage.
10277 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10278 table information for static and relocatable links.
10279 * symtab.h (Symbol_table::set_gc): New function.
10280 (Symbol_table::gc): New function.
10281 (Symbol_table::gc_mark_undef_symbols): New function.
10282 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10283 (Symbol_table::gc_mark_dyn_syms): New function.
10284 (Symbol_table::gc_): New data member.
e1df38aa 10285 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10286 function.
10287 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10288 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10289
3b293544
CF
102902009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10291
10292 * options.h (General_options::gc_sections): Define as a no-op for now.
10293 (General_options::no_keep_memory): Ditto.
10294 (General_options::Bshareable): Define.
10295 * options.cc (General_options::finalize): Honor -Bshareable.
10296
83d22aa8
AS
102972009-01-20 Andreas Schwab <schwab@suse.de>
10298
10299 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10300 read the value in the contents, since we don't use it. Use the
10301 template endianness when writing.
10302 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10303
cd536b21
AS
103042009-01-19 Andreas Schwab <schwab@suse.de>
10305
10306 * configure.tgt (powerpc64-*): Fix targ_obj.
10307
99e9a495
ILT
103082009-01-15 Ian Lance Taylor <iant@google.com>
10309
10310 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10311 local symbols when stripping all symbols.
10312
bbbfea06
CC
103132009-01-14 Cary Coutant <ccoutant@google.com>
10314
99e9a495 10315 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10316
0f7c0701
CC
103172009-01-14 Cary Coutant <ccoutant@google.com>
10318
10319 * archive.cc (Archive::get_elf_object_for_member): Remove call
10320 to File_read::claim_for_plugin.
10321 * descriptors.cc (Descriptors::open): Remove reference to
10322 is_claimed.
10323 (Descriptors::claim_for_plugin): Remove.
10324 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10325 (Descriptors::is_claimed): Remove.
10326 (claim_descriptor_for_plugin): Remove.
10327 * fileread.cc (File_read::claim_for_plugin): Remove.
10328 * fileread.h (File_read::claim_for_plugin): Remove.
10329 (File_read::descriptor): Reopen descriptor if necessary.
10330 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10331 (Plugin_manager::all_symbols_read): Add task parameter. Change
10332 all callers.
10333 (Plugin_manager::get_input_file): New function.
10334 (Plugin_manager::release_input_file): New function.
10335 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10336 corresponding data member.
10337 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10338 and pass to base constructor. Change all callers.
10339 (get_input_file, release_input_file): New functions.
10340 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10341 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10342 (Plugin_manager::all_symbols_read): Add task parameter.
10343 (Plugin_manager::get_input_file): New function.
10344 (Plugin_manager::release_input_file): New function.
10345 (Plugin_manager::task_): New data member.
10346 (Pluginobj::Pluginobj): Add filesize parameter.
10347 (Pluginobj::filename): New function.
10348 (Pluginobj::descriptor): New function.
10349 (Pluginobj::filesize): New function.
10350 (Pluginobj::filesize_): New data member.
10351 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10352 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10353 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10354
10355 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10356 with archive libraries.
10357 * testsuite/Makefile.in: Regenerate.
10358 * testsuite/plugin_test.c (struct sym_info): New type.
10359 (get_input_file, release_input_file): New static variables.
10360 (onload): Capture new transfer vector entries.
10361 (claim_file_hook): Stop reading at end of file according to filesize.
10362 Factor out parsing of readelf output into separate function.
10363 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10364 APIs and get the source file name from the symbol table. Convert
10365 source file name to corresponding object file name. Print info
10366 message when adding new input files.
10367 (parse_readelf_line): New function.
10368 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10369 * testsuite/plugin_test_2.sh: Likewise.
10370 * testsuite/plugin_test_3.sh: Likewise.
10371 * testsuite/plugin_test_4.sh: New test case.
10372
62a6d109
ILT
103732009-01-07 Ian Lance Taylor <iant@google.com>
10374
10375 * version.cc (version_string): Bump to 1.8.
10376
483620e8
CC
103772008-12-23 Cary Coutant <ccoutant@google.com>
10378
10379 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10380 * plugin.cc (Plugin_manager::finish): Rename as
10381 layout_deferred_objects. Move cleanup to separate function.
10382 (Plugin_manager::cleanup): New function.
10383 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10384 separately.
10385 * plugin.h (Plugin_manager::finish): Rename as
10386 layout_deferred_objects.
10387 (Plugin_manager::cleanup): New function.
10388 (Plugin_manager::cleanup_done): New field.
10389
d66a9eb3
CC
103902008-12-23 Cary Coutant <ccoutant@google.com>
10391
10392 * plugin.cc (is_visible_from_outside): New function.
10393 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10394 so we don't return "IR only" status for exported symbols or -r links.
10395
10396 * testsuite/Makefile.am (plugin_test_3): New test case.
10397 * testsuite/Makefile.in: Regenerate.
10398 * testsuite/plugin_test_3.sh: New file.
10399
5995b570
CC
104002008-12-22 Cary Coutant <ccoutant@google.com>
10401
10402 * object.cc (Sized_relobj::layout_section): New function.
10403 (Sized_relobj::do_layout): Defer layout of input sections until after
10404 plugin has provided replacement files.
10405 (Sized_relobj::do_layout_deferred_sections): New function.
10406 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10407 (Relobj::layout_deferred_sections): New function.
10408 (Relobj::do_layout_deferred_sections): New function.
10409 (Sized_relobj::do_layout_deferred_sections): New function.
10410 (Sized_relobj::layout_section): New function.
10411 (Sized_relobj::Deferred_layout): New structure.
10412 (Sized_relobj::deferred_layout_): New field.
10413 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10414 Change all callers. Layout deferred sections.
10415 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10416 references.
10417 (Plugin_hook::run): Move code from do_plugin_hook inline.
10418 (Plugin_hook::do_plugin_hook): Remove.
10419 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10420 (Plugin_manager::finish): Renamed, was cleanup.
10421 (Plugin_manager::should_defer_layout): New function.
10422 (Plugin_manager::add_deferred_layout_object): New function.
10423 (Plugin_manager::Deferred_layout_list): New type.
10424 (Plugin_manager::deferred_layout_objects_): New field.
10425 (Plugin_hook::do_plugin_hook): Remove.
10426
ee769c88
ILT
104272008-12-17 Ian Lance Taylor <iant@google.com>
10428
10429 * options.h (class General_options): Add --no case for
10430 --export-dynamic.
10431
abc8dcba
CC
104322008-12-16 Cary Coutant <ccoutant@google.com>
10433
10434 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10435 vector.
10436 (Plugin_manager::claim_file): Create plugin object even if
10437 plugin did not call the add_symbols callback.
10438 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10439 asking for more symbols than were added.
10440 * testsuite/Makefile.am (plugin_test_1): Add test case with
10441 no global symbols.
10442 (empty.syms): New target.
10443 * testsuite/Makefile.in: Regenerate.
10444 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10445 message. Don't call add_symbols if no globals.
10446 (all_symbols_read_hook): Don't provide replacement for empty
10447 claimed file.
10448
b0074644
ILT
104492008-12-12 Ian Lance Taylor <iant@google.com>
10450
68943102
ILT
10451 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10452 r_type == 0 for a local symbol with r_sym == 0.
10453 (scan_relocatable_relocs): Pass r_sym to
10454 local_non_section_strategy.
10455 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10456 r_sym parameter.
10457
b0074644
ILT
10458 * configure.ac: Update test for TLS descriptors: they are
10459 supported as of glibc 2.9.
10460 * configure: Rebuild.
10461
c2508178
ILT
104622008-12-11 Ian Lance Taylor <iant@google.com>
10463
10464 PR 7091
10465 * target-reloc.h (Default_scan_relocatable_relocs): For each
10466 function, map r_type == 0 to RELOC_DISCARD.
10467
2756a258
CC
104682008-12-10 Cary Coutant <ccoutant@google.com>
10469
10470 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10471 object to override a kept COMDAT group from a plugin object.
10472
bb6f53d3
ILT
104732008-12-09 Ian Lance Taylor <iant@google.com>
10474
fbc558e1
ILT
10475 PR 7088
10476 * yyscript.y (file_cmd): Handle INPUT.
10477
bb6f53d3
ILT
10478 * testsuite/initpri1.c: Change all declarations to be full
10479 prototypes by adding void, to avoid compiler warnings.
10480
4674ecfc
CC
104812008-12-05 Rafael Avila de Espindola <espindola@google.com>
10482
10483 * options.cc (General_options::parse_plugin_opt): New.
10484 (General_options::add_plugin): The argument now is just the filename.
10485 (General_options::add_plugin_option): New.
10486 * options.h (plugin_opt): New.
10487 (add_plugin): Change argument name.
10488 (add_plugin_option): New.
10489 * plugin.cc (Plugin::load): Don't parse the plugin option.
10490 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10491 (Plugin::add_option): New.
10492 (Plugin::args_): Change type.
10493 (Plugin::filename_): New.
10494 (Plugin_manager::add_plugin_option): New.
10495 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10496 * testsuite/Makefile.in: Regenerate.
10497
fd06b4aa
CC
104982008-12-05 Cary Coutant <ccoutant@google.com>
10499
10500 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10501 Handle --strip-lto-sections option.
10502 * options.h (strip_lto_sections): New option.
10503
6c52134c
CC
105042008-12-01 Cary Coutant <ccoutant@google.com>
10505
10506 * plugin.cc (ld_plugin_message): Change format parameter to const.
10507 Fix mismatch between new[] and delete.
10508
a45248e0
CC
105092008-11-14 Cary Coutant <ccoutant@google.com>
10510
10511 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10512 instead of -1U.
10513
c82fbeee
CS
105142008-11-05 Craig Silverstein <csilvers@google.com>
10515
10516 * options.cc (General_options::parse_dynamic_list): New function.
10517 * options.h (General_options): New flags dynamic_list,
10518 dynamic_list_data, dynamic_list_cpp_new, and
10519 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10520 (General_options::in_dynamic_list): New function.
10521 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10522 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10523 (Lex::can_continue_name): Likewise.
10524 (yylex): Likewise.
10525 (read_script_file): New parameter script_options.
10526 (read_dynamic_list): New function.
10527 (Script_options::define_dynamic_list): New function.
10528 (dynamic_list_keyword_parsecodes): New variable.
10529 (dynamic_list_keywords): New variable.
10530 * script.h (Script_options::define_dynamic_list): New function
10531 prototype.
10532 (read_dynamic_list): New function prototype.
10533 * symtab.cc (strprefix): New macro.
10534 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10535 dynamic_list_data, dynamic_list_cpp_new, and
10536 dynamic_list_cpp_typeinfo.
10537 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10538 (dynamic_list_expr): New rule.
10539 (dynamic_list_nodes): Likewise.
10540 (dynamic_list_node): Likewise.
10541 * testsuite/Makefile.am (dynamic_list): New test.
10542 * testsuite/Makefile.in: Regenerated.
10543 * testsuite/dynamic_list.t: New file.
10544 * testsuite/dynamic_list.sh: New file.
10545
e0bb29a5
CS
105462008-11-05 Craig Silverstein <csilvers@google.com>
10547
10548 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10549 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10550 (t11_last): Likewise.
10551 * testsuite/ver_test_6.c (main): Likewise.
10552
4e1e25e0
CC
105532008-10-07 Cary Coutant <ccoutant@google.com>
10554
10555 * options.c (General_options::finalize): Add check for -static and
10556 -shared.
10557 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10558 is not empty.
10559
92f03fcb
CC
105602008-10-02 Cary Coutant <ccoutant@google.com>
10561
10562 * plugin.cc (make_sized_plugin_object): Fix conditional
10563 compilation to work when not all targets are enabled.
10564
fbd8a257
CC
105652008-09-29 Cary Coutant <ccoutant@google.com>
10566
10567 * archive.cc (Archive::get_file_and_offset): Use filename instead
10568 of name to get library path.
10569 (Archive::include_member): Unlock external member of a thin archive.
10570
10571 * testsuite/Makefile.am (TEST_AR): New variable.
10572 (thin_archive_test_1): New test.
10573 (thin_archive_test_2): New test.
81636b3f
CC
10574 * testsuite/Makefile.in: Regenerate.
10575 * testsuite/thin_archive_main.cc: New file.
10576 * testsuite/thin_archive_test_1.cc: New file.
10577 * testsuite/thin_archive_test_2.cc: New file.
10578 * testsuite/thin_archive_test_3.cc: New file.
10579 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 10580
eff45813
CC
105812008-09-29 Cary Coutant <ccoutant@google.com>
10582
10583 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10584 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10585 instead of -1U.
10586 (Sized_relobj::do_finalize_local_symbols): Likewise.
10587 (Sized_relobj::map_to_kept_section): Likewise.
10588 * object.h (Sized_relobj::invalid_address): New constant.
10589 (Sized_relobj::do_output_section_offset): Check for invalid_address
10590 and return -1ULL.
10591 * output.cc (Output_reloc::local_section_offset): Use constant
10592 invalid_address instead of -1U.
10593 (Output_reloc::get_address): Likewise.
10594 (Output_section::output_address): Change -1U to -1ULL.
10595 * output.h (Output_reloc::invalid_address): New constant.
10596 * reloc.cc (Sized_relobj::write_sections): Use constant
10597 invalid_address instead of -1U.
10598 (Sized_relobj::relocate_sections): Likewise.
10599 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10600 values for merge sections.
10601 * target-reloc.h (relocate_for_relocatable): Use constant
10602 invalid_address instead of -1U.
10603
89fc3421
CC
106042008-09-19 Cary Coutant <ccoutant@google.com>
10605
10606 Add plugin functionality for link-time optimization (LTO).
10607 * configure.ac (plugins): Add --enable-plugins option.
10608 * configure: Regenerate.
10609 * config.in: Regenerate.
10610 * Makefile.am (LIBDL): New variable.
10611 (CCFILES): Add plugin.cc.
10612 (HFILES): Add plugin.h.
10613 (ldadd_var): Add LIBDL.
10614 * Makefile.in: Regenerate.
10615
10616 * archive.cc: Include "plugin.h".
10617 (Archive::setup): Don't preread archive symbols when using a plugin.
10618 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10619 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10620 files.
10621 (Archive::include_member): Add symbols from plugin objects.
10622 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10623 * descriptors.cc (Descriptors::open): Check for file descriptors
10624 abandoned by plugins.
10625 (Descriptors::claim_for_plugin): New function.
10626 * descriptors.h (Descriptors::claim_for_plugin): New function.
10627 (Open_descriptor::is_claimed): New field.
10628 (claim_descriptor_for_plugin): New function.
10629 * fileread.cc (File_read::claim_for_plugin): New function.
10630 * fileread.h (File_read::claim_for_plugin): New function.
10631 (File_read::descriptor): New function.
10632 * gold.cc: Include "plugin.h".
10633 (queue_initial_tasks): Add task to call plugin hooks for generating
10634 new object files.
10635 * main.cc: Include "plugin.h".
10636 (main): Load plugin libraries.
10637 * object.h (Pluginobj): Declare.
10638 (Object::pluginobj): New function.
10639 (Object::do_pluginobj): New function.
10640 (Object::set_target): New function.
10641 * options.cc: Include "plugin.h".
10642 (General_options::parse_plugin): New function.
10643 (General_options::General_options): Initialize plugins_ field.
10644 (General_options::add_plugin): New function.
10645 * options.h (Plugin_manager): Declare.
10646 (General_options): Add --plugin option.
10647 (General_options::has_plugins): New function.
10648 (General_options::plugins): New function.
10649 (General_options::add_plugin): New function.
10650 (General_options::plugins_): New field.
10651 * plugin.cc: New file.
10652 * plugin.h: New file.
10653 * readsyms.cc: Include "plugin.h".
10654 (Read_symbols::do_read_symbols): Check for archive before checking
10655 for ELF file. Call plugin hooks to claim files.
10656 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10657 from a real object file; force override when processing replacement
10658 files.
10659 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10660 (Symbol::init_base_object): Likewise.
10661 (Symbol::init_base_output_data): Likewise.
10662 (Symbol::init_base_output_segment): Likewise.
10663 (Symbol::init_base_constant): Likewise.
10664 (Symbol::init_base_undefined): Likewise.
10665 (Symbol::output_section): Assert that object is not a plugin.
10666 (Symbol_table::add_from_pluginobj): New function.
10667 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10668 undefined.
10669 (Symbol_table::sized_write_globals): Likewise.
10670 (Symbol_table::add_from_pluginobj): Instantiate template.
10671 * symtab.h (Sized_pluginobj): Declare.
10672 (Symbol::in_real_elf): New function.
10673 (Symbol::set_in_real_elf): New function.
10674 (Symbol::in_real_elf_): New field.
10675 (Symbol_table::add_from_pluginobj): New function.
10676
10677 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10678 (LIBDL): New variable.
10679 (LDADD): Add LIBDL.
10680 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10681 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10682 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10683 (MOSTLYCLEANFILES): Likewise.
10684 * testsuite/Makefile.in: Regenerate.
10685 * testsuite/plugin_test.c: New file.
10686 * testsuite/plugin_test_1.sh: New file.
10687 * testsuite/plugin_test_2.sh: New file.
10688
de31bda5
ILT
106892008-09-16 Ian Lance Taylor <iant@google.com>
10690
9c2d0ef9
ILT
10691 * target-reloc.h (relocate_section): Check whether a symbol is
10692 defined by the ABI before reporting an undefined symbol error.
10693 * target.h (Target::is_defined_by_abi): Make parameter const.
10694 (Target::do_is_defined_by_abi): Likewise.
10695 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10696 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10697 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10698 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10699 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10700 * testsuite/Makefile.in: Rebuild.
10701
de31bda5
ILT
10702 * fileread.cc (make_view): Add casts to avoid warning.
10703
9fa33bee
AO
107042008-09-16 Alexandre Oliva <aoliva@redhat.com>
10705
10706 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10707 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10708
183fd0e3
AO
107092008-09-16 Alexandre Oliva <aoliva@redhat.com>
10710
10711 * options.h (General_options::output_is_executable): New.
10712 (General_options::output_is_pie): New.
10713 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10714 for shared libraries.
10715 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10716
7be8330a
CD
107172008-09-11 Chris Demetriou <cgd@google.com>
10718
10719 * options.h (origin): New -z option.
10720 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10721 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10722 in DT_FLAGS_1.
10723
a9caad02
CC
107242008-09-05 Cary Coutant <ccoutant@google.com>
10725
10726 * fileread.cc (File_read::make_view): Add check for attempt to map
10727 beyond end of file.
10728
ae6dce4d
CC
107292008-09-05 Cary Coutant <ccoutant@google.com>
10730
10731 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10732 explicit instantiations.
10733
d7ab2a47
KVH
107342008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10735
10736 PR gold/6858
10737 * options.cc (General_options::finalize): Allow undefined symbols
10738 in shlibs if linking -shared.
10739
10740 PR gold/6859
10741 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10742 symbols as not needing a dynsym entry.
10743
1e52a9c1
CS
107442008-08-20 Craig Silverstein <csilvers@google.com>
10745
10746 * fileread.cc (File_read::open): Do not lock the file unless it
10747 was successfully opened.
10748
d85c80a3
CC
107492008-08-14 Cary Coutant <ccoutant@google.com>
10750
10751 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10752 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10753 * testsuite/tls_test.cc (struct int128): 128-bit struct
10754 for testing TLS relocs with non-zero addend.
10755 (v12): New TLS variable.
10756 (t12): New test.
10757 (t_last): Add check for v12.
10758 * testsuite/tls_test.h (t12): New function.
10759 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10760
2d924fd9
ILT
107612008-08-13 Ian Lance Taylor <iant@google.com>
10762
10763 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10764 set tls_segment_ or relro_segment_.
10765 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10766 when appropriate.
10767 * output.h (Output_section::clear_is_relro): New function.
10768 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10769 sections specially even when output_data_ is empty.
10770 (Output_segment::maximum_alignment): When first section is relro,
10771 only force alignment for PT_LOAD segments.
10772 * script.cc (script_data_segment_align): New function.
10773 (script_data_segment_relro_end): New function.
10774 * script-c.h (script_data_segment_align): Declare.
10775 (script_data_segment_relro_end): Declare.
10776 * script-sections.h (class Script_sections): Declare
10777 data_segment_align and data_segment_relro_end. Add fields
10778 segment_align_index_ and saw_relro_end_.
10779 * script-sections.cc (class Sections_element): Add set_is_relro
10780 virtual function. Add new bool* parameter to place_orphan_here.
10781 Add get_output_section virtual function.
10782 (class Output_section_definition): Add set_is_relro. Add new
10783 bool* parameter to place_orphan_here. Add get_output_section.
10784 Add is_relro_ field.
10785 (Output_section_definition::Output_section_definition): Initialize
10786 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10787 and is_relro_ fields.
10788 (Output_section_definition::place_orphan_here): Add is_relro
10789 parameter.
10790 (Output_section_definition::set_section_addresses): Set relro for
10791 output section.
10792 (Output_section_definition::alternate_constraint): Likewise.
10793 (class Orphan_output_section): Add new bool* parameter to
10794 place_orphan_here. Add get_output_section.
10795 (Orphan_output_section::place_orphan_here): Add is_relro
10796 parameter.
10797 (Script_sections::Script_sections): Initialize
10798 data_segment_align_index_ and saw_relro_end_.
10799 (Script_sections::data_segment_align): New function.
10800 (Script_sections::data_segment_relro_end): New function.
10801 (Script_sections::place_orphan): Set or clear is_relro.
10802 (Script_sections::set_section_addresses): Force alignment of first
10803 TLS section.
10804 * yyscript.y (exp): Call script_data_segment_align and
10805 script_data_segment_relro_end.
10806 * testsuite/relro_script_test.t: New file.
10807 * testsuite/relro_test.cc (using_script): Declare.
10808 (t1, t2): Test using_script.
10809 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10810 (relro_script_test_SOURCES): Define.
10811 (relro_script_test_DEPENDENCIES): Define.
10812 (relro_script_test_LDFLAGS): Define.
10813 (relro_script_test_LDADD): Define.
10814 (relro_script_test.so): New target.
10815 * testsuite/Makefile.in: Rebuild.
10816
f827c9a9
CC
108172008-08-06 Cary Coutant <ccoutant@google.com>
10818
10819 * archive.cc (Archive::total_archives, Archive::total_members)
10820 (Archive::total_members_loaded): New variables.
10821 (Archive::setup): Add parameter. Add option to preread
10822 archive symbols.
10823 (Archive::read_armap): Add counter.
10824 (Archive::get_file_and_offset): New function.
10825 (Archive::get_elf_object_for_member): New function.
10826 (Archive::read_all_symbols): New function.
10827 (Archive::read_symbols): New function.
10828 (Archive::add_symbols): Add counters.
10829 (Archive::include_all_members): Use armap to find members if it's
10830 already built.
10831 (Archive::include_member): Skip reading symbols if already read.
10832 Factored code into Archive::get_file_and_offset and
10833 Archive::get_elf_object_for_member. Changed call to
10834 Mapfile::report_include_archive_member.
10835 (Archive::print_stats): New function.
10836 * archive.h: Declare Object and Read_symbols_data classes.
10837 (Archive::Archive): Add initializers for new members.
10838 (Archive::setup): Add parameter.
10839 (Archive::print_stats): New function.
10840 (Archive::total_archives, Archive::total_members)
10841 (Archive::total_members_loaded): New variables.
10842 (Archive::get_file_and_offset): New function.
10843 (Archive::get_elf_object_for_member): New function.
10844 (Archive::read_all_symbols): New function.
10845 (Archive::read_symbols): New function.
10846 (Archive::Archive_member): New class.
10847 (Archive::members_): New member.
10848 (Archive::num_members_): New member.
10849 * main.cc: Include archive.h.
10850 (main): Call Archive::print_stats.
10851 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10852 archive parameter; member_name is now the fully-decorated name.
10853 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10854 * options.h: (General_options): Add --preread-archive-symbols option.
10855 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10856 Archive::setup.
10857
de4c45bd
ILT
108582008-08-04 Ian Lance Taylor <iant@google.com>
10859
10860 * symtab.h (Symbol::use_plt_offset): New function.
10861 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10862 * powerpc.cc (Relocate::relocate): Likewise.
10863 * sparc.cc (Relocate::relocate): Likewise.
10864 * x86_64.cc (Relocate::relocate): Likewise.
10865 * testsuite/weak_plt.sh: New test.
10866 * testsuite/weak_plt_main.cc: New test.
10867 * testsuite/weak_plt_shared.cc: New test.
10868 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10869 (check_PROGRAMS): Add weak_plt.
10870 (check_DATA): Add weak_plt_shared.so.
10871 (weak_plt_main_pic.o, weak_plt): New targets.
10872 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10873 * testsuite/Makefile.in: Rebuild.
10874
10875 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10876 gcctestdir/ld.
10877 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10878 * testsuite/Makefile.in: Rebuild.
10879
323ee3f4
AM
108802008-08-04 Alan Modra <amodra@bigpond.net.au>
10881
10882 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10883 * Makefile.in: Regenerate.
10884 * po/POTFILES.in: Regenerate.
10885
7c07ecec
ILT
108862008-07-29 Ian Lance Taylor <iant@google.com>
10887
10888 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10889 symbols before other symbols.
10890 * testsuite/script_test_2.cc (test_addr): Declare.
10891 (test_addr_alias): Declare.
10892 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10893 values.
7c07ecec
ILT
10894 * testsuite/script_test_2.t: Define test_addr_alias and
10895 test_addr.
10896
5778530e
ILT
108972008-07-24 Ian Lance Taylor <iant@google.com>
10898
2a00e4fb
ILT
10899 PR 5990
10900 * descriptors.cc: New file.
10901 * descriptors.h: New file.
10902 * gold-threads.h (class Hold_optional_lock): New class.
10903 * fileread.cc: Include "descriptors.h".
10904 (File_read::~File_read): Release descriptor rather than closing
10905 it.
10906 (File_read::open) [file]: Call open_descriptor rather than open.
10907 Set is_descriptor_opened_.
10908 (File_read::open) [memory]: Assert that descriptor is not open.
10909 (File_read::reopen_descriptor): New function.
10910 (File_read::release): Release descriptor.
10911 (File_read::do_read): Make non-const. Reopen descriptor.
10912 (File_read::read): Make non-const.
10913 (File_read::make_view): Reopen descriptor.
10914 (File_read::do_readv): Likewise.
10915 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10916 Update declarations.
10917 * layout.cc: Include "descriptors.h".
10918 (Layout::create_build_id): Use open_descriptor rather than open.
10919 * output.cc: Include "descriptors.h".
10920 (Output_file::open): Use open_descriptor rather than open.
10921 * archive.cc (Archive::const_iterator): Change Archive to be
10922 non-const.
10923 (Archive::begin, Archive::end): Make non-const.
10924 (Archive::count_members): Likewise.
10925 * archive.h (class Archive): Update declarations.
10926 * object.h (Object::read): Make non-const.
10927 * Makefile.am (CCFILES): Add descriptors.cc.
10928 (HFILES): Add descriptors.h.
10929 * Makefile.in: Rebuild.
10930
801647d1
ILT
10931 PR 6716
10932 * gold.h: Always include <clocale>. Add Solaris workarounds
10933 following code in binutils/sysdep.h.
10934
5edd166e
ILT
10935 PR 6048
10936 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10937 this->eh_frame_hdr_ is NULL before using it.
10938
c89ad728
ILT
10939 * dynobj.cc (Versions::Versions): Update comment.
10940
aa86f06b
ILT
10941 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10942 the base version name.
10943
5778530e
ILT
10944 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10945 array size plus one.
10946 (Stringpool_template::set_string_offsets): Subtract one from key
10947 before using it as an array index.
10948 (Stringpool_template::get_offset_with_length): Likewise.
10949 (Stringpool_template::write_to_buffer): Likewise.
10950 * stringpool.h (Stringpool_template::get_offset_from_key):
10951 Likewise.
10952
057ead22
ILT
109532008-07-23 Ian Lance Taylor <iant@google.com>
10954
7f649c59
ILT
10955 PR 6658
10956 * object.h (Merged_symbol_value::value): Do our best to handle a
10957 negative addend.
10958
057ead22
ILT
10959 PR 6647
10960 * script.cc (Version_script_info::get_versions): Don't add empty
10961 version tag to return value.
10962 (Version_script_info::get_symbol_version_helper): Change return
10963 type to bool. Add pversion parameter. Change all callers.
10964 (script_register_vers_node): Don't require a non-NULL tag.
10965 * script.h (class Version_script_info): Update declarations.
10966 (Version_script_info::get_symbol_version): Change return type to
10967 bool. Add version parameter. Change all callers.
10968 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10969 handling. Handle an empty version from a version script.
10970 (Symbol_table::define_special_symbol): Likewise.
10971 * testsuite/ver_test_10.script: New file.
10972 * testsuite/ver_test_10.sh: New file.
10973 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10974 (check_DATA): Add ver_test_10.syms.
10975 (ver_test_10.syms, ver_test_10.so): New target.
10976 * testsuite/Makefile.in: Rebuild.
10977
58e54ac2
CD
109782008-07-23 Simon Baldwin <simonb@google.com>
10979
10980 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10981 to zero for undefined symbols from dynamic libraries.
10982
95d14cd3
ILT
109832008-07-23 Ian Lance Taylor <iant@google.com>
10984
10985 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10986 Change all callers.
10987 * symtab.h (class Symbol_table): Update declaration.
10988 * testsuite/ver_test_9.cc: New file.
10989 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10990 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10991 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10992 (ver_test_9.so, ver_test_9.o): New targets.
10993 * testsuite/Makefile.in: Rebuild.
10994
92de84a6
ILT
109952008-07-22 Ian Lance Taylor <iant@google.com>
10996
34810851
ILT
10997 * options.h (class General_options): Define --check-sections.
10998 * layout.cc (Layout::set_segment_offsets): Handle
10999 --check-sections.
11000
af6156ef
ILT
11001 * options.h (class General_options): Define -n/--nmagic and
11002 -N/--omagic.
11003 * options.cc (General_options::finalize): For -n/--nmagic or
11004 -N/--omagic, set -static.
11005 * layout.cc (Layout::attach_allocated_section_to_segment): If
11006 -N/--omagic, don't put read-only and read-write sections in
11007 different segments.
11008 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11009 finding a read-only segment.
11010 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11011 don't set the minimum segment alignment to the common page size,
11012 and don't set the file offset to the address modulo the page size.
11013 * script-sections.cc (Script_sections::create_segments): If
11014 -n/--omagic, don't put read-only and read-write sections in
11015 different segments.
11016
92de84a6
ILT
11017 * cref.cc: New file.
11018 * cref.h: New file.
11019 * options.h (class General_options): Add --print-symbol-counts.
11020 * main.cc (main): Issue defined symbol report if requested.
11021 * archive.cc (Archive::interpret_header): Make into a const member
11022 function.
11023 (Archive::add_symbols): Call Input_objects::archive_start and
11024 archive_stop.
11025 (Archive::const_iterator): Define new class.
11026 (Archive::begin, Archive::end): New functions.
11027 (Archive::include_all_members): Rewrite to use iterator.
11028 (Archive::count_members): New function.
11029 * archive.h (class Archive): Update declarations.
11030 (Archive::filename): New function.
11031 * object.cc: Include "cref.h".
11032 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11033 (Sized_relobj::do_get_global_symbol_counts): New function.
11034 (Input_objects::add_object): Add object to cross-referencer.
11035 (Input_objects::archive_start): New function.
11036 (Input_objects::archive_stop): New function.
11037 (Input_objects::print_symbol_counts): New function.
11038 * object.h: Declare Cref and Archive.
11039 (Object::get_global_symbol_counts): New function.
11040 (Object::do_get_global_symbol_counts): New pure virtual function.
11041 (class Sized_relobj): Add defined_count_ field. Update
11042 declarations.
11043 (class Input_objects): Add cref_ field. Update constructor.
11044 Update declarations.
11045 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11046 defined_count_.
11047 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11048 symbol counts.
11049 (Sized_dynobj::do_get_global_symbol_counts): New function.
11050 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11051 defined_count_. Update declarations. Define Symbols typedef.
11052 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11053 parameter. Change all callers.
11054 (Symbol_table::add_from_dynobj): Add sympointers and defined
11055 parameters. Change all callers.
11056 * symtab.h (class Symbol_table): Update declarations.
11057 * Makefile.am (CCFILES): Add cref.cc.
11058 (HFILES): Add cref.h.
11059 * Makefile.in: Rebuild.
11060
3f7c5e1d
CD
110612008-07-22 Simon Baldwin <simonb@google.com>
11062
11063 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11064 to zero when writing undefined symbols.
11065
e0b64032
ILT
110662008-07-22 Ian Lance Taylor <iant@google.com>
11067
11068 * output.cc (Output_section::add_input_section): Don't try to
11069 merge empty merge sections.
11070
096b02cf
CS
110712008-07-21 Craig Silverstein <csilvers@google.com>
11072
11073 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11074 Include symbol version in error message.
cd536b21 11075
1d1f116d
CD
110762008-07-20 Chris Demetriou <cgd@google.com>
11077
cd536b21 11078 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11079 (RANDOM_SEED_CFLAGS): New substituted variable.
11080 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11081 * configure: Rebuild.
11082 * Makefile.in: Likewise.
11083 * testsuite/Makefile.in: Likewise.
11084
a18f591e
ILT
110852008-07-18 Ian Lance Taylor <iant@google.com>
11086
11087 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11088 where we see NAME/NULL and NAME/VERSION as separate symbols.
11089 * testsuite/ver_test_main.cc (main): Call t4.
11090 (t4, t4_2a): Define.
11091 * testsuite/ver_test_2.cc (t4_2): Define.
11092 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11093 * testsuite/ver_test_4.cc (t4_2a): Define.
11094 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11095 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11096
c6e3f6ed
ILT
110972008-07-17 Ian Lance Taylor <iant@google.com>
11098
11099 * dynobj.cc (Versions::add_def): If we give an error about a
11100 missing version, go ahead and create the version anyhow.
11101
ef9beddf
ILT
111022008-07-10 Ian Lance Taylor <iant@google.com>
11103
11104 Handle output sections with more than 0x7fffffff bytes.
11105 * object.h (class Relobj): Change map_to_output_ to
11106 output_sections_, and just keep a section pointer. Change all
11107 uses. Move comdat group support to Sized_relobj.
11108 (Relobj::is_section_specially_mapped): Remove.
11109 (Relobj::output_section): Remove poff parameter. Change all
11110 callers.
11111 (Relobj::output_section_offset): New function.
11112 (Relobj::set_section_offset): Rewrite.
11113 (Relobj::map_to_output): Remove.
11114 (Relobj::output_sections): New function.
11115 (Relobj::do_output_section_offset): New pure virtual function.
11116 (Relobj::do_set_section_offset): Likewise.
11117 (class Sized_relobj): Add section_offsets_ field. Add comdat
11118 group support from Relobj. Update declarations.
11119 (Sized_relobj::get_output_section_offset): New function.
11120 (Sized_relobj::do_output_section_offset): New function.
11121 (Sized_relobj::do_set_section_offset): New function.
11122 * object.cc (Relobj::output_section_address): Remove.
11123 (Sized_relobj::Sized_relobj): Initialize new fields.
11124 (Sized_relobj::include_section_group): Cast find_kept_object to
11125 Sized_relobj.
11126 (Sized_relobj::include_linkonce_section): Likewise.
11127 (Sized_relobj::do_layout): Use separate arrays for output section
11128 and output offset.
11129 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11130 output_sections.
11131 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11132 output_sections and section_offsets.
11133 (Sized_relobj::write_local_symbols): Likewise.
11134 (map_to_kept_section): Compute output address directly.
11135 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11136 output_sections and section_offsets.
11137 (Sized_relobj::write_sections): Likewise.
11138 (Sized_relobj::relocate_sections): Likewise.
11139 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11140 * output.h (class Output_reloc): Update declarations. Change
11141 u2_.relobj to Sized_relobj*.
11142 (class Output_data_reloc): Change add functions to use
11143 Sized_relobj*.
11144 * output.cc (Output_reloc::Output_reloc): Change relobj to
11145 Sized_relobj*.
11146 (Output_reloc::local_section_offset): Change return type to
11147 Elf_Addr. Use get_output_section_offset.
11148 (Output_reloc::get_address): Likewise.
11149 (Output_section::is_input_address_mapped): Don't call
11150 is_section_specially_mapped.
11151 (Output_section::output_offset): Likewise.
11152 (Output_section::output_address): Likewise.
11153 (Output_section::starting_output_address): Likewise.
11154 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11155 parameter to Sized_relobj*.
11156 (Copy_relocs::need_copy_reloc): Likewise.
11157 (Copy_relocs::save): Likewise.
11158 * copy-relocs.h (class Copy_relocs): Update declarations.
11159 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11160 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11161 * target-reloc.h (relocate_for_relocatable): Change
11162 offset_in_output_section type to Elf_Addr. Change code that uses
11163 it as well.
11164 * layout.cc (Layout::layout): Always set *off.
11165 * mapfile.cc (Mapfile::print_input_section): Use
11166 output_section_offset.
11167 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11168 Sized_relobj*.
11169 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11170 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11171 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11172
5cb66f97
ILT
111732008-07-03 Ian Lance Taylor <iant@google.com>
11174
11175 * layout.cc (Layout::include_section): Do not discard unrecognized
11176 SHT_STRTAB sections.
11177
afe47622
CS
111782008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11179
11180 * script.cc (Lex::can_continue_name): Make '?' allowable in
11181 version-script names.
11182 * testsuite/version_script.map: Change glob pattern to use '?'
11183
5adf9721
ILT
111842008-06-30 Manish Singh <yosh@gimp.org>
11185
11186 PR 6585
11187 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11188 Correct typo.
11189
e6fde208
ILT
111902008-06-30 Ian Lance Taylor <iant@google.com>
11191
11192 PR 6660
11193 PR 6682
11194 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11195 versions]: Don't try to read the value in the contents, since we
11196 don't use it. Use the template endianness when writing.
11197
3f2e6a2d
CC
111982008-06-25 Cary Coutant <ccoutant@google.com>
11199
11200 * fileread.cc (File_read::make_view): Assert on zero-length view.
11201 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11202 symbol table when there are no symbols to read.
11203
c43d3a48
CS
112042008-06-23 Craig Silverstein <csilvers@google.com>
11205
11206 * version.cc (version_string): Bump to 1.7
11207
5f494ea0
CS
112082008-06-18 Craig Silverstein <csilvers@google.com>
11209
11210 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11211 constant 0xFFFF to type Valtype.
11212 (Powerpc_relocate_functions::rel16_ha): Likewise.
11213
c42e122e
ILT
112142008-06-17 Ian Lance Taylor <iant@google.com>
11215
f34787f8
ILT
11216 * output.h (Output_section::Input_section): Initialize p2align_ to
11217 zero for Output_section_data constructors.
11218 (Output_section::Input_section::addralign): If not an input
11219 section, return the alignment of the Output_section_data.
11220 * testsuite/copy_test.cc: New file.
11221 * testsuite/copy_test_1.cc: New file.
11222 * testsuite/copy_test_2.cc: New file.
11223 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11224 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11225 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11226 (copy_test_1_pic.o, copy_test_1.so): New targets.
11227 (copy_test_2_pic.o, copy_test_2.so): New targets.
11228 * testsuite/Makefile.in: Rebuild.
11229
c42e122e
ILT
11230 * script-sections.cc (Script_sections::place_orphan): Initialize
11231 local variable exact.
11232
ce3ac18a
DE
112332008-06-13 David Edelsohn <edelsohn@gnu.org>
11234
11235 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11236
42cacb20
DE
112372008-06-12 David Edelsohn <edelsohn@gnu.org>
11238 David S. Miller <davem@davemloft.net>
11239
11240 * powerpc.cc: New file.
11241 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11242 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11243 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11244 * Makefile.in: Rebuild.
11245
7b308235
ILT
112462008-06-09 Ian Lance Taylor <iant@google.com>
11247
11248 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11249 <exception>.
11250 (throwing, orig_terminate): New static variables.
11251 (terminate_handler): New static function.
11252 (t2): Set terminate handler.
11253
f0b886e3
ILT
112542008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11255
11256 PR 6584
cd536b21 11257 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11258 alignment.
11259
3e90f135
CC
112602008-05-30 Cary Coutant <ccoutant@google.com>
11261
11262 * archive.cc (Archive::include_all_members) Correct to step
11263 over symbol table and extended name table in thin archives.
11264
e09ad04a
ILT
112652008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11266
11267 PR 6407
11268 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11269 calculation.
11270
62b01cb5
ILT
112712008-05-28 Caleb Howe <cshowe@google.com>
11272
11273 * reduced_debug_output.cc: New file.
11274 * reduced_debug_output.h: New file.
92de84a6 11275 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11276 * options.cc (General_options::finalize): Add strip_debug_non_line
11277 to the strip heirarchy.
11278 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11279 fields.
11280 * layout.cc: Include "reduced_debug_output.h".
11281 (Layout::Layout): Initialize new fields.
11282 (line_only_debug_sections): New static array.
11283 (is_lines_only_debug_sections): New static inline function.
11284 (Layout::include_section): Handle --strip-debug-non-line.
11285 (Layout::make_output_section): If --strip-debug-non-line, build
11286 new output sections for .debug_abbrev and .debug_info.
11287 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11288 gold. Warn about possible overflow.
11289 (read_signed_LEB_128): Likewise.
11290 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11291 (read_signed_LEB_128): Declare.
11292 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11293 (HFILES): Add reduced_debug_output.h.
11294 * Makefile.in: Rebuild.
11295
7d9e3d98
ILT
112962008-05-21 Ian Lance Taylor <iant@google.com>
11297
11298 * mapfile.cc: New file.
11299 * mapfile.h: New file.
11300 * options.h (class General_options): Add -M/--print-map and -Map.
11301 * options.cc (General_options::finalize): Make -M equivalent to
11302 -Map -.
11303 * main.cc: Include <cstdio> and "mapfile.h".
11304 (main): Open mapfile if requested.
11305 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11306 constructor. Change caller.
11307 (queue_initial_tasks): Add mapfile parameter. Change caller.
11308 (queue_middle_tasks): Likewise.
11309 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11310 declarations.
11311 * archive.cc: Include "mapfile.h".
11312 (Archive::add_symbols): Add mapfile parameter. Change all
11313 callers. Pass mapfile, symbol, and reason to include_member.
11314 (Archive::include_all_members): Add mapfile parameter. Change all
11315 callers.
11316 (Archive::include_member): Add mapfile, sym, and why parameters.
11317 Change all callers. Report inclusion to map file.
11318 * archive.h: Include "fileread.h".
11319 (class Archive): Update declarations.
11320 (Archive::file): New const method.
11321 (class Add_archive_symbols): Add mapfile_ field. Update
11322 constructor. Change all callers.
11323 * readsyms.h (class Read_symbols): Likewise.
11324 (class Finish_group): Likewise.
11325 (class Read_script): Likewise.
11326 * common.cc: Include "mapfile.h".
11327 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11328 all callers.
11329 (Symbol_table::do_allocate_commons): Likewise.
11330 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11331 symbol allocation to mapfile.
11332 * common.h (class Allocate_commons_task): Add mapfile_ field.
11333 Update constructor. Change all callers.
11334 * symtab.h (class Symbol_table): Update declarations.
11335 * layout.cc: Include "mapfile.h".
11336 (Layout_task_runner::run): Print information to mapfile.
11337 (Layout::create_gold_note): Change Output_data_fixed_space to
11338 Output_data_zero_fill.
11339 (Layout::create_build_id): Likewise.
11340 (Layout::print_to_mapfile): New function.
11341 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11342 constructor. Change caller.
11343 (class Layout): Declare print_to_mapfile.
11344 * output.cc (Output_section::Input_section::print_to_mapfile): New
11345 function.
11346 (Output_section::add_input_section): If producing a map, always
11347 add to input_sections_ list.
11348 (Output_section::do_print_to_mapfile): New function.
11349 (Output_segment::print_sections_to_mapfile): New function.
11350 (Output_segment::print_section_list_to_mapfile): New function.
11351 * output.h: Include "mapfile.h".
11352 (Output_data::print_to_mapfile): New function.
11353 (Output_data::do_print_to_mapfile): New virtual function.
11354 (Output_segment_headers::do_print_to_mapfile): New function.
11355 (Output_file_header::do_print_to_mapfile): New function.
11356 (Output_data_const::do_print_to_mapfile): New function.
11357 (class Output_data_const_buffer): Add map_name_ field. Update
11358 constructor. Change all callers. Add do_print_to_mapfile
11359 function.
11360 (class Output_data_fixed_space): Likewise.
11361 (class Output_data_space): Likewise.
11362 (class Output_data_zero_fill): New class.
11363 (Output_data_strtab::do_print_to_mapfile): New function.
11364 (Output_data_reloc_base::do_print_to_mapfile): New function.
11365 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11366 (Output_data_group::do_print_to_mapfile): New function.
11367 (Output_data_got::do_print_to_mapfile): New function.
11368 (Output_data_dynamic::do_print_to_mapfile): New function.
11369 (Output_symtab_xindex::do_print_to_mapfile): New function.
11370 (class Output_section): Declare do_print_to_mapflie. Declare
11371 print_to_mapfile in Input_section.
11372 (class Output_segment): Declare new functions.
11373 * object.h (Sized_relobj::symbol_count): New function.
11374 * script-sections.cc
11375 (Output_section_element_dot_assignment::set_section_addresses):
11376 Change Output_data_fixed_space to Output_data_zero_fill.
11377 (Output_data_expression::do_print_to_mapfile): New function.
11378 * script.cc (read_input_script): Add mapfile parameter. Change
11379 all callers.
11380 * script.h (read_input_script): Update declaration.
11381 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11382 (Eh_frame::do_print_to_mapfile): New function.
11383 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11384 (Output_merge_string::do_print_to_mapfile): New function.
11385 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11386 function.
11387 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11388 function.
11389 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11390 function.
11391 * Makefile.am (CCFILES): Add mapfile.cc.
11392 (HFILES): Add mapfile.h.
11393 * Makefile.in: Rebuild.
11394
9f1d377b
ILT
113952008-05-19 Ian Lance Taylor <iant@google.com>
11396
11397 * options.h (class General_options): Add -z relro.
11398 * layout.cc (Layout::Layout): Initialize relro_segment_.
11399 (Layout::add_output_section_data): Return the output section.
11400 (Layout::make_output_section): Rcognize relro sections and mark
11401 them appropriately.
11402 (Layout::attach_allocated_section_to_segment): Put relro sections
11403 in a PT_GNU_RELRO segment.
11404 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11405 section as relro.
11406 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11407 PT_TLS segments.
11408 (Layout::linkonce_mapping): Map d.rel.ro.local to
11409 .data.rel.ro.local.
11410 (Layout::output_section_name): Us .data.rel.ro.local for any
11411 section which begins with that.
11412 * layout.h (class Layout): Update add_output_section_data
11413 declaration. Add relro_segment_ field.
11414 * output.cc (Output_section::Output_section): Initialize is_relro_
11415 and is_relro_local_ fields.
11416 (Output_segment::add_output_section): Group relro sections.
11417 (Output_segment::is_first_section_relro): New function.
11418 (Output_segment::maximum_alignment): If there is a relro section,
11419 align the segment to the common page size.
11420 (Output_segment::set_section_addresses): Track whether we are
11421 looking at relro sections. If the last section is a relro
11422 section, align to the common page size.
11423 (Output_segment::set_section_list_addresses): Add in_relro
11424 parameter. Change all callers. Align to the page size when
11425 moving from relro to non-relro section.
11426 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11427 segment.
11428 * output.h (class Output_section): Add is_relro_ and
11429 is_relro_local_ fields.
11430 (Output_section::is_relro): New function.
11431 (Output_section::set_is_relro): New function.
11432 (Output_section::is_relro_local): New function.
11433 (Output_section::set_is_relro_local): New function.
11434 (class Output_segment): Update declarations.
11435 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11436 * sparc.cc (Target_sparc::got_section): Likewise.
11437 * x86_64.cc (Target_x86_64::got_section): Likewise.
11438 * testsuite/relro_test_main.cc: New file.
11439 * testsuite/relro_test.cc: New file.
11440 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11441 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11442 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11443 (relro_test.so, relro_test_pic.o): New targets.
11444 * testsuite/Makefile.in: Rebuild.
11445
a984ee1d
ILT
114462008-05-16 Ian Lance Taylor <iant@google.com>
11447
01676dcd
ILT
11448 * output.cc (Output_segment::add_output_section): Remove front
11449 parameter.
11450 * output.h (class Output_segment): Remove
11451 add_initial_output_section and overloaded add_output_section.
11452 Update declaration of remaining add_output_section.
11453 * layout.cc (Layout::create_interp): Call add_output_section
11454 rather than add_initial_output_section.
11455 (Layout::finish_dynamic_section): Likewise.
11456
497897f9
ILT
11457 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11458 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11459 know the dynamic type.
11460 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11461 field. Initialize it in constructor.
11462 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11463 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11464 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11465 reloc.
11466
a984ee1d
ILT
11467 * output.cc (Output_reloc::get_address): Change return type to
11468 Elf_Addr.
11469 * output.h (class Output_reloc): Update get_address declaration.
11470 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11471 for section addresses.
11472
55ba0940
ILT
114732008-05-09 Ian Lance Taylor <iant@google.com>
11474
11475 PR 6493
11476 * gold.cc (gold_nomem): Use return value of write.
11477
75517b77
ILT
114782008-05-08 Ian Lance Taylor <iant@google.com>
11479
11480 * symtab.c (Symbol::init_base_output_data): Add version
11481 parameter. Change all callers.
11482 (Symbol::init_base_output_segment): Likewise.
11483 (Symbol::init_base_constant): Likewise.
11484 (Symbol::init_base_undefined): Likewise.
11485 (Sized_symbol::init_output_data): Likewise.
11486 (Sized_symbol::init_output_segment): Likewise.
11487 (Sized_symbol::init_constant): Likewise.
11488 (Sized_symbol::init_undefined): Likewise.
11489 (Symbol_table::do_define_in_output_data): If the new symbol has a
11490 version, mark it as the default.
11491 (Symbol_table::do_define_in_output_segment): Likewise.
11492 (Symbol_table::do_define_as_constant): Likewise.
11493 * symtab.h (class Symbol): Update declarations.
11494 (class Sized_symbol): Likewise.
11495 * resolve.cc (Symbol::override_version): New function.
c42e122e 11496 (Symbol::override_base): Call override_version.
75517b77
ILT
11497 (Symbol::override_base_with_special): Likewise.
11498 * testsuite/ver_script_8.script: New file.
11499 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11500 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11501 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11502 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11503
f1f70eae
ILT
115042008-05-06 Ian Lance Taylor <iant@google.com>
11505
f3e9c5c5
ILT
11506 PR 6049
11507 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11508 functions.
11509 (class General_options): Remove existing --undefined, and add
11510 --no-undefined instead. Add new --undefined as synonym for -u.
11511 * archive.cc (Archive::add_symbols): Check whether symbol was
11512 named with -u.
11513 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11514 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11515 all uses. Add IS_UNDEFINED. Update declarations to split
11516 different versions of init_base. Declare init_base_undefined.
11517 (Symbol::is_defined): Handle IS_UNDEFINED.
11518 (Symbol::is_undefined): Likewise.
11519 (Symbol::is_weak_undefined): Call is_undefined.
11520 (Symbol::is_absolute): Handle IS_CONSTANT.
11521 (class Sized_symbol): Update declarations to split different
11522 versions of init. Declare init_undefined.
11523 (class Symbol_table): Declare new functions.
11524 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11525 Change all callers.
11526 (Symbol::init_base_output_data): Likewise.
11527 (Symbol::init_base_output_segment): Likewise.
11528 (Symbol::init_base_constant): Likewise.
11529 (Symbol::init_base_undefined): New function.
11530 (Sized_symbol::init_object): Rename from init. Change all
11531 callers.
11532 (Sized_symbol::init_output_data): Likewise.
11533 (Sized_symbol::init_output_segment): Likewise.
11534 (Sized_symbol::init_constant): Likewise.
11535 (Sized_symbol::init_undefined): New function.
11536 (Symbol_table::add_undefined_symbols_from_command_line): New
11537 function.
11538 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11539 function.
11540 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11541 (Symbol::output_section): Likewise.
11542 (Symbol::set_output_section): Likewise.
11543 (Symbol_table::sized_finalize_symbol): Likewise.
11544 (Symbol_table::sized_write_globals): Likewise.
11545 * resolve.cc (Symbol_table::should_override): Likewise.
11546 (Symbol::override_base_with_special): Likewise.
11547
8bdcdf2c
ILT
11548 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11549 symbol, change it to have default visibility.
11550 * testsuite/protected_1.cc: New file.
11551 * testsuite/protected_2.cc: New file.
11552 * testsuite/protected_3.cc: New file.
11553 * testsuite/protected_main_1.cc: New file.
11554 * testsuite/protected_main_2.cc: New file.
11555 * testsuite/protected_main_3.cc: New file.
11556 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11557 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11558 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11559 (protected_1.so): New target.
11560 (protected_1_pic.o, protected_2_pic.o): New targets.
11561 (protected_3_pic.o): New target.
11562 (check_PROGRAMS): Add protected_2.
11563 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11564 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11565 * testsuite/Makefile.in: Rebuild.
11566
2b706932
ILT
11567 * options.h (DEFINE_var): Add set_user_set_##varname__.
11568 (DEFINE_bool_alias): New macro.
11569 (class General_options): Define -Bstatic using DEFINE_bool_alias
11570 rather than DEFINE_special. Add --undefined as an alias for -z
11571 defs.
11572 * options.cc (General_options::parse_Bstatic): Remove.
11573
d82a5bcc
ILT
11574 * options.h (class General_options): Add --fatal-warnings.
11575 * main.cc (main): Implement --fatal-warnings.
11576 * errors.h (Errors::warning_count): New function.
11577
f1f70eae
ILT
11578 * options.h (class General_options): Add -Bsymbolic-functions.
11579 * symtab.h (Symbol::is_preemptible): Check for
11580 -Bsymbolic-functions.
11581
8825ac63
ILT
115822008-05-05 Ian Lance Taylor <iant@google.com>
11583
d98bc257
ILT
11584 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11585 as noVARNAME rather than no-VARNAME.
11586 (class General_options): Add option -z combreloc.
11587 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11588 get_address.
11589 (Output_reloc::sort_before) [SHT_REL]: New function.
11590 (Output_reloc::sort_before) [SHT_RELA]: New function.
11591 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11592 Sort_relocs_comparison.
11593 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11594 parameter. Change all callers.
11595 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11596 sort_relocs parameter. Change all callers.
11597 * output.cc (Output_reloc::get_address): New function, broken out
11598 of write_rel.
11599 (Output_reloc::write_rel): Call it.
11600 (Output_reloc::compare): New function.
11601 (Output_data_reloc_base::do_write): Optionally sort relocs.
11602
60b2b4e7
ILT
11603 * configure.ac: If targ_extra_obj is set, link it in.
11604 * configure.tgt: Initialize all variables.
11605 (x86_64*): Set targ_extra_obj and targ_extra_size.
11606 * configure: Rebuild.
11607
8825ac63
ILT
11608 * object.cc (Sized_relobj::include_section_group): Adjust section
11609 indexes read from group data. Build vector to pass to
11610 layout_group.
11611 * layout.cc (Layout::layout_group): Add flags and shndxes
11612 parameters. Remove contents parameter. Change caller. Update
11613 explicit instantiations.
11614 * layout.h (class Layout): Update layout_group declaration.
11615 * output.cc (Output_data_group::Output_data_group): Add flags and
11616 input_shndxes parameters. Remove contents parameter. Change
11617 caller.
11618 (Output_data_group::do_write): Change input_sections_ to
11619 input_shndxes_.
11620 * output.h (class Output_data_group): Update constructor
11621 declaration. Rename input_sections_ to input_shndxes_.
11622 * testsuite/many_sections_test.cc: Add template.
11623
e94cf127
CC
116242008-04-30 Cary Coutant <ccoutant@google.com>
11625
4418b2d5
CC
11626 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11627
e94cf127
CC
11628 * layout.cc (Layout::include_section): Refactored check for debug
11629 info section.
11630 (Layout::add_comdat): Add new parameters. Change type
11631 of signature parameter. Add object and shndx to signatures table.
11632 (Layout::find_kept_object): New function.
11633 * layout.h: Include <cstring>.
11634 (Layout::is_debug_info_section): New function.
11635 (Layout::add_comdat): Add new parameters.
11636 (Layout::find_kept_object): New function.
11637 (Layout::Kept_section): New struct.
11638 (Layout::Signatures): Change type of map range.
11639 * object.cc (Relobj::output_section_address): New function.
11640 (Sized_relobj::include_section_group): Add new parameters. Change
11641 calls to Layout::add_comdat. Change to build table of kept comdat
11642 groups and table mapping discarded sections to kept sections.
11643 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11644 (Sized_relobj::do_layout): Change calls to include_section_group and
11645 include_linkonce_section.
11646 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11647 value to zero when section is discarded.
11648 (Sized_relobj::map_to_kept_section): New function.
11649 * object.h (Relobj::output_section_address): New function.
11650 (Relobj::Comdat_group): New type.
11651 (Relobj::find_comdat_group): New function.
11652 (Relobj::Comdat_group_table): New type.
11653 (Relobj::Kept_comdat_section): New type.
11654 (Relobj::Kept_comdat_section_table): New type.
11655 (Relobj::add_comdat_group): New function.
11656 (Relobj::set_kept_comdat_section): New function.
11657 (Relobj::get_kept_comdat_section): New function.
11658 (Relobj::comdat_groups_): New field.
11659 (Relobj::kept_comdat_sections_): New field.
11660 (Symbol_value::input_value): Update comment.
11661 (Sized_relobj::map_to_kept_section) New function.
11662 (Sized_relobj::include_linkonce_section): Add new parameter.
11663 * target-reloc.h (Comdat_behavior): New type.
11664 (get_comdat_behavior): New function.
11665 (relocate_section): Add code to map a discarded section to the
11666 corresponding kept section when applying a relocation.
11667
e4e5049b
CS
116682008-04-30 Craig Silverstein <csilvers@google.com>
11669
11670 * dwarf_reader.cc (next_generation_count): New static var.
11671 (Addr2line_cache_entry): New struct.
11672 (addr2line_cache): New static var.
11673 (Dwarf_line_info::one_addr2line): Added caching.
11674 (Dwarf_line_info::clear_addr2line_cache): New function.
11675 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11676 cache-size parameter.
11677 (Dwarf_line_info::one_addr2line_cache): New function.
11678 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11679 new cache-size argument to one_addr2line(), and clear cache.
11680
d09e9154
CC
116812008-04-28 Cary Coutant <ccoutant@google.com>
11682
11683 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11684 R_386_PC8 relocations.
11685
7ef73768
ILT
116862008-04-23 Ian Lance Taylor <iant@google.com>
11687
55438702
ILT
11688 * object.cc (Sized_relobj::include_section_group): Check for
11689 invalid section group.
11690
c165fb93
ILT
11691 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11692 header size.
11693
7ef73768
ILT
11694 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11695 than read for file header.
11696 * archive.cc (Archive::include_member): Likewise.
11697
6194aaab
L
116982008-04-23 Paolo Bonzini <bonzini@gnu.org>
11699
11700 * aclocal.m4: Regenerate.
11701 * configure: Regenerate.
11702
d491d34e
ILT
117032008-04-19 Ian Lance Taylor <iant@google.com>
11704
5ea2bac6
ILT
11705 * version.cc (version_string): Bump to 1.6.
11706
7bc3e21a
ILT
11707 * testsuite/Makefile.am (many_sections_r_test): New target.
11708 (many_sections_r_test_SOURCES): Remove.
11709 (many_sections_r_test_DEPENDENCIES): Remove.
11710 (many_sections_r_test_LDFLAGS): Remove.
11711 (many_sections_r_test_LDADD): Remove.
11712
7fcd3aa9
ILT
11713 * object.cc (Sized_relobj::do_add_symbols): Always pass
11714 local_symbol_count_ to add_from_relobj.
11715
4c94d6ae
ILT
11716 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11717 every thousand variables.
11718 * testsuite/Makefile.in: Rebuild.
11719
d491d34e
ILT
11720 * object.cc (Xindex::initialize_symtab_xindex): New function.
11721 (Xindex::read_symtab_xindex): New function.
11722 (Xindex::sym_xindex_to_shndx): New function.
11723 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11724 available.
11725 (Sized_relobj::do_initialize_xindex): New function.
11726 (Sized_relobj::do_read_symbols): Adjust section links.
11727 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11728 parameter. Change all callers.
11729 (Sized_relobj::include_section_group): Adjust section links and
11730 symbol section indexes.
11731 (Sized_relobj::do_layout): Adjust section links.
11732 (Sized_relobj::do_count_local_symbols): Adjust section links and
11733 symbol section indexes.
11734 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11735 ordinary and special symbols.
11736 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11737 dynsym_xindex parameters. Change all callers. Adjust section
11738 links. Use SHN_XINDEX when needed.
11739 (Sized_relobj::get_symbol_location_info): Adjust section links.
11740 Don't get fooled by special symbols.
11741 * object.h (class Xindex): Define.
11742 (class Object): Add xindex_ parameter. Declare virtual functoin
11743 do_initialize_xindex.
11744 (Object::adjust_sym_shndx): New function.
11745 (Object::set_xindex): New protected function.
11746 (class Symbol_value): Add is_ordinary_shndx_ field.
11747 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11748 (Symbol_value::value): Assert ordinary section.
11749 (Symbol_value::initialize_input_to_output_map): Likewise.
11750 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11751 Change all callers.
11752 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11753 all callers.
11754 (class Sized_relobj): Update declarations.
11755 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11756 parameter. Change all callers.
11757 (Sized_relobj::adjust_shndx): New function.
11758 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11759 field.
11760 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11761 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11762 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11763 (Sized_dynobj::read_dynsym_section): Adjust section links.
11764 (Sized_dynobj::read_dynamic): Likewise.
11765 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11766 section links.
11767 (Sized_dynobj::do_initialize_xindex): New function.
11768 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11769 do_initialize_xindex.
11770 (Sized_dynobj::adjust_shndx): New function.
11771 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11772 dynsym_xindex_ fields.
11773 (Layout::finalize): Add a call to set_section_indexes before
11774 creating the symtab sections.
11775 (Layout::set_section_indexes): Don't do anything if the section
11776 already has a section index.
11777 (Layout::create_symtab_sections): Add shnum parameter. Change
11778 caller. Create .symtab_shndx section if needed.
11779 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11780 caller.
11781 (Layout::allocated_output_section_count): New function.
11782 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11783 needed.
11784 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11785 fields. Update declarations.
11786 (Layout::symtab_xindex): New function.
11787 (Layout::dynsym_xindex): New function.
11788 (class Write_symbols_task): Add layout_ field.
11789 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11790 Change caller.
11791 * output.cc (Output_section_headers::Output_section_headers): Add
11792 shstrtab_section parameter. Change all callers.
11793 (Output_section_headers::do_sized_write): Store overflow values
11794 for section count and section string table section index in
11795 section header zero.
11796 (Output_file_header::do_sized_write): Check for overflow of
11797 section count and section string table section index.
11798 (Output_symtab_xindex::do_write): New function.
11799 (Output_symtab_xindex::endian_do_write): New function.
11800 * output.h (class Output_section_headers): Add shstrtab_section_.
11801 Update declarations.
11802 (class Output_symtab_xindex): Define.
11803 (Output_section::has_out_shndx): New function.
11804 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11805 field.
11806 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11807 Change all callers.
11808 (Sized_symbol::init): Likewise.
11809 (Symbol::output_section): Check for ordinary symbol.
11810 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11811 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11812 callers.
11813 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11814 Change all callers. Simplify handling of symbols from sections
11815 not included in the link.
11816 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11817 distinction.
11818 (Weak_alias_sorter::operator()): Assert that symbols are
11819 ordinary.
11820 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11821 distinction.
11822 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11823 parameters. Change all callers.
11824 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11825 symbol distinction. Use SHN_XINDEX when needed.
11826 (Symbol_table::write_section_symbol): Add symtab_xindex
11827 parameter. Change all callers.
11828 (Symbol_table::sized_write_section_symbol): Likewise. Use
11829 SHN_XINDEX when needed.
11830 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11831 declarations.
11832 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11833 (Symbol::is_defined): Check is_ordinary.
11834 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11835 (Symbol::is_absolute, Symbol::is_common): Likewise.
11836 (class Sized_symbol): Update declarations.
11837 (class Symbol_table): Update declarations.
11838 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11839 parameters. Change all callers.
11840 (Sized_symbol::override): Likewise.
11841 (Symbol_table::override): Likewise.
11842 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11843 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11844 is_ordinary, and orig_st_shndx parameters. Change all callers.
11845 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11846 to be in an ordinary section.
11847 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11848 object and is_ordinary parameters. Change all callers.
11849 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11850 Change all callers. Don't add undefined or non-ordinary symbols
11851 to reloc_map_.
11852 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11853 Change all callers.
11854 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11855 declarations.
11856 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11857 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11858 (Sized_relobj::relocate_sections): Likewise.
11859 * target-reloc.h (scan_relocs): Adjust section symbol index.
11860 (scan_relocatable_relocs): Likewise.
11861 * i386.cc (Scan::local): Check for ordinary symbols.
11862 * sparc.cc (Scan::local): Likewise.
11863 * x86_64.cc (Scan::local): Likewise.
11864 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11865 to symbol_section_and_value.
11866 * testsuite/many_sections_test.cc: New file.
11867 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11868 (check_PROGRAMS): Add many_sections_test.
11869 (many_sections_test_SOURCES): Define.
11870 (many_sections_test_DEPENDENCIES): Define.
11871 (many_sections_test_LDFLAGS): Define.
11872 (BUILT_SOURCES): Add many_sections_define.h.
11873 (many_sections_define.h): New target.
11874 (BUILT_SOURCES): Add many_sections_check.h.
11875 (many_sections_check.h): New target.
11876 (check_PROGRAMS): Add many_sections_r_test.
11877 (many_sections_r_test_SOURCES): Define.
11878 (many_sections_r_test_DEPENDENCIES): Define.
11879 (many_sections_r_test_LDFLAGS): Define.
11880 (many_sections_r_test_LDADD): Define.
11881 (many_sections_r_test.o): New target.
11882 * testsuite/Makefile.in: Rebuild.
11883
c5818ff1
CC
118842008-04-17 Cary Coutant <ccoutant@google.com>
11885
11886 * errors.cc (Errors::info): New function.
11887 (gold_info): New function.
11888 * errors.h (Errors::info): New function.
11889 * gold.h (gold_info): New function.
11890 * object.cc (Input_objects::add_object): Print trace output.
11891 * options.cc (options::parse_set): New function.
11892 (General_options::parse_wrap): Deleted.
11893 (General_options::General_options): Deleted initializer.
11894 * options.h (options::String_set): New typedef.
11895 (options::parse_set): New function.
11896 (DEFINE_set): New macro.
11897 (General_options::wrap): Changed to use DEFINE_set. Changed
11898 callers of any_wrap_symbols and is_wrap_symbol.
11899 (General_options::trace, General_options::trace_symbol):
11900 New options.
11901 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11902 (General_options::wrap_symbols_): Deleted.
11903 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11904
b5be4a7c
DM
119052008-04-17 David S. Miller <davem@davemloft.net>
11906
11907 * options.cc (General_options::parse_V): New function.
11908 * options.h: Add entries for -V and -Qy.
11909
155a0dd7
ILT
119102008-04-17 Ian Lance Taylor <iant@google.com>
11911
11912 * common.cc (Symbol_table::allocate_commons): Remove options
11913 parameter. Change caller.
11914 (Symbol_table::do_allocate_commons): Remove options parameter.
11915 Change caller. Just call do_allocate_commons_list twice.
11916 (Symbol_table::do_allocate_commons_list): New function, broken out
11917 of do_allocate_commons.
11918 * common.h (class Allocate_commons_task): Remove options_ field.
11919 Update constructor.
11920 * symtab.cc (Symbol_table::Symbol_table): Initialize
11921 tls_commons_.
11922 (Symbol_table::add_from_object): Put TLS common symbols on
11923 tls_commons_ list.
11924 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11925 which are IN_OUTPUT_DATA.
11926 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11927 allocate_commons and do_allocate_commons declarations. Declare
11928 do_allocate_commons_list.
11929 * gold.cc (queue_middle_tasks): Update creation of
11930 Allocate_commons_task to not pass options.
11931 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11932 (TLS_TEST_C_FLAGS): New variable.
11933 (tls_test_c_pic.o): New target.
11934 (tls_test_shared.so): Link in tls_test_c_pic.o.
11935 (tls_test_c_pic_ie.o): New target.
11936 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11937 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11938 (tls_test_c.o): New target.
11939 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11940 (tls_pic_test_LDADD): Likewise.
11941 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11942 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11943 (tls_test_c_gnu2.o): New target.
11944 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11945 tls_test_c_gnu2.o.
11946 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11947 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11948 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11949 * testsuite/tls_test.cc: Include "config.h".
11950 (t_last): Call t11_last.
11951 * testsuite/tls_test.h (t11, t11_last): Declare.
11952 * testsuite/tls_test_c.c: New file.
11953 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11954 * configure.ac: Check for OpenMP support.
11955 * configure, config.in, Makefile.in: Rebuild.
11956 * testsuite/Makefile.in: Rebuild.
11957
edfbb029
CC
119582008-04-16 Cary Coutant <ccoutant@google.com>
11959
11960 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11961 (Target_i386::tls_base_symbol_defined_): New field.
11962 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11963 (Target_i386::Scan::global): Likewise.
11964 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11965 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11966 (Target_x86_64::tls_base_symbol_defined_): New field.
11967 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11968 (Target_x86_64::Scan::global): Likewise.
11969
f3c69fca
CC
119702008-04-16 Cary Coutant <ccoutant@google.com>
11971
11972 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11973 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11974 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11975 building shared libraries.
11976 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11977 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11978 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11979 * testsuite/Makefile.in: Rebuild.
11980 * testsuite/weak_undef.h: New file.
11981 * testsuite/weak_undef_file1.cc: Add extra test cases.
11982 * testsuite/weak_undef_file2.cc: Likewise.
11983 * testsuite/weak_undef_test.cc: Likewise.
11984
7c414435
DM
119852008-04-16 David S. Miller <davem@davemloft.net>
11986
32b769e1
DM
11987 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11988 Add issued_non_pic_error_ field. Declare check_non_pic.
11989 (Target_sparc::Scan::check_non_pic): New function.
11990 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11991 (Target_sparc::Scan::global): Likewise.
11992
11936fb1
DM
11993 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11994 * configure: Rebuild.
11995
7c414435
DM
11996 * options.h (DEFINE_enable): New macro.
11997 (new_dtags): New enable option.
11998 (initfirst, interpose, loadfltr, nodefaultlib,
11999 nodelete, nodlopen, nodump): New -z options.
12000 * layout.cc (Layout:finish_dynamic_section): If new
12001 dtags enabled, emit DT_RUNPATH. Also, emit a
12002 DT_FLAGS_1 containing any specified -z flags.
12003
85c7bf8b
ILT
120042008-04-16 Ian Lance Taylor <iant@google.com>
12005
12c0daef
ILT
12006 * copy-relocs.cc: New file.
12007 * copy-relocs.h: New file.
12008 * reloc.cc: Remove Copy_relocs code.
12009 * reloc.h: Likewise.
12010 * reloc-types.h (struct Reloc_types) [both versions]: Add
12011 get_reloc_addend_noerror.
12012 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12013 variants of add_global which take an addend which must be zero.
12014 * i386.cc: Include "copy-relocs.h".
12015 (class Target_i386): Change type of copy_relocs_ to variable,
12016 update initializer.
12017 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12018 Change all callers.
12019 (Target_i386::do_finalize_sections): Change handling of
12020 copy_relocs_.
12021 * sparc.cc: Include "copy-relocs.h".
12022 (class Target_sparc): Change type of copy_relocs_ to variable,
12023 update initializer.
12024 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12025 Change all callers.
12026 (Target_sparc::do_finalize_sections): Change handling of
12027 copy_relocs_.
12028 * x86_64.cc: Include "copy-relocs.h".
12029 (class Target_x86_64): Change type of copy_relocs_ to variable,
12030 update initializer.
12031 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12032 class. Change all callers.
12033 (Target_x86_64::do_finalize_sections): Change handling of
12034 copy_relocs_.
12035 * Makefile.am (CCFILES): Add copy-relocs.cc.
12036 (HFILES): Add copy-relocs.h.
12037
4f4995b6
ILT
12038 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12039
85c7bf8b
ILT
12040 * testsuite/script_test_4.sh: Permit leading zeroes.
12041
4f2a9edd
ILT
120422008-04-15 Ian Lance Taylor <iant@google.com>
12043
e6188289
ILT
12044 * script-sections.cc (Script_sections::create_segments): Use
12045 header_size_adjustment even when there is enough room for the
12046 headers.
12047 * testsuite/script_test_4.sh: New file.
12048 * testsuite/script_test_4.t: New file.
12049 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12050 (check_DATA): Add script_test_4.stdout.
12051 (MOSTLYCLEANFILES): Likewise.
12052 (script_test_4): New target.
12053 (script_test_4.stdout): New target.
12054 * testsuite/Makefile.in: Rebuild.
12055
4f2a9edd
ILT
12056 * sparc.cc: Add definitions for Output_data_plt_sparc class
12057 constants.
12058
f5314dd5
DM
120592008-04-14 David S. Miller <davem@davemloft.net>
12060
12061 * sparc.cc: New file.
12062 * Makefile.am (TARGETSOURCES): Add sparc.cc
12063 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12064 * configure.tgt: Document targ_extra_size and
12065 targ_extra_big_endian. Add entries for sparc-* and
12066 sparc64-*.
12067 * configure.ac: Handle targ_extra_size and
12068 targ_extra_big_endian.
12069 * Makefile.in: Rebuild.
12070 * configure: Likewise.
12071 * po/POTFILES.in: Likewise.
12072 * po/gold.pot: Likewise.
12073
154e0e9a
ILT
120742008-04-14 Ian Lance Taylor <iant@google.com>
12075
12076 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12077 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12078 in the name/type/flags to section mapping. Don't call
12079 allocate_output_section.
12080 (Layout::choose_output_section): Change parameter from adjust_name
12081 to is_input_section. Don't permit input sections after sections
12082 are attached to segments. Don't call allocate_output_section.
12083 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12084 not write_enable_output_section.
12085 (Layout::make_output_section): Don't push to
12086 unattached_section_list_ nor call attach_to_segment. Call
12087 attach_section_to_segment if sections are attached.
12088 (Layout::attach_sections_to_segments): New function.
12089 (Layout::attach_section_to_segment): New function.
12090 (Layout::attach_allocated_section_to_segment): Rename from
12091 attach_to_segment. Remove flags parameter.
12092 (Layout::allocate_output_section): Remove function.
12093 (Layout::write_enable_output_section): Remove function.
12094 * layout.h (class Layout): Update for above changes. Add new
12095 field sections_are_attached_.
12096 * output.h (Output_section::update_flags_for_input_section): New
12097 function.
12098 * output.cc (Output_section::add_input_section): Call
12099 update_flags_for_input_section.
12100 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12101
009a67a2
CC
121022008-04-11 Cary Coutant <ccoutant@google.com>
12103
12104 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12105 thought unnecessary.
12106 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12107
759b1a24
ILT
121082008-04-11 Ian Lance Taylor <iant@google.com>
12109
12110 * output.h (class Output_section_data): Remove inline definition
12111 of set_addralign.
12112 * output.cc (Output_section_data::set_addralign): New function.
12113
c2b45e22
CC
121142008-04-11 Cary Coutant <ccoutant@google.com>
12115
12116 Add support for TLS descriptors for i386 and x86_64.
12117 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12118 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12119 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12120 GOT_TYPE_TLS_DESC.
12121 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12122 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12123 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12124 relocations.
12125 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12126 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12127 Fix problem with initial-exec relocations.
12128 (Target_i386::Relocate::relocate_tls): Likewise.
12129 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12130 relaxation.
12131 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12132 support for section-plus-offset dynamic table entries.
12133 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12134 (Output_data_dynamic::Dynamic_entry): Add support for
12135 section-plus-offset dynamic table entries.
12136 (Output_data_dynamic::Classification): Likewise.
12137 (Output_data_dynamic::classification_): Renamed offset_.
12138 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12139 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12140 (Target_x86_64::make_plt_section): New function.
12141 (Target_x86_64::reserve_tlsdesc_entries): New function.
12142 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12143 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12144 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12145 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12146 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12147 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12148 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12149 add extra PLT entry for TLS descriptors.
12150 (Output_data_plt_x86_64::got_): New field.
12151 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12152 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12153 fields.
12154 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12155 descriptors.
12156 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12157 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12158 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12159 R_386_TLS_DESC_CALL relocations.
12160 (Target_x86_64::Scan::global): Likewise.
12161 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12162 for TLS descriptors.
12163 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12164 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12165 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12166 GD-to-IE relaxation.
12167 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12168 and TLS_DESCRIPTORS.
12169 * Makefile.in: Rebuild.
12170 * configure: Rebuild.
12171 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12172 (tls_test_shared2.so): New target.
12173 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12174 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12175 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12176 (tls_shared_gd_to_ie_test_LDADD): New variable.
12177 (tls_shared_gnu2_gd_to_ie_test): New target.
12178 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12179 New targets.
12180 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12181 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12182 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12183 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12184 (tls_shared_gnu2_test): New target.
12185 (tls_test_gnu2_shared.so): New target.
12186 (tls_shared_gnu2_test_SOURCES): New variable.
12187 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12188 (tls_shared_gnu2_test_LDFLAGS): New variable.
12189 (tls_shared_gnu2_test_LDADD): New variable.
12190 * testsuite/Makefile.in: Rebuild.
12191 * testsuite/Makefile.
12192
83bfb6b7
ILT
121932008-04-11 Ian Lance Taylor <iant@google.com>
12194
12195 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12196 justsyms.t.
12197 * testsuite/Makefile.in: Rebuild.
12198
12199 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12200 long.
12201 * testsuite/script_test_2.cc (main): Adjust test.
12202
706e1f5e
ILT
122032008-04-11 David S. Miller <davem@davemloft.net>
12204 Ian Lance Taylor <iant@google.com>
12205
12206 * options.h (General_options): Add entries for '-Y' and
12207 '-relax'.
12208 * options.cc (General_options:finalize): If -Y was used, add those
12209 entries to the library path instead of the default "/lib" and
12210 "/usr/lib".
12211
7c98e6bb
DM
122122008-04-11 David S. Miller <davem@davemloft.net>
12213
12214 * testsuite/justsyms.t: Start at 0x100.
12215 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12216 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12217 long.
12218 * testsuite/script_test_2.cc: Adjust string and section length
12219 checks.
7c98e6bb 12220
99a37bfd
ILT
122212008-04-09 Ian Lance Taylor <iant@google.com>
12222
2cefc357
ILT
12223 PR gold/5996
12224 * script-sections.cc (Sections_element::allocate_to_segment): Add
12225 orphan parameter.
12226 (Output_section_definition::allocate_to_segment): Likewise.
12227 (Orphan_output_section::allocate_to_segment): Likewise.
12228 (Script_sections::attach_sections_using_phdrs_clause): Don't
12229 propagate non-PT_LOAD segments to orphan sections.
12230 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12231 readelf rather than objdump.
12232 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12233 .interp section and PT_INTERP segment are the same size.
12234 * testsuite/Makefile.in: Rebuild.
12235
99a37bfd
ILT
12236 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12237 aliases for symbols defined in the same object.
12238 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12239 (weak_alias_test_SOURCES): New variable.
12240 (weak_alias_test_DEPENDENCIES): New variable.
12241 (weak_alias_test_LDFLAGS): New variable.
12242 (weak_alias_test_LDADD): New variable.
12243 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12244 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12245 (weak_alias_test_3.o): New target.
12246 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12247 * testsuite/weak_alias_test_main.cc: New file.
12248 * testsuite/weak_alias_test_1.cc: New file.
12249 * testsuite/weak_alias_test_2.cc: New file.
12250 * testsuite/weak_alias_test_3.cc: New file.
12251
780e49c5
ILT
122522008-04-08 Ian Lance Taylor <iant@google.com>
12253
cdb0b8f5
ILT
12254 * options.h (class General_options): Add --noinhibit-exec option.
12255 * main.cc (main): Check --noinhibit-exec.
12256
0864d551
ILT
12257 * options.h (class General_options): Define --wrap as a special
12258 option. Add wrap_symbols_ field.
12259 (General_options::any_wrap_symbols): New function.
12260 (General_options::is_wrap_symbol): New function.
12261 * options.cc (General_options::parse_wrap): New function.
12262 (General_options::General_options): Initialize wrap_symbols_.
12263 * symtab.cc (Symbol_table::wrap_symbol): New function.
12264 (Symbol_table::add_from_object): Handle --wrap.
12265 * symtab.h (class Symbol_table): Declare wrap_symbol.
12266 * target.h (Target::wrap_char): New function.
12267 (Target::Target_info): Add wrap_char field.
12268 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12269 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12270 * testsuite/testfile.cc (Target_test::test_target_info):
12271 Likewise.
12272
789aa6de
ILT
12273 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12274 there is one.
12275
2c38906f
ILT
12276 * layout.h (class Layout): Add added_eh_frame_data_ field.
12277 * layout.cc (Layout::Layout): Initialize new field.
12278 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12279 output section until we find a section we merged successfully.
12280 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12281 that the size be non-zero.
12282
780e49c5
ILT
12283 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12284 qualifier.
12285
7fcd0256
ILT
122862008-04-08 Craig Silverstein <csilvers@google.com>
12287
12288 * configure.ac: Export new conditional variable HAVE_ZLIB.
12289 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12290 on HAVE_ZLIB.
12291 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12292 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12293
6835af53
ILT
122942008-04-07 Ian Lance Taylor <iant@google.com>
12295
e24f324c
ILT
12296 * version.cc (version_string): Set to "1.5".
12297
a036edd8
ILT
12298 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12299 Add issued_non_pic_error_ field. Declare check_non_pic.
12300 (Target_x86_64::Scan::check_non_pic): New function.
12301 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12302 (Target_x86_64::Scan::global): Likewise.
12303
624f8810
ILT
12304 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12305 addend parameter. Change caller. Handle merge sections.
12306 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12307 Address to Addend. Don't add in the result of
12308 local_section_offset, pass down the addend and use the returned
12309 value.
12310 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12311 Update declarations of local_section_offset and symbol_value.
12312 * testsuite/two_file_test_1.cc (t18): New function.
12313 * testsuite/two_file_test_2.cc (f18): New function.
12314 * testsuite/two_file_test_main.cc (main): Call t18.
12315 * testsuite/two_file_test.h (t18, f18): Declare.
12316
6835af53
ILT
12317 * configure.ac: Don't test for objdump, c++filt, or readelf.
12318 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12319 conditionals.
12320 (TEST_READELF): New variable.
12321 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12322 (check_PROGRAMS): Add two_file_strip_test.
12323 (two_file_strip_test): New target.
12324 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12325 (two_file_same_shared_strip_test_SOURCES): New variable.
12326 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12327 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12328 (two_file_same_shared_strip_test_LDADD): New variable.
12329 (two_file_shared_strip.so): New target.
12330 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12331 (ver_test_5.syms, ver_test_7.syms): Likewise.
12332 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12333 (strip_test_3.stdout): Use TEST_OBJDUMP.
12334 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12335
86925eef
CC
123362008-04-04 Cary Coutant <ccoutant@google.com>
12337
12338 * symtab.h (Symbol::is_weak_undefined): New function.
12339 (Symbol::is_strong_undefined): New function.
12340 (Symbol::is_absolute): New function.
12341 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12342 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12343 absolute symbols.
12344 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12345 (weak_undef_test): New target.
12346 * testsuite/Makefile.in: Rebuild.
12347 * testsuite/weak_undef_file1.cc: New file.
12348 * testsuite/weak_undef_file2.cc: New file.
12349 * testsuite/weak_undef_test.cc: New file.
12350
126f3ece
ILT
123512008-04-03 Craig Silverstein <csilvers@google.com>
12352
12353 * compressed_output.h (class Output_compressed_section): Use
12354 unsigned buffer.
12355 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12356 add zlib header.
12357 (zlib_compressed_suffix): Removed.
12358 (Output_compressed_section::set_final_data_size): Use unsigned
12359 buffers.
12360 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12361 Fix linker invocation.
12362 (flagstest_o_specialfile_and_compress_debug_sections):
12363 Likewise.
12364 * testsuite/Makefile.in: Regenerated.
12365
deae2a14
DM
123662008-04-02 David S. Miller <davem@davemloft.net>
12367
12368 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12369 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12370
70752818
ILT
123712008-04-02 Craig Silverstein <csilvers@google.com>
12372
12373 * TODO: New file.
12374
39d0cb0e
ILT
123752008-04-02 Ian Lance Taylor <iant@google.com>
12376
12377 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12378 parameters. Update for new key type to views_. Change all
12379 callers.
12380 (File_read::read): Adjust for byteshift in returned view.
12381 (File_read::add_view): New function, broken out of
12382 find_and_make_view.
12383 (File_read::make_view): New function, broken out of
12384 find_and_make_view.
12385 (File_read::find_or_make_view): Add offset and aligned
12386 parameters. Rewrite accordingly. Change all callers.
12387 (File_read::get_view): Add offset and aligned parameters. Adjust
12388 for byteshift in return value.
12389 (File_read::get_lasting_view): Likewise.
12390 * fileread.h (class File_read): Update declarations.
12391 (class File_read::View): Add byteshift_ field. Add byteshift to
12392 constructor. Add byteshift method.
12393 * archive.h (Archive::clear_uncached_views): New function.
12394 (Archive::get_view): Add aligned parameter. Change all callers.
12395 * object.h (Object::get_view): Add aligned parameter. Change all
12396 callers.
12397 (Object::get_lasting_view): Likewise.
12398
12399 * fileread.cc (File_read::release): Don't call clear_views if
12400 there are multiple objects.
12401 * fileread.h (File_read::clear_uncached_views): New function.
12402 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12403 on the archive.
12404
a1207466
CC
124052008-03-31 Cary Coutant <ccoutant@google.com>
12406
12407 Add thin archive support.
12408 * archive.cc (Archive::armagt): New const.
12409 (Archive::setup): Remove task parameter and calls to unlock.
12410 (Archive::unlock_nested_archives): New function.
12411 (Archive::read_header): Add nested_off parameter. Change
12412 all callers.
12413 (Archive::interpret_header): Likewise.
12414 (Archive::include_all_members): Change to handle thin
12415 archives.
12416 (Archive::include_member): Likewise.
12417 * archive.h (Archive::Archive): Add new parameters and
12418 initializers.
12419 (Archive::armagt): New const.
12420 (Archive::setup): Remove task parameter.
12421 (Archive::unlock_nested_archives): New function.
12422 (Archive::read_header): Add nested_off parameter.
12423 (Archive::interpret_header): Likewise.
12424 (Archive::Nested_archive_table): New typedef.
12425 (Archive::is_thin_archive_): New field.
12426 (Archive::nested_archives_): New field.
12427 (Archive::options_): New field.
12428 (Archive::dirpath_): New field.
12429 (Archive::task_): New field.
12430 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12431 for thin archives. Pass additional parameters to
12432 Archive::Archive. Unlock the archive file after calling
12433 Archive::setup.
cd536b21 12434
479f6503
ILT
124352008-03-29 Ian Lance Taylor <iant@google.com>
12436
686c8caf
ILT
12437 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12438 version symbol to be local.
12439 * testsuite/ver_test_4.sh: New file.
12440 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12441 (check_DATA): Add ver_test_4.syms.
12442 (ver_test_4.syms): New target.
12443 * testsuite/Makefile.in: Rebuild.
12444
ab794b6b
ILT
12445 * output.cc
12446 (Output_section::Input_section_sort_entry::has_priority): New
12447 function.
12448 (Output_section::Input_section_sort_entry::match_file_name): New
12449 function.
12450 (Output_section::Input_section_sort_entry::match_section_name):
12451 Remove.
12452 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12453 Remove.
12454 (Output_section::Input_section_sort_entry::match_section_file):
12455 Remove.
12456 (Output_section::Input_section_sort_compare::operator()): Rewrite
12457 using new Input_section_sort_entry functions. Sort crtbegin and
12458 crtend first. Sort sections with no priority before sections with
12459 a priority.
12460 * testsuite/initpri1.c (d3): Check j != 4.
12461 (cd5): New constructor/destructor function.
12462 (main): Check j != 2.
12463
479f6503
ILT
12464 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12465 new symbol when resolving, don't call set_is_default.
12466 * testsuite/ver_test_7.cc: New file.
12467 * testsuite/ver_test_7.sh: New file.
12468 * testsuite/Makefile.am (ver_test_7.so): New target.
12469 (ver_test_7.o): New target.
12470 (check_SCRIPTS): Add ver_test_7.sh.
12471 (check_DATA): Add ver_test_7.syms.
12472 (ver_test_7.syms): New target.
12473
2fd32231
ILT
124742008-03-28 Ian Lance Taylor <iant@google.com>
12475
12476 * layout.cc (Layout::layout): If we see an input section with a
12477 name that needs sorting, set the must_sort flag for the output
12478 section.
12479 (Layout::make_output_section): If the name of the output section
12480 indicates that it might require sorting, set the may_sort flag.
12481 * output.h (Output_section::may_sort_attached_input_sections): New
12482 function.
12483 (Output_section::set_may_sort_attached_input_sections): New
12484 function.
12485 (Output_section::must_sort_attached_input_sections): New
12486 function.
12487 (Output_section::set_must_sort_attached_input_sections): New
12488 function.
12489 (class Output_section): Declare Input_section_sort_entry. Define
12490 Input_section_sort_compare. Declare
12491 sort_attached_input_sections. Add new fields:
12492 may_sort_attached_input_sections_,
12493 must_sort_attached_input_sections_,
12494 attached_input_sections_are_sorted_.
12495 * output.cc (Output_section::Output_section): Initialize new
12496 fields.
12497 (Output_section::add_input_section): Add an entry to
12498 input_sections_ if may_sort or must_sort are true.
12499 (Output_section::set_final_data_size): Call
12500 sort_attached_input_sections if necessary.
12501 (Output_section::Input_section_sort_entry): Define new class.
12502 (Output_section::Input_section_sort_compare::operator()): New
12503 function.
12504 (Output_section::sort_attached_input_sections): New function.
12505 * configure.ac: Check whether the compiler supports constructor
12506 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12507 * testsuite/initpri1.c: New file.
12508 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12509 CONSTRUCTOR_PRIORITY.
12510 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12511 (initpri1_LDFLAGS): New variable.
12512 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12513
18e6b24e
ILT
125142008-03-27 Ian Lance Taylor <iant@google.com>
12515
49bdd526
ILT
12516 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12517 * testsuite/common_test_1.c: New file.
12518 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12519 (common_test_1_SOURCES): New variable.
12520 (common_test_1_DEPENDENCIES): New variable.
12521 (common_test_1_LDFLAGS): New variable.
12522
18e6b24e
ILT
12523 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12524 and commons_ correctly when NAME/VERSION does not override
12525 NAME/NULL.
12526 * testsuite/ver_test_6.c: New file.
12527 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12528 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12529 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12530
04bf7072
ILT
125312008-03-26 Ian Lance Taylor <iant@google.com>
12532
5871526f
ILT
12533 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12534 of an undefined symbol from a version script.
12535 * testsuite/Makefile.am (ver_test_5.so): New target.
12536 (ver_test_5.o): New target.
12537 (check_SCRIPTS): Add ver_test_5.sh.
12538 (check_DATA): Add ver_test_5.syms.
12539 (ver_test_5.syms): New target.
12540 * testsuite/ver_test_5.cc: New file.
12541 * testsuite/ver_test_5.script: New file.
12542 * testsuite/ver_test_5.sh: New file.
12543 * Makefile.in, testsuite/Makefile.in: Rebuild.
12544
04bf7072
ILT
12545 PR gold/5986
12546 Fix problems building gold with gcc 4.3.0.
12547 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12548 (gold_error_at_location, gold_warning_at_location): Use it.
12549 * configure.ac: Check whether we can compile and use a template
12550 function with a printf attribute.
12551 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12552 when jumping over bytes.
12553 * object.cc: Instantiate Object::read_section_data.
12554 * debug.h: Include <cstring>
12555 * dwarf_reader.cc: Include <algorithm>
12556 * main.cc: Include <cstring>.
12557 * options.cc: Include <cstring>.
12558 * output.cc: Include <cstring>.
12559 * script.cc: Include <cstring>.
12560 * script.h: Include <string>.
12561 * symtab.cc: Include <cstring> and <algorithm>.
12562 * target-select.cc: Include <cstring>.
12563 * version.cc: Include <string>.
12564 * testsuite/testmain.cc: Include <cstdlib>.
12565 * configure, config.in: Rebuild.
12566
874c5b28
ILT
125672008-03-25 Ian Lance Taylor <iant@google.com>
12568
819d6c3a
ILT
12569 * options.cc: Include "../bfd/bfdver.h".
12570 (options::help): Print bug reporting address.
12571
f4b2c6f5
ILT
12572 * version.cc (print_version): Adjust output for current value of
12573 BFD_VERSION_STRING.
12574
12575 * NEWS: New file.
12576
e96caa79
ILT
12577 * options.cc (options::help): Print list of supported targets.
12578 * target-select.h: Include <vector>.
12579 (class Target_selector): Make machine_, size_, and is_big_endian_
12580 fields const. Add bfd_name_ and instantiated_target_ fields.
12581 (Target_selector::Target_selector): Add bfd_name parameter.
12582 (Target_selector::recognize): Make non-virtual, call
12583 do_recognize.
12584 (Target_selector::recognize_by_name): Make non-virtual, call
12585 do_recognize_by_name.
12586 (Target_selector::supported_names): New function.
12587 (Target_selector::bfd_name): New function.
12588 (Target_selector::do_instantiate_target): New pure virtual
12589 function.
12590 (Target_selector::do_recognize): New virtual function.
12591 (Target_selector::do_recognize_by_name): New virtual function.
12592 (Target_selector::instantiate_target): New private function.
12593 (supported_target_names): Declare.
12594 * target-select.cc (Target_selector::Target_selector): Update for
12595 new parameter and fields.
12596 (select_target_by_name): Check that the name matches before
12597 calling recognize_by_name.
12598 (supported_target_names): New function.
12599 * i386.cc (class Target_selector_i386): Update Target_selector
12600 constructor call. Remove recognize and recognize_by_name. Add
12601 do_instantiate_target.
12602 * x86_64.cc (class Target_selector_x86_64): Likewise.
12603 * testsuite/testfile.cc (class Target_selector_test): Update for
12604 changes to Target_selector.
12605
874c5b28
ILT
12606 * README: Rewrite, with some notes on unsupported features.
12607
0a65a3a7
CC
126082008-03-24 Cary Coutant <ccoutant@google.com>
12609
12610 * i386.cc (Target_i386::Got_type): New enum declaration.
12611 (Target_i386::Scan::local): Updated callers of Output_data_got
12612 member functions.
12613 (Target_i386::Scan::global): Likewise.
12614 (Target_i386::Relocate::relocate): Likewise.
12615 (Target_i386::Relocate::relocate_tls): Likewise.
12616 * object.h (Got_offset_list): New class.
12617 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12618 (Sized_relobj::local_got_offset): Likewise.
12619 (Sized_relobj::set_local_got_offset): Likewise.
12620 (Sized_relobj::local_has_tls_got_offset): Removed.
12621 (Sized_relobj::local_tls_got_offset): Removed.
12622 (Sized_relobj::set_local_tls_got_offset): Removed.
12623 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12624 * output.cc (Output_data_got::add_global): Added got_type parameter.
12625 (Output_data_got::add_global_with_rel): Likewise.
12626 (Output_data_got::add_global_with_rela): Likewise.
12627 (Output_data_got::add_global_pair_with_rel): New function.
12628 (Output_data_got::add_global_pair_with_rela): New function.
12629 (Output_data_got::add_local): Added got_type parameter.
12630 (Output_data_got::add_local_with_rel): Likewise.
12631 (Output_data_got::add_local_with_rela): Likewise.
12632 (Output_data_got::add_local_pair_with_rel): New function.
12633 (Output_data_got::add_local_pair_with_rela): New function.
12634 (Output_data_got::add_global_tls): Removed.
12635 (Output_data_got::add_global_tls_with_rel): Removed.
12636 (Output_data_got::add_global_tls_with_rela): Removed.
12637 (Output_data_got::add_local_tls): Removed.
12638 (Output_data_got::add_local_tls_with_rel): Removed.
12639 (Output_data_got::add_local_tls_with_rela): Removed.
12640 * output.h (Output_data_got::add_global): Added got_type parameter.
12641 (Output_data_got::add_global_with_rel): Likewise.
12642 (Output_data_got::add_global_with_rela): Likewise.
12643 (Output_data_got::add_global_pair_with_rel): New function.
12644 (Output_data_got::add_global_pair_with_rela): New function.
12645 (Output_data_got::add_local): Added got_type parameter.
12646 (Output_data_got::add_local_with_rel): Likewise.
12647 (Output_data_got::add_local_with_rela): Likewise.
12648 (Output_data_got::add_local_pair_with_rel): New function.
12649 (Output_data_got::add_local_pair_with_rela): New function.
12650 (Output_data_got::add_global_tls): Removed.
12651 (Output_data_got::add_global_tls_with_rel): Removed.
12652 (Output_data_got::add_global_tls_with_rela): Removed.
12653 (Output_data_got::add_local_tls): Removed.
12654 (Output_data_got::add_local_tls_with_rel): Removed.
12655 (Output_data_got::add_local_tls_with_rela): Removed.
12656 * resolve.cc (Symbol::override_base_with_special): Removed
12657 reference to has_got_offset_ field.
12658 * symtab.cc (Symbol::init_fields): Replaced initialization
12659 of got_offset_ with got_offsets_. Removed initialization
12660 of has_got_offset_
53fcba31 12661 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
12662 (Symbol::got_offset): Likewise.
12663 (Symbol::set_got_offset): Likewise.
12664 (Symbol::has_tls_got_offset): Removed.
12665 (Symbol::tls_got_offset): Removed.
12666 (Symbol::set_tls_got_offset): Removed.
12667 (Symbol::got_offset_): Removed.
12668 (Symbol::tls_mod_got_offset_): Removed.
12669 (Symbol::tls_pair_got_offset_): Removed.
12670 (Symbol::got_offsets_): New field.
12671 (Symbol::has_got_offset): Removed.
12672 (Symbol::has_tls_mod_got_offset): Removed.
12673 (Symbol::has_tls_pair_got_offset): Removed.
12674 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12675 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12676 member functions.
12677 (Target_x86_64::Scan::global): Likewise.
12678 (Target_x86_64::Relocate::relocate): Likewise.
12679 (Target_x86_64::Relocate::relocate_tls): Likewise.
12680
bd52eafb
BE
126812008-03-25 Ben Elliston <bje@au.ibm.com>
12682
12683 * yyscript.y: Fix spelling error in comment.
12684
8b105e34
ILT
126852008-03-24 Ian Lance Taylor <iant@google.com>
12686
8ed814a9
ILT
12687 * options.h (class General_options): Define build_id option.
12688 * layout.h (class Layout): Declare write_build_id, create_note,
12689 create_build_id. Add build_id_note_ member.
12690 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12691 "libiberty.h", "md5.h", "sha1.h".
12692 (Layout::Layout): Initialize eh_frame_data_,
12693 eh_frame_hdr_section_, and build_id_note_.
12694 (Layout::finalize): Call create_build_id.
12695 (Layout::create_note): New function, broken out of
12696 Layout::create_gold_note.
12697 (Layout::create_gold_note): Call create_note.
12698 (Layout::create_build_id): New function.
12699 (Layout::write_build_id): New function.
12700 (Close_task_runner::run): Call write_build_id.
12701
8b105e34
ILT
12702 * x86_64.cc: Correct license to GPLv3.
12703
086a1841
ILT
127042008-03-23 Ian Lance Taylor <iant@google.com>
12705
12706 * options.cc: Include "demangle.h".
12707 (parse_optional_string): New function.
12708 (parse_long_option): Handle takes_optional_argument.
12709 (parse_short_option): Update dash_z initializer. Handle
12710 takes_optional_argument.
12711 (General_options::General_options): Initialize do_demangle_.
12712 (General_options::finalize): Set do_demangle_. Handle demangling
12713 style.
12714 * options.h (parse_optional_string): Declare.
12715 (struct One_option): Add optional_arg field. Update constructor.
12716 Update call constructor calls. Add takes_optional_argument
12717 function.
12718 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12719 (DEFINE_optional_string): Define.
12720 (General_options::demangle): Change from DEFINE_bool to
12721 DEFINE_optional_string.
12722 (General_options::no_demangle): New function.
12723 (General_options::do_demangle): New function.
12724 (General_options::set_do_demangle): New function.
12725 (General_options::execstack_status_): Move definition to end of
12726 class definition.
12727 (General_options::static_): Likewise.
12728 (General_options::do_demangle_): New field.
12729 * object.cc (big_endian>::get_symbol_location_info): Call
12730 Options::do_demangle, not Options::demangle.
12731 * symtab.cc (demangle): Likewise.
12732
cbb93e63
ILT
127332008-03-22 Ian Lance Taylor <iant@google.com>
12734
12735 * gold.h: Include <cstddef> and <sys/types.h>
12736 * options.h: Include <cstring>.
12737
ec531623
ILT
127382008-03-21 Ian Lance Taylor <iant@google.com>
12739
12740 * Added source code to GNU binutils.
This page took 0.77649 seconds and 4 git commands to generate.