*** empty log message ***
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
2615994e
DM
12012-04-12 David S. Miller <davem@davemloft.net>
2
3 * sparc.cc (Reloc::wdisp10): New relocation method.
4 (Reloc::h34): Likewise.
5 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
6 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
7 R_SPARC_WDISP10.
8 (Target_sparc::Scan::local): Likewise.
9 (Target_sparc::Scan::global): Likewise.
10 (Target_sparc::Relocate::relocate): Likewise.
11
6782735d
CC
122012-04-09 Cary Coutant <ccoutant@google.com>
13
14 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
15 low_pc == 0.
16
8c7a0b00
ILT
172012-04-06 Ian Lance Taylor <iant@google.com>
18
19 * timer.cc: #include <unistd.h>.
20
58797674
RM
212012-04-06 Roland McGrath <mcgrathr@google.com>
22
23 * configure.in (AC_CHECK_HEADERS): Add locale.h.
24 * config.in: Regenerate.
25 * configure: Regenerate.
26
44350750
NC
272012-04-05 Nick Clifton <nickc@redhat.com>
28
29 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
30 (AM_LC_MESSAGES): Add.
31 * aclocal.m4: Regenerate.
32 * config.in: Regenerate.
33 * configure: Regenerate.
34
c1027032
CC
352012-03-21 Cary Coutant <ccoutant@google.com>
36
37 * Makefile.am: Add gdb-index.cc, gdb-index.h.
38 * Makefile.in: Regenerate.
39 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
40 (Sized_elf_reloc_mapper::symbol_section): New function.
41 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
42 (make_elf_reloc_mapper): New function.
43 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
44 (Dwarf_abbrev_table::do_read_abbrevs): New function.
45 (Dwarf_abbrev_table::do_get_abbrev): New function.
46 (Dwarf_ranges_table::read_ranges_table): New function.
47 (Dwarf_ranges_table::read_range_list): New function.
48 (Dwarf_pubnames_table::read_section): New function.
49 (Dwarf_pubnames_table::read_header): New function.
50 (Dwarf_pubnames_table::next_name): New function.
51 (Dwarf_die::Dwarf_die): New function.
52 (Dwarf_die::read_attributes): New function.
53 (Dwarf_die::skip_attributes): New function.
54 (Dwarf_die::set_name): New function.
55 (Dwarf_die::set_linkage_name): New function.
56 (Dwarf_die::attribute): New function.
57 (Dwarf_die::string_attribute): New function.
58 (Dwarf_die::int_attribute): New function.
59 (Dwarf_die::uint_attribute): New function.
60 (Dwarf_die::ref_attribute): New function.
61 (Dwarf_die::child_offset): New function.
62 (Dwarf_die::sibling_offset): New function.
63 (Dwarf_info_reader::check_buffer): New function.
64 (Dwarf_info_reader::parse): New function.
65 (Dwarf_info_reader::do_parse): New function.
66 (Dwarf_info_reader::do_read_string_table): New function.
67 (Dwarf_info_reader::lookup_reloc): New function.
68 (Dwarf_info_reader::get_string): New function.
69 (Dwarf_info_reader::visit_compilation_unit): New function.
70 (Dwarf_info_reader::visit_type_unit): New function.
71 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
72 Sized_elf_reloc_mapper.
73 (Sized_dwarf_line_info::symbol_section): Remove function.
74 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
75 (Sized_dwarf_line_info::read_line_mappings): Remove object
76 parameter, adjust callers.
77 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
78 * dwarf_reader.h: Include <sys/types.h>.
79 (class Track_relocs): Remove forward declaration.
80 (class Elf_reloc_mapper): New class.
81 (class Sized_elf_reloc_mapper): New class.
82 (class Dwarf_abbrev_table): New class.
83 (class Dwarf_range_list): New class.
84 (class Dwarf_ranges_table): New class.
85 (class Dwarf_pubnames_table): New class.
86 (class Dwarf_die): New class.
87 (class Dwarf_info_reader): New class.
88 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
89 (Sized_dwarf_line_info::symbol_section): Remove member function.
90 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
91 base class.
92 * gdb-index.cc: New source file.
93 * gdb-index.h: New source file.
94 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
95 and .debug_types sections, call Layout::add_to_gdb_index.
96 (Sized_relobj_incr::do_section_name): Implement.
97 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
98 return type; Implement.
99 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
100 return type.
101 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
102 parameter list and return type.
103 (Sized_incr_dynobj::do_section_contents): Likewise.
104 * layout.cc: Include gdb-index.h.
105 (Layout::Layout): Initialize gdb_index_data_.
106 (Layout::init_fixed_output_section): Check for .gdb_index section.
107 (Layout::add_to_gdb_index): New function. Instantiate.
108 * layout.h: Add forward declaration for class Gdb_index.
109 (Layout::add_to_gdb_index): New member function.
110 (Layout::gdb_index_data_): New data member.
111 * main.cc: Include gdb-index.h.
112 (main): Print statistics for gdb index.
113 * object.cc (Object::section_contents): Move code into
114 do_section_contents.
115 (need_decompressed_section): Check for sections needed when building
116 gdb index.
117 (build_compressed_section_map): Likewise.
118 (Sized_relobj_file::do_read_symbols): Need local symbols when building
119 gdb index.
120 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
121 sections; call Layout::add_to_gdb_index.
122 (Sized_relobj_file::do_decompressed_section_contents): Call
123 do_section_contents directly.
124 * object.h (Object::do_section_contents): Adjust parameter list and
125 return type.
126 (Object::do_decompressed_section_contents): Call do_section_contents
127 directly.
128 (Sized_relobj_file::do_section_contents): Adjust parameter list and
129 return type.
130 * options.h (class General_options): Add --gdb-index option.
131 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
132 list and return type.
133 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
134 * reloc.h (Track_relocs::checkpoint): New function.
135 (Track_relocs::reset): New function.
136
137 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
138 New test cases.
139 * testsuite/Makefile.in: Regenerate.
140 * testsuite/gdb_index_test.cc: New test source file.
141 * testsuite/gdb_index_test_1.sh: New test source file.
142 * testsuite/gdb_index_test_2.sh: New test source file.
143
647f1574
DK
1442012-03-19 Doug Kwan <dougkwan@google.com>
145
146 * arm.cc (Target_arm::do_define_standard_symbols): New method.
147 (Target_arm::do_finalize_sections): Remove code which defines
148 __exidx_start and __exidx_end. Make symbol table parameter
149 anonymous as it is not used.
150 * gold.cc (queue_middle_tasks): Call target hook to define any
151 target-specific symbols.
152 * target.h (Target::define_standard_symbols): New method.
153 (Target::do_define_standard_symbols): Same.
154 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
155 * testsuite/Makefile.in: Regenerate.
156 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
157 and __exidx_end.
158 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
159 relocations are generated for __exidx_start and __exidx_end.
160
7c6109da
DK
1612012-03-16 Doug Kwan <dougkwan@google.com>
162
163 * testsuite/Makefile.am: Disable test initpri3b.
164 * testsuite/Makefile.in: Regenerate.
165
7b8957f8
DK
1662012-03-15 Doug Kwan <dougkwan@google.com>
167
168 * arm.cc (Target_arm::got_section): Make .got section read-only
169 if -z now is given.
170
14dc9ef7
ILT
1712012-03-15 Ian Lance Taylor <iant@google.com>
172
173 PR gold/13850
174 * layout.cc (Layout::make_output_section): Correctly mark
175 SHT_INIT_ARRAY, et. al., as relro.
176
fa40b62a
DK
1772012-03-14 Doug Kwan <dougkwan@google.com>
178
179 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
180 dynamic relocations for protected symbols in shared objects.
181
fd325007
ILT
1822012-03-13 Ian Lance Taylor <iant@google.com>
183
184 * resolve.cc (Symbol_table::resolve): When merging common symbols,
185 keep the larger alignment.
186
e8dd54e1
CC
1872012-03-12 Cary Coutant <ccoutant@google.com>
188
189 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
190 handling of DW_LNE_define_file.
191
feb5f3b0
CC
1922012-03-12 Cary Coutant <ccoutant@google.com>
193
194 * reduced_debug_output.cc
195 (Output_reduced_debug_info_section::get_die_end): Add new FORM
196 codes to switch.
197
a1fb4256
CC
1982012-02-29 Cary Coutant <ccoutant@google.com>
199
200 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
201
5dd8762a
CC
2022012-02-29 Cary Coutant <ccoutant@google.com>
203
204 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
205 Call Object::decompressed_section_contents.
206 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
207 New dtor.
208 (Sized_dwarf_line_info::buffer_start_): New data member.
209 * merge.cc (Output_merge_data::do_add_input_section): Call
210 Object::decompressed_section_contents.
211 (Output_merge_string::do_add_input_section): Likewise.
212 * object.cc (need_decompressed_section): New function.
213 (build_compressed_section_map): Decompress sections needed later.
214 (Sized_relobj_file::do_decompressed_section_contents): New function.
215 (Sized_relobj_file::do_discard_decompressed_sections): New function.
216 * object.h (Object::decompressed_section_contents): New function.
217 (Object::discard_decompressed_sections): New function.
218 (Object::do_decompressed_section_contents): New function.
219 (Object::do_discard_decompressed_sections): New function.
220 (Compressed_section_info): New type.
221 (Compressed_section_map): Include decompressed section contents.
222 (Sized_relobj_file::do_decompressed_section_contents): New function.
223 (Sized_relobj_file::do_discard_decompressed_sections): New function.
224
7b5de7ee
CC
2252012-02-16 Cary Coutant <ccoutant@google.com>
226
227 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
228 * testsuite/Makefile.in: Regenerate.
229
f9fa4a63
CC
2302012-02-14 Cary Coutant <ccoutant@google.com>
231
232 * options.cc (General_options::finalize): Disallow -pie and -static.
233
2c175ebc
DK
2342012-02-03 Doug Kwan <dougkwan@google.com>
235
236 * arm.cc (Arm_relocate_functions::abs8,
237 Arm_relocate_functions::abs16): Use
238 Bits::has_signed_unsigned_overflow32.
239 (Arm_relocate_functions::thm_abs8): Correct range of
240 overflow check.
241 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
242 in assertions.
243
90cff06f
DK
2442012-02-02 Doug Kwan <dougkwan@google.com>
245
246 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
247 position independent outputs, not just shared objects.
248
63887f3d
L
2492012-01-30 H.J. Lu <hongjiu.lu@intel.com>
250
251 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
252 * configure: Regenerated.
253
bef2b434
ILT
2542012-01-27 Ian Lance Taylor <iant@google.com>
255
256 * reloc.h (Bits): New class with static functions, copied from
257 namespace utils in arm.cc.
258 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
259 instead.
260
c335b55d
L
2612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
262
263 * incremental.cc (write_info_blocks): Correct relocation offset.
264
41194d9f
L
2652012-01-27 H.J. Lu <hongjiu.lu@intel.com>
266
267 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
268 (Relocate::tls_gd_to_le): Likewise.
269
1bae613c
L
2702012-01-27 H.J. Lu <hongjiu.lu@intel.com>
271
272 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
273
24482ca0
L
2742012-01-27 H.J. Lu <hongjiu.lu@intel.com>
275
276 * configure.ac: Check if -mcmodel=medium works.
277 * configure: Regenerated.
278
c2c7840a
CC
2792012-01-24 Cary Coutant <ccoutant@google.com>
280
281 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
282 definition and ...
283 (read_unsigned_LEB_128_x): ... this new function.
284 (read_signed_LEB_128): Replaced with inline definition and ...
285 (read_signed_LEB_128_x): ... this new function.
286 * int_encoding.h (read_unsigned_LEB_128_x): New function.
287 (read_unsigned_LEB_128): Add inline definition.
288 (read_signed_LEB_128_x): New function.
289 (read_signed_LEB_128): Add inline definition.
290 * testsuite/Makefile.am (leb128_unittest): New unit test.
291 * testsuite/Makefile.in: Regenerate.
292 * testsuite/leb128_unittest.cc: New unit test.
293
833de760 2942012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
295
296 PR gold/13617
297 * i386.cc (Target_i386::do_code_fill): When using a jmp
298 instruction, pad with nop instructions.
299 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
300
618d6666
L
3012012-01-22 H.J. Lu <hongjiu.lu@intel.com>
302
303 * x86_64.cc (gc_process_relocs): Add typename on types used in
304 template.
305 (scan_relocs): Likewise.
306 (relocate_section): Likewise.
307 (apply_relocation): Likewise.
308
3660ff06
L
3092012-01-10 H.J. Lu <hongjiu.lu@intel.com>
310
311 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
312 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
313 under x32.
314
fc51264f
L
3152012-01-09 H.J. Lu <hongjiu.lu@intel.com>
316
317 * x86_64.cc: Initial support for x32.
318
dd74ae06
CC
3192012-01-03 Cary Coutant <ccoutant@google.com>
320
321 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
322 Use abstract base class for GOT.
323 * gold/output.h (class Output_data_got_base): New abstract base class.
324 (class Output_data_got): Derive from new base class, adjust ctors.
325 (Output_data_got::reserve_slot): Make virtual; rename to
326 do_reserve_slot; Adjust callers.
327 * gold/target.h (Sized_target::init_got_plt_for_update): Return
328 pointer to abstract base class.
329 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
330
83896202
ILT
3312011-12-18 Ian Lance Taylor <iant@google.com>
332
333 * object.h (Relobj::local_symbol_value): New function.
334 (Relobj::local_plt_offset): New function.
335 (Relobj::local_has_got_offset): New function.
336 (Relobj::local_got_offset): New function.
337 (Relobj::set_local_got_offset): New function.
338 (Relobj::do_local_symbol_value): New pure virtual function.
339 (Relobj::do_local_plt_offset): Likewise.
340 (Relobj::do_local_has_got_offset): Likewise.
341 (Relobj::do_local_got_offset): Likewise.
342 (Relobj::do_set_local_got_offset): Likewise.
343 (Sized_relobj::do_local_has_got_offset): Rename from
344 local_has_got_offset.
345 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
346 (Sized_relobj::do_set_local_got_offset): Rename from
347 set_local_got_offset.
348 (Sized_relobj_file::do_local_plt_offset): Rename from
349 local_plt_offset.
350 (Sized_relobj_file::do_local_symbol_value): New function.
351 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
352 local_plt_offset.
353 * output.cc (Output_data_got::Got_entry::write): Change object to
354 Relobj. Use local_symbol_value.
355 (Output_data_got::add_global_with_rel): Change rel_dyn to
356 Output_data_reloc_generic*. Use add_global_generic.
357 (Output_data_got::add_global_with_rela): Remove. Change all
358 callers to use add_global_with_rel.
359 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
360 Output_data_reloc_generic*. Use add_global_generic.
361 (Output_data_got::add_global_pair_with_rela): Remove. Change all
362 callers to use add_global_pair_with_rel.
363 (Output_data_got::add_local): Change object to Relobj*.
364 (Output_data_got::add_local_plt): Likewise.
365 (Output_data_got::add_local_with_rel): Change object to Relobj*,
366 change rel_dyn to Output_data_reloc_generic*. Use
367 add_local_generic.
368 (Output_data_got::add_local_with_rela): Remove. Change all
369 callers to use all_local_with_rel.
370 (Output_data_got::add_local_pair_with_rel): Change object to
371 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
372 add_output_section_generic.
373 (Output_data_got::add_local_pair_with_rela): Remove. Change all
374 callers to use add_local_pair_with_rel.
375 (Output_data_got::reserve_local): Change object to Relobj*.
376 * output.h: (class Output_data_reloc_generic): Add pure virtual
377 declarations for add_global_generic, add_local_generic,
378 add_output_section_generic.
379 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
380 functions for Output_data_reloc_generic. Update declarations for
381 changes listed in output.cc.
382 (class Output_data_got): Change template parameter to got_size.
383 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
384 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
385 function.
386 (Sized_relobj_incr::do_local_plt_offset): New function.
387 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
388 add_global_generic.
389
76677ad0
CC
3902011-12-17 Cary Coutant <ccoutant@google.com>
391
392 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
393 * resolve.cc (Symbol_table::resolve): Likewise.
394 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
395 arrays.
396 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
397
8b8dd8d5
ILT
3982011-12-16 Ian Lance Taylor <iant@google.com>
399
400 * output.h (Output_data_reloc_generic::add): Only call
401 add_dynamic_reloc if this is a dynamic reloc section.
402
d55525b9
L
4032011-12-15 H.J. Lu <hongjiu.lu@intel.com>
404
405 PR gold/13505
406 * target-reloc.h (apply_relocation): Replace <64, false> with
407 <size, big_endian>.
408
ff81c7c1
NC
4092011-11-25 Nick Clifton <nickc@redhat.com>
410
411 * po/it.po: New Italian translation.
412
628f39be
SA
4132011-11-17 Sterling Augustine <saugustine@google.com>
414
415 * script.cc (script_include_directive): Implement.
416 (read_script_file): New local variables name and search_path. Update
417 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
418 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
419 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
420
98ef3ea4
SA
4212011-11-11 Sterling Augustine <saugustine@google.com>
422
423 * yyscript.y (section_cmd): Add support for INCLUDE directive.
424 (file_or_sections_cmd): Likewise.
425
f4a8b6d7
DK
4262011-11-11 Doug Kwan <dougkwan@google.com>
427
428 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
429 if --just-symbols is given.
430
29ab395d
DK
4312011-11-10 Doug Kwan <dougkwan@google.com>
432
433 PR gold/13362
434 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
435 when processing data relocs.
436 * reloc.h (Relocate_functions::rel_unaligned): New method.
437 (Relocate_functions::pcrel_unaligned): Ditto.
438 (Relocate_functions::rel32_unaligned): Ditto.
439 (Relocate_functions::pcrel32_unaligned): Ditto.
440
2c339f71
DK
4412011-11-09 Doug Kwan <dougkwan@google.com>
442
443 PR gold/13362
444 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
445 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
446 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
447 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
448 (Relocate_functions::rel_unaligned): New.
449 (Relocate_functions::rel32_unaligned): New.
450 * target-reloc.h (relocate_for_relocatable): Add code to handle
451 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
452 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
453 arm_unaligned_reloc_r): New targets.
454 * testsuite/Makefile.in: Regenerate.
455 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
456 linking.
457
3f3cddf1
ILT
4582011-11-02 Ian Lance Taylor <iant@google.com>
459
460 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
461 NATIVE_LINKER.
462 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
463 * options.cc (General_options::finalize): Use library search path
464 from configure script if specified. If not native and no sysroot,
465 only search TOOLLIBDIR.
466 * options.h (Search_directory::Search_directory): Change name to
467 const std::string&.
468 (General_options::add_to_library_path_with_sysroot): Change arg to
469 const std::string&.
470 * configure, Makefile.in, config.in: Rebuild.
471
a8e2273b
ILT
4722011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
473
474 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
475 we are working around the ARM1176 Erratum.
476 * options.h (General_options::fix_arm1176): Add option.
477 * testsuite/Makefile.am: Add testcases, and keep current ones
478 working.
479 * testsuite/Makefile.in: Regenerate.
480 * testsuite/arm_fix_1176.s: New file.
481 * testsuite/arm_fix_1176.sh: Likewise.
482
cd6eab1c
ILT
4832011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
484
485 * arm.cc (Target_arm::Target_arm): Remove initialisation of
486 may_use_blx_.
487 (Target_arm::may_use_blx): Remove method.
488 (Target_arm::set_may_use_blx): Likewise.
489 (Target_arm::may_use_v4t_interworking): New method.
490 (Target_arm::may_use_v5t_interworking): Likewise.
491 (Target_arm::may_use_blx_): Remove member variable.
492 (Arm_relocate_functions::arm_branch_common): Check for v5T
493 interworking.
494 (Arm_relocate_functions::thumb_branch_common): Likewise.
495 (Reloc_stub::stub_type_for_reloc): Likewise.
496 (Target_arm::do_finalize_sections): Correct interworking checks.
497 * testsuite/Makefile.am: Add new tests.
498 * testsuite/Makefile.in: Regenerate.
499 * testsuite/arm_farcall_arm_arm.s: New test.
500 * testsuite/arm_farcall_arm_arm.sh: Likewise.
501 * testsuite/arm_farcall_arm_thumb.s: Likewise.
502 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
503 * testsuite/arm_farcall_thumb_arm.s: Likewise.
504 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
505 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
506 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
507
286adcf4
CC
5082011-10-31 Cary Coutant <ccoutant@google.com>
509
510 PR gold/13023
511 * expression.cc (Expression::eval_with_dot): Add
512 is_section_dot_assignment parameter.
513 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
514 absolute and assigning to dot within a section.
515 * script-sections.cc
516 (Output_section_element_assignment::set_section_addresses): Pass
517 dot_section to set_if_absolute.
518 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
519 as is_section_dot_assignment flag to eval_with_dot.
520 (Output_section_element_dot_assignment::set_section_addresses):
521 Likewise.
522 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
523 parameter. Also set value if relative to dot_section; set the
524 symbol's output_section.
525 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
526 parameter. Adjust all callers.
527 (Expression::eval_maybe_dot): Likewise.
528 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
529 Adjust all callers.
530 * testsuite/script_test_2.t: Test assignment of an absolute value
531 to dot within an output section element.
532
9634ed06
CC
5332011-10-31 Cary Coutant <ccoutant@google.com>
534
535 * options.h (class General_options): Add --[no-]gnu-unique options.
536 * symtab.cc (Symbol_table::sized_write_globals): Convert
537 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
538
de4101c7
CC
5392011-10-31 Cary Coutant <ccoutant@google.com>
540
541 PR gold/13359
542 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
543 unnecessary assertion.
544 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
545
7257cc92
ST
5462011-10-31 Sriraman Tallam <tmsriram@google.com>
547
548 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
549 gc_mark_symbol.
550 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
551 gc_mark_symbol.
552 Change to just keep the section associated with symbol.
553 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
554 they are externally visible and --export-dynamic is turned on.
555 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
556
bfc34b3f
ILT
5572011-10-19 Ian Lance Taylor <iant@google.com>
558
559 PR gold/13163
560 * script-sections.cc
561 (Output_section_element_dot_assignment::needs_output_section): New
562 function.
563
ea0d8c47
ILT
5642011-10-19 Ian Lance Taylor <iant@google.com>
565
566 PR gold/13204
567 * layout.cc (Layout::segment_precedes): Don't assert failure if a
568 --section-start option was seen.
569 * options.h (General_options::any_section_start): New function.
570
abd242a9
DM
5712011-10-18 David S. Miller <davem@davemloft.net>
572
573 PR binutils/13301
574 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
575 member to track relocation locations that have moved during TLS
576 reloc optimizations.
577 (Target_sparc::Relocate::Relocate): Initialize to NULL.
578 (Target_sparc::Relocate::relocate): Adjust view down by 4
579 bytes if it matches reloc_adjust_addr_.
580 (Target_sparc::Relocate::relocate_tls): Always move the
581 __tls_get_addr call delay slot instruction forward 4 bytes when
582 performing relaxation.
583
bab9090f
CC
5842011-10-18 Cary Coutant <ccoutant@google.com>
585
586 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
587 (Output_file::map_no_anonymous): Check for non-zero
588 return code from posix_fallocate.
589
f7c5b166
CC
5902011-10-17 Cary Coutant <ccoutant@google.com>
591
592 PR gold/13245
593 * plugin.cc (is_visible_from_outside): Check for symbols
594 referenced from dynamic objects.
595 * resolve.cc (Symbol_table::resolve): Don't count references
596 from dynamic objects as references from real ELF files.
597 * testsuite/plugin_test_2.sh: Adjust expected result.
598
b490c0bb
CC
5992011-10-17 Cary Coutant <ccoutant@google.com>
600
601 * gold.cc: Include timer.h.
602 (queue_middle_tasks): Stamp time.
603 (queue_final_tasks): Likewise.
604 * main.cc (main): Store timer in parameters. Print timers
605 for each pass.
606 * parameters.cc (Parameters::Parameters): Initialize timer_.
607 (Parameters::set_timer): New function.
608 (set_parameters_timer): New function.
609 * parameters.h (Parameters::set_timer): New function.
610 (Parameters::timer): New function.
611 (Parameters::timer_): New data member.
612 (set_parameters_timer): New function.
613 * timer.cc (Timer::stamp): New function.
614 (Timer::get_pass_time): New function.
615 * timer.h (Timer::stamp): New function.
616 (Timer::get_pass_time): New function.
617 (Timer::pass_times_): New data member.
618
f475cf7b
CC
6192011-10-17 Cary Coutant <ccoutant@google.com>
620
621 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
622 task for members of lib groups.
623
cdd7e244
CC
6242011-10-17 Cary Coutant <ccoutant@google.com>
625
626 PR gold/13288
4f95c8b4 627 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
628 (File_read::make_view): Move bounds check (replace with assert)...
629 (File_read::find_or_make_view): ... to here.
630
dfb45471
CC
6312011-10-12 Cary Coutant <ccoutant@google.com>
632
4f95c8b4 633 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
634 ::read returns less than requested size.
635
53bbcc1b
CC
6362011-10-10 Cary Coutant <ccoutant@google.com>
637
4f95c8b4 638 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
639 Initialize defined_count_.
640 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
641 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
642 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
643 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
644 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 645 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
646 member.
647 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 648 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
649 Return zeroes instead of internal error.
650
397b129b
CC
6512011-10-10 Cary Coutant <ccoutant@google.com>
652
653 PR gold/13249
4f95c8b4 654 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 655 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 656 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
657 (Output_reloc::type_): Adjust size of bit field.
658 (Output_reloc::use_plt_offset_): New bit field.
659 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
660 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
661 flag. Adjust all callers.
4f95c8b4 662 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
663 creating RELATIVE relocations.
664
d5698657
NC
6652011-10-10 Nick Clifton <nickc@redhat.com>
666
667 * po/es.po: Updated Spanish translation.
668 * po/fi.po: Updated Finnish translation.
669
6a59a5c2
DN
6702011-10-03 Diego Novillo <dnovillo@google.com>
671
672 * options.cc (parse_uint): Fix dereference of RETVAL.
673
f0558624
ST
6742011-09-29 Sriraman Tallam <tmsriram@google.com>
675
676 * layout.h (section_order_map_): New member.
677 (get_section_order_map): New member function.
678 * output.cc (Output_section::add_input_section): Check for patterns
679 only when --section-ordering-file is specified.
680 * gold.cc (queue_middle_tasks): Delay updating order of sections till
681 output_sections have been formed.
682 * layout.cc (Layout_Layout): Initialize section_order_map_.
683 * plugin.cc (update_section_order): Store order in order_map. Do not
684 update the order.
685 * testsuite/Makefile.am: Add test case for plugin_final_layout.
686 * testsuite/Makefile.in: Regenerate.
687 * testsuite/plugin_section_order.c: New file.
688 * testsuite/plugin_final_layout.cc: New file.
689 * testsuite/plugin_final_layout.sh: New file.
690
a7dac153
CC
6912011-09-29 Cary Coutant <ccoutant@google.com>
692
4f95c8b4 693 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 694 Check for NULL.
4f95c8b4 695 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
696 symbols during incremental update.
697 (Symbol_table::add_from_dynobj): Likewise.
698
eebd87a5
ILT
6992011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
700 Ian Lance Taylor <iant@google.com>
701
702 * symtab.cc (Symbol_table::define_special_symbol): Always
703 canonicalize version string.
704
403a3331
CC
7052011-09-26 Cary Coutant <ccoutant@google.com>
706
4f95c8b4
CC
707 * gold.cc (queue_initial_tasks): Move option checks ...
708 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
709 some options; make others fatal.
710
235061c2
CC
7112011-09-26 Cary Coutant <ccoutant@google.com>
712
713 gcc PR lto/47247
714 * plugin.cc (get_symbols_v2): New function.
715 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
716 (is_referenced_from_outside): New function.
717 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
718 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
719 (get_symbols): Pass version parameter.
720 (get_symbols_v2): New function.
721 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
722 parameter.
723 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
724 (onload): Add LDPT_GET_SYMBOLS_V2.
725 (all_symbols_read_hook): Use get_symbols_v2; check for
726 LDPR_PREVAILING_DEF_IRONLY_EXP.
727 * testsuite/plugin_test_3.sh: Update expected results.
728
dc87f620
ILT
7292011-09-23 Simon Baldwin <simonb@google.com>
730
731 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
732 configuration options.
733 * configure: Regenerate.
734 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
735 * Makefile.in: Regenerate.
736 * testsuite/Makefile.in: Regenerate.
737
a8279f82
ST
7382011-09-19 Sriraman Tallam <tmsriram@google.com>
739
740 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
741
0c9350c8
CC
7422011-09-19 Cary Coutant <ccoutant@google.com>
743
744 * incremental.cc (can_incremental_update): Fix typo in comment.
745 * incremental.h (can_incremental_update): Likewise.
746
aa06ae28
CC
7472011-09-18 Cary Coutant <ccoutant@google.com>
748
749 * incremental.cc (can_incremental_update): New function.
750 * incremental.h (can_incremental_update): New function.
751 * layout.cc (Layout::init_fixed_output_section): Call it.
752 (Layout::make_output_section): Don't allow patch space in .eh_frame.
753 * object.cc (Sized_relobj_file::do_layout): Call
754 can_incremental_update.
755
ebb300b2
CC
7562011-09-13 Cary Coutant <ccoutant@google.com>
757
758 * configure.ac: Check for glibc support for gnu_indirect_function
759 support with static linking, setting automake conditional
760 IFUNC_STATIC.
761 * Makefile.in: Regenerate.
762 * configure: Regenerate.
763
764 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
765 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
766 for IFUNC_STATIC.
767 * testsuite/Makefile.in: Regenerate.
768
1206d0d5
CC
7692011-09-13 Cary Coutant <ccoutant@google.com>
770
771 * incremental.cc (Sized_relobj_incr::do_layout): Call
772 report_comdat_group for kept comdat sections.
773 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
774 * testsuite/Makefile.in: Regenerate.
775 * testsuite/incr_comdat_test_1.cc: New source file.
776 * testsuite/incr_comdat_test_2_v1.cc: New source file.
777 * testsuite/incr_comdat_test_2_v2.cc: New source file.
778 * testsuite/incr_comdat_test_2_v3.cc: New source file.
779
40b29874
ILT
7802011-09-13 Ian Lance Taylor <iant@google.com>
781
782 * object.cc (Sized_relobj_file::do_layout): Remove unused local
783 variable external_symbols_offset.
784
1b045aac
ILT
7852011-09-12 Ian Lance Taylor <iant@google.com>
786
787 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
788 triggered if object has no symbols.
789
24c6c55a
DM
7902011-09-09 David S. Miller <davem@davemloft.net>
791
792 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
793 (Output_fill_debug_line::do_write): Likewise.
794
66570254
CC
7952011-08-29 Cary Coutant <ccoutant@google.com>
796
797 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
798 casts to match formatting specs.
799 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
800
8ea8cd50
CC
8012011-08-26 Cary Coutant <ccoutant@google.com>
802
803 * layout.cc (Free_list::allocate): Provide guarantee of minimum
804 remaining hole size when allocating.
805 (Layout::make_output_section): Set fill methods for debug sections.
806 * layout.h (Free_list::Free_list_node): Move from private to
807 public.
808 (Free_list::set_min_hole_size): New function.
809 (Free_list::begin, Free_list::end): New functions.
810 (Free_list::min_hole_): New data member.
811 * output.cc: Include dwarf.h.
812 (Output_fill_debug_info::do_minimum_hole_size): New function.
813 (Output_fill_debug_info::do_write): New function.
814 (Output_fill_debug_line::do_minimum_hole_size): New function.
815 (Output_fill_debug_line::do_write): New function.
816 (Output_section::Output_section): Initialize new data member.
817 (Output_section::set_final_data_size): Ensure patch space is larger
818 than minimum hole size.
819 (Output_section::do_write): Fill holes in debug sections.
820 * output.h (Output_fill): New class.
821 (Output_fill_debug_info): New class.
822 (Output_fill_debug_line): New class.
823 (Output_section::set_free_space_fill): New function.
824 (Output_section::free_space_fill_): New data member.
825 * testsuite/Makefile.am (incremental_test_3): Add
826 --incremental-patch option.
827 (incremental_test_4): Likewise.
828 (incremental_test_5): Likewise.
829 (incremental_test_6): Likewise.
830 (incremental_copy_test): Likewise.
831 (incremental_common_test_1): Likewise.
832 * testsuite/Makefile.in: Regenerate.
833
7cf80422
NC
8342011-08-26 Nick Clifton <nickc@redhat.com>
835
836 * po/es.po: Updated Spanish translation.
837
c3f7b0e5
CC
8382011-08-01 Cary Coutant <ccoutant@google.com>
839
840 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
841 * gold/testsuite/Makefile.in: Regenerate.
842 * gold/testsuite/justsyms_exec.c: New source file.
843 * gold/testsuite/justsyms_lib.c: New source file.
844
9590bf25
CC
8452011-08-01 Cary Coutant <ccoutant@google.com>
846
847 * layout.cc (Layout::set_segment_offsets): Don't realign text
848 segment if -Ttext was specified.
849 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
850 file type.
851 * object.h (Sized_relobj_file::e_type): New function.
852 (Sized_relobj_file::e_type_): New data member.
853 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
854 base address for ET_EXEC files.
855 * target.cc (Target::do_make_elf_object_implementation): Allow
856 ET_EXEC files with --just-symbols option.
857
dcd8d12e
CC
8582011-07-28 Cary Coutant <ccoutant@google.com>
859
860 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
861 Add thread_number parameter.
862 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
863 * workqueue-threads.cc
864 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
865 current thread if its thread number is greater than desired thread
866 count.
867 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
868 Add thread_number parameter.
869 (Workqueue::should_cancel_thread): Likewise.
870 (Workqueue::find_runnable_or_wait): Pass thread_number to
871 should_cancel_thread.
872 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
873 parameter.
874
804eb480
ST
8752011-07-22 Sriraman Tallam <tmsriram@google.com>
876
877 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
878 only after checking if it cannot be forced local.
879 * symtab.h (is_externally_visible): Check if the symbol is not forced
880 local.
881
f1ddb600
ILT
8822011-07-15 Ian Lance Taylor <iant@google.com>
883
884 * options.h (class General_options): Add --print-output-format.
885 Move -EL next to -EB, for better --help output.
886 * target-select.cc: Include <cstdio>, "options.h", and
887 "parameters.h".
888 (Target_selector::do_target_bfd_name): New function.
889 (print_output_format): New function.
890 * target-select.h (class Target_selector): Update declarations.
891 (Target_selector::target_bfd_name): New function.
892 (print_output_format): Declare.
893 * main.cc: Include "target-select.h".
894 (main): Handle --print-output-format.
895 * gold.cc: Include "target-select.h".
896 (queue_initial_tasks): Handle --print-output-format when there are
897 no input files.
898 * parameters.cc (parameters_force_valid_target): Give a better
899 error message if -EB/-EL does not match target.
900 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
901 function.
902
7d172687
ILT
9032011-07-15 Ian Lance Taylor <iant@google.com>
904
905 * i386.cc (class Output_data_plt_i386): Add layout_ field.
906 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
907 (Output_data_plt_i386::do_write): Write address of .dynamic
908 section to first entry in .got.plt section.
909 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
910 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
911 Initialize layout_.
912 (Output_data_plt_x86_64::do_write): Write address of .dynamic
913 section to first entry in .got.plt section.
914 * layout.h (Layout::dynamic_section): New function.
915
e9552f7e
ST
9162011-07-13 Sriraman Tallam <tmsriram@google.com>
917
918 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
919 to claim_file call.
920 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
921 input_section_position_, and input_section_glob_.
922 (read_layout_from_file): Call function section_ordering_specified.
923 * layout.h (is_section_ordering_specified): New function.
924 (section_ordering_specified): New function.
925 (section_ordering_specified_): New boolean member.
926 * main.cc(main): Call load_plugins after layout object is defined.
927 * output.cc (Output_section::add_input_section): Use
928 function section_ordering_specified to check if section ordering is
929 needed.
930 * output.cc (Output_section::add_relaxed_input_section): Use
931 function section_ordering_specified to check if section ordering is
932 needed.
933 (Output_section::update_section_layout): New function.
934 (Output_section::sort_attached_input_sections): Check if input section
935 must be reordered.
936 * output.h (Output_section::update_section_layout): New function.
937 * plugin.cc (get_section_count): New function.
938 (get_section_type): New function.
939 (get_section_name): New function.
940 (get_section_contents): New function.
941 (update_section_order): New function.
58797674 942 (allow_section_ordering): New function.
e9552f7e
ST
943 (Plugin::load): Add the new interfaces to the transfer vector.
944 (Plugin_manager::load_plugins): New parameter.
945 (Plugin_manager::all_symbols_read): New parameter.
946 (Plugin_manager::claim_file): New parameter. Save the elf object for
947 unclaimed objects.
948 (Plugin_manager::get_elf_object): New function.
949 (Plugin_manager::get_view): Change to directly use the bool to check
950 if get_view is called from claim_file_hook.
951 * plugin.h (input_objects): New function
952 (Plugin__manager::load_plugins): New parameter.
953 (Plugin_manager::claim_file): New parameter.
954 (Plugin_manager::get_elf_object): New function.
955 (Plugin_manager::in_claim_file_handler): New function.
956 (Plugin_manager::in_claim_file_handler_): New member.
957 (layout): New function.
958 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
959 handler with an extra parameter. Make the elf object before calling
960 claim_file handler.
961 * testsuite/plugin_test.c (get_section_count): New function pointer.
962 (get_section_type): New function pointer.
963 (get_section_name): New function pointer.
964 (get_section_contents): New function pointer.
965 (update_section_order): New function pointer.
966 (allow_section_ordering): New function pointer.
967 (onload): Check if the new interfaces exist.
968
9446efde
ILT
9692011-07-13 Ian Lance Taylor <iant@google.com>
970
971 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
972 relro section.
973 * x86_64.cc (Target_x86_64::got_section): Likewise.
974 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
975 (relro_now_test_SOURCES): New variable.
976 (relro_now_test_DEPENDENCIES): New variable.
977 (relro_now_test_LDFLAGS): New variable.
978 (relro_now_test_LDADD): New variable.
979 (relro_now_test.so): New target.
980 * testsuite/Makefile.in: Rebuild.
981
07aa62f2
ILT
9822011-07-12 Ian Lance Taylor <iant@google.com>
983
984 PR gold/12980
985 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
986 GLOB_DAT relocation rather than a RELATIVE relocation for a
987 protected symbol when creating a shared library.
988 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
989 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
990 * testsuite/protected_main_1.cc (main): Test that protected
991 function has same address.
992
e2153196
ILT
9932011-07-11 Ian Lance Taylor <iant@google.com>
994
995 PR gold/12979
996 * options.h (class General_options): Add -Bgroup.
997 * options.cc (General_options::finalize): If -Bgroup is set,
998 default to --unresolved-symbols=report-all.
999 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1000 * target-reloc.h (issue_undefined_symbol_error): Handle
1001 --unresolved-symbols=report-all.
1002
6daf5215
ILT
10032011-07-08 Ian Lance Taylor <iant@google.com>
1004
1005 PR gold/11985
1006 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1007 if linker script discards key sections.
1008 (Layout::create_dynamic_symtab): Likewise.
1009 (Layout::assign_local_dynsym_offsets): Likewise.
1010 (Layout::sized_create_version_sections): Likewise.
1011 (Layout::create_interp): Likewise.
1012 (Layout::finish_dynamic_section): Likewise.
1013 (Layout::set_dynamic_symbol_size): Likewise.
1014
beabb2c6
ILT
10152011-07-08 Ian Lance Taylor <iant@google.com>
1016
1017 PR gold/12386
1018 * options.h (class General_options): Add --unresolved-symbols.
1019 * target-reloc.h (issue_undefined_symbol_error): Check
1020 --unresolved-symbols. Add comments.
1021
9c16daf1
ILT
10222011-07-08 Ian Lance Taylor <iant@google.com>
1023
1024 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1025 expression more complex.
1026
191f1a2d
ILT
10272011-07-08 Ian Lance Taylor <iant@google.com>
1028
1029 PR gold/11317
1030 * target-reloc.h (issue_undefined_symbol_error): New inline
1031 function, broken out of relocate_section.
1032 (relocate_section): Call issue_undefined_symbol_error.
1033 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1034 there is no TLS segment if we are about to issue an undefined
1035 symbol error.
1036 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1037
62855347
ILT
10382011-07-08 Ian Lance Taylor <iant@google.com>
1039
1040 PR gold/12279
1041 * resolve.cc (Symbol_table::should_override): Add fromtype
1042 parameter. Change all callers. Give error when linking together
1043 TLS and non-TLS symbol.
1044 (Symbol_table::should_override_with_special): Add fromtype
1045 parameter. Change all callers.
1046 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1047 there is no TLS segment if we have reported some errors.
1048 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1049
67181c72
ILT
10502011-07-08 Ian Lance Taylor <iant@google.com>
1051
1052 PR gold/12372
1053 * target.h (Target::plt_address_for_global): New function.
1054 (Target::plt_address_for_local): New function.
1055 (Target::plt_section_for_global): Remove.
1056 (Target::plt_section_for_local): Remove.
1057 (Target::do_plt_address_for_global): New virtual function.
1058 (Target::do_plt_address_for_local): New virtual function.
1059 (Target::do_plt_section_for_global): Remove.
1060 (Target::do_plt_section_for_local): Remove.
1061 (Target::register_global_plt_entry): Add Symbol_table and Layout
1062 parameters.
1063 * output.cc (Output_data_got::Got_entry::write): Use
1064 plt_address_for_global and plt_address_for_local.
1065 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1066 address of output section.
1067 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1068 got_irelative_, and irelative_count_ fields. Update
1069 declarations.
1070 (Output_data_plt_i386::has_irelative_section): New function.
1071 (Output_data_plt_i386::entry_count): Add irelative_count_.
1072 (Output_data_plt_i386::set_final_data_size): Likewise.
1073 (class Target_i386): Add got_irelative_ and rel_irelative_
1074 fields. Update declarations.
1075 (Target_i386::Target_i386): Initialize new fields.
1076 (Target_i386::do_plt_address_for_global): New function replacing
1077 do_plt_section_for_global.
1078 (Target_i386::do_plt_address_for_local): New function replacing
1079 do_plt_section_for_local.
1080 (Target_i386::got_section): Create got_irelative_.
1081 (Target_i386::rel_irelative_section): New function.
1082 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1083 fields. Don't define __rel_iplt_{start,end}.
1084 (Output_data_plt_i386::add_entry): Add symtab and layout
1085 parameters. Change all callers. Use different PLT and GOT for
1086 IFUNC symbols.
1087 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1088 layout parameters. Change all callers. Use different PLT and
1089 GOT.
1090 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1091 (Output_data_plt_i386::rel_irelative): New function.
1092 (Output_data_plt_i386::address_for_global): New function.
1093 (Output_data_plt_i386::address_for_local): New function.
1094 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1095 IRELATIVE GOT when changing IFUNC GOT entries.
1096 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1097 reloc.
1098 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1099 if we didn't create an IRELATIVE GOT.
1100 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1101 plt_address_for_local.
1102 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1103 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1104 got_irelative_, and irelative_count_ fields. Update
1105 declarations.
1106 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1107 Initialize new fields. Remove symtab parameter. Change all
1108 callers.
1109 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1110 irelative_count_.
1111 (Output_data_plt_x86_64::has_irelative_section): New function.
1112 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1113 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1114 fields. Update declarations.
1115 (Target_x86_64::Target_x86_64): Initialize new fields.
1116 (Target_x86_64::do_plt_address_for_global): New function replacing
1117 do_plt_section_for_global.
1118 (Target_x86_64::do_plt_address_for_local): New function replacing
1119 do_plt_section_for_local.
1120 (Target_x86_64::got_section): Create got_irelative_.
1121 (Target_x86_64::rela_irelative_section): New function.
1122 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1123 all callers. Don't create __rel_iplt_{start,end}.
1124 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1125 parameters. Change all callers. Use different PLT and GOT for
1126 IFUNC symbols.
1127 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1128 layout parameters. Change all callers. Use different PLT and
1129 GOT.
1130 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1131 parameters. Change all callers. Use different PLT and GOT for
1132 IFUNC symbols.
1133 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1134 (Output_data_plt_x86_64::rela_irelative): New function.
1135 (Output_data_plt_x86_64::address_for_global): New function.
1136 (Output_data_plt_x86_64::address_for_local): New function.
1137 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1138 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1139 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1140 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1141 parameters.
1142 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1143 reloc.
1144 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1145 symbols if we didn't create an IRELATIVE GOT.
1146 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1147 plt_address_for_local.
1148 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1149 * testsuite/ifuncvar1.c: New test file.
1150 * testsuite/ifuncvar2.c: New test file.
1151 * testsuite/ifuncvar3.c: New test file.
1152 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1153 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1154 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1155 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1156 * testsuite/Makefile.in: Rebuild.
1157
33c15b45
CC
11582011-07-07 Cary Coutant <ccoutant@google.com>
1159
1160 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1161 (two_file_test_1_ndebug.o): Likewise.
1162 (two_file_test_1b_ndebug.o): Likewise.
1163 (two_file_test_2_ndebug.o): Likewise.
1164 (two_file_test_main_ndebug.o): Likewise.
1165 (incremental_test_2): Link with no-debug versions.
1166
f48b5fb7
CC
11672011-07-06 Cary Coutant <ccoutant@google.com>
1168
1169 * gold/incremental.cc
1170 (Output_section_incremental_inputs::write_info_blocks): Check for
1171 hidden and internal symbols.
1172
221597a5
CC
11732011-07-06 Cary Coutant <ccoutant@google.com>
1174
1175 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1176 Check disposition for startup file.
1177 (Incremental_inputs::report_command_line): Ignore
1178 --incremental-startup-unchanged option.
1179 * options.cc (General_options::parse_incremental_startup_unchanged):
1180 New function.
1181 (General_options::General_options): Initialize new data member.
1182 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1183 (General_options): Add --incremental-startup-unchanged option.
1184 (General_options::incremental_startup_disposition): New function.
1185 (General_options::incremental_startup_disposition_): New data member.
1186
e24719f6
CC
11872011-07-06 Cary Coutant <ccoutant@google.com>
1188
1189 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1190 input file index to Script_info ctor.
1191 (Sized_incremental_binary::do_file_has_changed): Find the
1192 command-line argument for files named in scripts.
1193 * incremental.h (Script_info::Script_info): New ctor
1194 with input file index.
1195 (Script_info::input_file_index): New function.
1196 (Script_info::input_file_index_): New data member.
1197 (Incremental_binary::get_library): Add const.
1198 (Incremental_binary::get_script_info): Add const.
1199 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1200 * testsuite/Makefile.am (incremental_test_5): New test case.
1201 (incremental_test_6): New test case.
1202 * testsuite/Makefile.in: Regenerate.
1203
8f7c81e8
CC
12042011-07-06 Cary Coutant <ccoutant@google.com>
1205
1206 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1207 debug output when command lines differ.
1208
9fbd3822
CC
12092011-07-06 Cary Coutant <ccoutant@google.com>
1210
1211 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1212 --incremental-patch option.
1213 * layout.cc (Free_list::allocate): Extend allocation beyond original
1214 end if enabled.
1215 (Layout::make_output_section): Mark sections that should get
1216 patch space.
1217 * options.cc (parse_percent): New function.
1218 * options.h (parse_percent): New function.
1219 (DEFINE_percent): New macro.
1220 (General_options): Add --incremental-patch option.
1221 * output.cc (Output_section::Output_section): Initialize new data
1222 members.
1223 (Output_section::add_input_section): Print section name when out
1224 of patch space.
1225 (Output_section::add_output_section_data): Likewise.
1226 (Output_section::set_final_data_size): Add patch space when
1227 doing --incremental-full.
1228 (Output_section::do_reset_address_and_file_offset): Remove patch
1229 space.
1230 (Output_segment::set_section_list_addresses): Print debug output
1231 only if --incremental-update.
1232 * output.h (Output_section::set_is_patch_space_allowed): New function.
1233 (Output_section::is_patch_space_allowed_): New data member.
1234 (Output_section::patch_space_): New data member.
1235 * parameters.cc (Parameters::incremental_full): New function.
1236 * parameters.h (Parameters::incremental_full): New function
1237 * testsuite/Makefile.am (incremental_test_2): Add test for
1238 --incremental-patch option.
1239 * testsuite/Makefile.in: Regenerate.
1240 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1241 (t18): Remove function body.
1242
f6cccc2c
DK
12432011-07-05 Doug Kwan <dougkwan@google.com>
1244
1245 PR gold/12771
1246 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1247 Arm_Address type for relocation result.
1248 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1249 overflow check.
1250 (Arm_relocate_functions::abs32): Use unaligned access.
1251 (Arm_relocate_functions::rel32): Ditto.
1252 (Arm_relocate_functions::prel31): Ditto.
1253 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1254 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1255 static data relocations.
1256 * testsuite/Makefile.in: Regnerate.
1257 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1258
28a13fec
ILT
12592011-07-05 Ian Lance Taylor <iant@google.com>
1260
1261 PR gold/12392
1262 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1263 symbols if necessary.
1264 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1265
24d47b34
ILT
12662011-07-05 Ian Lance Taylor <iant@google.com>
1267
1268 PR gold/12952
1269 * resolve.cc (Symbol::override_base_with_special): Simply override
1270 version with special symbol version, ignoring previous version.
1271
41f9cbbe
ILT
12722011-07-05 Ian Lance Taylor <iant@google.com>
1273
1274 * object.cc (Sized_relobj_file::include_section_group): Add
1275 information to comment about signature location.
1276
886288f1
ILT
12772011-07-02 Ian Lance Taylor <iant@google.com>
1278
1279 PR gold/12957
1280 * options.h (class General_options): Add -f and -F.
1281 * options.cc (General_options::finalize): Fatal error if -f/-F
1282 are used without -shared.
1283 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1284
ae3a6d4f
ILT
12852011-07-02 Ian Lance Taylor <iant@google.com>
1286
1287 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1288
21131061
ILT
12892011-07-01 Ian Lance Taylor <iant@google.com>
1290
1291 PR gold/12525
1292 PR gold/12952
1293 * resolve.cc (Symbol::override_base_with_special): Don't override
1294 the version if the overriding symbol has a different name.
1295 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1296 all callers. If we give an error about an undefined version,
1297 define the base version if necessary.
1298 * dynobj.h (class Versions): Update declaration.
1299 * testsuite/weak_alias_test_5.cc: New file.
1300 * testsuite/weak_alias_test.script: New file.
1301 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1302 and versioned_alias have the right value, and call t2.
1303 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1304 weak_alias_test_5.so.
1305 (weak_alias_test_LDADD): Likewise.
1306 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1307 * testsuite/Makefile.in: Rebuild.
1308
611062c0
ILT
13092011-07-01 Ian Lance Taylor <iant@google.com>
1310
1311 PR gold/12525
1312 * options.h (class General_options): Support -z notext.
1313 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1314 -Wl,-z,notext.
1315 (two_file_shared_nonpic.so): Likewise.
1316 (two_file_shared_mixed.so): Likewise.
1317 (two_file_shared_mixed_1.so): Likewise.
1318 (weak_undef_lib_nonpic.so): Likewise.
1319 (alt/weak_undef_lib_nonpic.so): Likewise.
1320 (tls_test_shared_nonpic.so): Likewise.
1321 * testsuite/Makefile.in: Rebuild.
1322
328c7c2f
ILT
13232011-07-01 Ian Lance Taylor <iant@google.com>
1324
1325 PR gold/12525
1326 * configure.ac: Test whether static linking works, setting
1327 the automake conditional HAVE_STATIC.
1328 * testsuite/Makefile.am: Disable tests using -static if
1329 HAVE_STATIC is not true.
1330 * configure, testsuite/Makefile.in: Rebuild.
1331
02d7cd44
ILT
13322011-07-01 Ian Lance Taylor <iant@google.com>
1333
1334 PR gold/12525
1335 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1336 Assert if we see DW_EH_PE_indirect.
1337 * target.h (Target::ehframe_datarel_base): New function.
1338 (Target::do_ehframe_datarel_base): New target function.
1339 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1340 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1341 function.
1342
07a60597
ILT
13432011-07-01 Ian Lance Taylor <iant@google.com>
1344
1345 PR gold/12571
1346 * options.h (class General_options): Add
1347 --ld-generated-unwind-info.
1348 * ehframe.cc (Fde::write): Add address parameter. Change all
1349 callers. If associated with PLT, fill in address and size.
1350 (Cie::set_output_offset): Only add merge mapping if there is an
1351 object.
1352 (Cie::write): Add address parameter. Change all callers.
1353 (Eh_frame::add_ehframe_for_plt): New function.
1354 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1355 input_offset_ fields into union u_, with new plt field.
1356 (Fde::Fde): Adjust for new union field.
1357 (Fde::Fde) [Output_data version]: New constructor.
1358 (Fde::add_mapping): Only add merge mapping if there is an object.
1359 (class Cie): Update declarations.
1360 (class Eh_frame): Declare add_ehframe_for_plt.
1361 * layout.cc (Layout::layout_eh_frame): Break out code into
1362 make_eh_frame_section, and call it.
1363 (Layout::make_eh_frame_section): New function.
1364 (Layout::add_eh_frame_for_plt): New function.
1365 * layout.h (class Layout): Update declarations.
1366 * merge.cc (Merge_map::add_mapping): Add assertion.
1367 * i386.cc: Include "dwarf.h".
1368 (class Output_data_plt_i386): Make first_plt_entry,
1369 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1370 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1371 and plt_eh_frame_fde.
1372 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1373 boundary. Call add_eh_frame_for_plt if appropriate.
1374 * x86_64.cc: Include "dwarf.h".
1375 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1376 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1377 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1378 and plt_eh_frame_fde.
1379 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1380 appropriate.
1381
14788a3f
ILT
13822011-06-29 Ian Lance Taylor <iant@google.com>
1383
1384 PR gold/12629
1385 * object.cc (Sized_relobj_file::layout_section): Change shdr
1386 parameter to be const.
1387 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1388 out of do_layout.
1389 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1390 appropriate. Call layout_eh_frame_section.
1391 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1392 sections.
1393 * object.h (class Sized_relobj_file): Update declarations.
1394
6c21fce1
ILT
13952011-06-29 Ian Lance Taylor <iant@google.com>
1396
37e41b03 1397 PR gold/12652
6c21fce1
ILT
1398 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1399 modifier.
1400 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1401
4d5e4e62
ILT
14022011-06-29 Ian Lance Taylor <iant@google.com>
1403
1404 PR gold/12675
1405 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1406 SHT_X86_64_UNWIND.
1407 * layout.cc (Layout::layout_eh_frame): Likewise.
1408
886f533a
ILT
14092011-06-29 Ian Lance Taylor <iant@google.com>
1410
1411 PR gold/12695
1412 * layout.cc (Layout::symtab_section_shndx): New function.
1413 * layout.h (class Layout): Declare symtab_section_shndx.
1414 * output.cc (Output_section::write_header): Call it.
1415
f3ae1b28
ILT
14162011-06-29 Ian Lance Taylor <iant@google.com>
1417
1418 PR gold/12818
1419 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1420 symbols which are not used in a relocation.
1421
aecf301f
ILT
14222011-06-28 Ian Lance Taylor <iant@google.com>
1423
1424 PR gold/12898
1425 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1426 script create indistinguishable segments.
1427 (Layout::set_segment_offsets): Use stable_sort when sorting
1428 segments. Pass this to Compare_segments constructor.
1429 * layout.h (class Layout): Make segment_precedes non-static.
1430 (class Compare_segments): Change from struct to class. Add
1431 layout_ field. Add constructor.
1432 * script-sections.cc
1433 (Script_sections::attach_sections_using_phdrs_clause): Rename
1434 local orphan to is_orphan. Don't report failure to put empty
1435 section in segment. On attachment failure, report name of
1436 section, and attach to first PT_LOAD segment.
1437
03ef7571
ILT
14382011-06-28 Ian Lance Taylor <iant@google.com>
1439
1440 PR gold/12934
1441 * target-select.cc (Target_selector::Target_selector): Add
1442 emulation parameter. Change all callers.
1443 (select_target_by_bfd_name): Rename from select_target_by_name.
1444 Change all callers.
1445 (select_target_by_emulation): New function.
1446 (supported_emulation_names): New function.
1447 * target-select.h (class Target_selector): Add emulation_ field.
1448 Update declarations.
1449 (Target_selector::recognize_by_bfd_name): Rename from
1450 recognize_by_name. Change all callers.
1451 (Target_selector::supported_bfd_names): Rename from
1452 supported_names. Change all callers.
1453 (Target_selector::recognize_by_emulation): New function.
1454 (Target_selector::supported_emulations): New function.
1455 (Target_selector::emulation): New function.
1456 (Target_selector::do_recognize_by_bfd_name): Rename from
1457 do_recognize_by_name. Change all callers.
1458 (Target_selector::do_supported_bfd_names): Rename from
1459 do_supported_names. Change all callers.
1460 (Target_selector::do_recognize_by_emulation): New function.
1461 (Target_selector::do_supported_emulations): New function.
1462 (select_target_by_bfd_name): Change name in declaration.
1463 (select_target_by_emulation): Declare.
1464 (supported_emulation_names): Declare.
1465 * parameters.cc (parameters_force_valid_target): Try to find
1466 target based on emulation from -m option.
1467 * options.h (class General_options): Change doc string for -m.
1468 * options.cc (help): Print emulations.
1469 (General_options::parse_V): Likewise.
1470 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1471 Add emulation parameter. Change all callers.
1472
200b2bb9
ILT
14732011-06-28 Ian Lance Taylor <iant@google.com>
1474
1475 * target.h (class Target): Add osabi_ field.
1476 (Target::osabi): New function.
1477 (Target::set_osabi): New function.
1478 (Target::Target): Initialize osabi_.
1479 (Target::do_adjust_elf_header): Make pure virtual.
1480 (Sized_target::do_adjust_elf_header): Declare.
1481 * target.cc (Sized_target::do_adjust_elf_header): New function.
1482 (class Sized_target): Instantiate all versions.
1483 * freebsd.h (class Target_freebsd): Remove.
1484 (Target_selector_freebsd::do_recognize): Call set_osabi on
1485 Target.
1486 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1487 (Target_selector_freebsd::set_osabi): Remove.
1488 * i386.cc (class Target_i386): Inherit from Sized_target rather
1489 than Target_freebsd.
1490 * x86_64.cc (class Target_x86_64): Likewise.
1491
b3ce541e
ILT
14922011-06-28 Ian Lance Taylor <iant@google.com>
1493
1494 * target.h (Target::can_check_for_function_pointers): Rewrite.
1495 Make non-virtual.
1496 (Target::can_icf_inline_merge_sections): Likewise.
1497 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1498 (Target::Target_info): Add can_icf_inline_merge_sections field.
1499 (Target::do_can_check_for_function_pointers): New virtual
1500 function.
1501 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1502 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1503 from can_check_for_function_pointers, move in file.
1504 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1505 section_may_have_icf_unsafe_poineters, move in file.
1506 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1507 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1508 Rename from can_check_for_function_pointers, move in file.
1509 (Target_i386::can_icf_inline_merge_sections): Remove.
1510 (Target_i386::i386_info): Initialize
1511 can_icf_inline_merge_sections.
1512 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1513 Initialize can_icf_inline_merge_sections.
1514 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1515 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1516 Rename from can_check_for_function_pointers, move in file.
1517 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1518 (Target_x86_64::x86_64_info): Initialize
1519 can_icf_inline_merge_sections.
1520 * testsuite/testfile.cc (Target_test::test_target_info):
1521 Likewise.
1522 * icf.cc (get_section_contents): Correct formatting.
1523
6d1c4efb
ILT
15242011-06-27 Ian Lance Taylor <iant@google.com>
1525
1526 * symtab.cc (Symbol::versioned_name): New function.
1527 (Symbol_table::add_to_final_symtab): Use versioned_name when
1528 appropriate.
1529 (Symbol_table::sized_write_symbol): Likewise.
1530 * symtab.h (class Symbol): Declare versioned_name.
1531 * stringpool.h (class Stringpool_template): Add variant of add
1532 which takes a std::basic_string.
1533 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1534 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1535 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1536 (ver_test_12.o): New target.
1537 * testsuite/Makefile.in: Rebuild.
1538
57eb9b50
DK
15392011-06-27 Doug Kwan <dougkwan@google.com>
1540
1541 * arm.cc (Arm_relocate_functions::thm_jump8,
1542 Arm_relocate_functions::thm_jump11): Use a wider signed
1543 type to compute offset.
1544 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1545 arm_thm_jump8.
1546 * testsuite/Makefile.in: Regenerate.
1547 * testsuite/arm_branch_in_range.sh: Check test results of
1548 arm_thm_jump11 and arm_thm_jump8.
1549 * testsuite/arm_thm_jump11.s: New test source file.
1550 * testsuite/arm_thm_jump11.t: New linker script.
1551 * testsuite/arm_thm_jump8.s: New test source file.
1552 * testsuite/arm_thm_jump8.t: New linker script.
1553
487b39df
ILT
15542011-06-24 Ian Lance Taylor <iant@google.com>
1555
1556 * layout.cc: Include "object.h".
1557 (ctors_sections_in_init_array): New static variable.
1558 (Layout::is_ctors_in_init_array): New function.
1559 (Layout::layout): Add entry to ctors_sections_in_init_array if
1560 appropriate.
1561 * layout.h (class Layout): Declare is_ctors_in_init_array.
1562 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1563 is_ctors_reverse_view is set.
1564 (Sized_relobj_file::write_sections): Add layout parameter. Change
1565 all callers. Set is_ctors_reverse_view field of View_size.
1566 (Sized_relobj_file::reverse_words): New function.
1567 * object.h (Sized_relobj_file::View_size): Add
1568 is_ctors_reverse_view field.
1569 (class Sized_relobj_file): Update declarations.
1570 * testsuite/initpri3.c: New test.
1571 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1572 initpri3b.
1573 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1574 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1575 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1576 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1577 * testsuite/Makefile.in: Rebuild.
1578
472076e4
CC
15792011-06-24 Cary Coutant <ccoutant@google.com>
1580
1581 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1582 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1583 (debug_msg_cdebug.err): New targets.
1584 * testsuite/Makefile.in: Regenerate.
1585 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1586 Fix checks for link with shared library.
1587
a60af0db
DK
15882011-06-24 Doug Kwan <dougkwan@google.com>
1589
1590 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1591 skip empty text sections.
1592 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1593
5393d741
ILT
15942011-06-22 Ian Lance Taylor <iant@google.com>
1595
1596 PR gold/12910
1597 * options.h (class General_options): Add --ctors-in-init-array.
1598 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1599 friends as SHT_PROGBITS for merging sections.
1600 (Layout::layout): Remove special handling of .init_array and
1601 friends. Don't sort if doing relocatable link. Sort for .ctors
1602 and .dtors if ctors_in_init_array.
1603 (Layout::make_output_section): Force correct section types for
1604 .init_array and friends. Don't sort if doing relocatable link,
1605 Don't sort .ctors and .dtors if ctors_in_init_array.
1606 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1607 (Layout::output_section_name): Add relobj parameter. Change all
1608 callers. Handle .ctors. and .dtors. in code rather than table.
1609 Handle .ctors and .dtors if ctors_in_init_array.
1610 (Layout::match_file_name): New function, moved from output.cc.
1611 * layout.h (class Layout): Update declarations.
1612 * output.cc: Include "layout.h".
1613 (Input_section_sort_entry::get_priority): New function.
1614 (Input_section_sort_entry::match_file_name): Just call
1615 Layout::match_file_name.
1616 (Output_section::Input_section_sort_init_fini_compare::operator()):
1617 Handle .ctors and .dtors. Sort by explicit priority rather than
1618 by name.
1619 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1620 * testsuite/initpri2.c: New test.
1621 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1622 (check_PROGRAMS): Add initpri2.
1623 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1624 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1625 * configure, testsuite/Makefile.in: Rebuild.
1626
e1f74f98
ILT
16272011-06-19 Ian Lance Taylor <iant@google.com>
1628
1629 PR gold/12880
1630 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1631 .interp section to a PT_INTERP segment even if we have seen a
1632 --dynamic-linker option. Don't do it if we have seen a PHDRS
1633 clause in a linker script.
1634 (Layout::finalize): Don't create a .interp section if we've
1635 already create a PT_INTERP segment.
1636 (Layout::create_interp): Always call choose_output_section (revert
1637 patch of 2011-06-17). Don't create PT_INTERP segment.
1638 * script-sections.cc
1639 (Script_sections::create_note_and_tls_segments): Add a .interp
1640 section to a PT_INTERP segment even if we have seen a
1641 --dynamic-linker option.
1642
766f91bb
ILT
16432011-06-18 Ian Lance Taylor <iant@google.com>
1644
1645 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1646 merely because a non-PT_LOAD segment has a dynamic reloc.
1647
0d212c3a
ILT
16482011-06-18 Ian Lance Taylor <iant@google.com>
1649
1650 * layout.cc (Layout::finish_dynamic_section): Don't create
1651 DT_FLAGS entry if not needed.
1652
911a5072
ILT
16532011-06-18 Ian Lance Taylor <iant@google.com>
1654
1655 PR gold/12745
1656 * layout.cc (Layout::layout_eh_frame): Correct handling of
1657 writable .eh_frame section.
1658
534b4e5f
ILT
16592011-06-17 Ian Lance Taylor <iant@google.com>
1660
1661 PR gold/12893
1662 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1663 symbol is redefined with the exact same object and value.
1664
10b4f102
ILT
16652011-06-17 Ian Lance Taylor <iant@google.com>
1666
1667 PR gold/12880
1668 * layout.h (class Layout): Add interp_segment_ field.
1669 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1670 (Layout::attach_allocated_section_to_segment): If making shared
1671 library, put .interp section in PT_INTERP segment.
1672 (Layout::finalize): Also call create_interp if -dynamic-linker
1673 option was used.
1674 (Layout::create_interp): Assert that there is no PT_INTERP
1675 segment. If not using a SECTIONS clause, use make_output_section.
1676 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1677 * script-sections.cc
1678 (Script_sections::create_note_and_tls_segments): If making shared
1679 library, put .interp section in PT_INTERP segment.
1680
a29b0dad
ILT
16812011-06-17 Ian Lance Taylor <iant@google.com>
1682
e588ea8d
ILT
1683 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1684 when making a shared library.
1685
16862011-06-17 Ian Lance Taylor <iant@google.com>
1687
1688 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1689 parameter. Change all callers. Don't issue warning about PC32
1690 against locally defined symbol.
a29b0dad 1691
9d3b0698
ILT
16922011-06-16 Ian Lance Taylor <iant@google.com>
1693
1694 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1695 occurs in same object.
1696
85b0f90c
AM
16972011-06-14 Alan Modra <amodra@gmail.com>
1698
1699 * po/POTFILES.in: Regenerate.
1700
a94907d9
ILT
17012011-06-09 Ian Lance Taylor <iant@google.com>
1702
1703 * script-sections.cc
1704 (Orphan_output_section::set_section_addresses): For a relocatable
1705 link set address to 0.
1706
4fb3a1c3
CC
17072011-06-09 Cary Coutant <ccoutant@google.com>
1708
1709 PR gold/12804
1710 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1711 used with --compress-debug-sections.
1712 * gold/object.cc (Sized_relobj_file::do_layout): Report
1713 uncompressed size of compressed input sections.
1714
61220854
CC
17152011-06-08 Cary Coutant <ccoutant@google.com>
1716
1717 PR gold/12804
1718 * testsuite/two_file_test_2_v1.cc: Change initialization of
1719 v2 to keep it in .data.
1720
e6455dfb
CC
17212011-06-07 Cary Coutant <ccoutant@google.com>
1722
1723 * common.cc (Symbol_table::do_allocate_commons_list): Call
1724 gold_fallback.
1725 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1726 (Errors::fallback): New function.
1727 (gold_fallback): New function.
1728 * errors.h (Errors::fallback): New function.
1729 * gold.cc (gold_exit): Change status parameter to enum; adjust
1730 all callers.
1731 (queue_initial_tasks): Call gold_fallback.
1732 * gold.h: Include cstdlib.
1733 (Exit_status): New enum type.
1734 (gold_exit): Change status parameter to enum.
1735 (gold_fallback): New function.
1736 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1737 (Layout::create_symtab_sections): Likewise.
1738 (Layout::create_shdrs): Likewise.
1739 * main.cc (main): Adjust call to gold_exit.
1740 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1741 (Output_data_got::add_got_entry_pair): Likewise.
1742 (Output_section::add_input_section): Likewise.
1743 (Output_section::add_output_section_data): Likewise.
1744 (Output_segment::set_section_list_addresses): Likewise.
1745 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1746
fb0e076f
CC
17472011-06-07 Cary Coutant <ccoutant@google.com>
1748
1749 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1750 for incremental links.
1751 * output.cc (Output_segment::set_section_list_addresses): Remove
1752 FIXME and test for TLS or BSS.
1753
a5ee4d5d
CC
17542011-06-07 Cary Coutant <ccoutant@google.com>
1755
1756 * testsuite/Makefile.am: Add incremental_copy_test,
1757 incremental_common_test_1.
1758 * testsuite/Makefile.in: Regenerate.
1759 * testsuite/common_test_1_v1.c: New source file.
1760 * testsuite/common_test_1_v2.c: New source file.
1761 * testsuite/copy_test_v1.cc: New source file.
1762
5146f448
CC
17632011-06-07 Cary Coutant <ccoutant@google.com>
1764
1765 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1766 update, allocate common from bss section's free list.
1767 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1768 linker-defined symbols.
1769 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1770 Skip GOT and PLT entries that are no longer referenced.
1771 (Output_section_incremental_inputs::write_info_blocks): Mark
1772 linker-defined symbols.
1773 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1774 * output.cc (Output_section::allocate): New function.
1775 * output.h (Output_section::allocate): New function.
1776 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1777 linker-defined symbols.
1778 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1779 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1780 (Symbol::init_base_output_data): Likewise.
1781 (Symbol::init_base_output_segment): Likewise.
1782 (Symbol::init_base_constant): Likewise.
1783 (Sized_symbol::init_output_data): Likewise.
1784 (Sized_symbol::init_output_segment): Likewise.
1785 (Sized_symbol::init_constant): Likewise.
1786 (Symbol_table::do_define_in_output_data): Likewise.
1787 (Symbol_table::do_define_in_output_segment): Likewise.
1788 (Symbol_table::do_define_as_constant): Likewise.
1789 * symtab.h (Symbol::is_predefined): New function.
1790 (Symbol::init_base_output_data): Add is_predefined parameter.
1791 (Symbol::init_base_output_segment): Likewise.
1792 (Symbol::init_base_constant): Likewise.
1793 (Symbol::is_predefined_): New data member.
1794 (Sized_symbol::init_output_data): Add is_predefined parameter.
1795 (Sized_symbol::init_output_segment): Likewise.
1796 (Sized_symbol::init_constant): Likewise.
1797 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1798
26d3c67d
CC
17992011-06-07 Cary Coutant <ccoutant@google.com>
1800
1801 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1802 instead of emit_copy_reloc.
1803 (Copy_relocs::emit_copy_reloc): Refactor.
1804 (Copy_relocs::make_copy_reloc): New function.
1805 (Copy_relocs::add_copy_reloc): Remove.
1806 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1807 section.
1808 (Copy_relocs::make_copy_reloc): New function.
1809 (Copy_relocs::add_copy_reloc): Remove.
1810 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1811 unchanged input files.
1812 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1813 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1814 Reserve BSS space for COPY relocations.
1815 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1816 (Output_section_incremental_inputs::write_info_blocks): Record
1817 whether a symbol is copied from a shared object.
1818 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1819 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1820 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1821 (Incremental_input_entry_reader::get_output_symbol_index): Add
1822 is_copy parameter.
1823 (Incremental_binary::emit_copy_relocs): New function.
1824 (Incremental_binary::do_emit_copy_relocs): New function.
1825 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1826 new data member.
1827 (Sized_incremental_binary::add_copy_reloc): New function.
1828 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1829 (Sized_incremental_binary::Copy_reloc): New struct.
1830 (Sized_incremental_binary::Copy_relocs): New typedef.
1831 (Sized_incremental_binary::copy_relocs_): New data member.
1832 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1833 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1834 * target.h (Sized_target::emit_copy_reloc): New function.
1835 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1836
7cdb37d9
CC
18372011-06-02 Cary Coutant <ccoutant@google.com>
1838
1839 PR gold/12163
1840 * gold/archive.cc (Archive::Archive): Initialize new data member.
1841 (Archive::include_all_members): Return if archive has already been
1842 included.
1843 * gold/archive.h (Archive::include_all_members_): New data member.
1844
cc643b88
NC
18452011-06-02 Nick Clifton <nickc@redhat.com>
1846
1847 * dynobj.h: Fix spelling mistake in comment.
1848 * output.cc: Likewise.
1849
f62a3ca7
DK
18502011-05-31 Doug Kwan <dougkwan@google.com>
1851 Asier Llano
1852
1853 PR gold/12826
cc643b88 1854 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1855 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1856 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1857 redundant arm_exidx_test.so.
1858 * testsuite/Makefile.in: Regenerate.
1859 (check_SCRIPTS): Add pr12826.sh
1860 (check_DATA): Add pr12826.stdout
1861 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1862 * testsuite/pr12826.sh: New file.
1863 * testsuite/pr12826_1.s: Ditto.
1864 * testsuite/pr12826_1.s: Ditto.
1865
8dbe1edc
ILT
18662011-05-30 Ian Lance Taylor <iant@google.com>
1867
1868 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1869 sections.
1870
c49875be
ILT
18712011-05-29 Ian Lance Taylor <iant@google.com>
1872
1873 PR gold/12804
1874 * testsuite/Makefile.am: Use different file name for two_file_test
1875 temporary file for each incremental test.
1876 * testsuite/Makefile.in: Rebuild.
1877
69d53f7a
ILT
18782011-05-29 Ian Lance Taylor <iant@google.com>
1879
1880 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1881 binary input file is empty.
1882
41d0ab5f
ILT
18832011-05-27 Ian Lance Taylor <iant@google.com>
1884
1885 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1886 (ver_test_9.so): Likewise.
1887 * testsuite/Makefile.in: Rebuild.
1888
89d8a36b
CC
18892011-05-26 Cary Coutant <ccoutant@google.com>
1890
1891 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1892 * incremental.cc (Incremental_inputs::report_input_section): Fix
1893 comment, indentation.
1894 (Incremental_inputs::report_comdat_group): New function.
1895 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1896 of data for incremental input file entry.
1897 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1898 group count, COMDAT group signatures.
1899 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1900 an unchanged input file.
1901 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1902 Initialize new data member.
1903 (Incremental_object_entry::add_comdat_group): New function.
1904 (Incremental_object_entry::get_comdat_group_count): New function.
1905 (Incremental_object_entry::get_comdat_signature_key): New function.
1906 (Incremental_object_entry::groups_): New data member.
1907 (Incremental_inputs::report_comdat_group): New function.
1908 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1909 data for incremental input file entry.
1910 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1911 (Incremental_input_entry_reader::get_input_section): Adjust size of
1912 data for incremental input file entry.
1913 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1914 (Incremental_input_entry_reader::get_comdat_group_signature): New
1915 function.
1916 * object.cc (Sized_relobj::include_section_group): Report kept
1917 COMDAT groups for incremental links.
1918
1706a06f
ILT
19192011-05-24 David Meyer <pdox@google.com>
1920
1921 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1922 with name parameter. Add found_name parameter.
1923 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1924 * dirsearch.h (class Dirsearch): Update declaration.
1925
a10ae760
ILT
19262011-05-24 Ian Lance Taylor <iant@google.com>
1927
1928 * archive.cc (Library_base::should_include_member): Pull in object
1929 from archive if it defines the entry symbol.
1930 * parameters.cc (Parameters::entry): New function.
1931 * parameters.h (class Parameters): Declare entry.
1932 * output.h (class Output_file_header): Remove entry_ field.
1933 * output.cc (Output_file_header::Output_file_header): Remove entry
1934 parameter. Change all callers.
1935 (Output_file_header::entry): Use parameters->entry.
1936 * gold.cc (queue_middle_tasks): Likewise.
1937 * plugin.cc (Plugin_hook::run): Likewise.
1938
aa92d6ed
CC
19392011-05-24 Cary Coutant <ccoutant@google.com>
1940
1941 * gold.cc (queue_initial_tasks): Pass incremental base filename
1942 to Output_file::open_base_file; don't print error message.
1943 * incremental-dump.cc (main): Adjust call to
1944 Output_file::open_for_modification.
1945 * incremental-dump.cc (main): Likewise.
1946 * incremental.cc (Incremental_inputs::report_command_line):
1947 Ignore --incremental-base option when comparing command lines.
1948 Ignore parameter when given as separate argument.
1949 * options.h (class General_options): Add --incremental-base.
1950 * output.cc (Output_file::Output_file):
1951 (Output_file::open_base_file): Add base_name and writable parameters;
1952 read base file into new file; print error message here.
1953 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1954 callers.
1955 * output.h (Output_file::open_for_modification): Rename to...
1956 (Output_file::open_base_file): ...this; add base_name and
1957 writable parameters; adjust all callers.
1958 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1959 callers.
1960 * testsuite/Makefile.am (incremental_test_4): Test
1961 --incremental-base.
1962 * testsuite/Makefile.in: Regenerate.
1963
2eedd706
CC
19642011-05-24 Cary Coutant <ccoutant@google.com>
1965
1966 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1967 incremental_test_4.
1968 * testsuite/Makefile.in: Regenerate.
1969 * testsuite/two_file_test_1_v1.cc: New test source file.
1970 * testsuite/two_file_test_1b_v1.cc: New test source file.
1971 * testsuite/two_file_test_2_v1.cc: New test source file.
1972
0f1c85a6
CC
19732011-05-24 Cary Coutant <ccoutant@google.com>
1974
1975 * dynobj.h (Dynobj::do_dynobj): New function.
1976 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1977 flag and soname for shared objects.
1978 * incremental.cc (Incremental_inputs::report_object): Make
1979 either Incremental_object_entry or Incremental_dynobj_entry; add
1980 soname to string table.
1981 (Incremental_inputs::report_input_section): Add assertion.
1982 (Output_section_incremental_inputs::set_final_data_size): Adjust
1983 type of input file entry for shared libraries; adjust size of
1984 shared library info entry.
1985 (Output_section_incremental_inputs::write_input_files): Write
1986 as_needed flag for shared libraries.
1987 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1988 of input file entry for shared libraries; write soname.
1989 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1990 soname from incremental info.
1991 * incremental.h (enum Incremental_input_flags): Add
1992 INCREMENTAL_INPUT_AS_NEEDED.
1993 (Incremental_input_entry::Incremental_input_entry): Initialize new
1994 data member.
1995 (Incremental_input_entry::set_as_needed): New function.
1996 (Incremental_input_entry::as_needed): New function.
1997 (Incremental_input_entry::do_dynobj_entry): New function.
1998 (Incremental_input_entry::as_needed_): New data member.
1999 (Incremental_object_entry::Incremental_object_entry): Don't check
2000 for shared library.
2001 (Incremental_object_entry::do_type): Likewise.
2002 (class Incremental_dynobj_entry): New class.
2003 (Incremental_input_entry_reader::as_needed): New function.
2004 (Incremental_input_entry_reader::get_soname): New function.
2005 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2006 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2007 size of shared library info entry.
58797674 2008 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2009 incremental link when adding DT_NEEDED entries.
2010 * object.h (Object::Object): Initialize new data member.
2011 (Object::dynobj): New function.
2012 (Object::set_as_needed): New function.
2013 (Object::as_needed): New function.
2014 (Object::do_dynobj): New function.
2015 (Object::as_needed_): New data member.
2016
6fa2a40b
CC
20172011-05-24 Cary Coutant <ccoutant@google.com>
2018
2019 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2020 info; adjust display of GOT entries.
2021 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2022 vector of input objects; remove file_status_.
2023 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2024 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2025 got_plt reader; call target hooks to reserve GOT entries.
2026 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2027 of input file info header and GOT info entry.
2028 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2029 relocation info.
2030 (Got_plt_view_info::got_descriptor): Remove.
2031 (Got_plt_view_info::sym_index): New data member.
2032 (Got_plt_view_info::input_index): New data member.
2033 (Local_got_offset_visitor::visit): Write input file index.
2034 (Global_got_offset_visitor::visit): Write 0 for input file index.
2035 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2036 with sym_index and input_index.
2037 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2038 incremental info GOT entry; replace got_descriptor with input_index.
2039 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2040 map from input file index to object.
2041 (Sized_relobj_incr::do_layout): Replace direct data member reference
2042 with accessor function.
2043 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2044 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2045 Adjust size of input file info header.
2046 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2047 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2048 (Incremental_input_entry_reader::get_input_section): Adjust size of
2049 input file info header.
2050 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2051 of incremental info GOT entry.
2052 (Incremental_got_plt_reader::get_got_desc): Remove.
2053 (Incremental_got_plt_reader::get_got_symndx): New function.
2054 (Incremental_got_plt_reader::get_got_input_index): New function.
2055 (Sized_incremental_binary::Sized_incremental_binary): Remove
2056 file_status_; add input_objects_.
2057 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2058 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2059 (Sized_incremental_binary::file_is_unchanged): Remove.
2060 (Sized_incremental_binary::set_input_object): New function.
2061 (Sized_incremental_binary::input_object): New function.
2062 (Sized_incremental_binary::file_status_): Remove.
2063 (Sized_incremental_binary::input_objects_): New data member.
2064 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2065 references.
2066 (Sized_relobj_incr::invalid_address): Move to base class.
2067 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2068 class.
2069 (Sized_relobj_incr::do_output_section_offset): Likewise.
2070 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2071 (Sized_relobj_incr::section_offsets_): Likewise.
2072 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2073 function.
2074 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2075 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2076 with accessor function.
2077 (Sized_relobj_file::do_layout): Likewise.
2078 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2079 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2080 (Sized_relobj_file::compute_final_local_value): Replace refs to
2081 section_offsets_ with accessor function.
2082 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2083 * object.h (Relobj::Relobj): Initialize new data members.
2084 (Relobj::add_dyn_reloc): New function.
2085 (Relobj::first_dyn_reloc): New function.
2086 (Relobj::dyn_reloc_count): New function.
2087 (Relobj::first_dyn_reloc_): New data member.
2088 (Relobj::dyn_reloc_count_): New data member.
2089 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2090 references.
2091 (Sized_relobj::Address): New typedef.
2092 (Sized_relobj::invalid_address): Move here from child class.
2093 (Sized_relobj::Sized_relobj): Initialize new data members.
2094 (Sized_relobj::sized_relobj): New function.
2095 (Sized_relobj::is_output_section_offset_invalid): Move here from
2096 child class.
2097 (Sized_relobj::get_output_section_offset): Likewise.
2098 (Sized_relobj::local_has_got_offset): Likewise.
2099 (Sized_relobj::local_got_offset): Likewise.
2100 (Sized_relobj::set_local_got_offset): Likewise.
2101 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2102 (Sized_relobj::clear_got_offsets): New function.
2103 (Sized_relobj::section_offsets): Move here from child class.
2104 (Sized_relobj::do_output_section_offset): Likewise.
2105 (Sized_relobj::do_set_section_offset): Likewise.
2106 (Sized_relobj::Local_got_offsets): Likewise.
2107 (Sized_relobj::local_got_offsets_): Likewise.
2108 (Sized_relobj::section_offsets_): Likewise.
2109 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2110 references.
2111 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2112 class.
2113 (Sized_relobj_file::sized_relobj): New function
2114 (Sized_relobj_file::local_has_got_offset): Move to base class.
2115 (Sized_relobj_file::local_got_offset): Likewise.
2116 (Sized_relobj_file::set_local_got_offset): Likewise.
2117 (Sized_relobj_file::get_output_section_offset): Likewise.
2118 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2119 (Sized_relobj_file::do_output_section_offset): Likewise.
2120 (Sized_relobj_file::do_set_section_offset): Likewise.
2121 (Sized_relobj_file::Local_got_offsets): Likewise.
2122 (Sized_relobj_file::local_got_offsets_): Likewise.
2123 (Sized_relobj_file::section_offsets_): Likewise.
2124 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2125 (all constructors).
2126 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2127 (Output_reloc::get_symbol_index): Likewise.
2128 (Output_reloc::local_section_offset): Likewise.
2129 (Output_reloc::get_address): Likewise.
2130 (Output_reloc::symbol_value): Likewise.
2131 (Output_data_got::reserve_slot): Move to class definition.
2132 (Output_data_got::reserve_local): New function.
2133 (Output_data_got::reserve_slot_for_global): Remove.
2134 (Output_data_got::reserve_global): New function.
2135 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2136 (all constructors, two instantiations).
2137 (Output_reloc::get_relobj): New function (two instantiations).
2138 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2139 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2140 (Output_data_reloc::add_global): Adjust type of relobj.
2141 (Output_data_reloc::add_global_relative): Likewise.
2142 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2143 (Output_data_reloc::add_local): Likewise.
2144 (Output_data_reloc::add_local_relative): Likewise.
2145 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2146 (Output_data_reloc::add_local_section): Likewise.
2147 (Output_data_reloc::add_output_section): Likewise.
2148 (Output_data_reloc::add_absolute): Likewise.
2149 (Output_data_reloc::add_target_specific): Likewise.
2150 (Output_data_got::reserve_slot): Move definition here.
2151 (Output_data_got::reserve_local): New function.
2152 (Output_data_got::reserve_global): New function.
2153 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2154 section_offsets_ with accessor function.
2155 (Sized_relobj_file::write_sections): Likewise.
2156 (Sized_relobj_file::do_relocate_sections): Likewise.
2157 * target.h (Sized_target::reserve_local_got_entry): New function.
2158 (Sized_target::reserve_global_got_entry): New function.
2159 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2160 (Target_x86_64::reserve_global_got_entry): New function.
2161 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2162
4829d394
CC
21632011-05-23 Cary Coutant <ccoutant@google.com>
2164
2165 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2166 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2167 bit when checking got_type.
2168 * incremental.cc (Sized_incremental_binary::setup_readers):
2169 Store symbol table and string table locations; initialize bit vector
2170 of file status flags.
2171 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2172 unchanged files.
2173 (Sized_incremental_binary::do_process_got_plt): New function.
2174 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2175 (Output_section_incremental_inputs::set_final_data_size): Record
2176 file index for each input file.
2177 (Output_section_incremental_inputs::write_got_plt): Store file index
2178 instead of input entry offset for each GOT entry.
2179 * incremental.h
2180 (Incremental_input_entry::Incremental_input_entry): Initialize new
2181 data member.
2182 (Incremental_input_entry::set_offset): Store file index.
2183 (Incremental_input_entry::get_file_index): New function.
2184 (Incremental_input_entry::file_index_): New data member.
2185 (Incremental_binary::process_got_plt): New function.
2186 (Incremental_binary::do_process_got_plt): New function.
2187 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2188 data members.
2189 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2190 (Sized_incremental_binary::set_file_is_unchanged): New function.
2191 (Sized_incremental_binary::file_is_unchanged): New function.
2192 (Sized_incremental_binary::do_process_got_plt): New function.
2193 (Sized_incremental_binary::file_status_): New data member.
2194 (Sized_incremental_binary::main_symtab_loc_): New data member.
2195 (Sized_incremental_binary::main_strtab_loc_): New data member.
2196 * output.cc (Output_data_got::Got_entry::write): Add case
2197 RESERVED_CODE.
2198 (Output_data_got::add_global): Call add_got_entry.
2199 (Output_data_got::add_global_plt): Likewise.
2200 (Output_data_got::add_global_with_rel): Likewise.
2201 (Output_data_got::add_global_with_rela): Likewise.
2202 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2203 (Output_data_got::add_global_pair_with_rela): Likewise.
2204 (Output_data_got::add_local): Call add_got_entry.
2205 (Output_data_got::add_local_plt): Likewise.
2206 (Output_data_got::add_local_with_rel): Likewise.
2207 (Output_data_got::add_local_with_rela): Likewise.
2208 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2209 (Output_data_got::add_local_pair_with_rela): Likewise.
2210 (Output_data_got::reserve_slot): New function.
2211 (Output_data_got::reserve_slot_for_global): New function.
2212 (Output_data_got::add_got_entry): New function.
2213 (Output_data_got::add_got_entry_pair): New function.
2214 (Output_section::add_output_section_data): Edit FIXME.
2215 * output.h
2216 (Output_section_data_build::Output_section_data_build): New
2217 constructor with size parameter.
2218 (Output_data_space::Output_data_space): Likewise.
2219 (Output_data_got::Output_data_got): Initialize new data member; new
2220 constructor with size parameter.
2221 (Output_data_got::add_constant): Call add_got_entry.
2222 (Output_data_got::reserve_slot): New function.
2223 (Output_data_got::reserve_slot_for_global): New function.
2224 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2225 (Output_data_got::add_got_entry): New function.
2226 (Output_data_got::add_got_entry_pair): New function.
2227 (Output_data_got::free_list_): New data member.
2228 * target.h (Sized_target::init_got_plt_for_update): New function.
2229 (Sized_target::register_global_plt_entry): New function.
2230 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2231 Initialize new data member; call init; add constructor with PLT count.
2232 (Output_data_plt_x86_64::init): New function.
2233 (Output_data_plt_x86_64::add_relocation): New function.
2234 (Output_data_plt_x86_64::reserve_slot): New function.
2235 (Output_data_plt_x86_64::free_list_): New data member.
2236 (Target_x86_64::init_got_plt_for_update): New function.
2237 (Target_x86_64::register_global_plt_entry): New function.
2238 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2239 incremental updates.
2240 (Output_data_plt_x86_64::add_relocation): New function.
2241 * testsuite/object_unittest.cc (Object_test): Set default options.
2242
ec69d6da
ILT
22432011-05-16 Ian Lance Taylor <iant@google.com>
2244
2245 * options.h (class General_options): Make -i a synonym for -r.
2246
732e31de
ILT
22472011-05-16 Ian Lance Taylor <iant@google.com>
2248
2249 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2250
403676b5
CC
22512011-05-10 Cary Coutant <ccoutant@google.com>
2252
2253 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2254 strip_all (-s).
2255
5b7b7d6e
ILT
22562011-05-06 Ian Lance Taylor <iant@google.com>
2257
2258 * layout.cc (Layout::layout): If the output section flags change,
2259 update the ordering.
2260
f0f9babf
CC
22612011-04-25 Cary Coutant <ccoutant@google.com>
2262
2263 * incremental-dump.cc (dump_incremental_inputs): Print local
2264 symbol info for each input file.
2265 * incremental.cc
2266 (Output_section_incremental_inputs::set_final_data_size): Add local
2267 symbol info to input file entries in incremental info.
2268 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2269 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2270 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2271 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2272 implementation.
2273 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2274 (Sized_incr_relobj::do_relocate): Write the local symbols.
2275 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2276 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2277 Adjust size of input file header.
2278 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2279 (Incremental_inputs_reader::get_local_symbol_count): New function.
2280 (Incremental_inputs_reader::get_input_section): Adjust size of input
2281 file header.
2282 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2283 (Sized_incr_relobj::This): New typedef.
2284 (Sized_incr_relobj::sym_size): New const data member.
2285 (Sized_incr_relobj::Local_symbol): New struct.
2286 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2287 (Sized_incr_relobj::do_local_symbol_offset): New function.
2288 (Sized_incr_relobj::local_symbol_count_): New data member.
2289 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2290 (Sized_incr_relobj::local_symbol_index_): New data member.
2291 (Sized_incr_relobj::local_symbol_offset_): New data member.
2292 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2293 (Sized_incr_relobj::local_symbols_): New data member.
2294 * object.h (Relobj::output_local_symbol_count): New function.
2295 (Relobj::local_symbol_offset): New function.
2296 (Relobj::do_output_local_symbol_count): New function.
2297 (Relobj::do_local_symbol_offset): New function.
2298 (Sized_relobj::do_output_local_symbol_count): New function.
2299 (Sized_relobj::do_local_symbol_offset): New function.
2300
d0a9ace3
ILT
23012011-04-22 Vladimir Simonov <sv@sw.ru>
2302
2303 * descriptors.cc (set_close_on_exec): New function.
2304 (Descriptors::open): Use set_close_on_exec.
2305 * output.cc (S_ISLNK): Define if not defined.
2306
94a3fc8b
CC
23072011-04-22 Cary Coutant <ccoutant@google.com>
2308
2309 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2310 global symbol map.
2311 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2312 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2313 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2314 relocations.
2315 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2316 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2317 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2318 * incremental.h
2319 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2320 function.
2321 (Incremental_binary::apply_incremental_relocs): New function.
2322 (Incremental_binary::do_apply_incremental_relocs): New function.
2323 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2324 data member.
2325 (Sized_incremental_binary::add_global_symbol): New function.
2326 (Sized_incremental_binary::global_symbol): New function.
2327 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2328 (Sized_incremental_binary::symbol_map_): New data member.
2329 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2330 * target.h (Sized_target::apply_relocation): New function.
2331 * target-reloc.h (apply_relocation): New function.
2332 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2333
c87e4302
DK
23342011-04-22 Doug Kwan <dougkwan@google.com>
2335
2336 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2337 flag of a SHT_ARM_EXIDX section.
2338 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2339 * testsuite/Makefile.in: Regenerate.
2340 * testsuite/arm_exidx_test.s: New file.
2341 * testsuite/arm_exidx_test.sh: Same.
2342
e7782cf6
CC
23432011-04-20 Cary Coutant <ccoutant@google.com>
2344
2345 PR gold/12689
2346 * archive.h (Incremental_archive_entry::Archive_member):
2347 Initialize arg_serial_ (second constructor).
2348
308ecdc7
ILT
23492011-04-17 Ian Lance Taylor <iant@google.com>
2350
2351 * object.cc (Relocate_info::location): Simplify location string.
2352 * errors.cc (Errors::error_at_location): Don't print program
2353 name.
2354 (Errors::warning_at_location): Likewise.
2355 (Errors::undefined_symbol): Likewise.
2356 * testsuite/debug_msg.sh: Update accordingly.
2357
bec5b579
CC
23582011-04-14 Cary Coutant <ccoutant@google.com>
2359
2360 * gold/layout.cc (Layout::symtab_section_offset): New function.
2361 * gold/layout.h (Layout::symtab_section_offset): New function.
2362 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2363
88597d34
ILT
23642011-04-12 Ian Lance Taylor <iant@google.com>
2365
2366 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2367 with MREMAP_MAYMOVE.
2368 * output.h (class Output_file): Add map_is_allocated_ field.
2369 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2370 not available, provide stubs. If mremap is not available, #define
2371 it to gold_mremap.
2372 (MREMAP_MAYMOVE): Define if not defined.
2373 (Output_file::Output_file): Initialize map_is_allocated_.
2374 (Output_file::resize): Check map_is_allocated_.
2375 (Output_file::map_anonymous): If mmap fails, use malloc.
2376 (Output_file::unmap): Don't do anything for an anonymous map.
2377 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2378 is not available, provide stubs.
2379 (File_read::View::~View): Use free rather than delete[].
2380 (File_read::make_view): Use malloc rather than new[]. If mmap
2381 fails, use malloc.
2382 (File_read::find_or_make_view): Use malloc rather than new[].
2383 * gold.h: Remove HAVE_REMAP code.
2384 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2385 exists. Rename mremap to gold_mremap. If mmap is not available
2386 don't do anything.
2387 * configure, config.in: Rebuild.
2388
11e361bc
ILT
23892011-04-11 Ian Lance Taylor <iant@google.com>
2390
2391 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2392 initialize local variable v.
2393
cdc29364
CC
23942011-04-11 Cary Coutant <ccoutant@google.com>
2395
2396 * archive.cc (Archive::include_member): Adjust call to
2397 report_object.
2398 (Add_archive_symbols::run): Track argument serial numbers.
2399 (Lib_group::include_member): Likewise.
2400 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2401 * archive.h (Incremental_archive_entry::Archive_member):
2402 Initialize arg_serial_.
2403 (Archive_member::arg_serial_): New data member.
2404 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2405 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2406 incremental link.
2407 (Sized_dynobj::do_for_all_local_got_entries): New function.
2408 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2409 function.
2410 * fileread.cc (get_mtime): New function.
2411 * fileread.h (get_mtime): New function.
2412 * gold.cc (queue_initial_tasks): Check for incremental update.
2413 (process_incremental_input): New function.
2414 (queue_middle_tasks): Don't force valid target for incremental
2415 update.
2416 * incremental-dump.cc (find_input_containing_global): Adjust
2417 size of symbol info entry.
2418 (dump_incremental_inputs): Dump argument serial number and
2419 in_system_directory flag; bias shndx by 1; print symbol names
2420 when dumping per-file symbol lists; use new symbol info readers.
2421 * incremental.cc
2422 (Output_section_incremental_inputs:update_data_size): New function.
2423 (Sized_incremental_binary::setup_readers): Setup input readers
2424 for each input file; build maps for files added from libraries
2425 and scripts.
2426 (Sized_incremental_binary::check_input_args): New function.
2427 (Sized_incremental_binary::do_check_inputs): Build map of argument
2428 serial numbers to input arguments.
2429 (Sized_incremental_binary::do_file_has_changed): Rename
2430 do_file_is_unchanged to this; compare file modification times.
2431 (Sized_incremental_binary::do_init_layout): New function.
2432 (Sized_incremental_binary::do_reserve_layout): New function.
2433 (Sized_incremental_binary::do_get_input_reader): Remove.
2434 (Sized_incremental_binary::get_symtab_view): New function.
2435 (Incremental_checker::can_incrementally_link_output_file): Remove.
2436 (Incremental_inputs::report_command_line): Exclude --debug options.
2437 (Incremental_inputs::report_archive_begin): Add parameter; track
2438 argument serial numbers; don't put input file entry for archive
2439 before archive members.
2440 (Incremental_inputs::report_archive_end): Put input file entry
2441 for archive after archive members.
2442 (Incremental_inputs::report_object): Add parameter; track argument
2443 serial numbers and in_system_directory flag.
2444 (Incremental_inputs::report_script): Add parameter; track argument
2445 serial numbers.
2446 (Output_section_incremental_inputs::set_final_data_size): Adjust
2447 size of symbol info entry; check for forwarding symbols.
2448 (Output_section_incremental_inputs::write_input_files): Write
2449 in_system_directory flag and argument serial number.
2450 (Output_section_incremental_inputs::write_info_blocks): Map section
2451 indices between incremental info and original input file; store
2452 input section index for each symbol.
2453 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2454 change operator() to visit().
2455 (class Global_got_offset_visitor): Likewise.
2456 (class Global_symbol_visitor_got_plt):
2457 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2458 classes.
2459 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2460 (Sized_incr_relobj::do_read_symbols): New function.
2461 (Sized_incr_relobj::do_layout): New function.
2462 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2463 (Sized_incr_relobj::do_add_symbols): New function.
2464 (Sized_incr_relobj::do_should_include_member): New function.
2465 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2466 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2467 (Sized_incr_relobj::do_section_size): New function.
2468 (Sized_incr_relobj::do_section_name): New function.
2469 (Sized_incr_relobj::do_section_contents): New function.
2470 (Sized_incr_relobj::do_section_flags): New function.
2471 (Sized_incr_relobj::do_section_entsize): New function.
2472 (Sized_incr_relobj::do_section_address): New function.
2473 (Sized_incr_relobj::do_section_type): New function.
2474 (Sized_incr_relobj::do_section_link): New function.
2475 (Sized_incr_relobj::do_section_info): New function.
2476 (Sized_incr_relobj::do_section_addralign): New function.
2477 (Sized_incr_relobj::do_initialize_xindex): New function.
2478 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2479 (Sized_incr_relobj::do_read_relocs): New function.
2480 (Sized_incr_relobj::do_gc_process_relocs): New function.
2481 (Sized_incr_relobj::do_scan_relocs): New function.
2482 (Sized_incr_relobj::do_count_local_symbols): New function.
2483 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2484 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2485 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2486 (Sized_incr_relobj::do_relocate): New function.
2487 (Sized_incr_relobj::do_set_section_offset): New function.
2488 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2489 (Sized_incr_dynobj::do_read_symbols): New function.
2490 (Sized_incr_dynobj::do_layout): New function.
2491 (Sized_incr_dynobj::do_add_symbols): New function.
2492 (Sized_incr_dynobj::do_should_include_member): New function.
2493 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2494 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2495 (Sized_incr_dynobj::do_section_size): New function.
2496 (Sized_incr_dynobj::do_section_name): New function.
2497 (Sized_incr_dynobj::do_section_contents): New function.
2498 (Sized_incr_dynobj::do_section_flags): New function.
2499 (Sized_incr_dynobj::do_section_entsize): New function.
2500 (Sized_incr_dynobj::do_section_address): New function.
2501 (Sized_incr_dynobj::do_section_type): New function.
2502 (Sized_incr_dynobj::do_section_link): New function.
2503 (Sized_incr_dynobj::do_section_info): New function.
2504 (Sized_incr_dynobj::do_section_addralign): New function.
2505 (Sized_incr_dynobj::do_initialize_xindex): New function.
2506 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2507 (make_sized_incremental_object): New function.
2508 (Incremental_library::copy_unused_symbols): New function.
2509 (Incremental_library::do_for_all_unused_symbols): New function.
2510 * incremental.h (enum Incremental_input_flags): New type.
2511 (class Incremental_checker): Remove.
2512 (Incremental_input_entry::Incremental_input_entry): Add argument
2513 serial number.
2514 (Incremental_input_entry::arg_serial): New function.
2515 (Incremental_input_entry::set_is_in_system_directory): New function.
2516 (Incremental_input_entry::is_in_system_directory): New function.
2517 (Incremental_input_entry::arg_serial_): New data member.
2518 (Incremental_input_entry::is_in_system_directory_): New data member.
2519 (class Script_info): Move here from script.h.
2520 (Script_info::Script_info): Add filename parameter.
2521 (Script_info::filename): New function.
2522 (Script_info::filename_): New data member.
2523 (Incremental_script_entry::Incremental_script_entry): Add argument
2524 serial number.
2525 (Incremental_object_entry::Incremental_object_entry): Likewise.
2526 (Incremental_object_entry::add_input_section): Build list of input
2527 sections with map to original shndx.
2528 (Incremental_object_entry::get_input_section_index): New function.
2529 (Incremental_object_entry::shndx_): New data member.
2530 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2531 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2532 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2533 serial number.
2534 (Incremental_inputs::report_archive_begin): Likewise.
2535 (Incremental_inputs::report_object): Likewise.
2536 (Incremental_inputs::report_script): Likewise.
2537 (class Incremental_global_symbol_reader): New class.
2538 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2539 and store flags and input file type.
2540 (Incremental_input_entry_reader::arg_serial): New function.
2541 (Incremental_input_entry_reader::type): Extract type from flags.
2542 (Incremental_input_entry_reader::is_in_system_directory): New function.
2543 (Incremental_input_entry_reader::get_input_section_count): Call
2544 accessor function for type.
2545 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2546 function for type; adjust size of global symbol entry.
2547 (Incremental_input_entry_reader::get_global_symbol_count): Call
2548 accessor function for type.
2549 (Incremental_input_entry_reader::get_object_count): Likewise.
2550 (Incremental_input_entry_reader::get_object_offset): Likewise.
2551 (Incremental_input_entry_reader::get_member_count): Likewise.
2552 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2553 (Incremental_input_entry_reader::get_member_offset): Likewise.
2554 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2555 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2556 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2557 (Incremental_input_entry_reader::get_global_symbol_reader): New
2558 function.
2559 (Incremental_input_entry_reader::get_output_symbol_index): New
2560 function.
2561 (Incremental_input_entry_reader::type_): Remove.
2562 (Incremental_input_entry_reader::flags_): New data member.
2563 (Incremental_inputs_reader::input_file_offset): New function.
2564 (Incremental_inputs_reader::input_file_index): New function.
2565 (Incremental_inputs_reader::input_file): Call input_file_offset.
2566 (Incremental_inputs_reader::input_file_at_offset): New function.
2567 (Incremental_relocs_reader::get_r_type): Reformat.
2568 (Incremental_relocs_reader::get_r_shndx): Reformat.
2569 (Incremental_relocs_reader::get_r_offset): Reformat.
2570 (Incremental_relocs_reader::data): New function.
2571 (Incremental_binary::Incremental_binary): Initialize new data members.
2572 (Incremental_binary::check_inputs): Add cmdline parameter.
2573 (Incremental_binary::file_is_unchanged): Remove.
2574 (Input_reader::arg_serial): New function.
2575 (Input_reader::get_unused_symbol_count): New function.
2576 (Input_reader::get_unused_symbol): New function.
2577 (Input_reader::do_arg_serial): New function.
2578 (Input_reader::do_get_unused_symbol_count): New function.
2579 (Input_reader::do_get_unused_symbol): New function.
2580 (Incremental_binary::input_file_count): New function.
2581 (Incremental_binary::get_input_reader): Change signature to use
2582 index instead of filename.
2583 (Incremental_binary::file_has_changed): New function.
2584 (Incremental_binary::get_input_argument): New function.
2585 (Incremental_binary::get_library): New function.
2586 (Incremental_binary::get_script_info): New function.
2587 (Incremental_binary::init_layout): New function.
2588 (Incremental_binary::reserve_layout): New function.
2589 (Incremental_binary::output_file): New function.
2590 (Incremental_binary::do_check_inputs): New function.
2591 (Incremental_binary::do_file_is_unchanged): Remove.
2592 (Incremental_binary::do_file_has_changed): New function.
2593 (Incremental_binary::do_init_layout): New function.
2594 (Incremental_binary::do_reserve_layout): New function.
2595 (Incremental_binary::do_input_file_count): New function.
2596 (Incremental_binary::do_get_input_reader): Change signature.
2597 (Incremental_binary::input_args_map_): New data member.
2598 (Incremental_binary::library_map_): New data member.
2599 (Incremental_binary::script_map_): New data member.
2600 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2601 new data members.
2602 (Sized_incremental_binary::output_section): New function.
2603 (Sized_incremental_binary::inputs_reader): Add const.
2604 (Sized_incremental_binary::symtab_reader): Add const.
2605 (Sized_incremental_binary::relocs_reader): Add const.
2606 (Sized_incremental_binary::got_plt_reader): Add const.
2607 (Sized_incremental_binary::get_symtab_view): New function.
2608 (Sized_incremental_binary::Inputs_reader): New typedef.
2609 (Sized_incremental_binary::Input_entry_reader): New typedef.
2610 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2611 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2612 (Sized_incremental_binary::do_file_has_changed): New function.
2613 (Sized_incremental_binary::do_init_layout): New function.
2614 (Sized_incremental_binary::do_reserve_layout): New function.
2615 (Sized_input_reader::Inputs_reader): Remove.
2616 (Sized_input_reader::Input_entry_reader): Remove.
2617 (Sized_input_reader::do_arg_serial): New function.
2618 (Sized_input_reader::do_get_unused_symbol_count): New function.
2619 (Sized_input_reader::do_get_unused_symbol): New function.
2620 (Sized_incremental_binary::do_input_file_count): New function.
2621 (Sized_incremental_binary::do_get_input_reader): Change signature;
2622 use index instead of filename.
2623 (Sized_incremental_binary::section_map_): New data member.
2624 (Sized_incremental_binary::input_entry_readers_): New data member.
2625 (class Sized_incr_relobj): New class.
2626 (class Sized_incr_dynobj): New class.
2627 (make_sized_incremental_object): New function.
2628 (class Incremental_library): New class.
2629 * layout.cc (Free_list::num_lists): New static data member.
2630 (Free_list::num_nodes): New static data member.
2631 (Free_list::num_removes): New static data member.
2632 (Free_list::num_remove_visits): New static data member.
2633 (Free_list::num_allocates): New static data member.
2634 (Free_list::num_allocate_visits): New static data member.
2635 (Free_list::init): New function.
2636 (Free_list::remove): New function.
2637 (Free_list::allocate): New function.
2638 (Free_list::dump): New function.
2639 (Free_list::print_stats): New function.
2640 (Layout_task_runner::run): Resize output file for incremental updates.
2641 (Layout::Layout): Initialize new data members.
2642 (Layout::set_incremental_base): New function.
2643 (Layout::init_fixed_output_section): New function.
2644 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2645 incremental updates.
2646 (Layout::create_gold_note): Do not create gold note section for
2647 incremental updates.
2648 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2649 for incremental updates.
2650 (Layout::set_section_offsets): For incremental updates, allocate space
2651 from free list.
2652 (Layout::create_symtab_sections): Layout with offsets relative to
2653 start of section; for incremental updates, allocate space from free
2654 list.
2655 (Layout::create_shdrs): For incremental updates, allocate space from
2656 free list.
2657 (Layout::finish_dynamic_section): For incremental updates, do not
2658 check --as-needed (fixed in subsequent patch).
2659 * layout.h (class Free_list): New class.
2660 (Layout::set_incremental_base): New function.
2661 (Layout::incremental_base): New function.
2662 (Layout::init_fixed_output_section): New function.
2663 (Layout::allocate): New function.
2664 (Layout::incremental_base_): New data member.
2665 (Layout::free_list_): New data member.
2666 * main.cc (main): Print Free_list statistics.
2667 * object.cc (Relobj::finalize_incremental_relocs): Add
2668 clear_counts parameter; clear counts only when clear_counts is set.
2669 (Sized_relobj::Sized_relobj): Initialize new base class.
2670 (Sized_relobj::do_layout): Don't report special sections.
2671 (Sized_relobj::do_for_all_local_got_entries): New function.
2672 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2673 symtab_off to all symbol table offsets.
2674 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2675 * object.h (class Got_offset_list): Move to top of file.
2676 (Object::Object): Allow case where input_file == NULL.
2677 (Object::~Object): Likewise.
2678 (Object::input_file): Assert that input_file != NULL.
2679 (Object::lock): Allow case where input_file == NULL.
2680 (Object::unlock): Likewise.
2681 (Object::is_locked): Likewise.
2682 (Object::token): Likewise.
2683 (Object::release): Likewise.
2684 (Object::is_incremental): New function.
2685 (Object::get_mtime): New function.
2686 (Object::for_all_local_got_entries): New function.
2687 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2688 (Object::set_is_in_system_directory): New function.
2689 (Object::is_in_system_directory): New function.
2690 (Object::do_is_incremental): New function.
2691 (Object::do_get_mtime): New function.
2692 (Object::do_for_all_local_got_entries): New function.
2693 (Object::is_in_system_directory_): New data member.
2694 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2695 (class Sized_relobj_base): New class.
2696 (class Sized_relobj): Derive from Sized_relobj_base.
2697 (class Sized_relobj::Symbols): Redeclare from base class.
2698 (class Sized_relobj::local_got_offset_list): Remove.
2699 (class Sized_relobj::Output_sections): Redeclare from base class.
2700 (class Sized_relobj::do_for_all_local_got_entries): New function.
2701 (class Sized_relobj::write_local_symbols): Add offset parameter.
2702 (class Sized_relobj::local_symbol_offset_): Update comment.
2703 (class Sized_relobj::local_dynsym_offset_): Update comment.
2704 * options.cc (Input_arguments::add_file): Remove const.
2705 * options.h (Input_file_argument::Input_file_argument):
2706 Initialize arg_serial_ (all constructors).
2707 (Input_file_argument::set_arg_serial): New function.
2708 (Input_file_argument::arg_serial): New function.
2709 (Input_file_argument::arg_serial_): New data member.
2710 (Input_arguments::Input_arguments): Initialize file_count_.
2711 (Input_arguments::add_file): Remove const.
2712 (Input_arguments::number_of_input_files): New function.
2713 (Input_arguments::file_count_): New data member.
2714 (Command_line::number_of_input_files): Call
2715 Input_arguments::number_of_input_files.
2716 * output.cc (Output_segment_headers::Output_segment_headers):
2717 Set current size.
2718 (Output_section::Input_section::current_data_size): New function.
2719 (Output_section::Output_section): Initialize new data members.
2720 (Output_section::add_input_section): Don't do merge sections for
2721 an incremental link; allocate space from free list for an
2722 incremental update.
2723 (Output_section::add_output_section_data): Allocate space from
2724 free list for an incremental update.
2725 (Output_section::update_data_size): New function.
2726 (Output_section::set_fixed_layout): New function.
2727 (Output_section::reserve): New function.
2728 (Output_segment::set_section_addresses): Remove const.
2729 (Output_segment::set_section_list_addresses): Remove const; allocate
2730 space from free list for an incremental update.
2731 (Output_segment::set_offset): Adjust size of RELRO segment for an
2732 incremental update.
2733 * output.h (Output_data::current_data_size): Move here from
2734 child classes.
2735 (Output_data::pre_finalize_data_size): New function.
2736 (Output_data::update_data_size): New function.
2737 (Output_section_headers::update_data_size): new function.
2738 (Output_section_data_build::current_data_size): Move to Output_data.
2739 (Output_data_strtab::update_data_size): New function.
2740 (Output_section::current_data_size): Move to Output_data.
2741 (Output_section::set_fixed_layout): New function.
2742 (Output_section::has_fixed_layout): New function.
2743 (Output_section::reserve): New function.
2744 (Output_section::update_data_size): New function.
2745 (Output_section::has_fixed_layout_): New data member.
2746 (Output_section::free_list_): New data member.
2747 (Output_segment::set_section_addresses): Remove const.
2748 (Output_segment::set_section_list_addresses): Remove const.
2749 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2750 New function.
2751 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2752 New function.
2753 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2754 parameter when calling Add_symbols constructor; store argument
2755 serial number for members of a lib group.
2756 (Add_symbols::locks): Allow case where token == NULL.
2757 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2758 (Read_member::~Read_member): New function.
2759 (Read_member::is_runnable): New function.
2760 (Read_member::locks): New function.
2761 (Read_member::run): New function.
2762 (Check_script::~Check_script): New function.
2763 (Check_script::is_runnable): New function.
2764 (Check_script::locks): New function.
2765 (Check_script::run): New function.
2766 (Check_library::~Check_library): New function.
2767 (Check_library::is_runnable): New function.
2768 (Check_library::locks): New function.
2769 (Check_library::run): New function.
2770 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2771 (Add_symbols::library_): New data member.
2772 (class Read_member): New class.
2773 (class Check_script): New class.
2774 (class Check_library): New class.
2775 * reloc.cc (Read_relocs::is_runnable): Allow case where
2776 token == NULL.
2777 (Read_relocs::locks): Likewise.
2778 (Scan_relocs::locks): Likewise.
2779 (Relocate_task::locks): Likewise.
2780 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2781 to clear counters.
2782 (Sized_relobj::incremental_relocs_scan): Fix comment.
2783 (Sized_relobj::do_relocate): Pass output file offset to
2784 write_local_symbols.
2785 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2786 from class declaration.
2787 * script.cc (read_input_script): Allocate Script_info; pass
2788 argument serial number to report_script.
2789 * script.h (class Script_info): Move to incremental.h.
2790 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2791 * symtab.h (Symbol_table::add_from_incrobj): New function.
2792 (Symbol_table::set_file_offset): New function.
2793
b961d0d7
CC
27942011-04-05 Cary Coutant <ccoutant@google.com>
2795
2796 * incremental-dump.cc (dump_incremental_inputs): Change signature
2797 to take a Sized_incremental_binary; change caller. Use readers
2798 in Sized_incremental_binary.
2799 * incremental.cc
2800 (Sized_incremental_binary::find_incremental_inputs_sections):
2801 Rename do_find_incremental_inputs_sections to this.
2802 (Sized_incremental_binary::setup_readers): New function.
2803 (Sized_incremental_binary::do_check_inputs): Check
2804 has_incremental_info_ flag; move setup code to setup_readers;
2805 use input readers.
2806 (Sized_incremental_binary::do_file_is_unchanged): New function.
2807 (Sized_incremental_binary::do_get_input_reader): New function.
2808 * incremental.h (class Incremental_binary): Move to end of file.
2809 (Incremental_binary::file_is_unchanged): New function.
2810 (Incremental_binary::do_file_is_unchanged): New function.
2811 (Incremental_binary::Input_reader): New class.
2812 (Incremental_binary::get_input_reader): New function.
2813 (class Sized_incremental_binary): Move to end of file.
2814 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2815 input section reader classes.
2816 (Sized_incremental_binary::has_incremental_info): New function.
2817 (Sized_incremental_binary::inputs_reader): New function.
2818 (Sized_incremental_binary::symtab_reader): New function.
2819 (Sized_incremental_binary::relocs_reader): New function.
2820 (Sized_incremental_binary::got_plt_reader): New function.
2821 (Sized_incremental_binary::do_file_is_unchanged): New function.
2822 (Sized_incremental_binary::Sized_input_reader): New class.
2823 (Sized_incremental_binary::get_input_reader): New function.
2824 (Sized_incremental_binary::find_incremental_inputs_sections):
2825 Rename do_find_incremental_inputs_sections to this.
2826 (Sized_incremental_binary::setup_readers): New function.
2827 (Sized_incremental_binary::has_incremental_info_): New data member.
2828 (Sized_incremental_binary::inputs_reader_): New data member.
2829 (Sized_incremental_binary::symtab_reader_): New data member.
2830 (Sized_incremental_binary::relocs_reader_): New data member.
2831 (Sized_incremental_binary::got_plt_reader_): New data member.
2832 (Sized_incremental_binary::current_input_file_): New data member.
2833
a869183f
PP
28342011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2835
2836 PR gold/12640
2837 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2838 violation.
2839
28402011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2841
2842 * archive.cc (Archive::include_member): Adjust call to report_object.
2843 (Add_archive_symbols::run): Add script_info to call to
2844 report_archive_begin.
2845 (Lib_group::include_member): Adjust call to report_object.
2846 (Add_lib_group_symbols::run): Adjust call to report_object.
2847 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2848 blocks. Add object count for script input files.
2849 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2850 script_info parameter; change all callers.
2851 (Incremental_inputs::report_object): Add script_info parameter;
2852 change all callers.
2853 (Incremental_inputs::report_script): Store backpointer to
2854 incremental info entry.
2855 (Output_section_incremental_inputs::set_final_data_size): Record
2856 additional information for scripts.
2857 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2858 * incremental.h (Incremental_script_entry::add_object): New function.
2859 (Incremental_script_entry::get_object_count): New function.
2860 (Incremental_script_entry::get_object): New function.
2861 (Incremental_script_entry::objects_): New data member; adjust
2862 constructor.
2863 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2864 (Incremental_inputs::report_object): Add script_info parameter.
2865 (Incremental_inputs_reader::get_object_count): New function.
2866 (Incremental_inputs_reader::get_object_offset): New function.
2867 * options.cc (Input_arguments::add_file): Return reference to
2868 new input argument.
2869 * options.h (Input_argument::set_script_info): New function.
2870 (Input_argument::script_info): New function.
2871 (Input_argument::script_info_): New data member; adjust all
2872 constructors.
2873 (Input_file_group::add_file): Return reference to new input argument.
2874 (Input_file_lib::add_file): Likewise.
2875 (Input_arguments::add_file): Likewise.
2876 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2877 * script.cc (Parser_closure::Parser_closure): Add script_info
2878 parameter; adjust all callers.
2879 (Parser_closure::script_info): New function.
2880 (Parser_closure::script_info_): New data member.
2881 (read_input_script): Report scripts earlier to incremental info.
2882 (script_add_file): Set script_info in Input_argument.
2883 (script_add_library): Likewise.
2884 * script.h (Script_options::Script_info): Rewrite class.
2885
a869183f 28862011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2887
2888 * archive.cc (Library_base::should_include_member): Move
2889 method here from class Archive.
2890 (Archive::Archive): Initialize base class.
2891 (Archive::should_include_member): Move to base class.
2892 (Archive::do_for_all_unused_symbols): New function.
2893 (Add_archive_symbols::run): Remove redundant access to
2894 incremental_inputs.
2895 (Lib_group::Lib_group): Initialize base class.
2896 (Lib_group::do_filename): New function.
2897 (Lib_group::include_member): Pass pointer to Lib_group to
2898 report_object.
2899 (Lib_group::do_for_all_unused_symbols): New function.
2900 (Add_lib_group_symbols::run): Report archive information for
2901 incremental links.
2902 * archive.h (class Library_base): New base class.
2903 (class Archive): Derive from Library_base.
2904 (Archive::filename): Move to base class.
2905 (Archive::set_incremental_info): Likewise.
2906 (Archive::incremental_info): Likewise.
2907 (Archive::Should_include): Likewise.
2908 (Archive::should_include_member): Likewise.
2909 (Archive::Armap_entry): Remove.
2910 (Archive::Unused_symbol_iterator): Remove.
2911 (Archive::unused_symbols_begin): Remove.
2912 (Archive::unused_symbols_end): Remove.
2913 (Archive::do_filename): New function.
2914 (Archive::do_get_mtime): New function.
2915 (Archive::do_for_all_unused_symbols): New function.
2916 (Archive::task_): Move to base class.
2917 (Archive::incremental_info_): Likewise.
2918 (class Lib_group): Derive from Library_base.
2919 (Lib_group::do_filename): New function.
2920 (Lib_group::do_get_mtime): New function.
2921 (Lib_group::do_for_all_unused_symbols): New function.
2922 (Lib_group::task_): Move to base class.
2923 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2924 function.
2925 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2926 function.
2927 * incremental.cc (Incremental_inputs::report_archive_begin):
2928 Use Library_base; call library's get_mtime; add incremental inputs
2929 entry before members.
2930 (class Unused_symbol_visitor): New class.
2931 (Incremental_inputs::report_archive_end): Use Library_base; use
2932 visitor class to record unused symbols; don't add incremental inputs
2933 entry after members.
2934 (Incremental_inputs::report_object): Use Library_base.
2935 * incremental.h
2936 (Incremental_archive_entry::Incremental_archive_entry): Remove
2937 unused Archive parameter.
2938 (Incremental_inputs::report_archive_begin): Use Library_base.
2939 (Incremental_inputs::report_archive_end): Likewise.
2940 (Incremental_inputs::report_object): Likewise.
2941 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2942 function.
2943 * object.h (Object::for_all_global_symbols): New function.
2944 (Object::do_for_all_global_symbols): New function.
2945 (Sized_relobj::do_for_all_global_symbols): New function.
2946 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2947 function.
2948 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2949 function.
2950
61ab3e40
ILT
29512011-03-27 Ian Lance Taylor <iant@google.com>
2952
2953 * archive.cc (Archive::interpret_header): Return -1 if something
2954 goes wrong. Change callers accordingly.
2955
30e1f9e6
CC
29562011-03-25 Cary Coutant <ccoutant@google.com>
2957
2958 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2959 * testsuite/Makefile.in: Regenerate.
2960
9370ce59 29612011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2962
2963 * plugin.cc (get_view): New.
2964 (Plugin::load): Pass get_view to the plugin.
2965 (Plugin_manager::get_view): New.
2966
9312bb0a
ILT
29672011-03-21 Ian Lance Taylor <iant@google.com>
2968
2969 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2970 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2971
7e12ba9e
ST
29722011-03-21 Sriraman Tallam <tmsriram@google.com>
2973
2974 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2975 Change == to -eq.
2976 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2977 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2978 Change == to -eq.
2979 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2980 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2981
fd7a005d
ILT
29822011-03-14 Ian Lance Taylor <iant@google.com>
2983
2984 * script-sections.cc (Sort_output_sections::script_compare):
2985 Rename from is_before, change return type.
2986 (Sort_output_sections::operator()): Adjust accordingly.
2987
ed16fd1b
ILT
29882011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2989
2990 PR gold/12572
2991 * testsuite/odr_violation2.cc: Add comment to make all error line
2992 numbers double digits.
2993 * testsuite/debug_msg.sh: Adjust expected errors.
2994
71ff8986
ILT
29952011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2996
2997 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2998 but mark earlier ones as non-canonical
2999 (offset_to_iterator): Update search target and example
3000 (do_addr2line): Return extra lines in a vector*
3001 (format_file_lineno): Extract from do_addr2line
3002 (one_addr2line): Add vector* out-param
3003 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3004 when a lineno entry appeared last for its instruction
3005 (Dwarf_line_info): Add vector* out-param
3006 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3007 * symtab.cc (Odr_violation_compare): Include the lineno in the
3008 comparison again.
3009 (linenos_from_loc): New. Combine the canonical line for an
3010 address with its other lines.
3011 (True_if_intersect): New. Helper functor to make
3012 std::set_intersection a query.
3013 (detect_odr_violations): Compare sets of lines instead of just
3014 one line for each function. This became less deterministic, but
3015 has fewer false positives.
3016 * symtab.h: Declarations.
3017 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3018 mix an optimized and non-optimized object in the same binary
3019 (odr_violation2.so): Same.
3020 * testsuite/Makefile.in: Regenerate from Makefile.am.
3021 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3022 * testsuite/debug_msg.sh: Update line numbers and add
3023 assertions.
3024 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3025 non-optimized context.
3026 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3027 isn't inlined, and use OdrDerived in an optimized context.
3028 * testsuite/odr_header1.h: Defines OdrDerived, where
3029 optimization will change the
3030 first-instruction-in-the-destructor's file and line number.
3031 * testsuite/odr_header2.h: Defines OdrBase.
3032
a19fefdc
ILT
30332011-03-09 Ian Lance Taylor <iant@google.com>
3034
3035 * fileread.cc (File_read::clear_views): Don't delete the whole
3036 file view.
3037
ecb351e9
ILT
30382011-03-08 Ian Lance Taylor <iant@google.com>
3039
3040 PR gold/12525
3041 * fileread.cc: #include <climits>.
3042 (GOLD_IOV_MAX): Define.
3043 (File_read::read_multiple): Limit number of entries by iov_max.
3044 * fileread.h (class File_read): Always set max_readv_entries to
3045 128.
3046
b821d13c
ILT
30472011-03-07 Ian Lance Taylor <iant@google.com>
3048
3049 PR gold/12525
3050 * options.h (class General_options): Add -dy and -dn.
3051
89243142
CC
30522011-03-02 Cary Coutant <ccoutant@google.com>
3053
3054 * testsuite/script_test_9.t: Add TLS segment.
3055
d0773f31
ILT
30562011-03-02 Simon Baldwin <simonb@google.com>
3057
3058 * configure.ac: Add check for gnu_indirect_function support in
3059 the toolchain building binutils.
3060 * configure: Rebuild.
3061
9370ce59 30622011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3063
3064 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3065 plugin only symbols.
3066 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3067 in plugin files as not needed in the symbol table.
3068
4cf7a849
ST
30692011-02-11 Sriraman Tallam <tmsriram@google.com>
3070
3071 * output.cc (Output_section::add_input_section): Delay fill
3072 generation for section ordering.
3073
b578bd7d
ILT
30742011-02-09 Ian Lance Taylor <iant@google.com>
3075
3076 PR gold/12316
3077 * object.h (class Sized_relobj): Remove clear_local_symbols.
3078 * reloc.cc (Sized_relobj::do_relocate): Don't call
3079 clear_local_symbols.
3080
9370ce59 30812011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3082
3083 * plugin.cc (is_visible_from_outside): Return true for symbols
3084 in the -u option.
3085
55382fb7
ILT
30862011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3087
3088 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3089 filename.
3090
4e271fff
ST
30912011-02-02 Sriraman Tallam <tmsriram@google.com>
3092
3093 * icf.h (is_section_foldable_candidate): Change type of parameter
3094 to std::string.
3095 * icf.cc (Icf::find_identical_sections): Change type of local variable
3096 section_name to be std::string.
3097 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3098
d433c3ac
ILT
30992011-01-25 Ian Lance Taylor <iant@google.com>
3100
3101 * script.cc (script_add_extern): Rewrite to use
3102 add_symbol_reference.
3103
880473a6
DK
31042011-01-25 Doug Kwan <dougkwan@google.com>
3105
d433c3ac 3106 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3107
f30f86fa
ILT
31082011-01-24 Ian Lance Taylor <iant@google.com>
3109
3110 * options.h (class General_options): Accept
3111 --no-detect-odr-violations.
3112
8e51a0b9
ILT
31132011-01-24 Ian Lance Taylor <iant@google.com>
3114
3115 * version.cc (version_string): Bump to 1.11.
3116
0f3b89d8
ILT
31172011-01-24 Ian Lance Taylor <iant@google.com>
3118
3119 * plugin.cc (class Plugin_rescan): Define new class.
3120 (Plugin_manager::claim_file): Set any_claimed_.
3121 (Plugin_manager::save_archive): New function.
3122 (Plugin_manager::save_input_group): New function.
3123 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3124 necessary.
3125 (Plugin_manager::new_undefined_symbol): New function.
3126 (Plugin_manager::rescan): New function.
3127 (Plugin_manager::rescannable_defines): New function.
3128 (Plugin_manager::add_input_file): Set any_added_.
3129 * plugin.h (class Plugin_manager): define new fields rescannable_,
3130 undefined_symbols_, any_claimed_, and any_added_. Declare
3131 Plugin_rescan as friend. Declare new functions.
3132 (Plugin_manager::Rescannable): Define type.
3133 (Plugin_manager::Rescannable_list): Define type.
3134 (Plugin_manager::Undefined_symbol_list): Define type.
3135 (Plugin_manager::Plugin_manager): Initialize new fields.
3136 * archive.cc (Archive::defines_symbol): New function.
3137 (Add_archive_symbols::run): Pass archive to plugins if any.
3138 * archive.h (class Archive): Declare defines_symbol.
3139 * readsyms.cc (Input_group::~Input_group): New function.
3140 (Finish_group::run): Pass input_group to plugins if any.
3141 * readsyms.h (class Input_group): Declare destructor.
3142 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3143 any.
3144
3bb951e5
ILT
31452011-01-10 Ian Lance Taylor <iant@google.com>
3146
3147 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3148 section as relro.
3149 (Layout::set_segment_offsets): Reset increase_relro before calling
3150 set_section_addresses a second time.
3151
0aa45fac
CC
31522011-01-04 Cary Coutant <ccoutant@google.com>
3153
3154 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3155 sections before NOBITS sections.
3156
0db46eb4
L
31572011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3158
3159 * version.cc (print_version): Update copyright to 2011.
3160
829c9745
CC
31612010-12-23 Cary Coutant <ccoutant@google.com>
3162
3163 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3164 of OS to this->add. Add OD parameter to second form of the function.
3165
7500420b
ILT
31662010-12-20 Ian Lance Taylor <iant@google.com>
3167
3168 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3169 second of two consecutive entries with same offset.
3170
f8e9a930
RW
31712010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3172
3173 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3174 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3175 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3176 to avoid unneeded links against $(LDADD).
3177 * testsuite/Makefile.in: Regenerate.
3178
2fbb4320
ILT
31792010-12-15 Ian Lance Taylor <iant@google.com>
3180
3181 PR gold/12324
3182 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3183 for R_X86_64_32 and R_X86_64_PC32.
3184 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3185 ver_matching_def_pic.o.
3186 (ver_matching_def_pic.o): New target.
3187
fedb228d
RW
31882010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3189
3190 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3191 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3192 Move definition before File_read::View member definitions.
3193 (File_read::View::~View): Initialize and hold lock before
3194 updating current_mapped_bytes.
3195
9b547ce6
RW
31962010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3197
3198 * dwarf_reader.cc: Remove outdated comment.
3199 * gold-threads.cc: Fix typo in error message.
3200 * archive.cc: Fix typos in comments.
3201 * archive.h: Likewise.
3202 * arm-reloc-property.cc: Likewise.
3203 * arm-reloc-property.h: Likewise.
3204 * arm-reloc.def: Likewise.
3205 * arm.cc: Likewise.
3206 * attributes.h: Likewise.
3207 * cref.cc: Likewise.
3208 * ehframe.cc: Likewise.
3209 * fileread.h: Likewise.
3210 * gold.h: Likewise.
3211 * i386.cc: Likewise.
3212 * icf.cc: Likewise.
3213 * incremental.h: Likewise.
3214 * int_encoding.cc: Likewise.
3215 * layout.h: Likewise.
3216 * main.cc: Likewise.
3217 * merge.h: Likewise.
3218 * object.cc: Likewise.
3219 * object.h: Likewise.
3220 * options.cc: Likewise.
3221 * readsyms.cc: Likewise.
3222 * reduced_debug_output.cc: Likewise.
3223 * reloc.cc: Likewise.
3224 * script-sections.cc: Likewise.
3225 * sparc.cc: Likewise.
3226 * symtab.h: Likewise.
3227 * target-reloc.h: Likewise.
3228 * target.cc: Likewise.
3229 * target.h: Likewise.
3230 * timer.cc: Likewise.
3231 * timer.h: Likewise.
3232 * x86_64.cc: Likewise.
3233
83e17bd5
CC
32342010-12-09 Cary Coutant <ccoutant@google.com>
3235
3236 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3237 stack.
3238 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3239 parameter; change all callers.
3240 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3241 * options.h (warn_execstack): New option.
3242
017257f8
DK
32432010-12-07 Doug Kwan <dougkwan@google.com>
3244
3245 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3246 like function call relocations.
3247
c20cbc06
ILT
32482010-12-07 Ian Lance Taylor <iant@google.com>
3249
3250 * archive.cc (Archive::get_elf_object_for_member): Permit
3251 punconfigured to be NULL.
3252 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3253 (Archive::include_member): Pass NULL to get_elf_object_for_member
3254 if we searched for the archive and this is the first included
3255 object.
3256
4dbfafcc
ILT
32572010-12-01 Ian Lance Taylor <iant@google.com>
3258
3259 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3260 track_relocs_type_ field.
3261 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3262 Set track_relocs_type_.
3263 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3264 contents when using RELA relocs.
3265 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3266 reloc_map_.
3267 * reloc.cc (Track_relocs::next_addend): New function.
3268 * reloc.h (class Track_relocs): Declare next_addend.
3269
e5e19edd
ILT
32702010-12-01 Ian Lance Taylor <iant@google.com>
3271
3272 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3273 virtual destructor.
3274
9a5ce24c
ILT
32752010-12-01 Ian Lance Taylor <iant@google.com>
3276
3277 * README: Update compilers known to work and fail.
3278
c7791212
NC
32792010-11-23 Matthias Klose <doko@ubuntu.com>
3280
3281 * configure.in: For --enable-gold, handle value `default' instead of
3282 `both*'. Always install ld as ld.bfd, install as ld if gold is
3283 not the default.
3284 * configure: Regenerate.
3285
0ad220c9
DK
32862010-11-18 Doug Kwan <dougkwan@google.com>
3287
3288 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3289 and right_alignment to be zero. Store result alignment only if it is
3290 greater than existing alignment.
3291
ab8056e0
CC
32922010-11-16 Cary Coutant <ccoutant@google.com>
3293
3294 PR gold/12220
3295 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3296 Check for ".zdebug_line".
3297
fd064a5b
CC
32982010-11-16 Doug Kwan <dougkwan@google.com>
3299 Cary Coutant <ccoutant@google.com>
3300
3301 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3302 by reference; adjust all callers.
3303 * output.cc (Output_segment::set_section_addresses): Adjust references
3304 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3305 list is empty.
3306 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3307 end at page boundary.
3308
6fc6ea19
CC
33092010-11-16 Cary Coutant <ccoutant@google.com>
3310
3311 PR gold/12220
3312 * layout.cc (Layout::choose_output_section): Transform names of
3313 compressed sections even when using a script with a SECTIONS clause.
3314 (Layout::output_section_name): Remove code to transform
3315 compressed debug section names.
3316 * output.cc (Output_section::add_input_section): Use uncompressed
3317 section size when tracking input sections.
3318
95a2c8d6
RS
33192010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3320
3321 * symtab.h (Symbol::NON_PIC_REF): Remove.
3322 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3323 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3324 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3325 (Symbol::use_plt_offset): Take a flags argument and pass it
3326 directly to needs_dynamic_reloc. Restrict check for undefined
3327 weak symbols to function calls.
3328 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3329 (Target_arm::Scan::global): Use it.
3330 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3331 (Target_arm::Relocate::relocate): Likewise.
3332 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3333 parameter with an r_type parameter. Use get_reference_flags
3334 to get the flags.
3335 (Target_arm::Relocate::relocate): Update accordingly.
3336 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3337 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3338 (Target_i386::Scan::global): Likewise.
3339 (Target_i386::Relocate::relocate): Likewise.
3340 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3341 parameter with an r_type parameter. Use get_reference_flags
3342 to get the flags.
3343 (Target_i386::Relocate::relocate): Update accordingly.
3344 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3345 (Target_powerpc::Scan::global): Use it.
3346 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3347 (Target_powerpc::Relocate::relocate): Likewise.
3348 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3349 (Target_sparc::Scan::global): Use it.
3350 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3351 (Target_sparc::Relocate::relocate): Likewise.
3352 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3353 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3354 (Target_x86_64::Scan::global): Likewise.
3355 (Target_x86_64::Relocate::relocate): Likewise.
3356
f625ae50
DK
33572010-11-08 Doug Kwan <dougkwan@google.com>
3358 Cary Coutant <ccoutant@google.com>
3359
3360 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3361 (Arm_exidx_merge_section::section_contents_): New data member.
3362 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3363 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3364 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3365 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3366 in parameters instead of calling Object::section_contents without
3367 locking.
3368 (Arm_output_section::group_section): New parameter TASK. Pass it
3369 to callees that need locking objects.
3370 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3371 to lock EXIDX input sections. Fix a formatting issue. Call
3372 Arm_exidx_merged_section::build_contents to create merged section
3373 contents.
3374 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3375 to lock object of stub table owner.
3376 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3377 TEXT_SIZE to initialize data member TEXT_SIZE_.
3378 (Arm_exidx_input_section::addralign): Fix typo in comment.
3379 (Arm_exidx_input_section::text_size): New method.
3380 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3381 that require locking objects. Lock objects before scanning for stubs
3382 and updating local symbols.
3383 (Arm_input_section<big_endian>::init): Copy contents of original
3384 input section.
3385 (Arm_input_section<big_endian>::do_write): Use saved contents of
3386 original input section instead of calling Object::section_contents
3387 without locking.
3388 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3389 size without calling Object::section_size().
3390 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3391 for size. Allocate a buffer for merged EXIDX entries.
3392 (Arm_exidx_merged_section::build_contents): New method.
3393 (Arm_exidx_merged_section::do_write): Move merge section contents
3394 building code to Arm_exidx_merged_section::build_contetns. Write
3395 out contetns in buffer instead of building it on the fly.
3396 (Arm_relobj::make_exidx_input_section): Also pass text section size
3397 to Arm_exidx_input_section constructor.
3398 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3399 (Arm_dynobj::do_read_symbols): Fix memory leak.
3400 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3401 * target.h: (class Task): Add forward declaration.
3402 (Target::relax): Add new parameter TASK and pass it to
3403 Target::do_relax().
3404 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3405
5f9bcf58
CC
34062010-11-05 Cary Coutant <ccoutant@google.com>
3407
3408 PR gold/10708
3409 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3410 object when reading from the file.
3411 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3412 second layout pass.
3413 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3414 when reading section contents.
3415 (get_section_contents): Likewise.
3416 (icf::find_identical_sections): Likewise.
3417 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3418 object when reading from the file.
3419 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3420 the object when doing deferred section layout.
3421
e597fa08
NC
34222010-11-03 Nick Clifton <nickc@redhat.com>
3423
3424 PR gold/12001
3425 * script.h (class Symbol_assignment: name): New member. Returns
3426 the name of the symbol.
3427 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3428 Returns true if the given symbol name is on the list of
3429 assignments wating to be processed.
3430 * archive.cc (should_incldue_member): If the symbol is undefined,
3431 check to see if it is on the list of symbols pending assignment.
3432
3f9a3278
ILT
34332010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3434
3435 * script-sections.cc (Script_sections::find_memory_region): Check
3436 for a NULL output section pointer.
3437
d06fb4d1
DK
34382010-10-29 Doug Kwan <dougkwan@google.com>
3439
3440 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3441 Output_section::add_relaxed_input_section.
3442 * output.cc (Output_section::add_relaxed_input_section): Add new
3443 arguments LAYOUT and NAME. Set section order index.
3444 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3445 Copy section order index.
3446 * output.h (Output_section::add_relaxed_input_section): Add new
3447 arguments LAYOUT and NAME.
3448
90e24de5
ILT
34492010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3450
3451 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3452 NATIVE_OR_CROSS_LINKER.
3453 * testsuite/Makefile.in: Regenerate.
3454
c9484ea5
DK
34552010-10-20 Doug Kwan <dougkwan@google.com>
3456
3457 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3458 without SHF_LINK_ORDER flags.
3459 * layout.cc (Layout::choose_output_section): Do not filter
3460 SHF_LINK_ORDER flag in a relocatable link.
3461
5bc2f5be
CC
34622010-10-17 Cary Coutant <ccoutant@google.com>
3463
3464 * output.h (Output_segment::set_section_addresses): Change function
3465 signature. Update all callers.
3466 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3467 sections.
3468 (Output_segment::set_section_addresses): Align after last TLS
3469 section. Add padding before last relro section instead of after.
3470
0c91cf04
DK
34712010-10-17 Doug Kwan <dougkwan@google.com>
3472
3473 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3474 GOT output section to be writable.
3475
8c21d9d3
CC
34762010-10-14 Cary Coutant <ccoutant@google.com>
3477
3478 * debug.h (DEBUG_INCREMENTAL): New flag.
3479 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3480 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3481 mode.
3482 * incremental.cc (report_command_line): Ignore all forms of
3483 --incremental.
3484 * layout.cc (Layout::Layout): Check parameters for incremental link
3485 mode.
3486 * options.cc (General_options::parse_incremental): New function.
3487 (General_options::parse_no_incremental): New function.
3488 (General_options::parse_incremental_full): New function.
3489 (General_options::parse_incremental_update): New function.
3490 (General_options::incremental_mode_): New data member.
3491 (General_options::finalize): Check incremental_mode_.
3492 * options.h (General_options): Update help text for --incremental.
3493 Add --no-incremental, --incremental-full, --incremental-update.
3494 (General_options::Incremental_mode): New enum type.
3495 (General_options::incremental_mode): New function.
3496 (General_options::incremental_mode_): New data member.
3497 * parameters.cc (Parameters::incremental_mode_): New data member.
3498 (Parameters::set_options): Set incremental_mode_.
3499 (Parameters::set_incremental_full): New function.
3500 (Parameters::incremental): New function.
3501 (Parameters::incremental_update): New function.
3502 (set_parameters_incremental_full): New function.
3503 * parameters.h (Parameters::set_incremental_full): New function.
3504 (Parameters::incremental): New function.
3505 (Parameters::incremental_update): New function.
3506 (Parameters::incremental_mode_): New data member.
3507 (set_parameters_incremental_full): New function.
3508 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3509 incremental link mode.
3510 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3511 (Sized_relobj::do_relocate_sections): Likewise.
3512 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3513 option.
3514 * testsuite/Makefile.in: Regenerate.
3515 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3516
bb32aa18 35172010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3518
3519 * script-sections.h (class Script_sections): Make
3520 Sections_elements typedef public.
3521 * script-sections.cc (class Sort_output_sections): Add elements_
3522 field. Add constructor which sets it; change all callers.
3523 (Sort_output_sections::is_before): New function.
3524 (Sort_output_sections::operator()): Call is_before.
3525 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3526 conditional.
3527 * testsuite/script_test_10.sh: New test. Test script section
3528 order.
3529 * testsuite/script_test_10.t: Likewise.
3530 * testsuite/script_test_10.s: Likewise.
3531 * testsuite/Makefile.am: Wrap the cross linker tests and the
3532 common tests into NATIVE_OR_CROSS_LINKER.
3533 (check_SCRIPTS): Add script_test_10.sh.
3534 (check_DATA): Add script_test_10.stdout.
3535 (script_test_10.o, script_test_10): New targets.
3536 (script_test_10.stdout): New target.
3537 * configure, testsuite/Makefile.in: Regenerate.
3538
3cef7179
ILT
35392010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3540
3541 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3542 error for the deprecated relocations.
3543 (Target_arm::Scan::global): Likewise.
3544 (Target_arm::Relocate::relocate): Likewise.
3545
7411e9a8
RS
35462010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3547
3548 * fileread.cc (Input_file::find_file): Initialize *found_name
3549 and *namep when using the fallback search for case 4.
3550
6a9da32a
CC
35512010-10-11 Cary Coutant <ccoutant@google.com>
3552
3553 * options.h (class General_options): Redefine -z lazy as an alias for
3554 the negation of -z now.
3555
ac897c20
ILT
35562010-10-11 Ian Lance Taylor <iant@google.com>
3557
3558 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3559 binding.
3560
ea5cae92
NC
35612010-10-06 Nick Clifton <nickc@redhat.com>
3562
3563 * script-sections.cc(class Memory_region): Remove
3564 current_lma_offset_ field. Rename current_vma_offset_ to
3565 current_offset_. Add last_section_ field.
3566 (Memory_region::get_current_vma_address): Rename to
3567 get_current_address.
3568 (Memory_region::get_current_lma_address): Delete.
3569 (Memory_region::increment_vma_offset): Rename to
3570 increment_offset.
3571 (Memory_region::increment_lma_offset): Delete.
3572 (Memory_region::attributes_compatible): New method. Returns
3573 true if the provided section is compatible with the region.
3574 (Memory_region::get_last_section): New method. Returns the last
3575 section to use the region.
3576 (Memory_region::set_last_section): New method. Stores the last
3577 section to use the region.
3578 (Script_sections::block_in_region): New method. Returns true if
3579 a block of memory is contained within a region.
3580 (Script_sections::find_memory_region): New method. Locates a
3581 memory region to be used to set a VMA or LMA address.
3582 (Output_section_definition::set_section_addresses): Add code to
3583 check for addresses set by memory regions.
3584 (Output_segment::set_section_addresses): Remove memory region
3585 walking code.
3586 (Script_sections::create_segment): Add a warning if a header
3587 segment is created outside of any region.
3588 * script-sections.h (class Script_sections): Add prototypes for
3589 find_memory_region and block_in_region methods.
3590 * testsuite/memory_test.s: Use .long instead of .word.
3591 * testsuite/memory_test.t: Add some more output sections.
3592 * testsuite/memory_test.sh: Update expected output.
3593
a9bfd952
DK
35942010-10-02 Doug Kwan <dougkwan@google.com>
3595
3596 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3597 defintion to symtab.h
3598 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3599 declaration to defintion.
3600
bacff3ab
NC
36012010-10-01 Nick Clifton <nickc@redhat.com>
3602
3603 * expression.cc (eval): Replace dummy argument with NULL.
3604 (eval_maybe_dot): Check for a NULL result section pointer.
3605 (Symbol_expression::value): Likewise.
3606 (Dot_expression::value): Likewise.
3607 (BINARY_EXPRESSION): Likewise.
3608 (Max_expression::value): Likewise.
3609 (Min_expression::value): Likewise.
3610 (Absolute_expression::value): Likewise.
3611 (Addr_expression::value_from_output_section): Likewise.
3612 (Loaddddr_expression::value_from_output_section): Likewise.
3613 (Segment_start_expression::value): Likewise.
3614 * script-sections.cc
3615 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3616 argument with NULL.
3617 (Sections_elememt_dot_assignment::set_section_addresses):
3618 Likewise.
3619 (Output_data_expression::do_write_to_buffer): Likewise.
3620 (Output_section_definition::finalize_symbols): Likewise.
3621 (Output_section_definition::set_section_addresses): Likewise.
3622
f81bc8b5
DK
36232010-09-30 Doug Kwan <dougkwan@google.com>
3624
3625 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3626
c95e9f27
ST
36272010-09-28 Sriraman Tallam <tmsriram@google.com>
3628
3629 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 3630 function.
c95e9f27
ST
3631 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3632 virtual function.
3633 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3634 virtual function.
3635 * icf.cc (get_section_contents): Inline merge sections only when
3636 target allows it.
3637
3cac54d2
RW
36382010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3639
3640 * configure: Regenerate.
3641
2904037a
ILT
36422010-09-17 Ian Lance Taylor <iant@google.com>
3643
3644 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
3645 * testsuite/Makefile.am (memory_test.o): New target.
3646 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3647 memory_test.t.
3648 * testsuite/Makefile.in: Rebuild.
2904037a 3649
bca7fb63
DK
36502010-09-17 Doug Kwan <dougkwan@google.com>
3651
3652 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3653 defintion if relocation uses GOT entries of the symbol.
3654 * testsuite/icf_safe_test.sh: Fix test.
3655 * testsuite/icf_safe_so_test.sh: Fix test.
3656
4ef28648
CC
36572010-09-16 Cary Coutant <ccoutant@google.com>
3658
3659 * script_sections.cc (class Memory_region): Remove "NULL" from
3660 vector initializations.
3661
793990de
CC
36622010-09-15 Cary Coutant <ccoutant@google.com>
3663
3664 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3665 Resolve forwarding symbols.
3666
81e015e2
DK
36672010-09-15 Doug Kwan <dougkwan@google.com>
3668
3669 * gold/testsuite/script_test_3.t: Add ARM special sections.
3670 * gold/testsuite/script_test_4.t: Same.
3671 * gold/testsuite/script_test_5.t: Same.
3672 * gold/testsuite/script_test_6.t: Same.
3673 * gold/testsuite/script_test_7.t: Same.
3674 * gold/testsuite/script_test_7.t: Same.
3675 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3676
36171d64
CC
36772010-09-14 Cary Coutant <ccoutant@google.com>
3678
3679 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3680 (Target_x86_64::Relocate::relocate_tls): Replace check for
3681 saw_tls_block_reloc_ with test for executable section.
3682
d89051bd
CC
36832010-09-12 Cary Coutant <ccoutant@google.com>
3684
3685 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3686 position-independent executables to shared libraries need dynamic
3687 relocations.
3688 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3689 position-independent executables.
3690 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3691 * testsuite/Makefile.in: Regenerate.
3692
fca41f0f
NC
36932010-09-10 Nick Clifton <nickc@redhat.com>
3694
3695 PR gold/11997
3696 * testsuite/memory_test.t: Discard any sections that are not
3697 needed.
3698
6695e4b3
L
36992010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3700
3701 PR gold/11996
3702 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3703 "This::" to work around a bug in gcc 4.2.
3704
3705 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3706
0f72bf6f
RÁE
37072010-09-09 Rafael Espindola <espindola@google.com>
3708
3709 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3710 sections with different PF_X flags in the same segment.
3711 (Layout::find_first_load_seg): Search all segments to find the first
3712 one.
3713 * options.h (rosegment): New.
3714
37152010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3716
05a79166 3717 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3718
aa98ff75
DK
37192010-09-08 Doug Kwan <dougkwan@google.com>
3720
3721 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3722 (Arm_relobj::do_relocate_sections): Add new parameter for output
3723 file to match the parent.
3724 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3725 of local symbols instead of input values. Update code to track
3726 changes in gold::relocate_section.
3727 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3728 (Sized_relobj::compute_final_local_value_internal): New methods.
3729 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3730 body into private version of Sized_relobj::compute_final_local_value.
3731 Call the inline method.
3732 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3733 merged symbol value if there is one.
3734 (Symbol_value::has_output_value): New method defintiion.
3735 (Sized_relobj::Compute_final_local_value_status): New enum type.
3736 (Sized_relobj::compute_final_local_value): New methods.
3737 (Sized_relobj::compute_final_local_value_internal): New methods.
3738 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3739 and arm_cortex_a8.sh.
3740 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3741 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3742 New tests.
3743 * Makefile.in: Regenerate.
3744 * testsuite/arm_bl_out_of_range.s: Update test.
3745 * testsuite/thumb_bl_out_of_range.s: Ditto.
3746 * testsuite/thumb_blx_out_of_range.s: Ditto.
3747 * testsuite/arm_branch_out_of_range.sh: New file.
3748 * testsuite/arm_cortex_a8.sh: Ditto.
3749 * testsuite/arm_cortex_a8_b.s: Ditto.
3750 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3751 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3752 * testsuite/arm_cortex_a8_bl.s: Ditto.
3753 * testsuite/arm_cortex_a8_blx.s: Ditto.
3754 * testsuite/arm_cortex_a8_local.s: Ditto.
3755 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3756 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3757
05a79166
L
37582010-09-08 Rafael Espindola <espindola@google.com>
3759
3760 * Makefile.am (memory_test.stdout): Run readelf with -W.
3761 * Makefile.in: Regenerate.
3762 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3763 64 bit output.
3764
33dbc701
RÁE
37652010-09-08 Rafael Espindola <espindola@google.com>
3766
3767 * script-sections.cc (Script_sections::add_memory_region): Convert
3768 field precision to int.
3769 * script.cc (script_set_section_region, script_set_section_region):
3770 Convert field precision to int.
3771
731ca54a
RÁE
37722010-09-08 Rafael Espindola <espindola@google.com>
3773
3774 * arm.cc (do_finalize_sections): Create the __exidx_start and
3775 __exdix_end symbols even when the section is missing.
3776
7f8cd844
NC
37772010-09-08 Nick Clifton <nickc@redhat.com>
3778
3779 * README: Remove claim that MEMORY is not supported.
3780 * expression.cc (script_exp_function_origin)
3781 (script_exp_function_length): Move from here to ...
3782 * script.cc: ... here.
3783 (script_set_section_region, script_add_memory)
3784 (script_parse_memory_attr, script_include_directive): New
3785 functions.
3786 * script-sections.cc
3787 (class Memory_region): New class.
3788 (class Output_section_definition): Add set_memory_region,
3789 set_section_vma, set_section_lma and get_section_name methods.
3790 (class Script_Sections): Add add_memory_region,
3791 find_memory_region, find_memory_region_origin,
3792 find_memory_region_length and set_memory_region methods.
3793 Have set_section_addresses method walk the list of set memory
3794 regions.
3795 Extend the print methos to display memory regions.
3796 * script-sections.h: Add prototypes for new methods.
3797 Add enum for MEMORY region attributes.
3798 * yyscript.y: Add support for parsing MEMORY regions.
3799 * script-c.h: Add prototypes for new functions.
3800 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3801 * testsuite/Makefile.in: Regenerate.
3802 * testsuite/memory_test.sh: New script.
3803 * testsuite/memory_test.s: New assembler source file.
3804 * testsuite/memory_test.t: New linker script.
3805
a4649286
DK
38062010-08-27 Doug Kwan <dougkwan@google.com>
3807
3808 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3809 reference override an existing dynamic weak reference.
3810 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3811 * testsuite/Makefile.in: Regenerate.
3812 * testsuite/dyn_weak_ref.sh: New file.
3813 * testsuite/dyn_weak_ref_1.c: Ditto.
3814 * testsuite/dyn_weak_ref_2.c: Ditto.
3815
b56648ad
ILT
38162010-08-27 Ian Lance Taylor <iant@google.com>
3817
3818 * incremental.h (class Incremental_input_entry): Add virtual
3819 destructor.
3820
809313cb
ILT
38212010-08-27 Ian Lance Taylor <iant@google.com>
3822
3823 * testsuite/start_lib_test_3.c: Mark t3 as used.
3824
11e32464
NC
38252010-08-27 Nick Clifton <nickc@redhat.com>
3826
3827 * options.cc (version_script): Fix small typo in previous
3828 whitespace tidyup.
3829
ca09d69a
NC
38302010-08-25 Nick Clifton <nickc@redhat.com>
3831
3832 * archive.cc: Formatting fixes: Remove whitespace between
3833 typename and following asterisk. Remove whitespace between
3834 function name and opening parenthesis.
3835 * archive.h: Likewise.
3836 * arm.cc: Likewise.
3837 * attributes.cc: Likewise.
3838 * attributes.h: Likewise.
3839 * common.cc: Likewise.
3840 * copy-relocs.cc: Likewise.
3841 * dirsearch.h: Likewise.
3842 * dynobj.cc: Likewise.
3843 * ehframe.cc: Likewise.
3844 * ehframe.h: Likewise.
3845 * expression.cc: Likewise.
3846 * fileread.cc: Likewise.
3847 * fileread.h: Likewise.
3848 * gc.h: Likewise.
3849 * gold-threads.cc: Likewise.
3850 * gold.cc: Likewise.
3851 * i386.cc: Likewise.
3852 * icf.h: Likewise.
3853 * incremental-dump.cc: Likewise.
3854 * incremental.cc: Likewise.
3855 * layout.cc: Likewise.
3856 * layout.h: Likewise.
3857 * main.cc: Likewise.
3858 * merge.cc: Likewise.
3859 * merge.h: Likewise.
3860 * object.cc: Likewise.
3861 * object.h: Likewise.
3862 * options.cc: Likewise.
3863 * options.h: Likewise.
3864 * output.cc: Likewise.
3865 * output.h: Likewise.
3866 * plugin.cc: Likewise.
3867 * plugin.h: Likewise.
3868 * powerpc.cc: Likewise.
3869 * reloc.cc: Likewise.
3870 * script-c.h: Likewise.
3871 * script-sections.cc: Likewise.
3872 * script.cc: Likewise.
3873 * stringpool.cc: Likewise.
3874 * symtab.cc: Likewise.
3875 * symtab.h: Likewise.
3876 * target.cc: Likewise.
3877 * timer.cc: Likewise.
3878 * timer.h: Likewise.
3879 * version.cc: Likewise.
3880 * x86_64.cc: Likewise.
3881
b8fa8750
NC
38822010-08-24 Nick Clifton <nickc@redhat.com>
3883
3884 PR 11899
3885 * layout.cc (segment_precedes): Sort segments by their physical
3886 addresses, if they have been set.
3887
9919d93b
CC
38882010-08-23 Cary Coutant <ccoutant@google.com>
3889
3890 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3891 symbols data.
3892 (Lib_group::include_member): Unlock object after deleting its
3893 symbols data.
3894 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3895 the bug fixed here.
3896
97b4be1c
CC
38972010-08-19 Neil Vachharajani <nvachhar@google.com>
3898 Cary Coutant <ccoutant@google.com>
3899
3900 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3901 constructor, and set_blocker.
3902 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3903 readsyms_blocker_.
3904 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3905 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3906 * testsuite/Makefile.am (start_lib_test): New test case.
3907 * testsuite/Makefile.in: Regenerate.
3908 * testsuite/start_lib_test_main.c: New file.
3909 * testsuite/start_lib_test_1.c: New file.
3910 * testsuite/start_lib_test_2.c: New file.
3911 * testsuite/start_lib_test_3.c: New file.
3912
dd0b1884
ILT
39132010-08-19 Ian Lance Taylor <iant@google.com>
3914
3915 * Makefile.in: Rebuild with automake 1.11.1.
3916 * aclocal.m4: Likewise.
3917 * testsuite/Makefile.in: Likewise.
3918
7223e9ca
ILT
39192010-08-19 Ian Lance Taylor <iant@google.com>
3920
3921 PR 10893
3922 * i386.cc (class Output_data_plt_i386): Update declarations.
3923 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3924 local_ifuncs_ fields.
3925 (Target_i386::do_plt_section_for_global): New function.
3926 (Target_i386::do_plt_section_for_local): New function.
3927 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3928 parameter; change all callers. Initialize global_ifuncs_ and
3929 local_ifuncs_. If doing a static link define __rel_iplt_start and
3930 __rel_iplt_end.
3931 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3932 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3933 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3934 symbols.
3935 (Target_i386::make_plt_section): New function, broken out of
3936 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3937 (Target_i386::make_plt_entry): Call make_plt_section.
3938 (Target_i386::make_local_ifunc_plt_entry): New function.
3939 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3940 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3941 R_386_IRELATIVE to switch.
3942 (Target_i386::Scan::global): Likewise.
3943 (Target_i386::Relocate::relocate): Likewise.
3944 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3945 switch.
3946 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3947 (Target_x86_64::do_plt_section_for_global): New function.
3948 (Target_x86_64::do_plt_section_for_local): New function.
3949 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3950 parameter; change all callers. If doing a static link define
3951 __rela_iplt_start and __rela_iplt_end.
3952 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3953 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3954 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3955 to point to .plt.
3956 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3957 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3958 switch.
3959 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3960 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3961 R_X86_64_IRELATIVE to switch.
3962 (Target_x86_64::Scan::global): Likewise.
3963 (Target_x86_64::Relocate::relocate): Likewise.
3964 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3965 switch.
3966 * target.h (class Target): Add plt_section_for_global and
3967 plt_section_for_local functions. Add do_plt_section_for_global
3968 and do_plt_section_for_local virtual functions.
3969 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3970 clarifying comments.
3971 (Symbol::use_plt_offset): Handle IFUNC symbol.
3972 * object.cc (Sized_relobj::Sized_relobj): Initialize
3973 local_plt_offsets_.
3974 (Sized_relobj::local_has_plt_offset): New function.
3975 (Sized_relobj::local_plt_offset): New function.
3976 (Sized_relobj::set_local_plt_offset): New function.
3977 (Sized_relobj::do_count): Handle IFUNC symbol.
3978 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3979 a bit away from input_shndx_ field. Add set_is_func_symbol and
3980 is_ifunc_symbol functions.
3981 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3982 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3983 local_plt_offsets_ field.
3984 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3985 * output.h (class Output_section_data): Add non-const
3986 output_section function.
3987 (class Output_data_got): Update declarations.
3988 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3989 Add use_plt_offset parameter to global and local constructors.
3990 Change all callers. Change local_sym_index_ field to 31 bits.
3991 Change GSYM_CODE and CONSTANT_CODE accordingly.
3992 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3993 doing a static link don't set sh_link field.
3994 (Output_data_got::Got_entry::write): Use PLT offset if
3995 appropriate.
3996 (Output_data_got::add_global_plt): New function.
3997 (Output_data_got::add_local_plt): New function.
3998 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3999 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4000 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4001 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4002 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4003 IFUNC conditional.
4004 * testsuite/ifunc-sel.h: New file.
4005 * testsuite/ifuncmain1.c: New file.
4006 * testsuite/ifuncmain1vis.c: New file.
4007 * testsuite/ifuncmod1.c: New file.
4008 * testsuite/ifuncdep2.c: New file.
4009 * testsuite/ifuncmain2.c: New file.
4010 * testsuite/ifuncmain3.c: New file.
4011 * testsuite/ifuncmod3.c: New file.
4012 * testsuite/ifuncmain4.c: New file.
4013 * testsuite/ifuncmain5.c: New file.
4014 * testsuite/ifuncmod5.c: New file.
4015 * testsuite/ifuncmain6pie.c: New file.
4016 * testsuite/ifuncmod6.c: New file.
4017 * testsuite/ifuncmain7.c: New file.
4018 * configure, testsuite/Makefile.in: Rebuild.
4019
56f75c03
ILT
40202010-08-18 Ian Lance Taylor <iant@google.com>
4021
4022 * incremental.cc
4023 (Output_section_incremental_inputs::write_input_files): Add cast
4024 to avoid signed/unsigned comparison warning.
4025 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4026
55455f89
CC
40272010-08-12 Cary Coutant <ccoutant@google.com>
4028
4029 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4030
e2054bcb
ILT
40312010-08-13 Ian Lance Taylor <iant@google.com>
4032
4033 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4034
74f67560
DK
40352010-08-12 Cary Coutant <ccoutant@google.com>
4036 Doug Kwan <dougkwan@google.com>
4037
4038 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4039 defintion overrides non-weak undef, remember that the original undef
4040 is not weak.
4041 * symtab.cc (Symbol_table::sized_write_global): For undef without
4042 an original weak binding, set binding to global in output.
4043 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4044 * testsuite/Makefile.in: Regenerate.
4045 * testsuite/strong_ref_weak_def.sh: New file.
4046 * testsuite/strong_ref_weak_def_1.c: Ditto.
4047 * testsuite/strong_ref_weak_def_2.c: Ditto.
4048
d1238d12
CC
40492010-08-12 Cary Coutant <ccoutant@google.com>
4050
4051 * testsuite/incremental_test.sh: Rewrite.
4052 * testsuite/incremental_test_1.c: Rewrite.
4053 * testsuite/incremental_test_2.c: Rewrite.
4054
0e70b911
CC
40552010-08-12 Cary Coutant <ccoutant@google.com>
4056
4057 * arm.cc (Target_arm::got_size): Add const.
4058 (Target_arm::got_entry_count): New function.
4059 (Target_arm::plt_entry_count): New function.
4060 (Target_arm::first_plt_entry_offset): New function.
4061 (Target_arm::plt_entry_size): New function.
4062 (Output_data_plt_arm::entry_count): New function.
4063 (Output_data_plt_arm::first_plt_entry_offset): New function.
4064 (Output_data_plt_arm::get_plt_entry_size): New function.
4065 * i386.cc (Target_i386::got_size): Add const.
4066 (Target_i386::got_entry_count): New function.
4067 (Target_i386::plt_entry_count): New function.
4068 (Target_i386::first_plt_entry_offset): New function.
4069 (Target_i386::plt_entry_size): New function.
4070 (Output_data_plt_i386::entry_count): New function.
4071 (Output_data_plt_i386::first_plt_entry_offset): New function.
4072 (Output_data_plt_i386::get_plt_entry_size): New function.
4073 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4074 find_incremental_inputs_sections. Dump incremental_got_plt section.
4075 * incremental.cc: Include target.h.
4076 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4077 parameter. Adjust all callers. Find incremental_got_plt section.
4078 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4079 section.
4080 (Output_section_incremental_inputs::set_final_data_size): Calculate
4081 size of incremental_got_plt section.
4082 (Output_section_incremental_inputs::do_write): Write the
4083 incremental_got_plt section.
4084 (Got_plt_view_info): New struct.
4085 (Local_got_offset_visitor): New class.
4086 (Global_got_offset_visitor): New class.
4087 (Global_symbol_visitor_got_plt): New class.
4088 (Output_section_incremental_inputs::write_got_plt): New function.
4089 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4090 Add parameter. Adjust all callers.
4091 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4092 (Incremental_inputs::got_plt_section): New function.
4093 (Incremental_inputs::got_plt_section_): New data member.
4094 (Incremental_got_plt_reader): New class.
4095 * layout.cc (Layout::create_incremental_info_sections): Add the
4096 incremental_got_plt section.
4097 * object.h (Got_offset_list::get_list): New function.
4098 (Got offset_list::for_all_got_offsets): New function.
4099 (Sized_relobj::local_got_offset_list): New function.
4100 * powerpc.cc (Target_powerpc::got_size): Add const.
4101 (Target_powerpc::got_entry_count): New function.
4102 (Target_powerpc::plt_entry_count): New function.
4103 (Target_powerpc::first_plt_entry_offset): New function.
4104 (Target_powerpc::plt_entry_size): New function.
4105 (Output_data_plt_powerpc::entry_count): New function.
4106 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4107 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4108 * sparc.cc (Target_sparc::got_size): Add const.
4109 (Target_sparc::got_entry_count): New function.
4110 (Target_sparc::plt_entry_count): New function.
4111 (Target_sparc::first_plt_entry_offset): New function.
4112 (Target_sparc::plt_entry_size): New function.
4113 (Output_data_plt_sparc::entry_count): New function.
4114 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4115 (Output_data_plt_sparc::get_plt_entry_size): New function.
4116 * symtab.h (Symbol::got_offset_list): New function.
4117 (Symbol_table::for_all_symbols): New function.
4118 * target.h (Sized_target::got_entry_count): New function.
4119 (Sized_target::plt_entry_count): New function.
4120 (Sized_target::plt_entry_size): New function.
4121 * x86_64.cc (Target_x86_64::got_size): Add const.
4122 (Target_x86_64::got_entry_count): New function.
4123 (Target_x86_64::plt_entry_count): New function.
4124 (Target_x86_64::first_plt_entry_offset): New function.
4125 (Target_x86_64::plt_entry_size): New function.
4126 (Output_data_plt_x86_64::entry_count): New function.
4127 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4128 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4129
09ec0418
CC
41302010-08-12 Cary Coutant <ccoutant@google.com>
4131
4132 * archive.cc: Include incremental.h.
4133 (Archive::Archive): Initialize incremental_info_.
4134 (Archive::include_member): Record archive members in incremental info.
4135 (Add_archive_symbols::run): Record begin and end of an archive in
4136 incremental info.
4137 (Lib_group::include_member): Record objects in incremental info.
4138 * archive.h (Incremental_archive_entry): Forward declaration.
4139 (Archive::set_incremental_info): New member function.
4140 (Archive::incremental_info): New member function.
4141 (Archive::Unused_symbol_iterator): New class.
4142 (Archive::unused_symbols_begin): New member function.
4143 (Archive::unused_symbols_end): New member function.
4144 (Archive::incremental_info_): New data member.
4145 * incremental-dump.cc (find_input_containing_global): New function.
4146 (dump_incremental_inputs): Dump new incremental info sections.
4147 * incremental.cc: Include symtab.h.
4148 (Output_section_incremental_inputs): New class.
4149 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4150 new incremental info sections.
4151 (Sized_incremental_binary::do_check_inputs): Likewise.
4152 (Incremental_inputs::report_archive): Remove.
4153 (Incremental_inputs::report_archive_begin): New function.
4154 (Incremental_inputs::report_archive_end): New function.
4155 (Incremental_inputs::report_object): New function.
4156 (Incremental_inputs::finalize_inputs): Remove.
4157 (Incremental_inputs::report_input_section): New function.
4158 (Incremental_inputs::report_script): Rewrite.
4159 (Incremental_inputs::finalize): Do nothing but finalize string table.
4160 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4161 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4162 (Incremental_inputs::create_data_sections): New function.
4163 (Incremental_inputs::relocs_entsize): New function.
4164 (Output_section_incremental_inputs::set_final_data_size): New function.
4165 (Output_section_incremental_inputs::do_write): New function.
4166 (Output_section_incremental_inputs::write_header): New function.
4167 (Output_section_incremental_inputs::write_input_files): New function.
4168 (Output_section_incremental_inputs::write_info_blocks): New function.
4169 (Output_section_incremental_inputs::write_symtab): New function.
4170 * incremental.h (Incremental_script_entry): Forward declaration.
4171 (Incremental_object_entry): Forward declaration.
4172 (Incremental_archive_entry): Forward declaration.
4173 (Incremental_inputs): Forward declaration.
4174 (Incremental_inputs_header_data): Remove.
4175 (Incremental_inputs_header): Remove.
4176 (Incremental_inputs_header_write): Remove.
4177 (Incremental_inputs_entry_data): Remove.
4178 (Incremental_inputs_entry): Remove.
4179 (Incremental_inputs_entry_write): Remove.
4180 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4181 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4182 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4183 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4184 Likewise.
4185 (Incremental_input_entry): New class.
4186 (Incremental_script_entry): New class.
4187 (Incremental_object_entry): New class.
4188 (Incremental_archive_entry): New class.
4189 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4190 (Incremental_inputs::report_inputs): Remove.
4191 (Incremental_inputs::report_archive): Remove.
4192 (Incremental_inputs::report_archive_begin): New function.
4193 (Incremental_inputs::report_archive_end): New function.
4194 (Incremental_inputs::report_object): Change prototype.
4195 (Incremental_inputs::report_input_section): New function.
4196 (Incremental_inputs::report_script): Change prototype.
4197 (Incremental_inputs::get_reloc_count): New function.
4198 (Incremental_inputs::set_reloc_count): New function.
4199 (Incremental_inputs::create_data_sections): New function.
4200 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4201 (Incremental_inputs::inputs_section): New function.
4202 (Incremental_inputs::symtab_section): New function.
4203 (Incremental_inputs::relocs_section): New function.
4204 (Incremental_inputs::get_stringpool): Add const.
4205 (Incremental_inputs::command_line): Add const.
4206 (Incremental_inputs::inputs): Remove.
4207 (Incremental_inputs::command_line_key): New function.
4208 (Incremental_inputs::input_file_count): New function.
4209 (Incremental_inputs::input_files): New function.
4210 (Incremental_inputs::relocs_entsize): New function.
4211 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4212 (Incremental_inputs::finalize_inputs): Remove.
4213 (Incremental_inputs::Input_info): Remove.
4214 (Incremental_inputs::lock_): Remove.
4215 (Incremental_inputs::inputs_): Change type.
4216 (Incremental_inputs::inputs_map_): Remove.
4217 (Incremental_inputs::current_object_entry_): New data member.
4218 (Incremental_inputs::inputs_section_): New data member.
4219 (Incremental_inputs::symtab_section_): New data member.
4220 (Incremental_inputs::relocs_section_): New data member.
4221 (Incremental_inputs::reloc_count_): New data member.
4222 (Incremental_inputs_reader): New class.
4223 (Incremental_symtab_reader): New class.
4224 (Incremental_relocs_reader): New class.
4225 * layout.cc (Layout::finalize): Move finalization of incremental info
4226 and creation of incremental info sections to follow finalization of
4227 symbol table. Set offsets for postprocessing sections.
4228 (Layout::create_incremental_info_sections): Call
4229 Incremental_inputs::create_data_sections. Add incremental symtab
4230 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4231 sections to layout after input sections.
4232 * layout.h (struct Timespec): Forward declaration.
4233 (Layout::incremental_inputs): Add const.
4234 (Layout::create_incremental_info_sections): Add parameter.
4235 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4236 * object.cc: Include incremental.h.
4237 (Relobj::finalize_incremental_relocs): New function.
4238 (Sized_relobj::do_layout): Record input sections in incremental info.
4239 * object.h (Object::output_section): New function.
4240 (Object::output_section_offset): Moved from Relobj.
4241 (Object::get_incremental_reloc_base): New function.
4242 (Object::get_incremental_reloc_count): New function.
4243 (Object::do_output_section): New function.
4244 (Object::do_output_section_offset): Moved from Relobj.
4245 (Object::do_get_incremental_reloc_base): New function.
4246 (Object::do_get_incremental_reloc_count): New function.
4247 (Object::Object): Initialize new data members.
4248 (Relobj::output_section): Renamed do_output_section and moved to
4249 protected.
4250 (Relobj::output_section_offset): Moved to Object.
4251 (Relobj::do_get_incremental_reloc_base): New function.
4252 (Relobj::do_get_incremental_reloc_count): New function.
4253 (Relobj::allocate_incremental_reloc_counts): New function.
4254 (Relobj::count_incremental_reloc): New function.
4255 (Relobj::finalize_incremental_relocs): New function.
4256 (Relobj::next_incremental_reloc_index): New function.
4257 (Relobj::reloc_counts_): New data member.
4258 (Relobj::reloc_bases_): New data member.
4259 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4260 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4261 (Sized_relobj::incremental_relocs_scan): New function.
4262 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4263 (Sized_relobj::incremental_relocs_write): New function.
4264 (Sized_relobj::incremental_relocs_write_reltype): New function.
4265 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4266 incremental link.
4267 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4268 archives and object files elsewhere.
4269 (Add_symbols::run): Report object files here.
4270 (Finish_group::run): Report end of archive at end of group.
4271 * reloc.cc: Include layout.h, incremental.h.
4272 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4273 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4274 (Sized_relobj::incremental_relocs_scan): New function.
4275 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4276 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4277 (Sized_relobj::incremental_relocs_write): New function.
4278 (Sized_relobj::incremental_relocs_write_reltype): New function.
4279 * script.cc (read_input_script): Rewrite test for incremental link.
4280 Change call to Incremental_inputs::report_script.
4281 * symtab.h (Symbol_table::first_global_index): New function.
4282 (Symbol_table::output_count): New function.
4283
ce0d1972
DK
42842010-08-12 Doug Kwan <dougkwan@google.com>
4285
4286 * arm.cc (Target_arm::merge_object_attributes): Check command line
4287 options --no-wchar-size-warning and --no-enum-size-warning.
4288 * options.h (General_options): Add ld-compatible options
4289 --no-enum-size-warning and --no-wchar-size-warning.
4290
6e5710ce
ILT
42912010-08-04 Ian Lance Taylor <iant@google.com>
4292
4293 * x86_64.cc (Target_x86_64::Scan::local): Use
4294 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4295 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4296 (Target_x86_64::Scan::global): Likewise.
4297 (Target_x86_64::Relocate::relocate): Likewise.
4298 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4299 Likewise.
4300
fef830db
CC
43012010-08-03 Cary Coutant <ccoutant@google.com>
4302
4303 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4304 to reserve space in merged_strings vector. Keep total input size
4305 for stats.
4306 (Output_merge_string::do_print_merge_stats): Print total input size.
4307 * merge.h (Output_merge_string): Add input_size_ field.
4308 * stringpool.cc (Stringpool_template::string_length): Move
4309 implementations out of Stringpool_template class and place in
4310 stringpool.h.
4311 * stringpool.h (string_length): Move out of Stringpool_template.
4312
1e3811b0
ILT
43132010-08-03 Ian Lance Taylor <iant@google.com>
4314
4315 PR 11712
4316 * layout.cc (relaxation_loop_body): If address of load segment is
4317 set, adjust address to include headers if possible.
4318
7af0c620
ILT
43192010-08-03 Ian Lance Taylor <iant@google.com>
4320
4321 * version.cc (version_string): Bump to 1.10.
4322
22f0da72
ILT
43232010-08-03 Ian Lance Taylor <iant@google.com>
4324
4325 PR 11805
4326 * layout.h (enum Output_section_order): Define.
4327 (class Layout): Update declarations.
4328 * layout.cc (Layout::get_output_section): Add order parameter.
4329 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4330 is_first_non_relro parameters. Change all callers.
4331 (Layout::choose_output_section): Likewise.
4332 (Layout::add_output_section_data): Likewise.
4333 (Layout::make_output_section): Likewise. Set order.
4334 (Layout::default_section_order): New function.
4335 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4336 * output.cc (Output_section::Output_section): Initialize order_.
4337 Don't initialize deleted fields.
4338 (Output_segment::Output_segment): Don't initialize deleted
4339 fields.
4340 (Output_segment::add_output_section_to_load): New function
4341 replacing add_output_section. Change all callers to call this or
4342 add_output_section_to_nonload.
4343 (Output_segment::add_output_section_to_nonload): New function.
4344 (Output_segment::remove_output_section): Rewrite.
4345 (Output_segment::add_initial_output_data): Likewise.
4346 (Output_segment::has_any_data_sections): Likewise.
4347 (Output_segment::is_first_section_relro): Likewise.
4348 (Output_segment::maximum_alignment): Likewise.
4349 (Output_segment::has_dynamic_reloc): New function replacing
4350 dynamic_reloc_count. Change all callers.
4351 (Output_segment::has_dynamic_reloc_list): New function replacing
4352 dynamic_reloc_count_list. Change all callers.
4353 (Output_segment::set_section_addresses): Rewrite.
4354 (Output_segment::set_offset): Rewrite.
4355 (Output_segment::find_first_and_last_list): Remove.
4356 (Output_segment::set_tls_offsets): Rewrite.
4357 (Output_segment::first_section_load_address): Likewise.
4358 (Output_segment::output_section_count): Likewise.
4359 (Output_segment::section_with_lowest_load_address): Likewise.
4360 (Output_segment::write_section_headers): Likewise.
4361 (Output_segment::print_sections_to_map): Likewise.
4362 * output.h (class Output_data): Remove dynamic_reloc_count_
4363 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4364 (Output_data::add_dynamic_reloc): Rewrite.
4365 (Output_data::has_dynamic_reloc): New function.
4366 (Output_data::dynamic_reloc_count): Remove.
4367 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4368 is_last_relro_, is_first_non_relro_, is_interp_,
4369 is_dynamic_linker_section_ fields. Add order and set_order
4370 functions. Remove is_relro_local, set_is_relro_local,
4371 is_last_relro, set_is_last_relro, is_first_non_relro,
4372 set_is_first_non_relro functions, is_interp, set_is_interp,
4373 is_dynamic_linker_section, and set_is_dynamic_linker_section
4374 functions.
4375 (class Output_segment): Change Output_data_list from std::list to
4376 std:;vector. Add output_lists_ field. Remove output_data_ and
4377 output_bss_ fields. Update declarations.
4378
3ff2ccb0
ILT
43792010-08-02 Ian Lance Taylor <iant@google.com>
4380
4381 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4382 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4383 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4384
88a4108b
ILT
43852010-08-02 Ian Lance Taylor <iant@google.com>
4386
4387 PR 11855
4388 * script.cc (Script_options::Script_options): Initialize
4389 symbol_definitions_ and symbol_references_.
4390 (Script_options::add_symbol_assignment): Update
4391 symbol_definitions_ and symbol_references_.
4392 (Script_options::add_symbol_reference): New function.
4393 (script_symbol): New function.
4394 * script.h (class Script_options): Add symbol_definitions_ and
4395 symbol_references_ fields.
4396 (Script_options::referenced_const_iterator): New type.
4397 (Script_options::referenced_begin): New function.
4398 (Script_options::referenced_end): New function.
4399 (Script_options::is_referenced): New function.
4400 (Script_options::any_unreferenced): New function.
4401 * script-c.h (script_symbol): Declare.
4402 * yyscript.y (exp): Call script_symbol.
4403 * symtab.cc: Include "script.h".
4404 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4405 Change all callers. Check symbols referenced by scripts.
4406 (Symbol_table::add_undefined_symbols_from_command_line): Add
4407 layout parameter. Change all callers.
4408 (Symbol_table::do_add_undefined_symbols_from_command_line):
4409 Likewise. Break out loop body. Check symbols referenced by
4410 scripts.
4411 (Symbol_table::add_undefined_symbol_from_command_line): New
4412 function broken out of
4413 do_add_undefined_symbols_from_command_line.
4414 * symtab.h (class Symbol_table): Update declarations.
4415 * archive.cc: Include "layout.h".
4416 (Archive::should_include_member): Add layout parameter. Change
4417 all callers. Check for symbol mentioned in expression.
4418 * archive.h (class Archive): Update declaration.
4419 * object.cc (Sized_relobj::do_should_include_member): Add layout
4420 parameter.
4421 * object.h (Object::should_include_member): Add layout parameter.
4422 Change all callers.
4423 (Object::do_should_include_member): Add layout parameter.
4424 (class Sized_relobj): Update declaration.
4425 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4426 parameter.
4427 * dynobj.h (class Sized_dynobj): Update declaration.
4428 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4429 layout parameter.
4430 * plugin.h (class Sized_pluginobj): Update declaration.
4431
5f1ab67a
ILT
44322010-08-02 Ian Lance Taylor <iant@google.com>
4433
4434 PR 11866
4435 * output.cc (Output_segment::set_offset): Search for the first and
4436 last sections rather than assuming that the list is in order.
4437 (Output_segment::find_first_and_last_list): New function.
4438 * output.h (class Output_segment): Update declarations.
4439 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4440 (relro_strip_test_SOURCES): New variable.
4441 (relro_strip_test_DEPENDENCIES): New variable.
4442 (relro_strip_test_LDFLAGS): New variable.
4443 (relro_strip_test_LDADD): New variable.
4444 (relro_strip_test.so): New target.
4445
a8df5856
ILT
44462010-08-02 Ian Lance Taylor <iant@google.com>
4447
4448 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4449 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4450 (Target_i386::got_tlsdesc_section): New function.
4451 (Target_i386::got_section): Create space for GOT entries for
4452 TLSDESC relocations.
4453 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4454 R_386_TLS_GOTDESC.
4455 (Target_i386::Scan::global): Likewise.
4456 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4457 using TLSDESC GOT.
4458 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4459 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4460 (Target_x86_64::got_tlsdesc_section): New function.
4461 (Target_x86_64::got_section): Create space for GOT entries for
4462 TLSDESC relocations.
4463 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4464 R_386_TLS_GOTDESC.
4465 (Target_x86_64::Scan::global): Likewise.
4466 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4467 using TLSDESC GOT.
4468
0c10a0a6
ILT
44692010-08-02 Ian Lance Taylor <iant@google.com>
4470
4471 * testsuite/final_layout.sh: Use dc to convert from hex to
4472 decimal.
4473
41cbeecc
ST
44742010-07-29 Sriraman Tallam <tmsriram@google.com>
4475
4476 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4477 paramter to the call to gold::gc_process_relocs.
4478 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4479 paramter to the call to gold::gc_process_relocs.
4480 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4481 parameter to the call to gold::gc_process_relocs.
4482 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4483 template parameter to the call to gold::gc_process_relocs.
4484 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4485 paramter to the call to gold::gc_process_relocs.
4486 * gc.h (get_embedded_addend_size): New function.
4487 (gc_process_relocs): Save the size of the reloc for use by ICF.
4488 * icf.cc (get_section_contents): Get the addend from the text section
4489 for SHT_REL relocation sections.
4490 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4491 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4492 * int_encoding.h (read_from_pointer): New overloaded function.
4493 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4494 * testsuite/icf_sht_rel_addend_test.sh: New file.
4495 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4496 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4497
6ea55b82
RW
44982010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4499
4500 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4501 * Makefile.in: Regenerate.
4502 * testsuite/Makefile.in: Regenerate.
4503
9691462b
ILT
45042010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4505
4506 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4507 * gold/testsuite/debug_msg.cc: Likewise.
4508 * gold/testsuite/odr_violation1.cc
4509 * gold/testsuite/odr_violation2.cc
4510
76897331
CC
45112010-07-21 Cary Coutant <ccoutant@google.com>
4512
4513 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4514 string, and length fields.
4515 (Output_merge_string::Merged_strings_list): New type.
4516 (Output_merge_string::Merged_strings_lists): New typedef.
4517 (Output_merge_string): Replace merged_strings_ with
4518 merged_strings_lists_.
4519 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4520 Merged_strings_list per input object and section. Don't store pointer
4521 to the string. Don't store length with each merged string entry.
4522 (Output_merge_string::finalize_merged_data): Loop over list of merged
4523 strings lists. Recompute length of each merged string.
4524
78384e8f
CC
45252010-07-15 Cary Coutant <ccoutant@google.com>
4526
4527 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4528 here.
4529
783659f9
ILT
45302010-07-14 Ian Lance Taylor <iant@google.com>
4531
4532 * descriptors.cc (Descriptors::open): Report correct name in error
4533 message.
4534
131687b4
DK
45352010-07-13 Doug Kwan <dougkwan@google.com>
4536
4537 * arm.cc (Arm_input_section::Arm_input_section): For a
4538 SHT_ARM_EXIDX section, always keeps the input sections.
4539 (Arm_input_section::set_exidx_section_link): New method.
4540 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4541 has_errors_ to false.
4542 (Arm_exidx_input_section::has_errors,
4543 Arm_exidx_input_section::set_has_errors): New methods.
4544 (Arm_exidx_input_section::has_errors_): New data member.
4545 (Arm_relobj::get_exidx_shndx_list): New method.
4546 (Arm_output_section::append_text_sections_to_list): Do not skip
4547 section without SHF_EXECINSTR.
4548 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4549 errors.
4550 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4551 section header. Make error messages more verbose. Check for
4552 a non-executable section linked to an EXIDX section.
4553 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4554 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4555 check that there is no deferred EXIDX section if we exit early.
4556 Instead of not making an EXIDX section in case of an error, make one
4557 and set the has_errors flag of it.
4558 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4559 in a relocatable link.
4560 (Target_arm::do_relax): Look for the EXIDX output section instead of
4561 assuming that it is called .ARM.exidx.
4562 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4563 section list. Do not check for SHF_EXECINSTR section flags but
4564 skip any input section with errors.
4565 * output.cc (Output_section::Output_section): Initialize
4566 always_keeps_input_sections_ to false.
4567 (Output_section::add_input_section): Check for
4568 always_keeps_input_sections_.
4569 * output.h (Output_section::always_keeps_input_sections,
4570 Output_section::set_always_keeps_input_sections): New methods.
4571 (Output_section::always_keeps_input_sections): New data member.
4572
69517287
RÁE
45732010-07-13 Rafael Espindola <espindola@google.com>
4574
4575 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4576 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4577
82742395
ILT
45782010-07-13 Philip Herron <herron.philip@googlemail.com>
4579 Ian Lance Taylor <iant@google.com>
4580
4581 * output.h (Output_section_lookup_maps::add_merge_section):
4582 Correct check of whether value was inserted.
4583 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4584 (Output_section_lookup_maps::add_relaxed_input_section):
4585 Likewise.
4586 * arm.cc (Target_arm::got_section): Remove used local os.
4587 * i386.cc (Target_i386::got_section): Likewise.
4588 * x86_64.cc (Target_x86_64::got_section): Likewise.
4589 * sparc.cc (Target_sparc::got_section): Likewise.
4590 (Target_sparc::relocate): Remove unused local have_got_offset.
4591 * powerpc.cc (Target_powerpc::relocate): Likewise.
4592
f2d707b5
ILT
45932010-07-13 Ian Lance Taylor <iant@google.com>
4594
241531d6
ILT
4595 * compressed_output.cc (zlib_decompress): Fix signature in
4596 !HAVE_ZLIB_H case.
4597
f2d707b5
ILT
4598 * archive.cc (Archive::include_member): Unlock an external member
4599 of a thin archive. Don't bother to delete an object we know is
4600 NULL.
4601
a2e47362
CC
46022010-07-12 Cary Coutant <ccoutant@google.com>
4603
4604 * compressed_output.cc (zlib_decompress): New function.
4605 (get_uncompressed_size): New function.
4606 (decompress_input_section): New function.
4607 * compressed_output.h (get_uncompressed_size): New function.
4608 (decompress_input_section): New function.
4609 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4610 Handle compressed debug sections.
4611 * layout.cc (is_compressed_debug_section): New function.
4612 (Layout::output_section_name): Map compressed section names to
4613 canonical names.
4614 * layout.h (is_compressed_debug_section): New function.
4615 (is_debug_info_section): Recognize compressed debug sections.
4616 * merge.cc: Include compressed_output.h.
4617 (Output_merge_data::do_add_input_section): Handle compressed
4618 debug sections.
4619 (Output_merge_string::do_add_input_section): Handle compressed
4620 debug sections.
4621 * object.cc: Include compressed_output.h.
4622 (Sized_relobj::Sized_relobj): Initialize new data members.
4623 (build_compressed_section_map): New function.
4624 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4625 * object.h (Object::section_is_compressed): New method.
4626 (Object::do_section_is_compressed): New method.
4627 (Sized_relobj::Compressed_section_map): New type.
4628 (Sized_relobj::do_section_is_compressed): New method.
4629 (Sized_relobj::compressed_sections_): New data member.
4630 * output.cc (Output_section::add_input_section): Handle compressed
4631 debug sections.
4632 * reloc.cc: Include compressed_output.h.
4633 (Sized_relobj::write_sections): Handle compressed debug sections.
4634
ce279a62
CC
46352010-07-08 Cary Coutant <ccoutant@google.com>
4636
4637 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4638 weak when resolving to a dynamic def.
4639 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4640 for weak undef/dynamic def cases. Adjust callers.
4641 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4642 undef_binding_weak_.
4643 (Symbol_table::sized_write_globals): Adjust symbol binding.
4644 (Symbol_table::sized_write_symbol): Add binding parameter.
4645 * symtab.h (Symbol::set_undef_binding): New method.
4646 (Symbol::is_undef_binding_weak): New method.
4647 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4648 (Symbol_table::should_override): Add new parameter.
4649 (Symbol_table::sized_write_symbol): Add new parameter.
4650
4651 * testsuite/weak_undef_file1.cc: Add new test case.
4652 * testsuite/weak_undef_file2.cc: Fix header comment.
4653 * testsuite/weak_undef_test.cc: Add new test case.
4654
b2286c10
DK
46552010-06-29 Doug Kwan <dougkwan@google.com>
4656
4657 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4658 Initialize USE_SYMBOL_.
4659 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4660 definition.
4661 (Arm_reloc_property::uses_symbol_): New data member declaration.
4662 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4663 uses symbol value and symbol is undefined but not weakly undefined.
4664
4802450a
RÁE
46652010-06-28 Rafael Espindola <espindola@google.com>
4666
4667 * plugin.cc (Plugin::load): Use dlerror.
4668
e5ca47ba
ILT
46692010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4670
4671 * symtab.cc (detect_odr_violations): When reporting an ODR
4672 violation, report an object where the symbol is defined.
4673
8a75a161
DK
46742010-06-25 Doug Kwan <dougkwan@google.com>
4675
4676 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4677 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4678 definition.
4679 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4680 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4681 target hook to detect function points.
4682 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4683 * icf.h (Icf::check_section_for_function_pointers): Change type of
4684 parameter SECTION_NAME to const reference to std::string. Use
4685 target hook to determine if section may have unsafe pointers.
4686 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4687 method definition.
4688
42218b9f
RÁE
46892010-06-21 Rafael Espindola <espindola@google.com>
4690
4691 * fileread.cc (Input_file::find_fie): New
4692 (Input_file::open): Use Input_file::find_fie.
4693 * fileread.h (Input_file::find_fie): New
4694 * plugin.cc (set_extra_library_path): New.
4695 (Plugin::load): Add set_extra_library_path to the transfer vector.
4696 (Plugin_manager::set_extra_library_path): New.
4697 (Plugin_manager::add_input_file): Use the extra search path if set.
4698 (set_extra_library_path(): New.
4699 * plugin.h (Plugin_manager): Add set_extra_library_path and
4700 extra_search_path_.
4701
a0506cca
CC
47022010-06-19 Cary Coutant <ccoutant@google.com>
4703
4704 * layout.cc (gdb_sections): Add .debug_types.
4705 (lines_only_debug_sections): Likewise.
4706
6508b958
RÁE
47072010-06-18 Rafael Espindola <espindola@google.com>
4708
4709 * plugin.cc (add_input_file,add_input_library)
4710 (Plugin_manager::add_input_file): Make filename arguments const.
4711 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4712 const.
4713
3e235302
DK
47142010-06-16 Doug Kwan <dougkwan@google.com>
4715
4716 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4717 .ARM.attributes section if we have not merged any input
4718 attributes sections.
4719
106e8a6c
DK
47202010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4721
4722 * arm.cc: Allow combining objects with no EABI version
4723 information.
4724
91ff43fe
RÁE
47252010-06-15 Rafael Espindola <espindola@google.com>
4726
4727 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4728
68ed838c
ILT
47292010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4730
4731 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4732 (struct iovec): Correct !HAVE_READV definition.
4733
f3a2388f
CC
47342010-06-10 Cary Coutant <ccoutant@google.com>
4735
4736 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4737 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4738 reloc sections.
4739 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4740
4741 PR 11683
4742 * symtab.h (Symbol::is_placeholder): New member function.
4743 * target-reloc.h (relocate_section): Check for placeholder symbols.
4744
4745 * testsuite/Makefile.am (plugin_test_8): New test.
4746 (plugin_test_9): New test.
4747 * testsuite/Makefile.in: Regenerate.
4748
e1df38aa
NC
47492010-06-09 Nick Clifton <nickc@redhat.com>
4750
4751 * yyscript.y (input_list_element): Allow strings prefixed with
4752 the '-' character. Treat these as libraries.
4753 * script.cc (script_add_library): New function. Adds a library
4754 specified by "-l<name>" found in an input script.
4755 * script-c.h: Add prototype for script_add_library.
4756
25bbe950
DK
47572010-06-07 Doug Kwan <dougkwan@google.com>
4758
4759 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4760 Restrict stub-group size to be within long conditional branch
4761 range when working around cortex-A8 erratum.
4762
0f32ea4c
ILT
47632010-06-07 Damien Diederen <dd@crosstwine.com>
4764
4765 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4766 #ifdef typo.
4767
8fe2a369
ST
47682010-06-03 Sriraman Tallam <tmsriram@google.com>
4769
4770 PR gold/11658
4771 * output.cc
4772 (Output_section::Input_section_sort_entry::compare_section_ordering):
4773 Change to return non-zero correctly.
4774 (Output_section::Input_section_sort_section_order_index_compare
4775 ::operator()): Change to fix ambiguity in comparisons.
4776
6e9ba2ca
ST
47772010-06-01 Sriraman Tallam <tmsriram@google.com>
4778
4779 * gold.h (is_wildcard_string): New function.
4780 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4781 (Layout::layout_eh_frame): Ditto.
4782 (Layout::find_section_order_index): New method.
4783 (Layout::read_layout_from_file): New method.
4784 * layout.h (Layout::find_section_order_index): New method.
4785 (Layout::read_layout_from_file): New method.
4786 (Layout::input_section_position_): New private member.
4787 (Layout::input_section_glob_): New private member.
4788 * main.cc (main): Call read_layout_from_file here.
4789 * options.h (--section-ordering-file): New option.
4790 * output.cc (Output_section::input_section_order_specified_): New
4791 member.
4792 (Output_section::Output_section): Initialize new member.
4793 (Output_section::add_input_section): Add new parameter.
4794 Keep input sections when --section-ordering-file is used.
4795 (Output_section::set_final_data_size): Sort input sections when
4796 section ordering file is specified.
4797 (Output_section::Input_section_sort_entry): Add new parameter.
4798 Check sorting type.
4799 (Output_section::Input_section_sort_entry::compare_section_ordering):
4800 New method.
4801 (Output_section::Input_section_sort_compare::operator()): Change to
4802 consider section_order_index.
4803 (Output_section::Input_section_sort_init_fini_compare::operator()):
4804 Change to consider section_order_index.
4805 (Output_section::Input_section_sort_section_order_index_compare
4806 ::operator()): New method.
4807 (Output_section::sort_attached_input_sections): Change to sort
4808 according to section order when specified.
e1df38aa
NC
4809 (Output_section::add_input_section<32, true>): Add new parameter.
4810 (Output_section::add_input_section<64, true>): Add new parameter.
4811 (Output_section::add_input_section<32, false>): Add new parameter.
4812 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4813 * output.h (Output_section::add_input_section): Add new parameter.
4814 (Output_section::input_section_order_specified): New
4815 method.
4816 (Output_section::set_input_section_order_specified): New method.
4817 (Input_section::Input_section): Initialize section_order_index_.
4818 (Input_section::section_order_index): New method.
4819 (Input_section::set_section_order_index): New method.
4820 (Input_section::section_order_index_): New member.
4821 (Input_section::Input_section_sort_section_order_index_compare): New
4822 struct.
4823 (Output_section::input_section_order_specified_): New member.
4824 * script-sections.cc (is_wildcard_string): Delete and move modified
4825 method to gold.h.
4826 (Output_section_element_input::Output_section_element_input): Modify
4827 call to is_wildcard_string.
4828 (Output_section_element_input::Input_section_pattern
4829 ::Input_section_pattern): Ditto.
4830 (Output_section_element_input::Output_section_element_input): Ditto.
4831 * testsuite/Makefile.am (final_layout): New test case.
4832 * testsuite/Makefile.in: Regenerate.
4833 * testsuite/final_layout.cc: New file.
4834 * testsuite/final_layout.sh: New file.
4835
3537c84b
RÁE
48362010-06-01 Rafael Espindola <espindola@google.com>
4837
4838 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4839
105b6afd
RÁE
48402010-06-01 Rafael Espindola <espindola@google.com>
4841
4842 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4843 visibility of symbols.
4844
29e11421
DK
48452010-05-27 Doug Kwan <dougkwan@google.com>
4846
4847 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4848 from start of output section instead of address for a local symbol
4849 in a merged or relaxed section when doing a relocatable link.
4850
5e0f337e
RÁE
48512010-05-26 Rafael Espindola <espindola@google.com>
4852
4853 PR 11604
4854 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4855 adding sections the garbage collector removed.
4856 * gold/testsuite/Makefile.am: Add test.
4857 * gold/testsuite/Makefile.in: Regenerate.
4858 * gold/testsuite/plugin_test_7.sh: New.
4859 * gold/testsuite/plugin_test_7_1.c: New.
4860 * gold/testsuite/plugin_test_7_2.c: New.
4861
f4187277
RÁE
48622010-05-26 Rafael Espindola <espindola@google.com>
4863
4864 * script-sections.cc (Output_section_definition::set_section_addresses):
4865 Check for --section-start.
4866
5c388529
DK
48672010-05-26 Doug Kwan <dougkwan@google.com>
4868
4869 * arm.cc (Arm_scan_relocatable_relocs): New class.
4870 (Target_arm::relocate_special_relocatable): New method.
4871 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4872 (Arm_relocate_functions::thumb_branch_common): Same.
4873 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4874 instead of Default_scan_relocatable_relocs.
4875 * target-reloc.h (relocate_for_relocatable): Let target handle
4876 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4877 * target.h (Sized_target::relocate_special_relocatable): New method.
4878
bca1c3ae
ILT
48792010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4880
4881 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4882
0439c796
DK
48832010-05-23 Doug Kwan <dougkwan@google.com>
4884
4885 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4886 instead of a cast.
4887 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4888 with a direct branch, not a conditional branch, to a stub.
4889 * merge.cc (Output_merge_base::record_input_section): New method
4890 defintion.
4891 (Output_merge_data::do_add_input_section): Record input section if
4892 keeps-input-sections flag is set.
4893 (Output_merge_string::do_add_input_section): Ditto.
4894 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4895 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4896 INPUT_SECTIONS_.
4897 (Output_merge_base::keeps_input_sections,
4898 Output_merge_base::set_keeps_input_sections,
4899 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4900 method definitions.
4901 (Output_merge_base::Input_sections): New type declaration.
4902 (Output_merge_base::input_sections_begin,
4903 Output_merge_base::input_sections_end,
4904 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4905 (Output_merge_base::bool keeps_input_sections_,
4906 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4907 Output_merge_base::input_sections_): New data members.
4908 (Output_merge_data::do_set_keeps_input_sections): New method
4909 defintion.
4910 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4911 * output.cc (Output_section::Input_section::relobj): Move method
4912 defintion from class declaration to here and handle merge sections.
4913 (Output_section::Input_section::shndx): Ditto.
4914 (Output_section::Output_section): Remove initializations of removed
4915 data members and initialize new data member LOOKUP_MAPS_.
4916 (Output_section::add_input_section): Set keeps-input-sections flag
4917 for a newly created merge output section as appropriate. Adjust code
4918 to use Output_section_lookup_maps class.
4919 (Output_section::add_relaxed_input_section): Adjst code for lookup
4920 maps code refactoring.
4921 (Output_section::add_merge_input_section): Add a new parameter
4922 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4923 class. If adding input section to a newly created merge output
4924 section fails, remove the new merge section.
4925 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4926 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4927 (Output_section::find_merge_section): Ditto.
4928 (Output_section::build_lookup_maps): New method defintion.
4929 (Output_section::find_relaxed_input_section): Adjust code to use
4930 Output_section_lookup_maps class.
4931 (Output_section::get_input_sections): Export merge sections. Adjust
4932 code to use Output_section_lookup_maps class.
4933 (Output_section:::add_script_input_section): Adjust code to use
4934 Output_section_lookup_maps class. Update lookup maps for merge
4935 sections also.
4936 (Output_section::discard_states): Use Output_section_lookup_maps.
4937 (Output_section::restore_states): Same.
4938 * output.h (Merge_section_properties): Move class defintion out of
4939 Output_section.
4940 (Output_section_lookup_maps): New class.
4941 (Output_section::Input_section::is_merge_section): New method
4942 defintion.
4943 (Output_section::Input_section::relobj): Move defintion out of class
4944 defintion. Declare method only.
4945 (Output_section::Input_section::shndx): Ditto.
4946 (Output_section::Input_section::output_merge_base): New method defintion.
4947 (Output_section::Input_section::u2_.pomb): New union field.
4948 (Output_section::Merge_section_by_properties_map,
4949 Output_section::Output_section_data_by_input_section_map,
4950 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4951 Remove types.
4952 (Output_section::add_merge_input_section): Add new parameter
4953 KEEPS_INPUT_SECTIONS.
4954 (Output_section::build_lookup_maps): New method declaration.
4955 (Output_section::merge_section_map_,
4956 Output_section::merge_section_by_properties_map_,
4957 Output_section::relaxed_input_section_map_,
4958 Output_section::is_relaxed_input_section_map_valid_): Remove data
4959 members.
4960 (Output_section::lookup_maps_): New data member.
4961
76295588
L
49622010-05-21 Doug Kwan <dougkwan@google.com>
4963
4964 PR gold/11619
4965 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4966 avoid a compilation error.
4967
d103a984
RÁE
49682010-05-19 Rafael Espindola <espindola@google.com>
4969
4970 * script-sections.cc (Output_section_definition::allocate_to_segment):
4971 Update the phdrs_list even when the output section is NULL.
4972 * testsuite/Makefile.am: Add test.
4973 * testsuite/Makefile.in: Regenerate.
4974 * testsuite/script_test_9.cc: New.
4975 * testsuite/script_test_9.sh: New.
4976 * testsuite/script_test_9.t: New.
4977
6625d24e
DK
49782010-05-19 Doug Kwan <dougkwan@google.com>
4979
4980 * arm.cc (Arm_input_section::original_size): New method.
4981 (Arm_input_section::do_addralign): Add a cast.
4982 (Arm_input_section::do_output_offset): Remove static cast.
4983 (Arm_input_section::original_addralign,
4984 Arm_input_section::original_size_): Change type to uint32_t.
4985 (Arm_input_section::init): Add safe casts for section alignment
4986 and size.
4987 (Arm_input_section::set_final_data_size): Do not set address and
4988 offset of stub table.
4989 (Arm_output_section::fix_exidx_coverage): Change use of of
4990 Output_section::Simple_input_section to that of
4991 Output_section::Input_section.
4992 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4993 except for the first pass.
4994 * output.cc (Output_section::get_input_sections): Change type of
4995 input_sections to std::list<Input_section>.
4996 (Output_section::add_script_input_section): Rename from
4997 Output_section::add_simple_input_section. Change type of SIS
4998 parameter from Simple_input_section to Input_section.
4999 * output.h (Output_section::Simple_input_section): Remove class.
5000 (Output_section::Input_section): Change class visibility to public.
5001 (Output_section::Input_section::addralign): Use stored alignments
5002 for special input sections if set.
5003 (Output_section::Input_section::set_addralign): New method.
5004 (Output_section::get_input_sections): Change parameter type from
5005 list of Simple_input_section to list of Input_section.
5006 (Output_section::add_script_input_section): Rename from
5007 Output_section::add_simple_input_section. Change first parameter's
5008 type from Simple_input_section to Input_section and remove the
5009 second and third parameters.
5010 * script-sections.cc (Input_section::Input_section_list): Change
5011 type to list of Output_section::Input_section/
5012 (Input_section_info::Input_section_info): Change parameter type of
5013 INPUT_SECTION to Output_section::Input_section.
5014 (Input_section_info::input_section): Change return type.
5015 (Input_section_info::input_section_): Change type to
5016 Output_section::Input_section.
5017 (Output_section_element_input::set_section_addresses): Adjust code
5018 to use Output_section::Input_section instead of
5019 Output_section::Simple_input_section. Adjust code for renaming
5020 of Output_section::add_simple_input_section.
5021 (Orphan_output_section::set_section_addresses): Ditto.
5022
e1e82ea4
RW
50232010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5024
5025 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5026 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5027
91e75c8a
RÁE
50282010-05-18 Rafael Espindola <espindola@google.com>
5029
5030 * options.cc (General_options::finalize): Handle -nostdlib.
5031 * options.h (nostdlib): New option.
5032 * script.cc (script_add_search_dir): Handle -nostdlib.
5033
da59ad79
DK
50342010-05-12 Doug Kwan <dougkwan@google.com>
5035
5036 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5037 attributes section only if there no attributes section after merging.
5038 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5039 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5040 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5041 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5042 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5043 and arm_attr_merge_7.stdout.
5044 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5045 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5046 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5047 arm_attr_merge_7b.o): New rules.
5048 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5049 arm_attr_merge_7
5050 * testsuite/Makefile.in: Regenerate.
5051 * testsuite/arm_attr_merge.sh: New file.
5052 * testsuite/arm_attr_merge_[67][ab].s: Same.
5053
3e01a7fd
NC
50542010-05-05 Nick Clifton <nickc@redhat.com>
5055
5056 * po/es.po: Updated Spanish translation.
5057
7ad2014a
L
50582010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5059
5060 * Makefile.am (install-exec-local): Properly install gold as
5061 default cross linker.
5062 * Makefile.in: Regenerated.
5063
4fda8867
NC
50642010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5065 Nick Clifton <nickc@redhat.com>
5066
5067 * configure.ac (install_as_default): Define and set to false
5068 unless --enable-gold or --enable-gold=both/gold has been
5069 specified.
5070 * configure: Regenerate.
5071
5072 * Makefile.am (install-exec-local): Install the executable as
5073 'ld.gold'. If install_as_default is true then also install it as
5074 'ld'.
5075 * Makefile.in: Regenerated.
5076
bd288ea2
ILT
50772010-04-24 Ian Lance Taylor <iant@google.com>
5078
5079 * layout.cc (Layout::layout_reloc): In relocatable link don't
5080 combine reloc sections for grouped sections.
5081
ef38fd8a
ST
50822010-04-23 Sriraman Tallam <tmsriram@google.com>
5083
5084 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5085 sections that are not ordinary to icf.
5086 * icf.cc (get_section_contents): Handle relocation pointing to section
5087 with no object or shndx information.
5088 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5089 * testsuite/Makefile.in: Regenerate.
5090 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5091 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5092
f6973bdc
ILT
50932010-04-22 Ian Lance Taylor <iant@google.com>
5094
5095 * expression.cc (Expression::Expression_eval_info): Add
5096 result_alignment_pointer field.
5097 (Expression::eval_with_dot): Add result_alignment_pointer
5098 parameter. Change all callers.
5099 (Expression::eval_maybe_dot): Likewise.
5100 (class Binary_expression): Add alignment_pointer parameter to
5101 left_value and right_value. Change all callers.
5102 (BINARY_EXPRESSION): Set result alignment.
5103 (class Trinary_expression): Add alignment_pointer parameter to
5104 arg2_value and arg3_value. Change all callers.
5105 (Trinary_cond::value): Set result alignment.
5106 (Max_expression::value, Min_expression::value): Likewise.
5107 (Align_expression::value): Likewise.
5108 * script-sections.cc (class Sections_element): Add dot_alignment
5109 parameter to set_section_addresses virtual function. Update
5110 instantiations.
5111 (class Output_section_element): Likewise.
5112 (Script_sections::create_segments): Add dot_alignment parameter.
5113 Change all callers.
5114 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5115 (Script_sections::set_phdrs_clause_addresses): Likewise.
5116 * script-sections.h: Update declarations.
5117 * script.h: Update declarations.
5118 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5119 min_p_align.
5120 * testsuite/script_test_3.t: Set large alignment.
5121 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5122 segment has expected alignment.
5123
9c9c98a5
NC
51242010-04-22 Nick Clifton <nickc@redhat.com>
5125
5126 * po/gold.pot: Updated by the Translation project.
5127 * po/vi.po: Updated Vietnamese translation.
5128
2253bfba
L
51292010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5130
5131 * testsuite/Makefile.am (check_PROGRAMS): Add
5132 icf_virtual_function_folding_test.
5133 * testsuite/Makefile.in: Regenerated.
5134
85fdf906
AH
51352010-04-15 Andrew Haley <aph@redhat.com>
5136
5137 * options.h (merge_exidx_entries): New option.
5138 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5139 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5140 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5141 (Target_arm::merge_exidx_entries): New function.
5142 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5143 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5144 to Arm_exidx_fixup constructor.
5145 Add new arg, merge_exidx_entries.
5146 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5147 Arm_output_section::fix_exidx_coverage.
5148
ce97fa81
ST
51492010-04-18 Sriraman Tallam <tmsriram@google.com>
5150
5151 * icf.cc (get_section_contents): Check for preemptible functions.
5152 Ignore addend when appropriate.
5153 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5154 section folded.
5155 (add_from_relobj): Check for section folded.
5156 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5157 * symtab.h (should_add_dynsym_entry): Add new parameter.
5158 * target-reloc.h (scan_relocs): Check for section folded.
5159 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5160 Check reloc types for function pointers in shared objects.
5161 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5162 case.
5163 (icf_preemptible_functions_test): New test case.
5164 (icf_string_merge_test): New test case.
5165 * testsuite.Makefile.in: Regenerate.
5166 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5167 bar_glob. Refactor code.
5168 * testsuite/icf_preemptible_functions_test.cc: New file.
5169 * testsuite/icf_preemptible_functions_test.sh: New file.
5170 * testsuite/icf_string_merge_test.cc: New file.
5171 * testsuite/icf_string_merge_test.sh: New file.
5172 * testsuite/icf_virtual_function_folding_test.cc: New file.
5173 * testsuite/icf_virtual_function_folding_test.sh: New file.
5174
04ceb17c
DK
51752010-04-14 Doug Kwan <dougkwan@google.com>
5176
5177 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5178 for local symbol recounting if we remove a section due to ICF.
5179 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5180 there are no regular objects in input.
5181
153e7da4
DK
51822010-04-13 Doug Kwan <dougkwan@google.com>
5183
5184 * arm.cc (Arm_input_section::set_final_data_size): Compute
5185 accurate final data size instead of using current data size.
5186
4dbd9faf
DK
51872010-04-09 Doug Kwan <dougkwan@google.com>
5188
5189 * layout.cc (Layout::choose_output_section): Handle script section
5190 types.
5191 (Layout::make_output_section_for_script): Add section type parameter.
5192 Handle script section types.
5193 * layout.h (Layout::make_output_section_for_script): Add section
5194 type parameter.
5195 * output.cc (Output_section::Output_section): Initialize data member
5196 is_noload_.
5197 (Output_section::do_reset_address_and_file_offset): Do not set address
5198 to 0 if section is a NOLOAD section.
5199 * output.h (Output_section::is_noload): New method.
5200 (Output_section::set_is_noload): Ditto.
5201 (Output_section::is_noload_): New data member.
5202 * script-c.h (Script_section_type): New enum type.
5203 (struct Parser_output_section_header): Add new file section_type.
5204 * script-sections.cc (Sections_element::output_section_name): Add
5205 parameter for returning script section type.
5206 (Output_section_definition::output_section_name): Ditto.
5207 (Output_section_definition::section_type)P; New method.
5208 (Output_section_definiton::script_section_type_name): Ditto.
5209 (Output_section_definition::script_section_type_): New data member.
5210 (Output_section_definition::Output_section_definition): Initialize
5211 data member Output_section_definition::script_section_type_.
5212 (Output_section_definition::create_sections): Pass script section type
5213 to Layout::make_output_section_for_script.
5214 (Output_section_definition::output_section_name): Return script
5215 section type to caller.
5216 (Output_section_definition::set_section_address): Do not advance
5217 dot value and load address if section type is NOLOAD. Set address
5218 of NOLOAD sections regardless of section flags.
5219 (Output_section_definition::print): Print section type if it is
5220 not SCRIPT_SECTION_TYPE_NONE.
5221 (Output_section_definition::section_type): New method.
5222 (Output_section_definition::script_section_type_name): Ditto.
5223 (Script_sections::output_section_name): Add new parameter
5224 PSECTION_TYPE for returning script section type. Pass it to
5225 section elements. Handle discard sections.
5226 (Sort_output_sections::operator()): Handle NOLOAD sections.
5227 * script-sections.h (Script_sections::Section_type): New enum type.
5228 (Script_sections::output_section_name): Add a new parameter for
5229 returning script section type.
5230 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5231 INFO and NOLOAD.
5232 * yyscript.y (union): Add new field SECTION_TYPE.
5233 (COPY, DSECT, INFO, NOLOAD): New tokens.
5234 (opt_address_and_section_type): Change type to output_section_header.
5235 (section_type): New non-terminal
5236 (section_header): Handle section type.
2253bfba 5237 (opt_address_and_section_type): Return section type value.
4dbd9faf 5238
721ea635
L
52392010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5240
5241 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5242 * testsuite/plugin_common_test_2.c (foo): Likewise.
5243
6bf924b0
DK
52442010-04-08 Doug Kwan <dougkwan@google.com>
5245
5246 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5247 Output_merge_data.
5248 * output.cc (Output_section::add_merge_input_section): Simplify
5249 code and return status of Output_merge_base::add_input_section.
e1df38aa 5250 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5251 returns true.
5252
24af6f92
DK
52532010-04-07 Doug Kwan <dougkwan@google.com>
5254
5255 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5256 if section is marked as containing instructions but has no mapping
5257 symbols.
5258 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5259 correct section index.
5260 (Arm_relobj::find_linked_text_section): Ditto.
5261
00698fc5
CC
52622010-04-07 Cary Coutant <ccoutant@google.com>
5263
5264 * archive.cc (include_member): Destroy Read_symbols_data object before
5265 releasing file.
5266 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5267 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5268 (Read_symbols_data::~Read_symbols_data) New destructor.
5269 (Section_relocs::Section_relocs) New constructor.
5270 (Section_relocs::~Section_relocs) New destructor.
5271 (Read_relocs_data::Read_relocs_data) New constructor.
5272 (Read_relocs_data::~Read_relocs_data) New destructor.
5273 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5274 pointers to NULL after deleting.
5275
7296d933
DK
52762010-04-07 Doug Kwan <dougkwan@google.com>
5277
5278 * arm.cc: Replace "endianity" with "endianness" in comments.
5279 (Arm_exidx_cantunwind): Ditto.
5280 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5281 (Arm_relobj::merge_flags_and_attributes): New method.
5282 (Arm_relobj::merge_flags_and_attributes_): New data member.
5283 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5284 (Arm_relobj::scan_sections_for_stubs): Ditto.
5285 (Arm_relobj::do_read_symbols): Check to see if we really want to
5286 merge processor-specific flags and attributes. Exit early if
5287 an object is empty except for section names and the undefined symbol.
5288 (Target_arm::do_finalize_sections): Move check for ELF format to
5289 Arm_relobj::do_read_symbols. Merge processor specific flags and
5290 attributes from a regular object only when we have determined that
5291 it is aapropriate. Do not create an .ARM.attributes section in
5292 output if there is no regular input object.
5293 (Target_arm::merge_processor_specific_flags): Check
5294 --warn-mismatch before printing any error.
5295 (Target_arm::merge_object_attributes): Ditto.
5296 * gold.cc (queue_middle_tasks): Handle the case in which there is
5297 no regular object in input.
5298 * options.cc (General_options::parse_EB): New method.
5299 (General_options::parse_EL): Same.
5300 (General_options::General_options): Initialize endianness_.
5301 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5302 New options.
5303 (General_options::Endianness): New enum.
5304 (General_options::endianness): New method.
5305 (General_options::endianness_): New data member.
5306 * parameters.cc (Parameters::set_options): Check target endianness.
5307 (Parameters::set_target_once): Ditto.
5308 (Parameters::check_target_endianness): New method.
5309 (parameters_force_valid_target): If either -EL or -EB is specified,
5310 use it to define endianness of default target.
5311 * parameters.h (Parameters::check_target_endianness): New method
5312 declaration.
5313 * target.h (class Target): Change "endianity" to "endianness"
5314 in comments.
5315
efc8d4f2
RW
53162010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5317
5318 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5319 * configure: Regenerate.
5320 * Makefile.in: Regenerate.
5321 * testsuite/Makefile.in: Regenerate.
5322
be234d88
CC
53232010-04-06 Cary Coutant <ccoutant@google.com>
5324
5325 gcc PR lto/42757
5326 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5327 prevailing definitions of common symbols.
5328 * testsuite/plugin_test_6.sh: New test case.
5329 * testsuite/plugin_common_test_1.c: New test case.
5330 * testsuite/plugin_common_test_2.c: New test case.
5331 * testsuite/Makefile.am (plugin_test_6): New test case.
5332 * testsuite/Makefile.in: Regenerate.
5333
bd32c6bd
NC
53342010-04-06 Nick Clifton <nickc@redhat.com>
5335
5336 * po/vi.po: New Vietnamese translation.
5337
323c532f
DK
53382010-03-30 Doug Kwan <dougkwan@google.com>
5339
5340 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5341
4fcd97eb
DK
53422010-03-25 Doug Kwan <dougkwan@google.com>
5343
5344 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5345 to avoid a conversion warning on a 32-bit host.
5346
4ebf39db
ILT
53472010-03-24 Ian Lance Taylor <iant@google.com>
5348
5349 * testsuite/script_test_3.t: Add a TLS segment.
5350 * testsuite/Makefile.am (check_PROGRAMS): Add
5351 tls_phdrs_script_test.
5352 (tls_phdrs_script_test_SOURCES): Define.
5353 (tls_phdrs_script_test_DEPENDENCIES): Define.
5354 (tls_phdrs_script_test_LDFLAGS): Define.
5355 (tls_phdrs_script_test_LDADD): Define.
5356 * testsuite/Makefile.in: Rebuild.
5357
4a599bdd
CC
53582010-03-23 Cary Coutant <ccoutant@google.com>
5359
5360 * fileread.cc (find_or_make_view): Fix comment.
5361
6c93b22c
ILT
53622010-03-23 Ian Lance Taylor <iant@google.com>
5363
5364 * script-sections.cc (class Orphan_section_placement): Define
5365 PLACE_TLS and PLACE_TLS_BSS.
5366 (Orphan_section_placement::Orphan_section_placement): Initialize
5367 new places.
5368 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5369 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5370 (tls_script_test_SOURCES): Define.
5371 (tls_script_test_DEPENDENCIES): Define.
5372 (tls_script_test_LDFLAGS): Define.
5373 (tls_script_test_LDADD): Define.
5374 * testsuite/Makefile.in: Rebuild.
5375
a2c7281b
DK
53762010-03-22 Doug Kwan <dougkwan@google.com>
5377
5378 * arm.cc (Arm_relocate_functions::abs8,
5379 Arm_relocate_functions::abs16): Use correct check for overflow
5380 specified in the ARM ELF specs.
5381 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5382 target of a BLX instruction specially.
5383 (Reloc_stub::stub_type_for_reloc): Ditto.
5384 (Relocate::relocate): Use symbolic names instead of numeric relocation
5385 codes to report error.
5386 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5387 workaround.
5388 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5389 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5390 thumb2_blx_out_of_range.stdout
5391 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5392 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5393 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5394 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5395 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5396 thumb2_blx_in_range, thumb2_blx_in_range.o,
5397 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5398 thumb2_blx_out_of_range.o): New rules.
5399 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5400 thumb2_blx_in_range and thumb2_blx_out_of_range.
5401 * testsuite/Makefile.in: Regenerate.
5402 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5403 * testsuite/thumb_blx_in_range.s: New file.
5404 * testsuite/thumb_blx_out_of_range.s: New file.
5405
b0193076
RÁE
54062010-03-22 Rafael Espindola <espindola@google.com>
5407
5408 * archive.cc (Should_include): Move to archive.h.
5409 (should_include_member): Make it a member of Archive.
5410 (Lib_group): New.
5411 (Add_lib_group_symbols): New.
5412 * archive.h: Include options.h.
5413 (Archive_member): Moved from Archive.
5414 (Should_include): Moved from archive.cc.
5415 (Lib_group): New.
5416 (Add_lib_group_symbols): New.
5417 * dynobj.cc (do_should_include_member): New.
5418 * dynobj.h (do_should_include_member): New.
5419 * gold.cc (queue_initial_tasks): Update call to queue.
5420 * main.cc (main): Print lib group stats.
5421 * object.cc (do_should_include_member): New.
5422 * object.h: Include archive.h.
5423 (Object::should_include_member): New.
5424 (Object::do_should_include_member): New.
5425 (Sized_relobj::do_should_include_member): New.
5426 * options.cc (General_options::parse_start_lib): New.
5427 (General_options::parse_end_lib): New.
5428 (Input_arguments::add_file): Handle lib groups.
5429 (Input_arguments::start_group): Check we are not in a lib.
5430 (Input_arguments::start_lib): New.
5431 (Input_arguments::end_lib): New.
5432 * options.h (General_options): Add start_lib and end_lib.
5433 (Input_argument::lib_): New.
5434 (Input_argument::lib): New.
5435 (Input_argument::is_lib): New.
5436 (Input_file_lib): New.
5437 (Input_arguments::in_lib_): New.
5438 (Input_arguments::in_lib): New.
5439 (Input_arguments::start_lib): New.
5440 (Input_arguments::end_lib_): New.
5441 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5442 in unused members as preempted.
5443 (Sized_pluginobj::do_should_include_member): New.
5444 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5445 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5446 return the blocker.
5447 (Read_symbols::do_whole_lib_group): New.
5448 (Read_symbols::do_lib_group): New.
5449 (Read_symbols::do_read_symbols): Handle lib groups.
5450 (Read_symbols::get_name): Handle lib groups.
5451 * readsyms.h (Read_symbols): Add an archive member pointer.
5452 (Read_symbols::do_whole_lib_group): New.
5453 (Read_symbols::do_lib_group): New.
5454 (Read_symbols::member_): New.
5455 * script.cc (read_input_script): Update call to queue_soon.
5456
d099120c
DK
54572010-03-19 Doug Kwan <dougkwan@google.com>
5458
5459 * arm.cc (Stub_table::Stub_table): Initialize new data members
5460 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5461 (Stub_table::add_reloc_stub): Assign stub offset and update
5462 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5463 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5464 New data members.
5465 (Stub_table::update_data_size_and_addralign): Use
5466 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5467 instead of going over all reloc stubs.
5468 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5469 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5470 Stringpool_template::offset_ to size of Stringpool_char.
5471 (Stringpool_template::new_key_offset): Remove code to initialize
5472 Stringpool_template::offset_.
5473 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5474 Stringpool_template::offset_ to zero.
5475
1aa37384
DK
54762010-03-15 Doug Kwan <dougkwan@google.com>
5477
5478 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5479 offset_.
5480 (Stringpool_template::new_key_offset): New method.
5481 (Stringpool_template::add_string): Assign offsets when adding new
5482 strings.
5483 (Stringpool_template::set_string_offsets): Do not set string offsets
5484 when not optimizing.
5485 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5486 member size_.
5487 (Chunked_vector::clear): Clear size_.
5488 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5489 (Chunked_vector::size): Return size_.
5490 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5491 (Chunked_vector::size_): New data member.
1aa37384
DK
5492 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5493 (Stringpool_template::new_key_offset): New method declaration.
5494 (Stringpool_template::offset_): New data member.
5495
b672b057
RÁE
54962010-03-15 Rafael Espindola <espindola@google.com>
5497
5498 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5499 Add_symbols' constructor.
5500 * readsyms.h (Add_symbols): Remove the input_group member.
5501
b6848d3c
ILT
55022010-03-10 Ian Lance Taylor <iant@google.com>
5503
5504 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5505 target to ask whether a reference to a symbol requires a stack
5506 split.
5507 * target.h (Target::is_call_to_non_split): New function.
5508 (Target::do_is_call_to_non_split): Declare virtual function.
5509 * target.cc: Include "symtab.h".
5510 (Target::do_is_call_to_non_split): New function.
5511 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5512
a2a5469e
CC
55132010-03-10 Cary Coutant <ccoutant@google.com>
5514
5515 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5516 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5517 (File_read::open[2]): Add whole_file_view_ to list of views.
5518 (File_read::make_view): Remove test of whole_file_view_.
5519 (File_read::find_or_make_view): Create whole_file_view_ if
5520 necessary.
5521 (File_read::clear_views): Replace bool parameter with enum;
5522 adjust all callers. Don't delete views with permanent data;
5523 do delete cached views and views from archives if
5524 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5525 if clearing the corresponding view.
5526 * fileread.h (File_read::Clear_views_mode): New enum.
5527 (File_read::View::is_permanent_view): New method.
5528 (File_read::clear_views): Replace bool parameter
5529 with enum; adjust all callers.
5530 * options.h (General_options): Change keep_files_mapped option;
5531 add map_whole_files.
5532 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5533 releasing the file.
5534 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5535 the file.
5536
8861f32b
DM
55372010-03-10 David S. Miller <davem@davemloft.net>
5538
5539 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5540
d62d0f5f
ST
55412010-03-09 Sriraman Tallam <tmsriram@google.com>
5542
5543 * icf.cc (get_section_contents): Add '@' marker after processing the
5544 merge reloc.
5545
9177756d
DK
55462010-03-08 Doug Kwan <dougkwan@google.com>
5547
5548 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5549 due to a conversion warning.
5550 (Arm_relobj::update_output_local_symbol_count): Check for local
5551 symbol with unset output index.
5552
9e9e071b
ILT
55532010-03-05 Ian Lance Taylor <iant@google.com>
5554
5555 * options.h (class General_options): Add --spare-dynamic-tags.
5556 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5557 --spare-dynamic-tags.
5558
a81ee015
ILT
55592010-03-05 Ian Lance Taylor <iant@google.com>
5560
5561 * incremental.cc: Include "libiberty.h".
5562
44ec90b9
RO
55632010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5564
5565 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5566 function, is_info_ member.
5567 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5568 (Versions::Versions): Update caller.
5569 (Versions::define_base_version): Likewise.
5570 (Versions::add_def): Likewise.
5571
0897ed3b
ST
55722010-03-03 Sriraman Tallam <tmsriram@google.com>
5573
5574 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5575 (Scan::possible_function_pointer_reloc): New function.
5576 (Scan::local_reloc_may_be_function_pointer): Change to call
5577 possible_function_pointer_reloc.
5578 (Scan::global_reloc_may_be_function_pointer): Ditto.
5579 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5580 relocations in ".data.rel.ro._ZTV" section.
5581 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5582 * testsuite/icf_safe_so_test.cc: Ditto.
5583 * testsuite/icf_safe_test.cc: Ditto.
5584 * testsuite/icf_safe_test.sh: Ditto.
5585
d3bbad62
ILT
55862010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5587 Ian Lance Taylor <iant@google.com>
5588
5589 * target-reloc.h (relocate_section): Check the symbol table index
5590 for -1U before setting the local symbol index.
5591 (scan_relocatable_relocs): If copying the relocation, record that
5592 the local symbol is required.
5593 * object.h (Symbol_value::is_output_symtab_index_set): New
5594 function.
5595 (Symbol_value::may_be_discarded_from_output_symtab): New
5596 function.
5597 (Symbol_value::has_output_symtab_entry): New function.
5598 (Symbol_value::needs_output_symtab_entry): Remove.
5599 (Symbol_value::output_symtab_index): Make sure the symbol index is
5600 set.
5601 (Symbol_value::set_output_symtab_index): Make sure the symbol
5602 index is not set. Make sure the new index is valid.
5603 (Symbol_value::set_must_have_output_symtab_entry): New function.
5604 (Symbol_value::has_output_dynsym_entry): New function.
5605 (Symbol_value::set_output_dynsym_index): Make sure the new index
5606 is valid.
5607 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5608 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5609 local symbol if permitted.
5610 (Sized_relobj::do_finalize_local_symbols): Call
5611 is_output_symtab_index_set rather than needs_output_symtab_entry.
5612 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5613 rather than needs_output_symtab_entry. Call
5614 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5615 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5616 is_output_symtab_index_set rather than needs_output_symtab_entry.
5617 * testsuite/discard_locals_relocatable_test.c: New file.
5618 * testsuite/discard_locals_test.sh: Test -r.
5619 * testsuite/Makefile.am (check_DATA): Add
5620 discard_locals_relocatable_test1.syms,
5621 discard_local_relocatable_test2.syms.
5622 (MOSTLYCLEANFILES): Likewise. Also add
5623 discard_locals_relocatable_test1.lout and
5624 discard_locals_relocatable_test2.out.
5625 (discard_locals_relocatable_test1.syms): New target.
5626 (discard_locals_relocatable_test.o): New target.
5627 (discard_locals_relocatable_test1.out): New target.
5628 (discard_locals_relocatable_test2.syms): New target.
5629 (discard_locals_relocatable_test2.out): New target.
5630 (various): Add missing ../ld-new dependencies.
5631 * testsuite/Makefile.in: Rebuild.
5632
7e8ccf26
NC
56332010-03-03 Nick Clifton <nickc@redhat.com>
5634
5635 * po/fi.po: New Finnish translation.
5636
2a0ff005
DK
56372010-03-01 Doug Kwan <dougkwan@google.com>
5638
5639 * layout.cc (Layout::Layout): Force section types of .init_array*,
5640 .preinit_array* and .fini_array* sections.
5641 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5642 Fix check of return value of std::string::find.().
5643 (Output_section::Input_section_sort_compare::operator()): Remove
5644 comment about .init_array.
5645 (Output_section::Input_section_sort_init_fini_compare::operator()):
5646 New method.
5647 (Output_section::sort_attached_input_sections): Handle .init_array
5648 and .fini_array specially.
5649 * output.h (Output_section::Inut_section_sort_compare): Update
5650 comment.
5651 (Output_section::Input_section_sort_init_fini_compare): New struct.
5652
c3e4ae29
DK
56532010-02-26 Doug Kwan <dougkwan@google.com>
5654
5655 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5656 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5657 * testsuite/debug_msg.sh: Avoid matching source line number for
5658 use of global variable undef_int.
5659
2fd9ae7a
DK
56602010-02-26 Doug Kwan <dougkwan@google.com>
5661
5662 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5663 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5664 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5665 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5666 * options.cc (General_options::General_options): Initialize member
5667 fix_v4bx_.
5668 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5669 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5670 and rm_no_fix_v4bx.stdout
5671 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5672 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5673 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5674 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5675 and arm_no_fix_v4bx.
5676 * Makefile.in: Regenerate.
5677 * testsuite/arm_fix_v4bx.s: New file.
5678 * testsuite/arm_fix_v4bx.sh: Ditto.
5679
67ec7d0b
DK
56802010-02-24 Doug Kwan <dougkwan@google.com>
5681
5682 * arm.cc (Target_arm::got_section): Make the .got section the first
5683 non RELRO section in the data segment.
5684 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5685 suffixes of section names.
5686
10165461
DK
56872010-02-24 Doug Kwan <dougkwan@google.com>
5688
5689 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5690 flags and attributes merging if an input file is a binary file.
5691 * fileread.cc (Input_file::open): Record format of original file.
5692 * fileread.h (Input_file::Format): New enum type.
5693 (Input_file::Input_file): Initialize data member format_.
5694 (Input_file::format): New method definition.
5695 (Input_file::format_):: New data member.
5696
4a54abbb
DK
56972010-02-24 Doug Kwan <dougkwan@google.com>
5698
5699 * arm.cc (Arm_output_data_got): New class.
5700 (ARM_TCB_SIZE): New constant
5701 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5702 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5703 If user uses a script with a SECTIONS clause, issue only a warning
5704 for a misplaced EXIDX input section. Otherwise, issue an error.
5705 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5706 garbage collection.
5707 (Target_arm::got_mode_index_entry): Handle static linking.
5708 (Target_arm::Scan::local): Ditto.
5709 (Target_arm::Scan::global): Ditto.
5710 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5711 all incorrectly implemented relocations.
e1df38aa 5712 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5713 Arm_output_section::fix_exidx_coverage.
5714 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5715 from ".ARM.exidx." and ".ARM.extab.".
5716
ca419a6f
ILT
57172010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5718
5719 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5720 section if it does not already exist.
5721 * attributes.cc (Attributes_section_data::Attributes_section_data):
5722 Don't crash if size is zero.
5723
135b9c78
ILT
57242010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5725 Ian Lance Taylor <iant@google.com>
5726
5727 * gold.cc (queue_middle_tasks): If no input files were opened,
5728 exit.
5729 * workqueue.h (Task_function::Task_function): Assert that there is
5730 a blocker.
5731
bb0bfe4f
DK
57322010-02-22 Doug Kwan <dougkwan@google.com>
5733
5734 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5735 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5736 types to avoid warnings due to different uint64_t implementations
5737 on different hosts.
5738
2a2b6d42
DK
57392010-02-21 Doug Kwan <dougkwan@google.com>
5740
5741 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5742 handling of the maximum backward branch offset.
5743 (Arm_relocate_functions::thumb_branch_common): Ditto.
5744 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5745 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5746 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5747 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5748 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5749 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5750 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5751 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5752 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5753 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5754 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5755 thumb2_bl_out_of_range.o): New rules.
5756 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5757 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5758 thumb2_bl_out_of_range
5759 * testsuite/Makefile.in: Regenerate.
5760 * testsuite/arm_bl_in_range.s: New file.
5761 * testsuite/arm_bl_out_of_range.s: Ditto.
5762 * testsuite/arm_branch_in_range.sh: Ditto.
5763 * testsuite/arm_branch_range.t: Ditto.
5764 * testsuite/thumb2_branch_range.t: Ditto.
5765 * testsuite/thumb_bl_in_range.s: Ditto.
5766 * testsuite/thumb_bl_out_of_range.s: Ditto.
5767 * testsuite/thumb_branch_range.t: Ditto.
5768
b487ad64
ST
57692010-02-20 Sriraman Tallam <tmsriram@google.com>
5770
5771 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5772 Add reloc offset information.
5773 * icf.cc (get_section_contents): Change iterators to point to the new
5774 vectors. Add reloc offset information to the contents.
5775 * icf.h (Icf::Sections_reachable_info): New typedef.
5776 (Icf::Sections_reachable_list): New typedef.
5777 (Icf::Offset_info): New typedef.
5778 (Icf::Reloc_info): New struct typedef.
5779 (Icf::Reloc_info_list): New typedef.
5780 (Icf::symbol_reloc_list): Delete method.
5781 (Icf::addend_reloc_list): Delete method.
5782 (Icf::section_reloc_list): Delete method.
5783 (Icf::reloc_info_list): New method.
5784 (Icf::reloc_info_list_): New member.
5785
f96accdf
DK
57862010-02-19 Doug Kwan <dougkwan@google.com>
5787
5788 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5789 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5790 * arm.cc (Arm_relocation_functions): New forward declaration.
5791 (Target_arm::Target_arm): Initialize new data members
5792 got_mod_index_offset_ and tls_base_symbol_defined_.
5793 (Target_arm::Relocate::relocate_tls): New method.
5794 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5795 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5796 New methods.
5797 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5798 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5799 (Target_arm::got_mod_index_offset_,
5800 Target_arm::tls_base_symbol_defined_): New data members.
5801 (Target_arm::Scan::local, Target::Scan::global,
5802 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5803 relocations.
5804
c8761b9a
DK
58052010-02-18 Doug Kwan <dougkwan@google.com>
5806
5807 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5808 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5809 text section as a parameter becuase some broken tools may not set
5810 the link in section header.
5811 (Target_arm::has_got_section): New method.
5812 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5813 without any mapping symbol as data only. Remove warning.
5814 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5815 link in its section header, try to discover the link by inspecting the
5816 REL31 relocation at the beginning of the section.
5817 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5818 in error message.
5819 (Target_arm::Scan::global): Treat any reference to the symbol
5820 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5821
21bb3914
ST
58222010-02-12 Sriraman Tallam <tmsriram@google.com>
5823
5824 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5825 (Scan::global_reloc_may_be_function_pointer): New function.
5826 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5827 (Scan::global_reloc_may_be_function_pointer): New function.
5828 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5829 (Scan::global_reloc_may_be_function_pointer): New function.
5830 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5831 (Scan::global_reloc_may_be_function_pointer): New function.
5832 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5833 (Scan::global_reloc_may_be_function_pointer): New function.
5834 (Scan::possible_function_pointer_reloc): New function.
5835 (Target_x86_64::can_check_for_function_pointers): New function.
5836 * gc.h (gc_process_relocs): Scan relocation types to determine if
5837 function pointers were taken for targets that support it.
5838 * icf.cc (Icf::find_identical_sections): Include functions for
5839 folding in safe ICF whose pointer is not taken.
5840 * icf.h (Secn_fptr_taken_set): New typedef.
5841 (fptr_section_id_): New member.
5842 (section_has_function_pointers): New function.
5843 (set_section_has_function_pointers): New function.
5844 (check_section_for_function_pointers): New function.
5845 * options.h: Fix comment for safe ICF option.
5846 * target.h (can_check_for_function_pointers): New function.
5847 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5848 Modify icf_safe_test for X86-64.
5849 * testsuite/Makefile.in: Regenerate.
5850 * testsuite/icf_safe_so_test.cc: New file.
5851 * testsuite/icf_safe_so_test.sh: New file.
5852 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5853 (main): Change to take pointer to function kept_func_3.
5854 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5855 folding is done correctly for X86-64.
5856
0da6fa6c
DM
58572010-02-12 David S. Miller <davem@davemloft.net>
5858
5859 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5860 is_symbolless parameter.
5861 (Output_reloc<SHT_REL>::is_symbolless): New.
5862 (Output_reloc<SHT_REL>::is_symbolless_): New.
5863 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5864 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5865 (Output_reloc<SHT_RELA>::is_symbolless): New.
5866 (Output_data_reloc::add_global): Handle is_symbolless.
5867 (Output_data_reloc::add_global_relative): Likewise.
5868 (Output_data_reloc::add_local): Likewise.
5869 (Output_data_reloc::add_local_relative): Likewise.
5870 (Output_data_reloc::add_symbolless_global_addend): New.
5871 (Output_data_reloc::add_symbolless_local_addend): New.
5872 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5873 is_symbolless.
5874 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5875 instead of ->is_relative_
5876 (Output_reloc::write): Likewise.
5877 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5878 (Output_reloc::write_rel): Simplify.
5879
5880 * sparc.cc (Target_sparc::Scan::local): Use
5881 ->add_symbolless_local_addend as needed.
5882 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5883 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5884 based upon relocation offset.
5885
e4782e83
DK
58862010-02-11 Doug Kwan <dougkwan@google.com>
5887
5888 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5889 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5890 beginning of function.
5891 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5892 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5893 parameter is_32bit in calls to should_apply_static_reloc.
5894 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5895 (check_DATA): Add arm_abs_global.stdout.
5896 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5897 arm_abs_global.stdout): New rules.
5898 (MOSTLLYCLEANFILES): Add arm_abs_global
5899 * Makefile.in: Regenerate.
5900 * testsuite/arm_abs_global.s: New file.
5901 * testsuite/arm_abs_global.sh: Ditto.
5902 * testsuite/arm_abs_lib.s: Ditto.
5903
93ceb764
ILT
59042010-02-11 Ian Lance Taylor <iant@google.com>
5905
5906 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5907 Read_relocs task.
5908 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5909 Allocate_commons_task first.
5910 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5911 task, rather than symtab_lock_.
5912 (Gc_process_relocs::~Gc_process_relocs): New function.
5913 (Gc_process_relocs::is_runnable): Check this_blocker_.
5914 (Gc_process_relocs::locks): Use next_blocker_ rather than
5915 blocker_.
5916 (Scan_relocs::~Scan_relocs): New function.
5917 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5918 symtab_lock_.
5919 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5920 next_blocker_.
5921 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5922 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5923 constructor accordingly.
5924 (class Gc_process_relocs): Likewise.
5925 (class Scan_relocs): Likewise.
5926 * common.h (class Allocate_commons_task): Remove symtab_lock_
5927 field, and corresponding constructor parameter.
5928 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5929 symtab_lock_.
5930 (Allocate_commons_task::locks): Likewise.
5931
114dfbe1
ILT
59322010-02-11 Ian Lance Taylor <iant@google.com>
5933
5934 * gold-threads.h (class Once): Define.
5935 (class Initialize_lock): Rewrite as child of Once.
5936 * gold-threads.cc (class Once_initialize): Define.
5937 (once_pointer_control): New static variable.
5938 (once_pointer, once_arg): New static variables.
5939 (c_run_once): New static function.
5940 (Once::Once, Once::run_once, Once::internal_run): New functions.
5941 (class Initialize_lock_once): Remove.
5942 (initialize_lock_control): Remove.
5943 (initialize_lock_pointer): Remove.
5944 (initialize_lock_once): Remove.
5945 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5946 (Initialize_lock::initialize): Rewrite.
5947 (Initialize_lock::do_run_once): New function.
5948 * archive.cc (Archive::interpret_header): Only clear name if it is
5949 not already empty.
5950 * fileread.cc: Include "gold-threads.h"
5951 (file_counts_lock): New static variable.
5952 (file_counts_initialize_lock): Likewise.
5953 (File_read::release): Only increment counts when using --stats.
5954 Use a lock around the increment.
5955 * parameters.cc (class Set_parameters_target_once): Define.
5956 (set_parameters_target_once): New static variable.
5957 (Parameters::Parameters): Move here from parameters.h.
5958 (Parameters::set_target): Rewrite.
5959 (Parameters::set_target_once): New function.
5960 (Parameters::clear_target): Move here and rewrite.
5961 * parameters.h (class Parameters): Update declarations. Add
5962 set_parameters_target_once_ field.
5963 (Parameters::Parameters): Move to parameters.cc.
5964 (Parameters::clear_target): Likewise.
5965 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5966 task.
5967 (Start_group::~Start_group): New function.
5968 (Start_group::is_runnable): New function.
5969 (Start_group::locks, Start_group::run): New functions.
5970 (Finish_group::run): Change saw_undefined to size_t.
5971 * readsyms.h (class Start_group): Define.
5972 (class Finish_group): Change saw_undefined_ field to size_t.
5973 (Finish_group::Finish_group): Remove saw_undefined and
5974 this_blocker parameters. Change all callers.
5975 (Finish_group::set_saw_undefined): New function.
5976 (Finish_group::set_blocker): New function.
5977 * symtab.h (class Symbol_table): Change saw_undefined to return
5978 size_t. Change saw_undefined_ field to size_t.
5979 * target-select.cc (Set_target_once::do_run_once): New function.
5980 (Target_selector::Target_selector): Initialize set_target_once_
5981 field. Don't initialize lock_ and initialize_lock_ fields.
5982 (Target_selector::instantiate_target): Rewrite.
5983 (Target_selector::set_target): New function.
5984 * target-select.h (class Set_target_once): Define.
5985 (class Target_selector): Update declarations. Make
5986 Set_target_once a friend. Remove lock_ and initialize_lock_
5987 fields. Add set_target_once_ field.
5988
fa17a3f4
ILT
59892010-02-10 Ian Lance Taylor <iant@google.com>
5990
5991 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5992 queueing any tasks.
5993 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5994 (queue_middle_tasks): Add all blockers before queueing any tasks.
5995 (queue_final_tasks): Likewise.
5996 * token.h (Task_token::add_blockers): New function.
5997 * object.h (Input_objects::number_of_relobjs): New function.
5998
c7177d31
ILT
59992010-02-10 Ian Lance Taylor <iant@google.com>
6000
5de0e392
ILT
6001 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6002 shared, not if not position independent.
6003 * x86_64.cc (Relocate::relocate_tls): Likewise.
6004 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6005 (tls_pie_pic_test): New target.
6006 * testsuite/Makefile.in: Rebuild.
6007
c7177d31
ILT
6008 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6009 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6010 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6011 * testsuite/Makefile.in: Rebuild.
6012
684b268a
DM
60132010-02-09 David S. Miller <davem@davemloft.net>
6014
6015 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6016 R_SPARC_RELATIVE using ->add_local_relative().
6017 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6018
612a8d3d
DM
6019 * output.h (Output_data_dynamic::add_section_size): New method
6020 that takes two Output_data objects.
6021 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6022 entry param. Handle it in initializers.
6023 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6024 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6025 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6026 arg.
6027 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6028 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6029 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6030 for dynrel_includes_plt.
6031 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6032 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6033 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6034 before .rela.plt
6035 (Target_sparc::do_finalize_sections): Update to pass true for
6036 dynrel_includes_plt.
6037 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6038 output before .rela.plt
6039 (Target_powerpc::do_finalize_sections): Update to pass true for
6040 dynrel_includes_plt when 32-bit.
6041
cb1be87e
DK
60422010-02-08 Doug Kwan <dougkwan@google.com>
6043
6044 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6045 method.
6046 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6047 Arm_relobj::scan_section_for_cortex_a8_stubs,
6048 Arm_relobj::do_relocation_section): Instead of calling
6049 Output_section::output_address, use faster
6050 Arm_relobj::simple_input_section_output_address.
6051
705b5121
DM
60522010-02-08 David S. Miller <davem@davemloft.net>
6053
6054 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6055 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6056 relocation helper function.
6057
024c4466
DM
6058 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6059 just like R_SPARC_GOT{10,13,22}.
6060 (Target_sparc::Scan::local): Likewise.
6061 (Target_sparc::Relocate:relocate): Likewise.
6062
9109c078
ILT
60632010-02-06 Ian Lance Taylor <iant@google.com>
6064
6065 * configure.ac: Rewrite targetobjs duplicate removal code to use
6066 only shell constructs.
6067 * configure: Rebuild.
6068
cf846138
DK
60692010-02-05 Doug Kwan <dougkwan@google.com>
6070
6071 PR 11247
6072 * arm.cc (Arm_relobj::section_is_scannable): New method.
6073 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6074 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6075
6cfaf60b
DK
60762010-02-04 Doug Kwan <dougkwan@google.com>
6077
6078 PR 11247
6079 * arm-reloc-property.cc (cstdio): Include.
6080 * configure.ac (targetobjs): Remove duplicates.
6081 * configure: Regenerate.
6082 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6083 big and little endian version for a given address size.
6084
5c57f1be
DK
60852010-02-03 Doug Kwan <dougkwan@google.com>
6086
6087 * arm-reloc-property.cc
6088 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6089 definition.
6090 * arm-reloc-property.h
6091 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6092 New method definition.
6093 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6094 declaration.
6095 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6096 overflow to N.
6097 (GOT_PREL): Change implemented to Y.
6098 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6099 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6100 (Arm_relocate_functions::movw_abs_nc): Remove method.
6101 (Arm_relocate_functions::movt_abs): Ditto.
6102 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6103 (Arm_relocate_functions::thm_movt_abs): Ditto.
6104 (Arm_relocate_functions::movw_rel_nc): Ditto.
6105 (Arm_relocate_functions::movw_rel): Ditto.
6106 (Arm_relocate_functions::movt_rel): Ditto.
6107 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6108 (Arm_relocate_functions:thm_movw_rel): Ditto.
6109 (Arm_relocate_functions:thm_movt_rel): Ditto.
6110 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6111 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6112 New method definitions.
6113 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6114 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6115 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6116 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6117 (Target_arm::Relocate::relocate): Check for non-static or
6118 unimplemented relocation code and exit early. Change calls to
6119 Target_arm::reloc_uses_thumb_bit and
6120 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6121 instead. Refactor code to handle similar relocations to increase
6122 code sharing. Remove check for unsupported relocation code in switch
6123 statement.
6124 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6125 relocation property table to find out size. Change error message to
6126 print out the name of a relocation code instead of the numeric value.
6127 (Target_arm::scan_reloc_for_stub): Use relocation property table
6128 instead of calling Target_arm::reloc_uses_thumb_bit().
6129
218c5831
DK
61302010-02-02 Doug Kwan <dougkwan@google.com>
6131
6132 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6133 types of relaxed input section.
6134
0d31c79d
DK
61352010-02-02 Doug Kwan <dougkwan@google.com>
6136
6137 * Makefile.am (HFILES): Add arm-reloc-property.h.
6138 (DEFFILES): New.
6139 (TARGETSOURCES): Add arm-reloc-property.cc
6140 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6141 (libgold_a_SOURCES): $(DEFFILES)
6142 * Makefile.in: Regenerate.
6143 * arm-reloc-property.cc: New file.
6144 * arm-reloc-property.h: New file.
6145 * arm-reloc.def: New file.
6146 * arm.cc: Update comments.
6147 (arm-reloc-property.h): New included header.
6148 (arm_reloc_property_table): New global variable.
6149 (Target_arm::do_select_as_default_target): New method definition.
6150 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6151 arm-reloc-property to targ_extra_obj.
6152 * parameters.cc (set_parameters_target): Call
6153 Target::select_as_default_target().
6154 * target.h (Target::select_as_default_target): New method definition.
6155 (Target::do_select_as_default_target): Same.
6156
546c7457
DK
61572010-02-01 Doug Kwan <dougkwan@google.com>
6158
6159 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6160 first_output_text_section_.
6161 (Arm_exidx_fixup::first_output_text_section): New method definition.
6162 (Arm_exidx_fixup::first_output_text_section_): New data member.
6163 (Arm_exidx_fixup::process_exidx_section): Record the first text
6164 output section seen.
6165 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6166 and entsize in output section header.
6167
11b861d5
DK
61682010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6169
6170 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6171 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6172 (Arm_relocate_functions::thm_alu11): New Method.
6173 (Arm_relocate_functions::thm_pc8): New Method.
6174 (Arm_relocate_functions::thm_pc12): New Method.
6175 (Target_arm::Scan::local): Handle the relocations.
6176 (Target_arm::Scan::global): Likewise.
6177 (Target_arm::Relocate::relocate): Likewise.
6178 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6179
c9a2c125
DK
61802010-01-29 Doug Kwan <dougkwan@google.com>
6181
6182 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6183 of relocation types as ld.
6184
1521477a
DK
61852010-01-29 Doug Kwan <dougkwan@google.com>
6186
6187 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6188 to public.
6189 (Arm_relocate_functions::thumb_branch_common): Ditto.
6190 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6191 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6192 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6193 Arm_relocate_functions::jump24): Remove.
6194 (Target_arm::Relocate::relocate): Adjust code to call
6195 Arm_relocation_functions::arm_branch_common and
6196 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6197 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6198
e7eca48c
DK
61992010-01-29 Doug Kwan <dougkwan@google.com>
6200
6201 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6202 output_local_symbol_count_needs_update_.
6203 (Arm_relobj::output_local_symbol_count_needs_update,
6204 Arm_relobj::set_output_local_symbol_count_needs_update,
6205 Arm_relobj::update_output_local_symbol_count): New methods.
6206 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6207 member.
6208 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6209 of pointed function as in a R_ARM_PREL31 relocation.
6210 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6211 for output local symbol count updating.
6212 (Target_arm::do_relax): Update output local symbol counts in objects
6213 if necessary.
6214 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6215
02961d7e
ILT
62162010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6217
6218 * arm.cc: Added support for the ARM relocations:
6219 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6220 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6221 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6222 movw_prel_nc).
6223 (Arm_relocate_functions::movw_rel): New method.
6224 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6225 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6226 thm_movw_prel_nc).
6227 (Arm_relocate_functions::thm_movw_rel): New method.
6228 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6229 thm_movt_prel).
6230 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6231 relocations.
6232 (Target_arm::Scan::global): Likewise.
6233 (Target_arm::Relocate::relocate): Likewise.
6234 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6235 Likewise.
6236
b10d2873
ILT
62372010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6238
6239 * arm.cc: Added support for ARM group relocations.
6240 (Target_arm::reloc_needs_sym_origin): New method.
6241 (Arm_relocate_functions::calc_grp_kn): New method.
6242 (Arm_relocate_functions::calc_grp_residual): New method.
6243 (Arm_relocate_functions::calc_grp_gn): New method.
6244 (Arm_relocate_functions::arm_grp_alu): New Method.
6245 (Arm_relocate_functions::arm_grp_ldr): New Method.
6246 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6247 (Arm_relocate_functions::arm_grp_ldc): New Method.
6248 (Target_arm::Scan::local): Handle the ARM group relocations.
6249 (Target_arm::Scan::global): Likewise.
6250 (Target_arm::Relocate::relocate): Likewise.
6251 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6252 Likewise.
6253
2b328d4e
DK
62542010-01-26 Doug Kwan <dougkwan@google.com>
6255
6256 * arm.cc (set): Include.
6257 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6258 pointer type.
6259 (Arm_output_section::Text_section_list): New type.
6260 (Arm_output_section::append_text_sections_to_list): New method.
6261 (Arm_output_section::fix_exidx_coverage): Ditto.
6262 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6263 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6264 Relobj::set_section_offset() instead of
6265 Sized_relobj::invalidate_section_offset().
6266 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6267 parameter for section headers. Ignore relocation sections for
6268 unallocated sections and EXIDX sections.
6269 (Target_arm::fix_exidx_coverage): New method.
6270 (Target_arm::output_section_address_less_than): New type.
6271 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6272 linked text section instead of the EXIDX section.
6273 (Arm_output_section::create_stub_group): Add an assertion to check
6274 that this is not an EXIDX output section.
6275 (Arm_output_section::append_text_sections_to_list): New method.
6276 (Arm_output_section::fix_exidx_coverage): Ditto.
6277 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6278 Arm_relobj::section_needs_reloc_stub_scanning.
6279 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6280 first pass.
6281 (Target_arm::fix_exidx_coverage): New method.
6282 * object.h (Relobj::set_output_section): New method.
6283 (Sized_relobj::invalidate_section_offset): Remove method.
6284 (Sized_relobj::do_invalidate_section_offset): Remove method.
6285 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6286
c7f3c371
DK
62872010-01-25 Doug Kwan <dougkwan@google.com>
6288
6289 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6290 Fix warning due to signed and unsigned comparison on a 32-bit host.
6291
8923b24c
DK
62922010-01-22 Doug Kwan <dougkwan@google.com>
6293
6294 * arm.cc (Target_arm::do_relax): Record an output section for section
6295 offset adjustment it contains any stub table that has changed.
6296 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6297 offsets in an output section if necessary.
6298 * output.cc (Output_section::Output_section): Initialize
6299 section_offsets_need_adjustments_.
6300 (Output_section::add_input_section_for_script): Renamed to
6301 Output_section::add_simple_input_section.
6302 (Output_section::save_states): Add a comment.
6303 (Output_section::discard_states): New method defintion.
6304 (Output_section::adjust_section_offsets): Same.
6305 * output.h (Output_section::add_input_section_for_script): Renamed to
6306 Output_section::add_simple_input_section.
6307 (Output_section::discard_states): New method declaration.
6308 (Output_section::adjust_section_offsets): Same.
6309 (Output_section::section_offsets_need_adjustment,
6310 Output_section::set_section_offsets_need_adjustment): New method
6311 definitions.
6312 (Output_section::section_offsets_need_adjustment_): New data member.
6313 * script-sections.cc
6314 (Output_section_element_input::set_section_address): Adjust code for
6315 renaming of Output_section::add_input_section_for_script.
6316 (Orphan_output_section::set_section_address): Same.
6317
9b2fd367
DK
63182010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6319
6320 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6321 Fix_v4bx enum values .
6322 * gold/options.h (General_options): New option definitions.
6323 (General_options::fix_v4bx): New method.
6324 (General_options::Fix_v4bx): New enum.
6325 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6326 (General_options::parse_fix_v4bx_interworking): New method.
6327
80d0d023
DK
63282010-01-22 Doug Kwan <dougkwan@google.com>
6329
6330 * arm.cc (Arm_exidx_fixup): New class.
6331
af2cdeae
DK
63322010-01-21 Doug Kwan <dougkwan@google.com>
6333
6334 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6335 classes.
6336 (Arm_exidx_section_offset_map): New type.
6337
993d07c1
DK
63382010-01-21 Doug Kwan <dougkwan@google.com>
6339
6340 * arm.cc (Arm_exidx_input_section): New class.
6341 (Arm_relobj::exidx_input_section_by_link,
6342 Arm_relobj::exidx_input_section_by_shndx,
6343 Arm_relobj::make_exidx_input_section): New methods.
6344 (read_arm_attributes_section): Remove.
6345 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6346 information about them.
6347 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6348 to here.
6349
5ac169d4
DK
63502010-01-20 Doug Kwan <dougkwan@google.com>
6351
6352 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6353 Input_section_specifier to Section_id.
6354 (Target_arm::new_arm_input_section: Adjust code for change of key
6355 type.
6356 (Target_arm::find_arm_input_section): Ditto.
6357 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6358 (Section_id): Remove.
6359 (Garbage_collection::Section_id_hash): Remove.
6360 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6361 (Section_id): Remove.
6362 (Icf::Section_id_hash): Remove.
6363 * object.h (Section_id, Const_section_id, Section_id_hash,
6364 Const_section_id_hash): New type definitions.
6365 * output.cc (Output_section::add_relaxed_input_section): Change to
6366 use Const_section_id instead of Input_section_specifier as key type.
6367 (Output_section::add_merge_input_section): Ditto.
6368 (Output_section::build_relaxation_map): Change to use Section_id
6369 instead of Input_section_specifier as key type.
6370 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6371 Ditto.
6372 (Output_section::convert_input_sections_to_relaxed_sections): Change
6373 to use Const_section_id instead of Input_section_specifier as key type.
6374 (Output_section::find_merge_section): Ditto.
6375 (Output_section::find_relaxed_input_section): Ditto.
6376 * output.h (Input_section_specifier): Remove class.
6377 (Output_section::Output_section_data_by_input_section_map): Change
6378 key type to Const_section_id.
6379 (Output_section::Output_relaxed_input_section_by_input_section_map):
6380 Ditto.
6381 (Output_section::Relaxation_map): Change key type to Section_id.
6382
a2162063
ILT
63832010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6384
6385 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6386 (class Arm_v4bx_stub): New class.
6387 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6388 (Stub_factory::make_arm_v4bx_stub): New method.
6389 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6390 (Stub_table::empty): Handle v4bx stubs.
6391 (Stub_table::add_arm_v4bx_stub): New method.
6392 (Stub_table::find_arm_v4bx_stub): New method.
6393 (Arm_relocate_functions::v4bx): New method.
6394 (Target_arm::fix_v4bx): New method.
6395 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6396 (Stub_table::relocate_stubs): Likewise.
6397 (Stub_table::do_write): Likewise.
6398 (Stub_table::update_data_size_and_addralign): Likewise.
6399 (Stub_table::finalize_stubs): Likewise.
6400 (Target_arm::Scan::local): Likewise.
6401 (Target_arm::Scan::global): Likewise.
6402 (Target_arm::do_finalize_sections): Likewise.
6403 (Target_arm::Relocate::relocate): Likewise.
6404 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6405 Likewise.
6406 (Target_arm::scan_reloc_for_stub): Likewise.
6407 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6408
5696ab0b
ILT
64092010-01-19 Ian Lance Taylor <iant@google.com>
6410
6411 * output.cc (Output_section_headers::do_sized_write): Write large
6412 segment count to sh_info field.
6413 (Output_file_header::do_sized_write): For large segment count,
6414 write PN_XNUM to e_phnum field.
6415
800d0f56
ILT
64162010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6417
6418 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6419 (Arm_relocate_functions::thm_jump8): New function.
6420 (Arm_relocate_functions::thm_jump11): New function.
6421 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6422 R_ARM_THM_JUMP11.
6423 (Target_arm::Scan::global): Likewise.
6424 (Target_arm::Relocate::relocate): Likewise.
6425 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6426 Likewise.
6427
41263c05
DK
64282010-01-14 Doug Kwan <dougkwan@google.com>
6429
6430 * arm.cc (map, utility): Include headers.
6431 (Target_arm::apply_cortex_a8_workaround): New method.
6432 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6433 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6434 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6435 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6436 the --[no-]fix-cortex-a8 command line options.
6437 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6438 (Target_arm::relocate_stub): Use addend in instruction template.
6439 * options.h (DEFINE_bool): Set the user-set flag.
6440 (General_options): Add --[no-]-fix-cortex options.
6441 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6442 : Update fast look-up map after conversion.
41263c05 6443
459e9b03
ST
64442010-01-14 Sriraman Tallam <tmsriram@google.com>
6445
6446 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6447 in the first pass of do_layout.
6448
b521dfe4
DK
64492010-01-13 Doug Kwan <dougkwan@google.com>
6450
6451 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6452 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6453 apparent compiler problem of not folding static constant integral
6454 data members of elfcpp::Elf_sizes<32>.
6455
44272192
DK
64562010-01-13 Doug Kwan <dougkwan@google.com>
6457
6458 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6459 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6460 Arm_relobj::scan_section_for_cortex_a8_erratum,
6461 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6462 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6463 sections to scan for relocation stubs into a new method
6464 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6465 relocation and Cortex-A8 stub scanning.
6466 (Target_arm::do_relax): Force stubs to be after stubbed sections
6467 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6468 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6469 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6470
44b71ece
ILT
64712010-01-12 Ian Lance Taylor <iant@google.com>
6472
6473 * target-reloc.h (visibility_error): New inline function.
6474 (relocate_section): Call visibility_error.
6475 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6476 (MOSTLYCLEANFILES): Likewise.
6477 (protected_4_pic.o, protected_3.err): New targets.
6478 * testsuite/protected_4.cc: New file.
6479
a120bc7f
DK
64802010-01-12 Doug Kwan <dougkwan@google.com>
6481
6482 * arm.cc (Cortex_a8_reloc): New class.
6483 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6484 and cortex_a8_relocs_info_.
6485 (Target_arm::fix_cortex_a8): New method definition.
6486 (Target_arm::Cortex_a8_relocs_info): New type.
6487 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6488 New data member declarations.
6489 (Target_arm::scan_reloc_for_stub): Record information about
6490 relocations for THUMB branches that might be exempted from the
6491 Cortex-A8 workaround.
6492 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6493 at the beginning of a relaxation pass.
6494
20138696
DK
64952010-01-12 Doug Kwan <dougkwan@google.com>
6496
6497 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6498 (Arm_relobj::Mapping_symbol_position,
6499 Arm_reloj::Mapping_symbol_position_less,
6500 Arm_relobj::Mapping_symbols_info): New types.
6501 (Target_arm::is_mapping_symbol_name): New method definition.
6502 (Arm_relobj::do_count_local_symbols): Save information about mapping
6503 symbols.
6504
089d69dc
DK
65052010-01-11 Doug Kwan <dougkwan@google.com>
6506
6507 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6508 Arm_relocate_functions::thumb32_branch_upper,
6509 Arm_relocate_functions::thumb32_branch_lower,
6510 Arm_relocate_functions::thumb32_cond_branch_offset,
6511 Arm_relocate_functions::thumb32_cond_branch_upper,
6512 Arm_relocate_functions::thumb32_cond_branch_lower,
6513 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6514 branch offset encoding.
6515 (Arm_relocate_functions::thumb_branch_common): Use new branch
6516 offset encoding methods to avoid code duplication.
6517 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6518 (Stub_addend_reader::operator()): Use new branch encoding method
6519 to avoid code duplication.
6520
99e5bff2
DK
65212010-01-11 Doug Kwan <dougkwan@google.com>
6522
6523 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6524 (Target_arm::do_finalize_sections): Define special EXIDX section
6525 symbols only if referenced.
6526 * gc.h (Garbage_collection::add_reference): New method.
6527 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6528 code duplication.
6529
98e090bd
ILT
65302010-01-11 Ian Lance Taylor <iant@google.com>
6531
d0a91bd8
ILT
6532 * script.cc (Version_script_info::build_expression_list_lookup):
6533 Change complaing about duplicate wildcard match from error to
6534 warning.
6535
98e090bd
ILT
6536 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6537 of 2009-12-30.
6538 (Version_script_info::Version_script_info): Initialize globs_,
6539 default_version_, default_is_global_, and exact_. Don't
6540 initialize globals_ or locals_.
6541 (Version_script_info::build_lookup_tables): Build local symbols
6542 first.
6543 (Version_script_info::unquote): New function.
6544 (Version_script_info::add_exact_match): New function.
6545 (Version_script_info::build_expression_list_lookup): Remove lookup
6546 parameter. Add is_global parameter. Change all callers. Handle
6547 wildcard pattern specially. Unquote pattern. Call
6548 add_exact_match.
6549 (Version_script_info::get_name_to_match): New function.
6550 (Version_script_info::get_symbol_version): New function.
6551 (Version_script_info::get_symbol_version_helper): Remove.
6552 (Version_script_info::check_unmatched_names): Call unquote.
6553 * script.h (class Version_script_info): Change get_symbol_version
6554 to be non-inline and add is_global parameter; change all callers.
6555 Rewrite symbol_is_local. Update declarations. Define struct
6556 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6557 Remove globals_ and locals_ members. Add exact_, globs_,
6558 default_version_, is_global_.
6559 (Version_script_info::Glob): Remove pattern, add expression and
6560 is_global. Update constructor. Change all callers.
6561 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6562 default version.
6563 (Versions::symbol_section_contents): If a symbol is undefined, or
6564 defined in a dynamic object, set the version index to
6565 VER_NDX_LOCAL.
6566 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6567 symbol_is_local.
6568 (Symbol_table::add_from_pluginobj): Likewise.
6569 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6570
d56962d3
DK
65712010-01-11 Doug Kwan <dougkwan@google.com>
6572
6573 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6574 (incremental_dump_LDADD): Add linking option for libintl.
6575 * Makefile.in: Regenerate.
6576
94e6ee91
L
65772010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6578
6579 PR gold/11144
6580 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6581 instead of -Ds.
6582 * testsuite/Makefile.in: Regenerated.
6583
e96c574b
DK
65842010-01-10 Doug Kwan <dougkwan@google.com>
6585
6586 * options.h (DEFINE_var): Use parentheses around argument varname__
6587 in macro body to avoid any unintended subsequent substitutions.
6588
7198066b
ILT
65892010-01-10 Ian Lance Taylor <iant@google.com>
6590
ba4d53bf
ILT
6591 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6592 candidates before doing symbol resolution.
6593
7198066b
ILT
6594 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6595 ODR candidates if only one is weak.
6596
a2beed37
ILT
65972010-01-08 Ian Lance Taylor <iant@google.com>
6598
6599 * script.cc (Version_script_info::build_expression_list_lookup):
6600 Don't warn about ambiguous version, just record the ambiguity.
6601 (Version_script_info::get_symbol_version_helper): Give error if
6602 version is ambiguous.
6603
2fb7225c
DK
66042010-01-08 Doug Kwan <dougkwan@google.com>
6605
6606 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6607 prev_data_size_ and prev_addralign_. Remove initializer for
6608 deleted data member has_been_changed_.
6609 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6610 to determine if the table is empty.
6611 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6612 Remove.
6613 (Stub_table::add_reloc_stub): Define method in class definition
6614 instead of just declaring it there.
6615 (Stub_table::add_cortex_a8_stub): New method definition.
6616 (Stub_table::update_data_size_and_addralign): Ditto.
6617 (Stub_table::finalize_stubs): Ditto.
6618 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6619 (Stub_table::do_addralign_): Return address alignment in the
6620 (Stub_table::do_reset_address_and_file_offset): Define method in
6621 class definition instead of declaring it there. Set current data
6622 size to be the data size of the previous pass.
6623 (Stub_table::set_final_data_size): Use current data size as the
6624 final data size.
6625 (Stub_table::relocate_stub): Change parameter type of stub from
6626 Reloc_stub pointer to Stub pointer.
6627 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6628 (Stub_table::Cortex_a8_stub_list): New typedef.
6629 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6630 Stub_table::prev_addralign_): New data member.
6631 (Arm_relobj::Arm_relobj): Initialize data member
6632 section_has_cortex_a8_workaround_.
6633 (Arm_relobj::section_has_cortex_a8_workaround,
6634 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6635 definitions.
6636 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6637 declarations.
6638 (Target_arm::relocate_stub): Change parameter type of stub from
6639 Reloc_stub pointer to Stub pointer.
6640 (Insn_template::size, Insn_template::alignment): Handle
6641 THUMB16_SPECIAL_TYPE.
6642 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6643 Stub_table::update_data_size_and_addralign,
6644 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6645 definitions.
6646 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6647 (Stub_table::do_write): Ditto.
6648 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6649
880cd20d
ILT
66502010-01-08 Ian Lance Taylor <iant@google.com>
6651
6652 PR 11108
6653 * symtab.h (class Symbol): Remove fields is_target_special_ and
6654 has_plt_offset_. Add field is_defined_in_discarded_section_.
6655 (Symbol::is_defined_in_discarded_section): New function.
6656 (Symbol::set_is_defined_in_discarded_section): New function.
6657 (Symbol::has_plt_offset): Rewrite.
6658 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6659 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6660 Don't initialize is_target_special_ or has_plt_offset_.
6661 Initialize is_defined_in_discarded_section_.
6662 (Symbol_table::add_from_relobj): If appropriate, set
6663 is_defined_in_discarded_section.
6664 * resolve.cc (Symbol::override_base_with_special): Don't test
6665 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6666 * target-reloc.h (relocate_section): Do special handling for
6667 symbols defined in discarded sections for global symbols as well
6668 as local symbols.
6669
2703e3eb
ILT
66702010-01-08 Ian Lance Taylor <iant@google.com>
6671
6672 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6673 the SHT_SYMTAB case.
6674
339d40a3
ILT
66752010-01-08 Ian Lance Taylor <iant@google.com>
6676
6677 * object.cc (Sized_relobj::do_layout): Don't get confused if
6678 layout_eh_frame returns NULL.
6679
abecea76
ILT
66802010-01-08 Ian Lance Taylor <iant@google.com>
6681
6682 PR 11084
6683 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6684 dynamic symbol table, use the normal symbol table.
6685 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6686 symbol table.
6687
6b7dd3f3
ILT
66882010-01-08 Ian Lance Taylor <iant@google.com>
6689
6690 PR 11072
6691 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6692 sections.
6693
36c50e63
L
66942010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6695
6696 * version.cc (print_version): Change to "Copyright 2010".
6697
e291e7b9
ILT
66982010-01-08 Ian Lance Taylor <iant@google.com>
6699
6700 PR 10287
6701 PR 11063
6702 * i386.cc (class Target_i386): Change return type of plt_section
6703 to be non-const.
6704 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6705 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6706 tls_desc_rel_ field.
6707 (Output_data_plt_i386::rel_tls_desc): New function.
6708 (Target_i386::rel_tls_desc_section): New function.
6709 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6710 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6711 R_386_TLS_DESC reloc in rel_tls_desc_section.
6712 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6713 Define struct Tlsdesc_info.
6714 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6715 (Target_x86_64::do_reloc_symbol_index): New function.
6716 (Target_x86_64::add_tlsdesc_info): New function.
6717 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6718 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6719 tlsdesc_rel_ field.
6720 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6721 all callers.
6722 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6723 (Target_x86_64::rela_tlsdesc_section): New function.
6724 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6725 handling.
6726 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6727 (Target_x86_64::do_reloc_addend): New function.
6728 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6729 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6730 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6731 (Output_reloc::type): New function.
6732 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6733 (Output_reloc::is_target_specific): New function.
6734 (Output_reloc::target_arg): New function.
6735 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6736 absolute relocs and target specific relocs.
6737 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6738 add_target_specific.
6739 (class Output_data_reloc) [SHT_RELA]: Likewise.
6740 * output.cc (Output_reloc::Output_reloc): Add four new versions
6741 for absolute relocs and target specific relocs.
6742 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6743 (Output_reloc::get_symbol_index): Likewise.
6744 (Output_reloc::local_section_offset): Check that local_sym_index_
6745 is not TARGET_CODE or 0.
6746 (Output_reloc::symbol_value): Likewise.
6747 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6748 reloc.
6749 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6750 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6751 functions.
6752 * layout.cc (add_target_dynamic_tags): Use output section for
6753 DT_PLTRELSZ and DT_JMPREL.
6754
3a44184e
ILT
67552010-01-07 Ian Lance Taylor <iant@google.com>
6756
6757 PR 11061
6758 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6759 function.
6760 (class Output_data_reloc_generic): Define.
6761 (class Output_data_reloc_base): Change base class to
6762 Output_data_reloc_generic. Change add() method to call
6763 bump_relative_reloc_count for a relative reloc. Remove
6764 sort_relocs_ field.
6765 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6766 to sort_relocs().
6767 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6768 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6769 appropriate.
6770 * layout.h (class Layout): Update declaration.
6771
ea715a34
ILT
67722010-01-07 Ian Lance Taylor <iant@google.com>
6773
6774 * output.h (class Output_data): Add const version of
6775 output_section and do_output_section.
6776 (class Output_section_data): Add const version of
6777 do_output_section.
6778 (class Output_section): Likewise.
6779 * layout.cc (Layout::add_target_dynamic_tags): New function.
6780 * layout.h (class Layout): Update declarations.
6781 * arm.cc (Target_arm::do_finalize_sections): Use
6782 add_target_dynamic_tags.
6783 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6784 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6785 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6786 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6787
659948a4
ILT
67882010-01-07 Ian Lance Taylor <iant@google.com>
6789
6790 PR 11042
6791 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6792 object as needed.
6793
9d3b86f6
ILT
67942010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6795 Ian Lance Taylor <iant@google.com>
6796
6797 PR 11019
6798 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6799 Xindex::read_symtab_xindex.
6800
bb0d3eb0
DK
68012010-01-07 Doug Kwan <dougkwan@google.com>
6802
6803 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6804 (Insn_template::thumb16_bcond_insn): New method declaration.
6805 (Insn_template): Fix spelling.
6806 (Stub::thumb16_special): New method declaration.
6807 (Stub::do_write): Define virtual method which was previously pure
6808 virtual.
6809 (Stub::do_thumb16_special): New method declaration.
6810 (Stub::do_fixed_endian_write): New template member.
6811 (Reloc_stub::do_write): Remove.
6812 (Reloc_stub::do_fixed_endian_write): Remove.
6813 (Cortex_a8_stub): New class definition.
6814 (Stub_factory::make_cortex_a8_stub): New method definition.
6815 (Stub_factory::Stub_factory): Add missing static storage class
6816 qualifier for elf32_arm_stub_a8_veneer_blx.
6817
ffeef7df
ILT
68182010-01-07 Ian Lance Taylor <iant@google.com>
6819
dc3f80fe
ILT
6820 PR 10980
6821 * options.h (class General_options): Add --warn-unresolved-symbols
6822 and --error-unresolved-symbols.
6823 * errors.cc (Errors::undefined_symbol): Implement
6824 --warn-unresolved-symbols.
6825
ffeef7df
ILT
6826 * options.h (class General_options): Add -z text and -z textoff.
6827 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6828
f1ec9ded
ST
68292010-01-06 Sriraman Tallam <tmsriram@google.com>
6830
6831 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6832 (Garbage_collection::cident_sections): New function.
6833 (Garbage_collection::add_cident_section): New function.
6834 (Garbage_collection::cident_sections_): New member.
6835 (gc_process_relocs): Add references to sections whose names are C
6836 identifiers.
6837 * gold.h (cident_section_start_prefix): New constant.
6838 (cident_section_stop_prefix): New constant.
6839 (is_cident): New function.
6840 * layout.cc (Layout::define_section_symbols): Replace string constants
6841 with the newly defined constants.
6842 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6843 C identifiers.
6844 * testsuite/Makefile.am: Add gc_orphan_section_test.
6845 * testsuite/Makefile.in: Regenerate.
6846 * testsuite/gc_orphan_section_test.cc: New file.
6847 * testsuite/gc_orphan_section_test.sh: New file.
6848
6eda8c29
ILT
68492010-01-06 Ian Lance Taylor <iant@google.com>
6850
b9674e17
ILT
6851 PR 10980
6852 * options.h (class General_options): Add --warn-shared-textrel.
6853 * layout.cc (Layout::finish_dynamic_section): Implement
6854 --warn-shared-textrel.
6855
6eda8c29
ILT
6856 PR 10980
6857 * options.h (class General_options): Add --warn-multiple-gp.
6858
32dcd44e
ILT
68592010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6860
6861 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6862 $(THREADSLIB) and $(LIBDL).
6863 * Makefile.in: Rebuild.
6864
a192ba05
ILT
68652010-01-06 Ian Lance Taylor <iant@google.com>
6866
6867 PR 10980
6868 * options.cc (General_options::parse_section_start): New function.
6869 (General_options::section_start): New function.
6870 (General_options::General_options): Initialize all members.
6871 * options.h: Include <map>
6872 (class General_options): Add --section-start. Add section_starts_
6873 member.
6874 * layout.cc (Layout::attach_allocated_section_to_segment): If
6875 --section-start was used, set the address of the segment. Remove
6876 local sort_sections.
6877 (Layout::relaxation_loop_body): If the address of the load segment
6878 has been set by --section-start, don't use it.
6879 * output.h (Output_segment::update_flags_for_output_section): New
6880 function.
6881 * output.cc (Output_segment::add_output_section): Call
6882 update_flags_for_output_section.
6883
dde3f402
ILT
68842010-01-05 Ian Lance Taylor <iant@google.com>
6885
62dfdd4d
ILT
6886 PR 10980
6887 * options.h (class General_options): Add --undefined-version.
6888 * script.cc (struct Version_expression): Add was_matched_by_symbol
6889 field.
6890 (Version_script_info::matched_symbol): New function.
6891 (Version_script_info::get_symbol_version_helper): Call
6892 matched_symbol.
6893 (Version_script_info::check_unmatched_names): New function.
6894 * script.h (class Version_script_info): Update declarations.
6895 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6896
9c4ae156
ILT
6897 * options.h (class General_options): Use DEFINE_bool_alias for
6898 allow_multiple_definition.
6899 * resolve.cc (Symbol_table::should_override): Don't test
6900 allow_multiple_definition.
6901
dde3f402
ILT
6902 PR 10980
6903 * options.h (class General_options): Add --cref.
6904 * main.cc (main): Print cref table if --cref. Don't close mapfile
6905 until after printing cref table.
6906 * cref.cc: Include "symtab.h".
6907 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6908 (Cref_table_compare::operator()): New function.
6909 (Cref_inputs::gather_cref): New function.
6910 (filecol): New static const.
6911 (Cref_inputs::print_cref): New function.
6912 (Cref::print_cref): New function.
6913 * cref.h: Include <cstdio>.
6914 (class Cref): Update declarations.
6915 * mapfile.h (Mapfile::file): New function.
6916 * object.h (class Object): Define Symbols. Declare virtual
6917 do_get_global_symbols.
6918 (Object::get_global_symbols): New function.
6919 * object.cc (Input_objects::add_object): Pass object to cref_ if
6920 --cref.
6921 (Input_objects::archive_start): Likewise.
6922 (Input_objects::archive_stop): Likewise.
6923 (Input_objects::print_cref): New function.
6924 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6925 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6926 --cref.
6927 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6928 function.
6929 * plugin.h (class Sized_pluginobj): Update declarations.
6930
8781f709
ILT
69312010-01-05 Ian Lance Taylor <iant@google.com>
6932
6933 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6934 to is_default_version. Rename insdef to insdefault.
6935 (Symbol_table::add_from_relobj): Rename def to is_default_version
6936 and local to is_forced_local.
6937 (Symbol_table::add_from_pluginobj): Likewise.
6938 (Symbol_table::add_from_dynobj): Likewise.
6939 (Symbol_table::define_special_symbol): Rename insdef to
6940 insdefault.
6941
fe35d28d
ILT
69422010-01-04 Ian Lance Taylor <iant@google.com>
6943
30bc8c46
ILT
6944 PR 10980
6945 * options.h (class General_options): Add
6946 --allow-multiple-definition and -z muldefs.
6947 * resolve.cc (Symbol_table::should_override): Don't warn about a
6948 multiple symbol definition if --allow-multiple-definition or -z
6949 muldefs.
6950
7eaea549
ILT
6951 PR 10980
6952 * options.h (class General_options): Add --add-needed and
6953 --copy-dt-needed-entries. Tweak --as-needed help entry.
6954 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6955 error if --copy-dt-needed-entries aka --add-needed is used and
6956 would cause a change in behaviour.
6957
fe35d28d
ILT
6958 PR 10980
6959 * options.h (class General_options): Add -G as a short version of
6960 --shared. Add no-op options -assert, -g, and -i.
6961
55a2bb35
ST
69622010-01-04 Sriraman Tallam <tmsriram@google.com>
6963
6964 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6965 check for .text or .gnu.linkonce.t sections.
6966 * icf.cc (Icf::find_identical_sections): Ditto.
6967 Change the detection for mangled function name within the section
6968 name.
6969 * icf.h (is_section_foldable_candidate): New function.
6970
719328e1
ILT
69712009-12-30 Ian Lance Taylor <iant@google.com>
6972
6973 PR 10980
6974 * options.h (class General_options): Permit two dashes with
6975 --retain-symbols-file.
6976
d7bb5745
ILT
69772009-12-30 Ian Lance Taylor <iant@google.com>
6978
403a15dd
ILT
6979 PR 10979
6980 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6981 don't put the file header and segment headers in the text
6982 segment.
6983
eda294df
ILT
6984 PR 10979
6985 * common.cc (Sort_commons::operator()): Stabilize sort when both
6986 entries are NULL.
6987 (Symbol_table::do_allocate_commons_list): When allocating common
6988 symbols, skip a symbol which is no longer common.
6989 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6990 an object before checking its type.
6991 * testsuite/common_test_2.c: New file.
6992 * testsuite/common_test_3.c: New file.
6993 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6994 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6995 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6996 (common_test_2_pic.o, common_test_2.so): New targets.
6997 (common_test_3_pic.o, common_test_3.so): New targets.
6998 * testsuite/Makefile.in: Rebuild.
6999
d7bb5745
ILT
7000 PR 10979
7001 * script.cc (read_input_script): If we see a new SECTIONS clause,
7002 and we have added an input section, give an error.
7003 * layout.h (class Layout): Add have_added_input_section function.
7004 Add have_added_input_section_ field.
7005 * layout.cc (Layout::Layout): Initialize
7006 have_added_input_section_.
7007 (Layout::layout): Set have_added_input_section_.
7008 (Layout::layout_eh_frame): Likewise.
7009
fc59c572
ILT
70102009-12-30 Ian Lance Taylor <iant@google.com>
7011
7012 PR 10931
7013 * options.h (class General_options): Add --sort-common option.
7014 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7015 * common.cc (Sort_common): Add sort_order parameter to
7016 constructor. Add sort_order_ field.
7017 (Sort_commons::operator): Check sort_order_.
7018 (Symbol_table::allocate_commons): Determine the sort order.
7019 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7020 Change all callers.
7021 (Symbol_table::do_allocate_commons_list): Likewise.
7022
1c74fab0
ILT
70232009-12-30 Ian Lance Taylor <iant@google.com>
7024
7025 PR 10916
7026 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7027 symbols from this object, don't change the visibility of an
7028 undefined symbol.
7029 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7030
6affe781
ILT
70312009-12-30 Ian Lance Taylor <iant@google.com>
7032
7033 PR 10861
7034 * script.h (class Version_script_info): Define Language enum.
7035 Update declarations. Define Glob, Exact, and Lookup types. Add
7036 new fields globals_, locals_, and is_finalized_.
7037 * script.cc: Various formatting fixes.
7038 (class Parser_closure): Change language_stack_ from a vector of
7039 std::string to one of Version_script_info::Language. Adjust all
7040 uses accordingly.
7041 (class Lazy_demangler): Remove.
7042 (struct Version_expression): Change language from std::string to
7043 Version_script_info::Language.
7044 (Version_script_info::Version_script_info): New function.
7045 (Version_script_info::~Version_script_info): Don't call clear.
7046 (Version_script_info::finalize): New function.
7047 (Version_script_info::build_lookup_tables): New function.
7048 (Version_script_info::build_expression_list_lookup): New
7049 function.
7050 (Version_script_info::get_symbol_version_helper): Rewrite to use
7051 lookup tables.
7052 (Version_script_info::print_expression_list): Adjust to use
7053 Version_script_info::Language.
7054 (script_push_lex_into_version_mode): Check that the version script
7055 has not been finalized.
7056 (version_script_push_lang): Change language string to
7057 Version_script_info::Language.
7058 * options.cc (Command_line::version_script): New function.
7059 * options.h (class General_options): Add finalize_dynamic_list
7060 function. Change version_script from declaration to definition.
7061 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7062 * testsuite/version_script.map: Remove duplicate def of foo.
7063 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7064 version_script.map.
7065 * testsuite/Makefile.in: Rebuild.
7066
818bf354
ILT
70672009-12-30 Ian Lance Taylor <iant@google.com>
7068
7069 PR 10843
7070 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7071 if the input symbol index is 0, make the output symbol index 0.
7072
ebcc8304
ILT
70732009-12-30 Ian Lance Taylor <iant@google.com>
7074
7075 PR 10670
7076 * options.h (class General_options): Add -x/--discard-all.
7077 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7078 --discard-all. If the local symbol needs a dynamic entry, check
7079 that before handling --discard-locals.
7080
176fe33f
ILT
70812009-12-30 Ian Lance Taylor <iant@google.com>
7082
bb321bb1
ILT
7083 PR 10450
7084 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7085 flags to PF_R.
7086 (Output_segment::add_output_section): Don't change the flags if
7087 the type is PT_TLS.
7088
176fe33f
ILT
7089 PR 10450
7090 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7091 GNU hash table if they need a dynamic value. Otherwise, don't add
7092 them if they are defined in a dynamic object or are forced local.
7093
e8cd95c7
ILT
70942009-12-29 Ian Lance Taylor <iant@google.com>
7095
1b81fb71
ILT
7096 PR 10450
7097 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7098 .gnu.hash table for a 32-bit target.
7099
8d6d383d
ILT
7100 PR 10450
7101 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7102 regular and a dynamic object only needs a dynamic symbol table
7103 entry if it is externally visible.
7104
e785ec03
ILT
7105 PR 10450
7106 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7107 constructor. Add global_offset_table_ field.
7108 (Target_i386::got_section): Set global_offset_table_.
7109 (Target_i386::do_finalize_sections): Set global_offset_table_
7110 size.
7111 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7112 in constructor. Add global_offset_table_ field.
7113 (Target_x86_64::got_section): Set global_offset_table_.
7114 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7115 size.
7116
1a2dff53
ILT
7117 * layout.cc (Layout::Layout): Initialize increase_relro_.
7118 (Layout::get_output_section): Add is_relro, is_last_relro, and
7119 is_first_non_relro parameters. Change all callers.
7120 (Layout::choose_output_section): Likewise.
7121 (Layout::add_output_section_data): Likewise.
7122 (Layout::make_output_section): Likewise.
7123 (Layout::set_segment_offsets): Clear increase_relro when using a
7124 linker script.
7125 * layout.h (class Layout): Add increase_relro method. Add
7126 increase_relro_ field. Update declarations.
7127 * output.cc (Output_section::Output_section): Initialize
7128 is_last_relro_ and is_first_non_relro_.
7129 (Output_segment::add_output_section): Group relro sections is
7130 do_sort is true. Handle is_last_relro and is_first_non_relro.
7131 (Output_segment::maximum_alignment): Remove relro handling.
7132 (Output_segment::set_section_addresses): Add increase_relro
7133 parameter. Change all callers. Add initial alignment to align
7134 relro sections on separate page. Remove old relro handling.
7135 (Output_segment::set_section_list_addresses): Remove in_relro
7136 parameter. Change all callers.
7137 (Output_segment::set_offset): Add increase parameter. Change all
7138 callers. Remove old relro handling.
7139 * output.h (class Output_section): Add new methods: is_last_relro,
7140 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7141 Add is_last_relro_ and is_first_non_relro_ fields.
7142 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7143 Create separate .got.plt section. Call increase_relro.
7144 * x86_64.cc (Target_x86_64::got_section): Likewise.
7145 * testsuite/relro_script_test.t: Add .got.plt.
7146
f0ba79e2
ILT
7147 PR 10450
7148 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7149 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7150 (Layout::finalize): Call set_dynamic_symbol_size.
7151 (Layout::set_dynamic_symbol_size): New function.
7152 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7153 set_dynamic_symbol_size.
7154
e8cd95c7
ILT
7155 PR 10450
7156 * output.h (class Output_section): Add is_entsize_zero_ field.
7157 * output.cc (Output_section::Output_section): Initialize
7158 is_entsize_zero_.
7159 (Output_section::set_entsize): If two different entsizes are
7160 requested, force it to zero.
7161 (Output_section::add_input_section): Set flags for .debug_str
7162 before updating section flags. Set entsize.
7163 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7164 and SHF_STRING if all input sections have those flags.
7165
3e1b9a8a
RÁE
71662009-12-29 Rafael Espindola <espindola@google.com>
7167
7168 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7169 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7170 reporting.
3e1b9a8a 7171
3dcad376
ST
71722009-12-29 Sriraman Tallam <tmsriram@google.com>
7173
7174 * options.cc (General_options::parse_version): Allow -v to exit
7175 without an error if there is nothing to link.
7176
084e2665
ILT
71772009-12-29 Ian Lance Taylor <iant@google.com>
7178
7179 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7180 using a version of gcc before 4.1.
7181 * configure: Rebuild.
7182
250acde3
CD
71832009-12-28 Chris Demetriou <cgd@google.com>
7184
7185 * attributes.cc (Output_attributes_section_data::do_write): Use
7186 std::vector::front rather than std::vector::data.
7187
99fff23b
ILT
71882009-12-28 Ian Lance Taylor <iant@google.com>
7189
7190 * symtab.h (class Symbol_table): Add enum Defined.
7191 * resolve.cc (Symbol_table::should_override): Add defined
7192 parameter. Change all callers. Test whether object is NULL
7193 before calling a method on it.
7194 (Symbol_table::report_resolve_problem): Add defined parameter.
7195 Change all callers.
7196 (Symbol_table::should_override_with_special): Likewise.
7197 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7198 parameter. Change all callers.
7199 (Symbol_table::do_define_in_output_data): Likewise.
7200 (Symbol_table::define_in_output_segment): Likewise.
7201 (Symbol_table::do_define_in_output_segment): Likewise.
7202 (Symbol_table::define_as_constant): Likewise.
7203 (Symbol_table::do_define_as_constant): Likewise.
7204 * script.h (class Symbol_assignment): Add is_defsym parameter to
7205 constructor; change all callers.
7206 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7207 parameter. Change all callers. Add is_defsym_ field.
7208 (class Parser_closure): Add parsing_defsym parameter to
7209 constructor; change all callers. Add parsing_defsym accessor
7210 function. Add parsing_defsym_ field.
7211
556bd683
ILT
72122009-12-28 Ian Lance Taylor <iant@google.com>
7213
7214 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7215 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7216
1782c879
ILT
72172009-12-23 Ian Lance Taylor <iant@google.com>
7218
7219 * i386.cc (Target_i386::do_calls_non_split): Recognize
7220 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7221 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7222 -fsplit-stack prologue when using %r11.
1782c879 7223
329ca2b1
ST
72242009-12-21 Sriraman Tallam <tmsriram@google.com>
7225
7226 * options.cc (General_options::parse_version): Make -v continue and do
7227 the link like GNU ld does.
7228
d675ff46
RÁE
72292009-12-17 Rafael Avila de Espindola <espindola@google.com>
7230
7231 * Makefile.am (CCFILES): Add timer.cc.
7232 (HFILES): Add timer.h.
7233 * configure.ac: Check for sysconf and times.
7234 * main.cc: include timer.h.
7235 (main): Use Timer instead of get_run_time.
7236 * timer.cc: New.
7237 * timer.h: New.
7238 * workqueue.cc: include timer.h.
7239 (Workqueue::find_and_run_task):
7240 Report user, sys and wall time.
7241 * Makefile.in: Regenerate.
7242 * config.in: Regenerate.
7243 * configure: Regenerate.
7244
d6344fb5
DK
72452009-12-16 Doug Kwan <dougkwan@google.com>
7246
7247 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7248 sections.
7249 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7250 relaxed input sections.
7251 * output.cc (Output_section::find_relaxed_input_section): Change
7252 return type to Output_relaxed_input_section pointer. Adjust code
7253 for new type of relaxed_input_section_map_.
7254 * output.h (Output_section::find_relaxed_input_section): Change
7255 return type to Output_relaxed_input_section pointer.
7256 (Output_section::Output_relaxed_input_section_by_input_section_map):
7257 New type.
7258 (Output_section::relaxed_input_section_map_): Change type to
7259 Output_section::Output_relaxed_input_section_by_input_section_map.
7260 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7261 input section.
7262
0e0d5469
ILT
72632009-12-15 Ian Lance Taylor <iant@google.com>
7264
7265 * layout.cc (Layout::create_shstrtab): Only write out after input
7266 sections if we are compressing debug sections.
7267
0649a889
ILT
72682009-12-15 Ian Lance Taylor <iant@google.com>
7269
7270 * archive.cc (Archive::add_symbols): Only look up a symbol without
7271 a version if there is, in fact, a version.
7272
2ea97941
ILT
72732009-12-14 Ian Lance Taylor <iant@google.com>
7274
7275 Revert -Wshadow changes, all changes from:
7276 2009-12-11 Doug Kwan <dougkwan@google.com>
7277 2009-12-11 Nick Clifton <nickc@redhat.com>
7278 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7279
b0eec2cc
DK
72802009-12-11 Doug Kwan <dougkwan@google.com>
7281
7282 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7283 due to -Wshadow.
7284 * attributes.cc (Object_attribute::size): Ditto.
7285 (Attributes_section_data::size): Ditto.
7286 (Attributes_section_data::Attributes_section_data): Ditto.
7287 (Output_attributes_section_data::do_write): Ditto.
7288 * attributes.h (Object_attribute::set_type): Ditto.
7289 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7290
91d6fa6a
NC
72912009-12-11 Nick Clifton <nickc@redhat.com>
7292
7293 * archive.cc: Fix shadowed variable warnings.
7294 * arm.cc: Likewise.
7295 * compressed_output.cc: Likewise.
7296 * compressed_output.h: Likewise.
7297 * configure: Likewise.
7298 * dwarf_reader.cc: Likewise.
7299 * dynobj.cc: Likewise.
7300 * dynobj.h: Likewise.
7301 * ehframe.cc: Likewise.
7302 * ehframe.h: Likewise.
7303 * errors.cc: Likewise.
7304 * expression.cc: Likewise.
7305 * fileread.cc: Likewise.
7306 * fileread.h: Likewise.
7307 * freebsd.h: Likewise.
7308 * i386.cc: Likewise.
7309 * icf.cc: Likewise.
7310 * incremental.h: Likewise.
7311 * layout.cc: Likewise.
7312 * layout.h: Likewise.
7313 * mapfile.cc: Likewise.
7314 * merge.cc: Likewise.
7315 * merge.h: Likewise.
7316 * object.cc: Likewise.
7317 * object.h: Likewise.
7318 * options.h: Likewise.
7319 * output.cc: Likewise.
7320 * output.h: Likewise.
7321 * parameters.cc: Likewise.
7322 * plugin.cc: Likewise.
7323 * powerpc.cc: Likewise.
7324 * reduced_debug_output.cc: Likewise.
7325 * reduced_debug_output.h: Likewise.
7326 * reloc.cc: Likewise.
7327 * reloc.h: Likewise.
7328 * resolve.cc: Likewise.
7329 * script-sections.cc: Likewise.
7330 * script.cc: Likewise.
7331 * script.h: Likewise.
7332 * sparc.cc: Likewise.
7333 * symtab.cc: Likewise.
7334 * symtab.h: Likewise.
7335 * target-select.cc: Likewise.
7336 * target-select.h: Likewise.
7337 * token.h: Likewise.
7338 * workqueue.cc: Likewise.
7339 * workqueue.h: Likewise.
7340 * x86_64.cc: Likewise.
7341
a0351a69
DK
73422009-12-10 Doug Kwan <dougkwan@google.com>
7343
7344 * arm.cc (attributes.h): New include.
7345 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7346 (Arm_relobj::~Arm_relobj): Delete object pointed by
7347 attributes_section_data_.
7348 (Arm_relobj::attributes_section_data): New method definition.
7349 (Arm_relobj::attributes_section_data_): New data member declaration.
7350 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7351 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7352 attributes_section_data_.
7353 (Arm_dynobj::attributes_section_data): New method definition.
7354 (Arm_dynobj::attributes_section_data_): New data member declaration.
7355 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7356 initialization value of may_use_blx_ to false.
7357 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7358 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7359 object attributes to compute results instead of hard-coding.
7360 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7361 Target_arm::get_secondary_compatible_arch,
7362 Target_arm::set_secondary_compatible_arch
7363 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7364 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7365 New method declarations.
7366 (Target_arm::get_aeabi_object_attribute): New method definition.
7367 (Target_arm::attributes_section_data_): New data member declaration.
7368 (read_arm_attributes_section): New template definition.
7369 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7370 (Arm_dynobj::do_read_symbols): Ditto.
7371 (Target_arm::do_finalize_sections): Merge attributes sections from
7372 input. Check for BLX use after attributes section merging.
7373 Fix __exidx_start and __exidx_end visibility. Create an
7374 .ARM.attributes section if necessary.
7375 (Target_arm::get_secondary_compatible_arch,
7376 Target_arm::set_secondary_compatible_arch,
7377 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7378 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7379 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7380 New method definitions.
7381
b59befec
ILT
73822009-12-09 Ian Lance Taylor <iant@google.com>
7383
7384 * plugin.cc (Plugin::load): Don't cast from void* to a function
7385 pointer.
7386
1276bc89
ILT
73872009-12-09 Ian Lance Taylor <iant@google.com>
7388
7389 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7390 information fields.
7391
2f2de248
L
73922009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7393
7394 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7395 Replace two_file_shared_1.so with two_file_shared_2.so.
7396 * testsuite/Makefile.in: Regenerated.
7397
4f787271
DK
73982009-12-08 Doug Kwan <dougkwan@google.com>
7399
7400 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7401 (HFILES): Add attributes.h and int_encoding.h.
7402 * Makefile.in: Regenerate.
7403 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7404 function definitions to int_encoding.cc
7405 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7406 prototypes to int_encoding.h
7407 * reduced_debug_output.cc (int_encoding.h): New include.
7408 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7409 function definitions to int_encoding.cc
7410 (insert_into_vector, read_from_pointer): Move template definitions to
7411 int_encoding.h
7412 * attributes.cc: New file.
7413 * attributes.h: New file.
7414 * int_encoding.cc: New file.
7415 * int_encoding.h: New file.
7416
20b52f1a
RÁE
74172009-12-07 Rafael Avila de Espindola <espindola@google.com>
7418
7419 PR gold/11055
7420 * incremental-dump.cc (dump_incremental_inputs): New.
7421 (main): Use dump_incremental_inputs.
7422
53d7974c
L
74232009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7424
7425 PR gold/10893
7426 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7427 checking elfcpp::STT_FUNC.
7428 (Target_i386::Relocate::relocate): Likewise.
7429 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7430
7431 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7432 symbols from shared libraries into normal FUNC symbols.
7433
7434 * symtab.h (Symbol): Add is_func and use it.
7435
05a352e6
DK
74362009-12-05 Doug Kwan <dougkwan@google.com>
7437
7438 * arm.cc (Target_arm::arm_info): Initialize new fields
7439 attributes_section and attributes_vendor.
7440 * i386.cc (Target_i386::i386_info): Same.
7441 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7442 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7443 fields attributes_section and attributes_vendor.
53d7974c 7444 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7445 * target.h (Target::attributes_section, Target::attributes_vendor,
7446 Target::is_attributes_section, Target::attribute_arg_type,
7447 Target::attributes_order): New method definitions.
7448 (Target::Target_info::attributes_section,
7449 Target::Target_info::attributes_vendor): New fields.
7450 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7451 virtual method definitions.
7452 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7453 attributes_section and attributes_vendor.
7454 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7455
f4e5969c
DK
74562009-12-05 Doug Kwan <dougkwan@google.com>
7457
7458 * arm.cc: Update comments about interworking and stub generation.
7459 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7460 considered as non-PIC.
7461 (Arm_relocate_functions::base_abs): Fix formatting.
7462 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7463 of function to use GOT entry address instead of offset.
7464 (Target_arm::Scan::global): Issue an error if a symbol would need a
7465 PLT does not get one because it is untyped. Remove code to create
7466 dynamic symbols for relative branches.
7467 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7468 takes unsigned integer instead of boolean.
7469
1abce4a6
L
74702009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7471
7472 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7473 (two_file_test_LDADD): Likewise.
7474 (common_test_1_LDADD): Likewise.
7475 (exception_test_LDADD) Likewise.
7476 (weak_test_LDADD): Likewise.
7477 (many_sections_test_LDADD): Likewise.
7478 (initpri1_LDADD): Likewise.
7479 (script_test_1_LDADD): Likewise.
7480 (script_test_2_LDADD): Likewise.
7481 (justsyms_LDADD): Likewise.
7482 (binary_test_LDADD): Likewise.
7483 (large_LDADD): Likewise.
7484 * testsuite/Makefile.in: Regenerated.
7485
adcf2816 74862009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7487
adcf2816
L
7488 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7489 (Symbol_table::override_with_special): Likewise.
7490 (Symbol_table::add_from_object): Likewise.
7491
28e67f5d
RÁE
74922009-12-04 Rafael Avila de Espindola <espindola@google.com>
7493
7494 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7495 Don't set the data_offset twice.
7496
ae10a101
RÁE
74972009-12-04 Rafael Avila de Espindola <espindola@google.com>
7498
7499 * testsuite/Makefile.in: Regenerate.
7500
f59f41f3
DK
75012009-12-03 Doug Kwan <dougkwan@google.com>
7502
7503 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7504 (Target_arm::do_finalize_sections): Add parameter for symbol table
7505 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7506 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7507 parameter for symbol table pointer.
7508 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7509 an additional parameter for a pointer to symbol table.
7510 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7511 parameter for a symbol table pointer.
7512 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7513 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7514 Ditto.
7515 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7516 parameter for a symbol table pointer.
7517
ca55d848
RÁE
75182009-12-03 Rafael Avila de Espindola <espindola@google.com>
7519
7520 * incremental.cc (Incremental_inputs_header)
7521 (Incremental_inputs_header_write, Incremental_inputs_entry)
7522 (Incremental_inputs_entry_write): Move ...
7523 * incremental.h (Incremental_inputs_header)
7524 (Incremental_inputs_header_write, Incremental_inputs_entry)
7525 (Incremental_inputs_entry_write): here.
7526
3aec4f9c
RÁE
75272009-12-02 Rafael Avila de Espindola <espindola@google.com>
7528
7529 * incremental.cc (make_sized_incremental_binary): Set the target.
7530 Error if it is incompatible.
7531 * output.h (Output_file): Add filename method.
7532
9c0ae74d
RÁE
75332009-12-02 Rafael Avila de Espindola <espindola@google.com>
7534
7535 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7536 from the get_* methods.
7537
a45500ae
RÁE
75382009-12-02 Rafael Avila de Espindola <espindola@google.com>
7539
7540 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7541 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7542 Write 0 for the data_offset of scripts.
7543
325e6408
RÁE
75442009-12-02 Rafael Avila de Espindola <espindola@google.com>
7545
7546 * testsuite/Makefile.am: Add the incremental_test.sh test.
7547 * testsuite/incremental_test.sh: New.
7548 * testsuite/incremental_test_1.c: New.
7549 * testsuite/incremental_test_2.c: New.
7550
954c3e2e
RÁE
75512009-12-01 Rafael Avila de Espindola <espindola@google.com>
7552
7553 * incremental-dump.cc (main): Fix typos.
7554
f8086623
RÁE
75552009-11-27 Rafael Avila de Espindola <espindola@google.com>
7556
7557 PR gold/11025
7558 * incremental-dump.cc (main): Use llu to print 64 bit values.
7559
3b0dd6ac
L
75602009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7561 H.J. Lu <hongjiu.lu@intel.com>
7562
7563 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7564 $(LIBDL).
7565 (incremental_dump_LDADD): Likewise.
7566 * Makefile.in: Regenerated.
7567
a6d1ef57 75682009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7569
a6d1ef57
DK
7570 Revert:
7571
7572 2009-11-25 Doug Kwan <dougkwan@google.com>
7573
7574 * arm.cc (Target_arm::Target_arm): Move method definition
7575 outside of class definition. Add code to handle
7576 --target1-rel, --target1-abs and --target2= options.
7577 (Target_arm::get_reloc_reloc_type): Change method to be
7578 non-static and const.
7579 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7580 New data member declaration.
7581 (Target_arm::Scan::local, Target_arm::Scan::global,
7582 Target_arm::Relocate::relocate,
7583 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7584 Adjust call to Target_arm::get_real_reloc_type.
7585 (Target_arm::get_real_reloc_type): Use command line options
7586 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7587 * options.h (--target1-rel, --target1-abs, --target2): New
7588 ARM-only options.
7589
50aeb7d4
DK
75902009-11-25 Doug Kwan <dougkwan@google.com>
7591
7592 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7593 class definition. Add code to handle --target1-rel, --target1-abs
7594 and --target2= options.
7595 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7596 and const.
7597 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7598 member declaration.
7599 (Target_arm::Scan::local, Target_arm::Scan::global,
7600 Target_arm::Relocate::relocate,
7601 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7602 call to Target_arm::get_real_reloc_type.
7603 (Target_arm::get_real_reloc_type): Use command line options to
7604 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7605 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7606 options.
7607
51938283
DK
76082009-11-25 Doug Kwan <dougkwan@google.com>
7609
7610 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7611 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7612 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7613 formatting.
7614 (Arm_relocate_functions::thm_call): Replace body with a call to
7615 Arm_relocate_functions::thumb_branch_common.
7616 (Arm_relocate_functions::thm_jump24,
7617 Arm_relocate_functions::thm_xpc22): New method definitions.
7618 (Arm_relocate_functions::thumb_branch_common): New method definition.
7619 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7620 operator.
7621 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7622 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7623
e2b8f3c4
RÁE
76242009-11-24 Rafael Avila de Espindola <espindola@google.com>
7625
7626 * Makefile.am: Build incremental-dump
7627 * Makefile.in: Regenerate.
7628 * incremental-dump.cc: New.
7629 * incremental.cc (Incremental_inputs_header_data,
7630 Incremental_inputs_entry_data): Move to incremental.h
7631 * incremental.h: (Incremental_inputs_header_data,
7632 Incremental_inputs_entry_data): Move from incremental.cc
7633
bcba9aec
RÁE
76342009-11-24 Rafael Avila de Espindola <espindola@google.com>
7635
7636 * incremental.cc (Incremental_inputs_header,
7637 Incremental_inputs_header_write, Incremental_inputs_entry,
7638 Incremental_inputs_entry_write): Add a typedef with the data type.
7639
7c3afe08
RÁE
76402009-11-24 Rafael Avila de Espindola <espindola@google.com>
7641
7642 * incremental.cc (Incremental_inputs_header,
7643 Incremental_inputs_header_write, Incremental_inputs_entry,
7644 Incremental_inputs_entry_write): Update comment about which
7645 type has the filed descriptions.
7646
d204b6e9
DK
76472009-11-15 Doug Kwan <dougkwan@google.com>
7648
7649 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7650 (Arm_relocate_functions::arm_branch_common): Change method defintion
7651 in class definition to a method declaration and update list of formal
7652 parameters.
7653 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7654 Arm_relocation_functions::jump24): Adjust call to
7655 Arm_relocate_functions::arm_branch_common. Update list of formal
7656 parameters.
7657 (Arm_relocate_functions::xpc25): New method definition.
7658 (Arm_relocate_functions::arm_branch_common): Move method defintion
7659 out from class definition. Use stubs for mode-switching and extending
7660 branch ranges.
7661 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7662 specially. Change code to enable use of stubs in ARM branches.
7663
43d12afe
DK
76642009-11-10 Doug Kwan <dougkwan@google.com>
7665
7666 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7667 in method declaration.
7668 (Target_arm::relocate_stub): New method declaration.
7669 (Target_arm::default_target): Change to return a pointer instead of
7670 a const reference.
7671 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7672 Target_arm::default_target.
7673 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7674 method definition.
7675 (Target_arm::relocate_section): Adjust view.
7676 (Target_arm::relocate_stub): New method definition.
7677
ac33a407
DK
76782009-11-10 Doug Kwan <dougkwan@google.com>
7679
7680 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7681 a format warning.
7682 * incremental.cc (open_incremental_binary): Initialized local
7683 variables to avoid warnings.
7684 * object.cc (make_elf_object): Ditto.
7685 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7686 a format warning.
e1df38aa 7687
88ee28e9
L
7688009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7689
7690 PR gold/10930
7691 * testsuite/plugin_test.c: Include "config.h".
7692
2daedcd6
DK
76932009-11-09 Doug Kwan <dougkwan@google.com>
7694
7695 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7696 (arm_symbol_value): Remove.
7697 (Arm_relocate_functions::arm_branch_common,
7698 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7699 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7700 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7701 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7702 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7703 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7704 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7705 Arm_relocate_functions::thm_mobw_abs_nc,
7706 Arm_relocate_functions::thm_mov_abs,
7707 Arm_relocate_functions::movw_prel_nc,
7708 Arm_relocate_functions::thm_movt_abs,
7709 Arm_relocate_functions::movt_prel,
7710 Arm_relocate_functions::thm_movw_prel_nc,
7711 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7712 (Target_arm::Relocate::relocate): Only decompose address into two
7713 parts if relocation type uses the thumb-bit and pass the actual
7714 bit instead of a flag indicating that the thumb-bit is used. Adjust
7715 calls to methods in Arm_relocate_functions for this change.
7716
1276bc89 77172009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7718
7719 PR 10925
7720 * reloc.cc: Instantiate
7721 Sized_relobj::initialize_input_to_output_maps and
7722 Sized_relobj:free_input_to_output_maps.
7723
e53ad1b5
ILT
77242009-11-06 Ian Lance Taylor <iant@google.com>
7725
7726 PR 10876
7727 * defstd.cc (in_segment): Set only_if_ref true for "end".
7728
eb44217c
DK
77292009-11-06 Doug Kwan <dougkwan@google.com>
7730
7731 * arm.cc (class Reloc_stub): Correct a comment.
7732 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7733 (Target_arm::scan_section_for_stubs): New method declaration.
7734 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7735 Change methods from private to protected.
7736 (Target_arm::do_may_relax): New method definition.
7737 (Target_arm::do_relax, Target_arm::group_sections,
7738 Target_arm::scan_reloc_for_stub,
7739 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7740 (Target_arm::arm_input_section_map_): New data member declaration.
7741 (Target_arm::scan_reloc_for_stub,
7742 Target_arm::scan_reloc_section_for_stubs,
7743 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7744 Target_arm::do_relax): New method definitions.
7745
5d329b7d
ILT
77462009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7747
7748 * configure.ac: Check for (struct stat)::st_mtim
7749 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7750 * config.in: Regenerate.
7751 * configure: Regenerate.
7752
96a0d71b
ILT
77532009-11-05 Ian Lance Taylor <iant@google.com>
7754
7755 PR 10910
7756 * output.cc (Output_segment::add_output_section): Add missing
7757 return statement.
7758
594c8e5e
ILT
77592009-11-04 Ian Lance Taylor <iant@google.com>
7760
7761 PR 10880
7762 * object.h (class Object): Add is_needed and set_is_needed
7763 methods. Add is_needed_ field. Make bool fields into bitfields.
7764 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7765 defined in a dynamic object and referenced by a regular object,
7766 set is_needed for the dynamic object.
7767 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7768 if the file is marked with as_needed and it is not needed.
7769
22b127cc
ILT
77702009-11-04 Ian Lance Taylor <iant@google.com>
7771
7772 PR 10887
7773 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7774 tags if data is discarded by linker script.
7775 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7776 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7777 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7778 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7779
f5c870d2
ILT
77802009-11-04 Ian Lance Taylor <iant@google.com>
7781
7782 * layout.cc (Layout::get_output_section): Add is_interp and
7783 is_dynamic_linker_section parameters. Change all callers.
7784 (Layout::choose_output_section): Likewise.
7785 (Layout::make_output_section): Likewise.
7786 (Layout::add_output_section_data): Add is_dynamic_linker_section
7787 parameter. Change all callers.
7788 * layout.h (class Layout): Update declarations.
7789 * output.h (class Output_section): Add is_interp, set_is_interp,
7790 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7791 Add is_interp_, is_dynamic_linker_section_ fields. Change
7792 generate_code_fills_at_write_ to a bitfield.
7793 * output.cc (Output_section::Output_sections): Initialize new
7794 fields.
7795 (Output_segment::add_output_section): Add do_sort parameter.
7796 Change all callers.
7797
1ae4d23b
ILT
77982009-11-03 Ian Lance Taylor <iant@google.com>
7799
7800 PR 10860
7801 * options.h (class General_options): Add --warn-common.
7802 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7803 merging two common symbols.
7804 (Symbol_table::should_override): Handle --warn-common when merging
7805 a common symbol with a defined symbol. Use report_resolve_problem
7806 for multiple definitions.
7807 (Symbol_table::report_resolve_problem): New function.
7808 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7809
55da9579
DK
78102009-11-03 Doug Kwan <dougkwan@google.com>
7811
7812 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7813 stub_factory_.
7814 (Target_arm::stub_factory): New method definition.
7815 (Target_arm::new_arm_input_section,
7816 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7817 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7818 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7819 New type definitions.
7820 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7821 member declarations.
7822 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7823 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7824 New method definitions.
7825
37a9ac43
ILT
78262009-11-03 Ian Lance Taylor <iant@google.com>
7827
7828 * options.h (class General_options): Add --warn_constructors.
7829
b3d6a3d4
ILT
78302009-11-03 Ian Lance Taylor <iant@google.com>
7831
7832 PR 10893
7833 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7834 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7835
934b01dd
ILT
78362009-11-03 Ian Lance Taylor <iant@google.com>
7837
7838 PR 10895
7839 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7840 --msgid-bugs-address.
7841 (install-pdf): New target.
7842 (install-data_yes): Look up one directory to find mkinstalldirs.
7843
03c1939b
L
78442009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7845
7846 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7847 tree.
7848
ebd95253
DK
78492009-10-30 Doug Kwan <dougkwan@google.com>
7850
7851 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7852
e9bbb538
DK
78532009-10-30 Doug Kwan <dougkwan@google.com>
7854
7855 * arm.cc (Stub_addend_reader): New struct template definition
7856 and partial specializations.
7857 (Stub_addend_reader::operator()): New method definition for a
7858 partially specialized template.
7859
d5b40221
DK
78602009-10-30 Doug Kwan <dougkwan@google.com>
7861
7862 * arm.cc (Arm_relobj::processor_specific_flags): New method
7863 definition.
7864 (Arm_relobj::do_read_symbols): New method declaration.
7865 (Arm_relobj::processor_specific_flags_): New data member declaration.
7866 (Arm_dynobj): New class definition.
7867 (Target_arm::do_finalize_sections): Add input_objects parameter.
7868 (Target_arm::do_adjust_elf_header): New method declaration.
7869 (Target_arm::are_eabi_versions_compatible,
7870 (Target_arm::merge_processor_specific_flags): New method declaration.
7871 (Target_arm::do_make_elf_object): New overloaded method definitions
7872 and declaration.
7873 (Arm_relobj::do_read_symbols): New method definition.
7874 (Arm_dynobj::do_read_symbols): Ditto.
7875 (Target_arm::do_finalize_sections): Add input_objects parameters.
7876 Merge processor-specific flags from all input objects.
7877 (Target_arm::are_eabi_versions_compatible,
7878 Target_arm::merge_processor_specific_flags,
7879 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7880 New method definitions.
7881 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7882 Input_objects pointer type parameter.
7883 * layout.cc (Layout::finalize): Pass input objects to target's.
7884 finalize_sections function.
7885 * output.cc (Output_file_header::do_sized_write): Set ELF file
7886 header's processor-specific flags.
7887 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7888 Input_objects pointer type parameter.
7889 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7890 * target.h (Input_objects): New forward class declaration.
7891 (Target::processor_specific_flags,
7892 Target::are_processor_specific_flags_sect): New method definitions.
7893 (Target::finalize_sections): Add input_objects parameter.
7894 (Target::Target): Initialize processor_specific_flags_ and
7895 are_processor_specific_flags_set_.
7896 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7897 parameter.
7898 (Target::set_processor_specific_flags): New method definition.
7899 (Target::processor_specific_flags_,
7900 Target::are_processor_specific_flags_set_): New data member
7901 declarations.
7902 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7903 Input_objects pointer type parameter.
7904
ebabffbd
DK
79052009-10-30 Doug Kwan <dougkwan@google.com>
7906
7907 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7908
ad0f2072
ILT
79092009-10-28 Ian Lance Taylor <iant@google.com>
7910
7911 * object.h (class Relobj): Drop options parameter from
7912 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7913 do_scan_relocs, do_relocate. Change all callers.
7914 (class Sized_relobj): Drop options parameters from
7915 do_gc_process_relocs, do_scan_relocs, do_relocate,
7916 do_relocate_sections, relocate_sections, emit_relocs_scan,
7917 emit_relocs_scan_reltype. Change all callers.
7918 (struct Relocate_info): Remove options field and all references to
7919 it.
7920 * reloc.h (class Read_relocs): Remove options constructor
7921 parameter and options_ field. Change all callers.
7922 (class Gc_process_relocs, class Scan_relocs): Likewise.
7923 (class Relocate_task): Likewise.
7924 * target-reloc.h (scan_relocs): Remove options parameter. Change
7925 all callers.
7926 (scan_relocatable_relocs): Likewise.
7927 * target.h (class Sized_target): Remove options parameter from
7928 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7929 all callers.
7930 * gc.h (gc_process_relocs): Remove options parameter. Change all
7931 callers.
7932 * arm.cc: Update functions to remove options parameters.
7933 * i386.cc: Likewise.
7934 * powerpc.cc: Likewise.
7935 * sparc.cc: Likewise.
7936 * x86_64.cc: Likewise.
7937 * testsuite/testfile.cc: Likewise.
7938
8ffa3667
DK
79392009-10-28 Doug Kwan <dougkwan@google.com>
7940
7941 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7942 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7943 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7944 New method definitions.
7945
40f36857
CC
79462009-10-28 Cary Coutant <ccoutant@google.com>
7947
7948 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7949 (Plugin::cleanup_done_): New member.
7950 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7951 (Plugin_manager::cleanup_done_): Remove.
7952 (Plugin_manager::add_input_file): Edit error message.
7953 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7954 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7955
2c849493
ILT
79562009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7957
7958 * fileread.cc: (File_read::View::~View): Use the new
7959 data_ownership_ filed.
7960 (File_read::~File_read): Dispose the new whole_file_view_.
7961 (File_read::open): Mmap the whole file if needed.
7962 (File_read::open): Use whole_file_view_ instead of contents_.
7963 (File_read::find_view): Use whole_file_view_ if applicable.
7964 (File_read::do_read): Use whole_file_view_ instead of contents_.
7965 (File_read::make_view): Use whole_file_view_ instead of contents_,
7966 update File_read::View::View call.
7967 (File_read::find_or_make_view): Update File_read::View::View
7968 call.
7969 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7970 remove contents_
7971 (File_read::View::Data_ownership): New enum.
7972 (File_read::View::View): Replace bool mapped_ with Data_ownership
7973 argument.
7974 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7975 (File_read::View::data_ownership_): New field.
7976 (File_read::contents_): Remove (replaced by whole_file_view_).
7977 (File_read::whole_file_view_): New field.
7978 * options.h (class General_options): Add --keep-files-mapped.
7979
24998053
CC
79802009-10-27 Cary Coutant <ccoutant@google.com>
7981
7982 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7983 * testsuite/Makefile.am (plugin_test_5): New test case.
7984 * testsuite/Makefile.in: Regenerate.
7985
72adc4fa
DK
79862009-10-25 Doug Kwan <dougkwan@google.com>
7987
7988 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7989 from private to protected to allow access by child class.
7990 (Sized_relobj::do_relocate_sections): New method declaration.
7991 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 7992 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
7993 Sized_relobj::relocate_sections. Instantiate template explicitly
7994 for different target sizes and endianity.
7995
07f508a2
DK
79962009-10-24 Doug Kwan <dougkwan@google.com>
7997
7998 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7999 (Arm_input_section::as_arm_input_section): New method.
8000 (Arm_output_section): New class definition.
8001 (Arm_output_section::create_stub_group,
8002 Arm_output_section::group_sections): New method definitions.
8003
10ad9fe5
DK
80042009-10-22 Doug Kwan <dougkwan@google.com>
8005
8006 * arm.cc (Arm_input_section): New class definition.
8007 (Arm_input_section::init, Arm_input_section:do_write,
8008 Arm_input_section::set_final_data_size,
8009 Arm_input_section::do_reset_address_and_file_offset): New method
8010 definitions.
8011
56ee5e00
DK
80122009-10-21 Doug Kwan <dougkwan@google.com>
8013
8014 * arm.cc (Stub_table, Arm_input_section): New forward class
8015 declarations.
8016 (Stub_table): New class defintion.
8017 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8018 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8019 New method definition.
8020
b569affa
DK
80212009-10-21 Doug Kwan <dougkwan@google.com>
8022
8023 * arm.cc: Update copyright comments.
8024 (Target_arm): New forward class template declaration.
8025 (Arm_address): New type.
8026 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8027 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8028 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8029 constants.
8030 (Insn_template): Same.
8031 (DEF_STUBS): New macro.
8032 (Stub_type): New enum type.
8033 (Stub_template): New class definition.
8034 (Stub): Same.
8035 (Reloc_stub): Same.
8036 (Stub_factory): Same.
8037 (Target_arm::Target_arm): Initialize may_use_blx_ and
8038 should_force_pic_veneer_.
8039 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8040 Target_arm::should_force_pic_veneer,
8041 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8042 Target_arm::using_thumb_only, Target_arm:;default_target): New
8043 method defintions.
8044 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8045 New data member declarations.
8046 (Insn_template::size, Insn_template::alignment): New method defintions.
8047 (Stub_template::Stub_template): New method definition.
8048 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8049 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8050 (Stub_factory::Stub_factory): New method definition.
8051 * gold.h (string_hash): New template.
8052 * output.h (Input_section_specifier::hash_value): Use
8053 gold::string_hash.
8054 (Input_section_specifier::string_hash): Remove.
8055 * stringpool.cc (Stringpool_template::string_hash): Use
8056 gold::string_hash.
8057
6c172549
DK
80582009-10-20 Doug Kwan <dougkwan@google.com>
8059
8060 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8061 symbols of relaxed input sections.
8062 * output.h (Output_section::find_relaxed_input_section): Make
8063 method public.
8064
c5617f2f
DK
80652009-10-16 Doug Kwan <dougkwan@google.com>
8066
8067 * dynobj.cc (Versions::Versions): Initialize version_script_.
8068 Only insert base version symbol definition for a shared object
8069 if version script defines any version versions.
8070 (Versions::define_base_version): New method definition.
8071 (Versions::add_def): Check that base version is not needed.
8072 (Versions::add_need): Define base version lazily.
8073 * dynobj.h (Versions::define_base_version): New method declaration.
8074 (Versions::needs_base_version_): New data member declaration.
8075 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8076 (check_DATA): Add no_version_test.stdout.
8077 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8078 New make rules.
8079 * testsuite/Makefile.in: Regenerate.
8080 * testsuite/no_version_test.c: New file.
8081 * testsuite/no_version_test.sh: Ditto.
8082
3c12dcdb
DK
80832009-10-16 Doug Kwan <dougkwan@google.com>
8084
8085 * expression.cc (class Segment_start_expression): New class definition.
8086 (Segment_start_expression::value): New method definition.
8087 (script_exp_function_segment_start): Return a new
8088 Segment_start_expression.
8089 * gold/script-c.h (script_saw_segment_start_expression): New function
8090 prototype.
8091 * script-sections.cc (Script_sections::Script_sections): Initialize
8092 SAW_SEGMENT_START_EXPRESSION_ to false.
8093 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8094 and -Tbbs options to specify section addresses if given in
8095 command line and no SEGMENT_START expression is seen in a script.
8096 * script-sections.h (Script_sections::saw_segment_start_expression,
8097 Script_sections::set_saw_segment_start_expression): New method
8098 definition.
8099 (Script_sections::saw_segment_start_expression_): New data member
8100 declaration.
8101 * script.cc (script_saw_segment_start_expression): New function.
8102 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8103 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8104 script_test_7.sh and script_test_8.sh.
8105 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8106 script_test_8.stdout.
8107 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8108 (script_test_6, script_test_6.stdout, script_test_7,
8109 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8110 * Makefile.in: Regenerate.
8111 * testsuite/script_test_6.sh: New file.
8112 * testsuite/script_test_6.t: Same.
8113 * testsuite/script_test_7.sh: Same.
8114 * testsuite/script_test_7.t: Same.
8115 * testsuite/script_test_8.sh: Same.
8116
64b1ae37
DK
81172009-10-16 Doug Kwan <dougkwan@google.com>
8118
8119 * output.cc (Output_segment::set_section_list_address): Cast
8120 expressions to unsigned long long type to avoid format warnings.
8121
661be1e2
ILT
81222009-10-15 Ian Lance Taylor <iant@google.com>
8123
12edd763 8124 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8125 dot assignment to script_sections_.
12edd763
ILT
8126 * script-sections.cc (Script_sections::add_dot_assignment):
8127 Initialize if necessary.
8128
68b6574b
ILT
8129 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8130 program headers with no load segment if there is a linker script.
8131
661be1e2
ILT
8132 * layout.cc (Layout::set_segment_offsets): Align the file offset
8133 to the segment aligment for -N or -n with no load segment.
8134 * output.cc (Output_segment::add_output_section): Don't crash if
8135 the first section is a TLS section.
8136 (Output_segment::set_section_list_addresses): Print an error
8137 message if the address moves backward in a linker script.
8138 * script-sections.cc
8139 (Output_section_element_input::set_section_addresses): Don't
8140 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8141 (Orphan_output_section::set_section_addresses): Likewise.
8142
f15f61a7
DK
81432009-10-15 Doug Kwan <dougkwan@google.com>
8144
8145 * layout.cc (Layout::finish_dynamic_section): Generate tags
8146 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8147 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8148 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8149
82bb573a
ILT
81502009-10-14 Ian Lance Taylor <iant@google.com>
8151
8152 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8153 fields.
8154 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8155 data_shdr fields of relinfo.
8156 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8157 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8158 R_386_TLS_LDO_32, adjust based on section flags.
8159 (Target_i386::Relocate::fix_up_ldo): Remove.
8160
374ad285
ILT
81612009-10-13 Ian Lance Taylor <iant@google.com>
8162
8163 Add support for -pie.
8164 * options.h (class General_options): Add -pie and
8165 --pic-executable.
8166 (General_options::output_is_position_independent): Test -pie.
8167 (General_options::output_is_executable): Return true if not shared
8168 and not relocatable.
8169 (General_options::output_is_pie): Remove.
8170 * options.cc (General_options::finalize): Reject incompatible uses
8171 of -pie.
8172 * gold.cc (queue_middle_tasks): A -pie link is not static.
8173 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8174 * symtab.cc (Symbol::final_value_is_known): Return false if
8175 output_is_position_independent.
8176 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8177 output_is_position_independent.
8178 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8179 output_is_position_independent.
8180 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8181 output_is_position_independent.
8182 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8183 two_file_pie_test.
8184 (basic_pie_test.o, basic_pie_test): New targets.
8185 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8186 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8187 (two_file_pie_test): New target.
8188 * testsuite/Makefile.in: Rebuild.
8189 * README: Remove note saying that -pie is not supported.
8190
c6585162
ILT
81912009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8192
8193 * options.h (class General_options): Add -init and -fini.
8194 * layout.cc (Layout::finish_dynamic_section): Emit
8195 given init and fini functions.
8196
032ce4e9
ST
81972009-10-13 Sriraman Tallam <tmsriram@google.com>
8198
8199 * gc.h (gc_process_relocs): Check if icf is enabled using new
8200 function.
8201 * gold.cc (queue_initial_tasks): Likewise.
8202 (queue_middle_tasks): Likewise.
8203 * object.cc (do_layout): Likewise.
8204 * symtab.cc (is_section_folded): Likewise.
8205 * main.cc (main): Likewise.
8206 * reloc.cc (Read_relocs::run): Likewise.
8207 (Sized_relobj::do_scan_relocs): Likewise.
8208 * icf.cc (is_function_ctor_or_dtor): New function.
8209 (Icf::find_identical_sections): Check if function is ctor or dtor when
8210 safe icf is chosen.
8211 * options.h (General_options::icf): Change option to be an enum.
8212 (Icf_status): New enum.
8213 (icf_enabled): New method.
8214 (icf_safe_folding): New method.
8215 (set_icf_status): New method.
8216 (icf_status_): New variable.
8217 * (options.cc) (General_options::finalize): Set icf_status_.
8218 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8219 icf_test and icf_keep_unique_test to use the --icf enum flag.
8220 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8221 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8222
f345227a
ST
82232009-10-12 Sriraman Tallam <tmsriram@google.com>
8224
8225 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8226 includes to gc.h and icf.h.
8227 * arm.cc: Include gc.h.
8228 * gold.cc: Likewise.
8229 * i386.cc: Likewise.
8230 * powerpc.cc: Likewise.
8231 * sparc.cc: Likewise.
8232 * x86_64.cc: Likewise.
8233 * gc.h: Include icf.h.
8234
1c7814ed
ILT
82352009-10-11 Ian Lance Taylor <iant@google.com>
8236
8237 * plugin.cc: Include "gold.h" before other header files.
8238
ae3b5189
CD
82392009-10-10 Chris Demetriou <cgd@google.com>
8240
8241 * options.h (Input_file_argument::Input_file_type): New enum.
8242 (Input_file_argument::is_lib_): Replace with...
8243 (Input_file_argument::type_): New member.
8244 (Input_file_argument::Input_file_argument): Take Input_file_type
8245 'type' rather than boolean 'is_lib' as second argument.
8246 (Input_file_argument::is_lib): Use type_.
8247 (Input_file_argument::is_searched_file): New function.
8248 (Input_file_argument::may_need_search): Handle is_searched_file.
8249 * options.cc (General_options::parse_library): Support -l:filename.
8250 (General_options::parse_just_symbols): Update for Input_file_argument
8251 changes.
8252 (Command_line::process): Likewise.
8253 * archive.cc (Archive::get_file_and_offset): Likewise.
8254 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8255 * script.cc (read_script_file, script_add_file): Likewise.
8256 * fileread.cc (Input_file::Input_file): Likewise.
8257 (Input_file::will_search_for): Handle is_searched_file.
8258 (Input_file::open): Likewise.
8259 * readsyms.cc (Read_symbols::get_name): Likewise.
8260 * testsuite/Makefile.am (searched_file_test): New test.
8261 * testsuite/Makefile.in: Regenerate.
8262 * testsuite/searched_file_test.cc: New file.
8263 * testsuite/searched_file_test_lib.cc: New file.
8264
f3048a1d
ILT
82652009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8266 Ian Lance Taylor <iant@google.com>
8267
8268 * descriptor.cc: Include <cstdio> and "binary-io.h".
8269 (Descriptors::open): Open the files in binary mode always.
8270 * script.cc (Lex::get_token): Treat \r as whitespace.
8271
d4780e57
ILT
82722009-10-09 Ian Lance Taylor <iant@google.com>
8273
8274 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8275
d9a893b8
ILT
82762009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8277 Ian Lance Taylor <iant@google.com>
8278
8279 * configure.ac: Check for readv function also.
8280 * fileread.cc (readv): Define if not HAVE_READV.
8281 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8282 does not exist.
8283 * config.in: Regenerate.
8284 * configure: Regenerate.
8285
c0a62865
DK
82862009-10-09 Doug Kwan <dougkwan@google.com>
8287
8288 * layout.cc (Layout::make_output_section): Call target hook to make
8289 ordinary output section.
8290 (Layout::finalize): Adjust parameter list of call the
8291 Target::may_relax().
8292 * layout.h (class Layout::section_list): New method.
8293 * merge.h (Output_merge_base::entsize): Change visibility to public.
8294 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8295 New methods.
8296 (Output_merge_string::do_is_string): New method.
8297 * object.cc (Sized_relobj::do_setup): renamed from
8298 Sized_relobj::set_up.
8299 * object.h (Sized_relobj::adjust_shndx,
8300 Sized_relobj::initializ_input_to_output_maps,
8301 Sized_relobj::free_input_to_output_maps): Change visibilities to
8302 protected.
8303 (Sized_relobj::setup): Virtualize.
8304 (Sized_relobj::do_setup): New method declaration.
8305 (Sized_relobj::invalidate_section_offset,
8306 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8307 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8308 * options.cc (parse_int): New function.
8309 * options.h (parse_int): New declaration.
8310 (DEFINE_int): New macro.
8311 (stub_group_size): New option.
8312 * output.cc (Output_section::Output_section): Initialize memebers
8313 merge_section_map_, merge_section_by_properties_map_,
8314 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8315 (Output_section::add_input_section): Handled deferred code-fill
8316 generation and remove an old comment.
8317 (Output_section::add_relaxed_input_section): New method definition.
8318 (Output_section::add_merge_input_section): Use merge section by
8319 properties map to speed to search. Update merge section maps
8320 as appropriate.
8321 (Output_section::build_relaxation_map): New method definition.
8322 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8323 Same.
8324 (Output_section::relax_input_section): Renamed to
8325 Output_section::convert_input_sections_to_relaxed_sections and change
8326 interface to take a vector of pointers to relaxed sections.
8327 (Output_section::find_merge_section,
8328 Output_section::find_relaxed_input_section): New method definitions.
8329 (Output_section::is_input_address_mapped,
8330 Output_section::output_offset, Output_section::output_address):
8331 Use output section data maps to speed up searching.
8332 (Output_section::find_starting_output_address): Add comments.
8333 (Output_section::do_write,
8334 Output_section::write_to_postprocessing_buffer): Do code-fill
8335 generation as appropriate.
8336 (Output_section::get_input_sections): Invalidate relaxed input section
8337 map.
8338 (Output_section::restore_states): Adjust type of checkpoint .
8339 Invalidate relaxed input section map.
8340 * output.h (Output_merge_base): New class declaration.
8341 (Input_section_specifier): New class defintion.
8342 (class Output_relaxed_input_section) Change base class to
8343 Output_section_data_build.
8344 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8345 base class initializer.
8346 (Output_section::add_relaxed_input_section): New method declaration.
8347 (Output_section::Input_section): Change visibility to protected.
8348 (Output_section::Input_section::relobj,
8349 Output_section::Input_section::shndx): Handle relaxed input sections.
8350 Output_section::input_sections) Change visibility to protected. Also
8351 define overload to return a non-const pointer.
8352 (Output_section::Merge_section_properties): New class defintion.
8353 (Output_section::Merge_section_by_properties_map,
8354 Output_section::Output_section_data_by_input_section_map,
8355 Output_section::Relaxation_map): New types.
8356 (Output_section::relax_input_section): Rename method to
8357 Output_section::convert_input_sections_to_relaxed_sections and change
8358 interface to take a vector of relaxed section pointers.
8359 (Output_section::find_merge_section,
8360 Output_section::find_relaxed_input_section,
8361 Output_section::build_relaxation_map,
8362 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8363 New method declarations.
8364 (Output_section::merge_section_map_
8365 Output_section::merge_section_by_properties_map_,
8366 Output_section::relaxed_input_section_map_,
8367 Output_section::is_relaxed_input_section_map_valid_,
8368 Output_section::generate_code_fills_at_write_): New data members.
8369 * script-sections.cc
8370 (Output_section_element_input::set_section_addresses): Call
8371 current_data_size and addralign methods of relaxed input sections.
8372 (Orphan_output_section::set_section_addresses): Call current_data_size
8373 and addralign methods of relaxed input sections.
8374 * symtab.cc (Symbol_table::compute_final_value): Extract template
8375 from the body of Symbol_table::sized_finalize_symbol.
8376 (Symbol_table::sized_finalized_symbol): Call
8377 Symbol_table::compute_final_value.
8378 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8379 (Symbol_table::compute_final_value): New templated method declaration.
8380 * target.cc (Target::do_make_output_section): New method defintion.
8381 * target.h (Target::make_output_section): New method declaration.
8382 (Target::relax): Add more parameters for input objects, symbol table
8383 and layout. Adjust call to do_relax.
8384 (Target::do_make_output_section): New method declaration.
8385 (Target::do_relax): Add parameters for input objects, symbol table
8386 and layout.
8387
d446d6c4
ILT
83882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8389
8390 * pread.c: Include stdio.h.
8391
bc06c745
ILT
83922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8393
8394 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8395 defined.
8396
75aea3d0
ILT
83972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8398
8399 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8400 Change read_shndx type to unsigned int.
8401 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8402 int.
8403 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8404 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8405 Change read_shndx type to unsigned int.
8406 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8407 int.
8408 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8409 * layout.cc (Layout::create_symtab_sections): Cast the result of
8410 local_symcount * symsize to off_t in the gold_assert.
8411
be8fcb75
ILT
84122009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8413
8414 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8415 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8416 R_ARM_BASE_ABS.
8417 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8418 (Arm_relocate_functions::thm_abs5): New function.
8419 (Arm_relocate_functions::abs12): New function.
8420 (Arm_relocate_functions::abs16): New function.
8421 (Arm_relocate_functions::base_abs): New function.
8422 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8423 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8424 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8425 R_ARM_BASE_ABS.
8426 (Scan::global): Likewise.
8427 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8428 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8429 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8430 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8431 R_ARM_BASE_ABS.
8432
c2a122b6
ILT
84332009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8434
8435 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8436 (Arm_relocate_functions::movt_prel): New function.
8437 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8438 (Arm_relocate_functions::thm_movt_prel): New function.
8439 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8440 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8441 (Scan::global, Relocate::relocate): Likewise.
8442 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8443
c4aa1e2d
ILT
84442009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8445
8446 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8447 Incremental_checker.
8448 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8449 unsigned int.
8450 (class Incremental_inputs_header): New class.
8451 (Incremental_inputs_header_writer): Edit comment.
8452 (Incremental_inputs_entry): New class.
8453 (Incremental_inputs_entry_writer): Edit comment.
8454 (Sized_incremental_binary::do_find_incremental_inputs_section):
8455 Add *strtab_shndx parameter, fill it.
8456 (Sized_incremental_binary::do_check_inputs): New method.
8457 (Incremental_checker::can_incrementally_link_output_file): Use
8458 Sized_incremental_binary::check_inputs.
8459 (Incremental_inputs::report_command_line): Save command line in
8460 command_line_.
8461 * incremental.h:
8462 (Incremental_binary::find_incremental_inputs_section): New
8463 method.
8464 (Incremental_binary::do_find_incremental_inputs_section): Add
8465 strtab_shndx parameter.
8466 (Incremental_binary::do_check_inputs): New pure virtual method.
8467 (Sized_incremental_binary::do_check_inputs): Declare.
8468 (Incremental_checker::Incremental_checker): Add incremental_inputs
8469 parameter, use it to initialize incremental_inputs_.
8470 (Incremental_checker::incremental_inputs_): New field.
8471 (Incremental_checker::command_line): New method.
8472 (Incremental_checker::inputs): New method.
8473 (Incremental_checker::command_line_): New field.
8474
c549a694
ILT
84752009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8476
8477 * incremental.cc: Include <cstdarg> and "target-select.h".
8478 (vexplain_no_incremental): New function.
8479 (explain_no_incremental): New function.
8480 (Incremental_binary::error): New method.
8481 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8482 method.
8483 (make_sized_incremental_binary): New function.
8484 (open_incremental_binary): New function.
8485 (can_incrementally_link_file): Add checks if output is ELF and has
8486 inputs section.
8487 * incremental.h: Include "elfcpp_file.h" and "output.h".
8488 (Incremental_binary): New class.
8489 (Sized_incremental_binary): New class.
8490 (open_incremental_binary): Declare.
8491 * object.cc (is_elf_object): Use
8492 elfcpp::Elf_recognizer::is_elf_file.
8493 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8494 * output.h (Output_file::filesize): New method.
8495
fd3c5f0b
ILT
84962009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8497
8498 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8499 New function.
8500 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8501 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8502 function.
8503 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8504 function.
8505 (Arm_relocate_functions::movw_abs_nc): New function.
8506 (Arm_relocate_functions::movt_abs): New function.
8507 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8508 (Arm_relocate_functions::thm_movt_abs): New function.
8509 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8510 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8511 (Scan::global): Likewise.
8512 (Relocate::relocate): Likewise.
8513 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8514
7f5309a5
ILT
85152009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8516
8517 * arm.cc (Arm_relocate_functions::got_prel) New function.
8518 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8519 (Relocate::relocate): Likewise.
8520 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8521
364c7fa5
ILT
85222009-10-06 Ian Lance Taylor <iant@google.com>
8523
8524 * options.h (class General_options): Define
8525 split_stack_adjust_size parameter.
8526 * object.h (class Object): Add uses_split_stack_ and
8527 has_no_split_stack_ fields. Add uses_split_stack and
8528 has_no_split_stack accessor functions. Declare
8529 handle_split_stack_section.
8530 (class Reloc_symbol_changes): Define.
8531 (class Sized_relobj): Define Function_offsets. Declare
8532 split_stack_adjust, split_stack_adjust_reltype, and
8533 find_functions.
8534 * object.cc (Object::handle_split_stack_section): New function.
8535 (Sized_relobj::do_layout): Call handle_split_stack_section.
8536 * dynobj.cc (Sized_dynobj::do_layout): Call
8537 handle_split_stack_section.
8538 * reloc.cc (Sized_relobj::relocate_sections): Call
8539 split_stack_adjust for executable sections in split_stack
8540 objects. Pass reloc_map to relocate_section.
8541 (Sized_relobj::split_stack_adjust): New function.
8542 (Sized_relobj::split_stack_adjust_reltype): New function.
8543 (Sized_relobj::find_functions): New function.
8544 * target-reloc.h: Include "object.h".
8545 (relocate_section): Add reloc_symbol_changes parameter. Change
8546 all callers.
8547 * target.h (class Target): Add calls_non_split method. Declare
8548 do_calls_non_split virtual method. Declare match_view and
8549 set_view_to_nop.
8550 * target.cc: Include "elfcpp.h".
8551 (Target::do_calls_non_split): New function.
8552 (Target::match_view): New function.
8553 (Target::set_view_to_nop): New function.
8554 * gold.cc (queue_middle_tasks): Give an error if mixing
8555 split-stack and non-split-stack objects with -r.
8556 * i386.cc (Target_i386::relocate_section): Add
8557 reloc_symbol_changes parameter.
8558 (Target_i386::do_calls_non_split): New function.
8559 * x86_64.cc (Target_x86_64::relocate_section): Add
8560 reloc_symbol_changes parameter.
8561 (Target_x86_64::do_calls_non_split): New function.
8562 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8563 parameter.
8564 * powerpc.cc (Target_powerpc::relocate_section): Add
8565 reloc_symbol_changes parameter.
8566 * sparc.cc (Target_sparc::relocate_section): Add
8567 reloc_symbol_changes parameter.
8568 * configure.ac: Call AM_CONDITIONAL for the default target.
8569 * configure: Rebuild.
8570 * testsuite/Makefile.am (TEST_AS): New variable.
8571 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8572 (check_DATA): Add split_i386 and split_x86_64 files.
8573 (SPLIT_DEFSYMS): Define.
8574 (split_i386_[1234n].o): New targets.
8575 (split_i386_[124]): New targets.
8576 (split_i386_[1234r].stdout): New targets.
8577 (split_x86_64_[1234n].o): New targets.
8578 (split_x86_64_[124]): New targets.
8579 (split_x86_64_[1234r].stdout): New targets.
8580 (MOSTLYCLEANFILES): Add new executables.
8581 * testsuite/split_i386.sh: New file.
8582 * testsuite/split_x86_64.sh: New file.
8583 * testsuite/split_i386_1.s: New file.
8584 * testsuite/split_i386_2.s: New file.
8585 * testsuite/split_i386_3.s: New file.
8586 * testsuite/split_i386_4.s: New file.
8587 * testsuite/split_i386_n.s: New file.
8588 * testsuite/split_x86_64_1.s: New file.
8589 * testsuite/split_x86_64_2.s: New file.
8590 * testsuite/split_x86_64_3.s: New file.
8591 * testsuite/split_x86_64_4.s: New file.
8592 * testsuite/split_x86_64_n.s: New file.
8593 * testsuite/testfile.cc (Target_test): Update relocation_section
8594 function.
8595 * testsuite/Makefile.in: Rebuild.
8596
e8a9fcda
ILT
85972009-10-06 Ian Lance Taylor <iant@google.com>
8598
8599 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8600 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8601 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8602 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8603 the address on ldo_addrs_.
8604 (Target_i386::Relocate::fix_up_ldo): New function.
8605
e99daf92
ILT
86062009-10-06 Rafael Espindola <espindola@google.com>
8607
8608 * plugin.cc (add_input_library): New.
8609 (Plugin::load): Add add_input_library to tv.
8610 (Plugin_manager::add_input_file): Add the is_lib argument.
8611 (add_input_file): Update call to Plugin_manager::add_input_file.
8612 (add_input_library): New.
8613 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8614
966d4097
DK
86152009-09-30 Doug Kwan <dougkwan@google.com>
8616
8617 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8618 symbol and call Symbol::may_need_copy_reloc to determine if
8619 a copy reloc is needed.
8620 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8621 nocopyreloc is given in command line.
8622 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8623 given in command line.
8624 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8625 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8626 of the removed Target_i386::may_need_copy_reloc.
8627 * options.h (copyreloc): New option with default value false.
8628 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8629 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8630 instead of the removed Target_powerpc::may_need_copy_reloc.
8631 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8632 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8633 instead of the removed Target_sparc::may_need_copy_reloc.
8634 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8635 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8636 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8637 instead of the removed Target_x86_64::may_need_copy_reloc.
8638
029ba973
ILT
86392009-09-30 Ian Lance Taylor <iant@google.com>
8640
8641 * object.h (class Object): Remove target_ field, and target,
8642 sized_target, and set_target methods.
8643 (Object::sized_target): Remove.
8644 (class Sized_relobj): Update declarations. Remove sized_target.
8645 * object.cc (Sized_relobj::setup): Remove target parameter.
8646 Change all callers.
8647 (Input_objects::add_object): Don't do anything with the target.
8648 (make_elf_sized_object): Add punconfigured parameter. Change all
8649 callers. Set or test parameter target.
8650 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8651 Change all callers.
8652 * parameters.cc (Parameters::set_target): Change parameter type to
8653 be non-const.
8654 (Parameters::default_target): Remove.
8655 (set_parameters_target): Change parameter type to be non-const.
8656 (parameters_force_valid_target): New function.
8657 (parameters_clear_target): New function.
8658 * parameters.h (class Parameters): Update declarations. Remove
8659 default_target method. Add sized_target and clear_target
8660 methods. Change target_ to be non-const.
8661 (set_parameters_target): Update declaration.
8662 (parameters_force_valid_target): Declare.
8663 (parameters_clear_target): Declare.
8664 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8665 as NULL if we aren't searching.
8666 (Add_symbols::run): Don't check for compatible target.
8667 * fileread.cc (Input_file::open_binary): Call
8668 parameters_force_valid_target.
8669 * gold.cc (queue_middle_tasks): Likewise.
8670 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8671 set_target on object.
8672 * dynobj.h (class Sized_dynobj): Update declarations.
8673 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8674 make_elf_object returns NULL.
8675 (Archive::include_member): Don't check whether object target is
8676 compatible.
8677 * output.cc (Output_section::add_input_section): Get target from
8678 parameters.
8679 (Output_section::relax_input_section): Likewise.
8680 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8681 parameters.
8682 (Sized_relobj::do_scan_relocs): Likewise.
8683 (Sized_relobj::relocate_sections): Likewise.
8684 * resolve.cc (Symbol_table::resolve): Likewise.
8685 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8686 parameter. Change all callers.
8687 (Symbol_table::add_from_object): Get target from parameters.
8688 (Symbol_table::add_from_relobj): Don't check object target.
8689 (Symbol_table::add_from_dynobj): Likewise.
8690 (Symbol_table::define_special_symbol): Get target from
8691 parameters.
8692 * symtab.h (class Symbol_table): Update declaration.
8693 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8694 parameter. Change all callers. Clear parameter target.
8695 (Binary_test): Test target here.
8696 * testsuite/object_unittest.cc (gold_testsuite): Remove
8697 target_test_pointer parameter. Change all callers.
8698 (Object_test): Test target here.
8699
a6a22b83
ILT
87002009-09-26 Ian Lance Taylor <iant@google.com>
8701
8702 * testsuite/initpri1.c: Don't try to use constructor priorities if
8703 compiling with gcc before 4.3.
8704
6a8f49fe
ILT
87052009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8706
8707 * testsuite/retain_symbols_file_test.sh (check_present): Change
8708 output file name to retain_symbols_file_test.stdout.
8709 (check_absent): Likewise.
8710
8c604651
CS
87112009-09-18 Craig Silverstein <csilvers@google.com>
8712
8713 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8714 * options.cc: Include <cerrno> and <fstream>.
8715 (General_options::finalize): Parse -retain-symbols-file tag.
8716 * options.h: New flag.
8717 (General_options): New method should_retain_symbol, new
8718 variable symbols_to_retain.
8719 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8720 should_retain_symbol map.
8721 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8722 * testsuite/Makefile.in: Regenerate.
8723 * testsuite/retain_symbols_file_test.sh: New file.
8724
ca58b19f
NC
87252009-09-18 Nick Clifton <nickc@redhat.com>
8726
8727 * po/es.po: Updated Spanish translation.
8728
20e6d0d6
DK
87292009-09-17 Doug Kwan <dougkwan@google.com>
8730
8731 * debug.h (DEBUG_RELAXATION): New constant.
8732 (DEBUG_ALL): Add DEBUG_RELAXATION.
8733 (debug_string_to_enum): Add relaxation debug option.
8734 * layout.cc
8735 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8736 Layout::Relaxation_debug_check::read_sections,
8737 Layout::Relaxation_debug_check::read_sections): New method definitions.
8738 (Layout::Layout): Initialize data members
8739 record_output_section_data_from_scrips_,
8740 script_output_section_data_list_ and relaxation_debug_check_.
8741 (Layout::save_segments, Layout::restore_segments,
8742 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8743 Layout::relaxation_loop_body): New method definitions.
8744 (Layout::finalize): Support relaxation. Move section layout code to
8745 Layout::relaxation_loop_body.
8746 (Layout::set_asection_address_from_script): Move code for orphan
8747 section placement out.
8748 (Layout::place_orphan_sections_in_script): New method definition.
8749 * layout.h (Output_segment_headers, Output_file_header):
8750 New forward class declarations.
8751 (Layout::~Layout): Define.
8752 (Layout::new_output_section_data_from_script): New method definition.
8753 (Layout::place_orphan_sections_in_script): New method declaration.
8754 (Layout::Segment_states): New type declaration.
8755 (Layout::save_segments, Layout::restore_segments,
8756 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8757 Layout::relaxation_loop_body): New method declarations.
8758 (Layout::Output_section_data_list): New type declaration.
8759 (Layout::Relaxation_debug_check): New class definition.
8760 (Layout::record_output_section_data_from_script_,
8761 Layout::script_output_section_data_list_, Layout::segment_states_,
8762 Layout::relaxation_debug_check_): New data members.
8763 * output.cc: (Output_section_headers::do_size): New method definition.
8764 (Output_section_headers::Output_section_headers): Move size
8765 computation to Output_section_headers::do_size.
8766 (Output_segment_headers::do_size): New method definition.
e1df38aa 8767 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8768 Output_file_header::do_size and call it.
8769 (Output_file_header::do_size): New method definition.
8770 (Output_data_group::Output_data_group): Adjust call to
8771 Output_section_data.
8772 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8773 (Output_symtab_xindex::do_write): Add array bound check.
8774 (Output_section::Input_section::print_to_mapfile): Handle
8775 RELAXED_INPUT_SECTION_CODE.
8776 (Output_section::Output_section): Initialize data member checkpoint_.
8777 (Output_section::~Output_section): Delete checkpoint object pointed
8778 by checkpoint_.
8779 (Output_section::add_input_section): Always add an Input_section if
8780 relaxing.
8781 (Output_section::add_merge_input_section): Add assert.
8782 (Output_section::relax_input_section): New method definition.
8783 (Output_section::set_final_data_size): Set load address to zero for
8784 an unallocated section.
8785 (Output_section::do_address_and_file_offset_have_reset_values):
8786 New method definition.
8787 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8788 Handle relaxed input section.
8789 (Output_section::sort_attached_input_sections): Checkpoint input
8790 section list lazily.
8791 (Output_section::get_input_sections): Change type of input_sections to
8792 list of Simple_input_section pointers. Checkpoint input section list
8793 lazily. Also handle relaxed input sections.
8794 (Output_section::add_input_section_for_script): Take a reference to
8795 a Simple_input_section object instead of Relobj pointer and section
8796 index as parameter. Handle relaxed input sections.
8797 (Output_section::save_states, Output_section::restore_states): New
8798 method definitions.
8799 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8800 (Output_data::is_data_size_fixed): New method definition.
8801 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8802 if it is fixed.
8803 (Output_data::address_and_file_offset_have_reset_values): New method
8804 definition.
8805 (Output_data::do_address_and_file_offset_have_reset_values): New method
8806 definition.
8807 (Output_data::set_data_size): Check that data size is not fixed.
8808 (Output_data::fix_data_size): New method definition.
8809 (Output_data::is_data_size_fixed_): New data member.
8810 (Output_section_headers::set_final_data_size): New method definition.
8811 (Output_section_headers::do_size): New method declaration.
8812 (Output_segment_headers::set_final_data_size): New method definition.
8813 (Output_segment_headers::do_size): New method declaration.
8814 (Output_file_header::set_final_data_size)::New method definition.
8815 (Output_file_header::do_size)::New method declaration.
8816 (Output_section_data::Output_section_data): Add new parameter
8817 is_data_size_fixed and use it to fix data size.
8818 (Output_data_const::Output_data_const): Adjust call to base class
8819 constructor and fix data size.
8820 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8821 base class constructor and fix data size.
8822 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8823 base class constructor and fix data size.
8824 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8825 class constructor and fix data size.
8826 (Output_data_group::set_final_data_size): New method definition.
8827 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8828 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8829 class constructor and fix data size.
8830 (Output_relaxed_input_section): New class definition.
8831 (Output_section::Simple_input_section): New class definition.
8832 (Output_section::get_input_sections): Adjust parameter list.
8833 (Output_section::add_input_section_for_script): Same.
8834 (Output_section::save_states, Output_section::restore_states,
8835 Output_section::do_address_and_file_offset_have_reset_values,
8836 (Output_section::Input_section::Input_section): Handle
8837 RELAXED_INPUT_SECTION_CODE. Add new overload for
8838 Output_relaxed_input_section.
8839 (Output_section::Input_section::is_input_section,
8840 Output_section::Input_section::set_output_section): Handle relaxed
8841 input section.
8842 (Output_section::Input_section::is_relaxed_input_section,
8843 Output_section::Input_section::output_section_data,
8844 Output_section::Input_section::relaxed_input_section): New method
8845 definitions.
8846 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8847 value.
8848 (Output_section::Input_section::u1_): Update comments.
8849 (Output_section::Input_section::u2_): Add new union member poris.
8850 (Output_section::Checkpoint_output_section): New classs definition.
8851 (Output_section::relax_input_section): New method declaration.
8852 (Output_section::checkpoint_): New data member.
8853 (Output_segment): Update comments.
8854 (Output_segment::Output_segment): Un-privatize copy constructor.
8855 (Output_segment::operator=): Un-privatize.
8856 * script-sections.cc (Output_section_element::Input_section_list):
8857 Change element type to Output_section::Simple_input_section.
8858 (Output_section_element_dot_assignment::set_section_addresses):
8859 Register output section data for relaxation clean up.
8860 (Output_data_exression::Output_data_expression): Adjust call to base
8861 constructor to fix data size.
8862 (Output_section_element_data::set_section_addresses): Register
8863 Output_data_expression object for relaxation clean up.
8864 (struct Input_section_info): Replace Relobj pointer and section index
8865 pair with Output_section::Simple_input_section and Convert struct to a
8866 class.
8867 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8868 Input_section_info data member to use accessors.
20e6d0d6
DK
8869 (Output_section_element_input::set_section_addresses): Use layout
8870 parameter. Adjust code to use Output_section::Simple_input_section
8871 and Input_secction_info classes. Register filler for relaxation
8872 clean up.
8873 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8874 and section index pair with Output_section::Simple_input_section
8875 class. Adjust code accordingly.
8876 (Phdrs_element::release_segment): New method definition.
8877 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8878 segment list.
8879 (Script_sections::release_segments): New method definition.
8880 * gold/script-sections.h (Script_sections::release_segments): New
8881 method declaration.
8882 * gold/target.h (Target::may_relax, Target::relax,
8883 Target::do_may_relax, Target::do_relax): New method definitions.
8884
5e445df6
ILT
88852009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8886
8887 * arm.cc (has_signed_unsigned_overflow): New function.
8888 (Arm_relocate_functions::abs8): New function.
8889 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8890 (Target_arm::Scan::global): Likewise.
8891 (Target_arm::relocate::relocate): Likewise.
8892 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8893 Likewise.
8894
8c604651 88952009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8896
8897 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8898 * testsuite/Makefile.in: Regenerate.
8899
1e9cc1c2
NC
89002009-09-11 Nick Clifton <nickc@redhat.com>
8901
8902 * po/gold.pot: Updated by the Translation project.
8903
6a89f575
CC
89042009-09-08 Cary Coutant <ccoutant@google.com>
8905
8906 * output.cc (Output_file::open): Add execute permission to empty file.
8907 * testsuite/Makefile.am (permission_test): New test.
8908 * testsuite/Makefile.in: Regenerate.
8909
fdcac5af
ILT
89102009-09-02 Ian Lance Taylor <iant@google.com>
8911
8912 * output.cc (Output_file::resize): Call map_no_anonymous rather
8913 than map.
8914
44453f85
ILT
89152009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8916
8917 * gold.cc: Include "incremental.h".
8918 (queue_initial_tasks): Call Incremental_checker methods.
8919 * incremental.cc: Include "output.h".
8920 (Incremental_checker::can_incrementally_link_output_file): New
8921 method.
8922 * incremental.h (Incremental_checker): New class.
8923
8924 * output.cc (Output_file::open_for_modification): New method.
8925 (Output_file::map_anonymous): Changed return type to bool. Record
8926 map in base_ field.
8927 (Output_file::map_no_anonymous): New method, broken out of map.
8928 (Output_file::map): Use map_no_anonymous and map_anonymous.
8929 * output.h (class Output_file): Update declarations.
8930
293c1386
CC
89312009-08-24 Cary Coutant <ccoutant@google.com>
8932
8933 * options.h (Command_line::Pre_options): New class.
8934 (Command_line::pre_options): New member.
8935 * options.cc (gold::options::ready_to_register): New variable.
8936 (One_option::register_option): Do nothing if not registering options.
8937 Assert if same short option registered twice.
8938 (General_options::General_options): Turn off option registration when
8939 done constructing.
8940 (Command_line::Pre_options::Pre_options): New constructor.
8941
f773f3d2
CC
89422009-08-24 Cary Coutant <ccoutant@google.com>
8943
06a73cfe
CC
8944 * options.h (General_options::no_keep_memory): Remove incorrect
8945 short option.
f773f3d2 8946
a15af8e2
RW
89472009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8948
8949 * Makefile.am (am__skiplex, am__skipyacc): New.
8950 * Makefile.in: Regenerate.
8951
c462b41b
RW
89522009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8953
14ec8efd
RW
8954 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8955 (INCLUDES): ... this.
8956 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8957 (AM_CPPFLAGS): Renamed from ...
8958 (INCLUDE): ... this.
8959 * Makefile.in, testsuite/Makefile.in: Regenerate.
8960
81ecdfbb
RW
8961 * Makefile.in: Regenerate.
8962 * aclocal.m4: Likewise.
8963 * config.in: Likewise.
8964 * configure: Likewise.
8965 * testsuite/Makefile.in: Likewise.
8966
c462b41b
RW
8967 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8968 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8969 * Makefile.in: Regenerate.
8970 * testsuite/Makefile.in: Regenerate.
8971
2da73f13
CC
89722009-08-19 Cary Coutant <ccoutant@google.com>
8973
8974 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8975 symbols in shared libraries overridden by hidden or internal symbols
8976 in the main program.
8977
2db70501
CD
89782009-08-19 Chris Demetriou <cgd@google.com>
8979
8980 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8981 checking source file names in error messages.
8982
f733487b
DK
89832009-08-18 Doug Kwan <dougkwan@google.com>
8984
8985 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8986 an elcpp::Ehdr as parameter. Adjust call to set_target.
8987 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8988 an elfcpp::Ehdr as parameter.
8989 * object.cc (Object::set_target): Remove the version that looks up
8990 a target and sets it.
8991 (Sized_relobj::setup): Take a Target object instead of
8992 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8993 (make_elf_sized_object): Find target and ask target to
8994 make an ELF object.
8995 * object.h: (Object::set_target): Remove the version that looks up
8996 a target and sets it.
8997 (Sized_relobj::setup): Take a Target object instead of
8998 an elfcpp:Ehdr as parameter.
8999 * target.cc: Include dynobj.h.
9000 (Target::do_make_elf_object_implementation): New.
9001 (Target::do_make_elf_object): New.
9002 * target.h (Target::make_elf_object): New template declaration.
9003 (Target::do_make_elf_object): New method declarations.
9004 (Target::do_make_elf_object_implementation): New template declaration.
9005
cc70f101
ILT
90062009-08-14 Ian Lance Taylor <iant@google.com>
9007
9008 * gold.h (FUNCTION_NAME): Define.
9009 (gold_unreachable): Use FUNCTION_NAME.
9010
ef5e0cb1
ST
90112009-08-12 Sriraman Tallam <tmsriram@google.com>
9012
9013 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9014 symbol in the --keep-unique list is not found.
9015
48c187ce
ST
90162009-08-12 Sriraman Tallam <tmsriram@google.com>
9017
9018 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9019 been maked as --keep-unique.
9020 (Icf::unfold_section): New function.
9021 * icf.h (Icf::unfold_section): New function.
9022 * options.h (General_options::keep_unique): New option.
9023 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9024 * testsuite/Makefile.in: Regenerate.
9025 * testsuite/icf_keep_unique_test.sh: New file.
9026 * testsuite/icf_keep_unique_test.cc: New file.
9027
645afe0c
CC
90282009-08-12 Cary Coutant <ccoutant@google.com>
9029
9030 PR 10471
9031 * resolve.cc (Symbol_table::resolve): Check for references from
9032 dynamic objects to hidden and internal symbols.
9033 * testsuite/Makefile.am (hidden_test.sh): New test.
9034 * testsuite/Makefile.in: Regenerate.
9035 * testsuite/hidden_test.sh: New script.
9036 * testsuite/hidden_test_1.c: New test source.
9037 * testsuite/hidden_test_main.c: New test source.
9038
11af873f
DK
90392009-08-11 Doug Kwan <dougkwan@google.com>
9040
9041 * arm.cc: Update comments.
9042 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9043 segment to locate the .ARM.exidx section if present.
9044
b9f7d72d
DK
90452009-08-09 Doug Kwan <dougkwan@google.com>
9046
9047 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9048 patch.
9049
ddd3c53c
ST
90502009-08-07 Sriraman Tallam <tmsriram@google.com>
9051 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9052 compiler warnings.
9053
27721062
ST
90542009-08-06 Sriraman Tallam <tmsriram@google.com>
9055
9056 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9057 valid tls_segment only for non-debug-section relocations.
9058 * testsuite/Makefile.am: Add gc_tls_test.
9059 * testsuite/Makefile.in: Regenerate.
9060 * testsuite/gc_tls_test.cc: New file.
9061 * testsuite/gc_tls_test.sh: New file.
9062
ef15dade 90632009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9064
ef15dade
ST
9065 * icf.cc: New file.
9066 * icf.h: New file.
9067 * Makefile.am (CCFILES): Add icf.cc.
9068 (HFILES): Add icf.h
9069 * Makefile.in: Regenerate.
9070 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9071 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9072 section, symbol and addend information for the relocs.
9073 * gold.cc (queue_middle_tasks): Call identical code folding.
9074 * gold.h: Add defines for multimap.
9075 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9076 to the call of finalize_local_symbols.
9077 * main.cc (main): Create object of class Icf.
9078 * object.cc (Sized_relobj::do_layout): Allow this function to be
9079 called twice during icf.
9080 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9081 to sections marked as identical by icf.
9082 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9083 when available.
9084 (Sized_relobj::do_section_entsize): New function.
9085 * object.h (Object::section_entsize): New function.
9086 (Object::do_section_entsize): New pure virtual function.
9087 (Relobj::finalize_local_symbols): Add new parameter.
9088 (Relobj::do_section_entsize): New function.
9089 * options.h (General_options::icf): New option.
9090 (General_options::icf_iterations): New option.
9091 (General_options::print_icf_sections): New option.
9092 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9093 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9094 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9095 icf.
9096 * symtab.cc (Symbol_table::is_section_folded): New function.
9097 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9098 to sections marked as identical by icf.
9099 * symtab.h (Symbol_table::set_icf): New function.
9100 (Symbol_table::icf): New function.
9101 (Symbol_table::is_section_folded): New function.
9102 (Symbol_table::icf_): New data member.
9103 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9104 * testsuite/Makefile.am: Add commands to build icf_test.
9105 * testsuite/Makefile.in: Regenerate.
9106 * testsuite/icf_test.sh: New file.
9107 * testsuite/icf_test.cc: New file.
9108
c3b65ac4
CD
91092009-07-24 Chris Demetriou <cgd@google.com>
9110
9111 * layout.cc (is_compressible_debug_section): Fix incorrect
9112 comment about compressed section names.
9113
1caf2c51
ILT
91142009-07-20 Ian Lance Taylor <ian@airs.com>
9115
9116 PR 10419
9117 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9118
1ef4d87f
ILT
91192009-07-16 Ian Lance Taylor <iant@google.com>
9120
9121 PR 10400
9122 * layout.h: #include <map>.
9123 (class Kept_section): Change from struct to class. Add accessors
9124 and setters. Add section size to Comdat_group mapping. Change
9125 Comdat_group to std::map. Add is_comdat_ field. Add
9126 linkonce_size field in union.
9127 (class Layout): Update declaration of find_or_add_kept_section.
9128 Don't declare find_kept_object.
9129 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9130 parameter. Add object, shndx, is_comdat, and is_group_name
9131 parameters. Change all callers. Adjust for new Kept_section.
9132 (Layout::find_kept_object): Remove.
9133 * object.cc (Sized_relobj::include_section_group): Update use of
9134 Kept_section. Rename secnum to shndx. Only record
9135 Kept_comdat_section if sections are the same size.
9136 (Sized_relobj::include_linkonce_section): Update use of
9137 Kept_section. Only record Kept_comdat_section if sections are the
9138 same size. Set size of linkonce section.
9139 (Sized_relobj::map_to_kept_section): Update call to
9140 get_kept_comdat_section.
9141 * object.h (class Sized_relobj): Rename fields in
9142 Kept_comdat_section to drop trailing underscores; change object
9143 field to Relobj*. Change Kept_comdat_section_table to store
9144 struct rather than pointer.
9145 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9146 Add kept_object and kept_shndx parameters. Change all callers.
9147 (Sized_relobj::get_kept_comdat_section): Change return type to
9148 bool. Add kept_object and kept_shndx parameters. Change all
9149 callers.
9150 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9151 Layout::find_or_add_kept_section.
9152
37c3b7b0
ILT
91532009-07-09 Ian Lance Taylor <iant@google.com>
9154
9155 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9156 Reserve space in the hash table.
9157
98fa85cb
ILT
91582009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9159
9160 * fileread.cc (File_read::get_mtime): New method.
9161 * fileread.h (Timespec): New structure.
9162 (File_read::get_mtime): New method.
9163 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9164 Renamed from timestamp_nsec.
9165 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9166 Elf_Xword.
e1df38aa 9167 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9168 timestamp_nsec.
e1df38aa 9169 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9170 (Incremental_inputs::report_obejct): Save mtime; style fix.
9171 (Incremental_inputs::report_script): Save mtime; style fix.
9172 (Incremental_inputs::finalize_inputs): Style fix.
9173 (Incremental_inputs::finalize): Style fix.
9174 (Incremental_inputs::create_input_section_data): Store inputs
9175 mtime.
9176 * incremental.h (Incremental_inputs::report_script): Add mtime
9177 argument.
9178 (Incremental_inputs::Input_info::Input_info): Intialize only one
9179 union member.
9180 (Incremental_inputs::Input_info::archive): Move to nameless
9181 union.
9182 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9183 (Incremental_inputs::Input_info::script): Move to nameless union.
9184 (Incremental_inputs::mtime): New field.
9185 * script.cc (read_input_script): Pass file mtime to
9186 Incremental_input.
9187 * script.h (Script_info::inputs): Style fix.
9188
c9d70757
ILT
91892009-07-01 Ian Lance Taylor <ian@airs.com>
9190
9191 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9192 instead of 32.
9193
9c547ec3
ILT
91942009-06-24 Ian Lance Taylor <iant@google.com>
9195
9196 PR 10156
9197 * layout.cc (Layout::choose_output_section): If we find an
9198 existing section, update the flags.
9199 (Layout::create_notes): New function, broken out of
9200 Layout::finalize.
9201 (Layout::finalize): Don't create note sections.
9202 (Layout::create_note): Don't crash if linker script discards
9203 section.
9204 (Layout::create_gold_note): Likewise.
9205 (Layout::create_build_id): Likewise. Don't set
9206 after_input_sections on the section.
9207 (Layout::create_executable_stack_info): Remove target parameter.
9208 Change caller.
9209 * layout.h (class Layout): Declare create_notes. Update
9210 declaration of create_executable_stack_info.
9211 * gold.cc (queue_middle_tasks): Call create_notes.
9212 * output.cc (Output_section::update_flags_for_input_section): Move
9213 here from output.h. If SHF_ALLOC flag is newly set, mark address
9214 invalid.
9215 * output.h (Output_data::mark_address_invalid): New function.
9216 (class Output_section): Only declare, not define,
9217 update_flags_for_input_section. Remove set_flags.
9218
55458500
ILT
92192009-06-24 Ian Lance Taylor <iant@google.com>
9220
9221 * script-sections.cc (Output_section_definition::
9222 set_section_addresses): Rename shadowing local load_address to
9223 laddr.
9224
1307d6cd
ILT
92252009-06-24 Ian Lance Taylor <iant@google.com>
9226
9227 PR 10244
9228 * reloc.cc (relocate_sections): Skip empty relocation sections.
9229
ec3f783e
ILT
92302009-06-23 Ian Lance Taylor <iant@google.com>
9231
9232 PR 10156
9233 * layout.cc (Layout::create_note): Use choose_output_section
9234 rather than make_output_section.
9235
459c9f1c
ILT
92362009-06-23 Ian Lance Taylor <iant@google.com>
9237
9238 PR 10237
9239 * options.cc (General_options::parse_V): Set printed_version_.
9240 (General_options::General_options): Initialize printed_version_.
9241 * options.h (class General_options): Add printed_version_ field.
9242 * gold.cc (queue_initial_tasks): If there are no input files,
9243 don't give a fatal error if we printed the version information.
9244 (queue_middle_tasks): If using -r with a shared object, give a
9245 fatal error rather than an ordinary error.
9246
1518dc8f
ILT
92472009-06-23 Ian Lance Taylor <iant@google.com>
9248
9249 PR 10219
9250 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9251 (Layout::make_output_section): Set have_stabstr_section_ if we see
9252 a .stab*str section.
9253 (Layout::finalize): Call link_stabs_sections.
9254 (Layout::link_stabs_sections): New file.
9255 * layout.h (class Layout): Add have_stabstr_section_ field.
9256 Declare link_stabs_sections.
9257
3d857b98
DK
92582009-06-23 Doug Kwan <dougkwan@google.com>
9259
9260 * Makefile.am (libgold_a_LIBADD): New.
9261 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9262 * Makefile.in: Regenerate.
9263 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9264 * configure: Regenerate.
9265 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9266 * fileread.cc: Include sys/state.h
9267 * gold.h: Declare memmem and strndup if found missing.
9268 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9269
0639a6f6
ILT
92702009-06-23 Ian Lance Taylor <iant@google.com>
9271
9272 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9273 * configure: Rebuild.
9274
8d63875c
ILT
92752009-06-23 Ian Lance Taylor <iant@google.com>
9276
9277 PR 10147
9278 * object.cc (Object::section_contents): Don't try to get a view if
9279 the section has length zero.
9280 (Object::handle_gnu_warning_section): If the section is empty, use
9281 the name of the section as the warning.
9282
f7c8a183
ILT
92832009-06-23 Ian Lance Taylor <iant@google.com>
9284
9285 PR 10133
9286 * stringpool.h (class Stringpool_template): Add optimize_ field.
9287 (Stringpool_template::set_optimize): New function.
9288 * stringpool.cc (Stringpool_template::Stringpool_template):
9289 Initialize optimize_ field.
9290 (Stringpool_template::set_string_offsets): Test local optimize
9291 fild rather than parameter.
9292 * layout.cc (Layout::Layout): Call set_optimize on the section
9293 name stringpool.
9294
e6a307ba
ILT
92952009-06-22 Ian Lance Taylor <iant@google.com>
9296
9297 PR 10030
9298 * yyscript.y: Parse TARGET.
9299 * script.cc (script_set_target): New function.
9300 * script-c.h (script_set_target): Declare.
9301 * options.cc (General_options::string_to_object_format): Rename
9302 from string_to_object_format in anonymous namespace. Change
9303 callers.
9304 * options.h (class General_options): Declare
9305 string_to_object_format.
9306
3ee173de
ILT
93072009-06-22 Ian Lance Taylor <iant@google.com>
9308
9309 * script-sections.cc (Script_sections::create_segments): Don't put
9310 program headers in a PT_LOAD segment if -n or -N.
9311
93122009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9313
9314 PR 10141
9315 * options.h (class General_options): Add -z lazy and -z now. Sort
9316 -z options into alphabetical order.
9317 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9318
cd6739a1 93192009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9320
9321 * layout.cc (Layout::make_output_section): Call
9322 Target::new_output_section.
9323 (Layout::attach_allocated_section_to_segment): Put large section
9324 sections in a separate load segment with the large segment flag
9325 set.
9326 (Layout::segment_precedes): Sort large data segments after other
9327 load segments.
9328 (align_file_offset): New static function.
9329 (Layout::set_segment_offsets): Use align_file_offset.
9330 * output.h (class Output_section): Add is_small_section_ and
9331 is_large_section_ fields.
9332 (Output_section::is_small_section): New function.
9333 (Output_section::set_is_small_section): New function.
9334 (Output_section::is_large_section): New function.
9335 (Output_section::set_is_large_section): New function.
9336 (Output_section::is_large_data_section): New function.
9337 (class Output_segment): Add is_large_data_segment_ field.
9338 (Output_segment::is_large_data_segment): New function.
9339 (Output_segment::set_is_large_data_segment): New function.
9340 * output.cc (Output_section::Output_section): Initialize new
9341 fields.
9342 (Output_segment::Output_segment): Likewise.
9343 (Output_segment::add_output_section): Add assertion that large
9344 data sections always go in large data segments. Force small data
9345 sections to the end of the list of data sections. Force small BSS
9346 sections to the start of the list of BSS sections. For large BSS
9347 sections to the end of the list of BSS sections.
9348 * symtab.h (class Symbol): Declare is_common_shndx.
9349 (Symbol::is_defined): Check Symbol::is_common_shndx.
9350 (Symbol::is_common): Likewise.
9351 (class Symbol_table): Define enum Commons_section_type. Update
9352 declarations. Add small_commons_ and large_commons_ fields.
9353 * symtab.cc (Symbol::is_common_shndx): New function.
9354 (Symbol_table::Symbol_table): Initialize new fields.
9355 (Symbol_table::add_from_object): Put small and large common
9356 symbols in the right list.
9357 (Symbol_table::sized_finalized_symbol): Check
9358 Symbol::is_common_shndx.
9359 (Symbol_table::sized_write_globals): Likewise.
9360 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9361 common symbol lists. Don't call do_allocate_commons_list if the
9362 list is empty.
9363 (Symbol_table::do_allocate_commons_list): Remove is_tls
9364 parameter. Add comons_section_type parameter. Change all
9365 callers. Handle small and large common symbols.
9366 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9367 Symbol::is_common_shndx.
9368 * resolve.cc (symbol_to_bits): Likewise.
9369 * target.h (Target::small_common_shndx): New function.
9370 (Target::small_common_section_flags): New function.
9371 (Target::large_common_shndx): New function.
9372 (Target::large_common_section_flags): New function.
9373 (Target::new_output_section): New function.
9374 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9375 small_common_section_flags, and large_common_section_flags
9376 fields.
9377 (Target::do_new_output_section): New virtual function.
9378 * arm.cc (Target_arm::arm_info): Initialize new fields.
9379 * i386.cc (Target_i386::i386_info): Likewise.
9380 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9381 Likewise.
9382 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9383 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9384 (Target_x86_64::do_new_output_section): New function.
9385 * configure.ac: Define conditional MCMODEL_MEDIUM.
9386 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9387 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9388 (large_LDFLAGS): Define.
9389 * testsuite/large.c: New file.
9390 * testsuite/testfile.cc (Target_test::test_target_info):
9391 Initialize new fields.
9392 * configure, testsuite/Makefile.in: Rebuild.
9393
bb04269c
DK
93942009-06-05 Doug Kwan <dougkwan@google.com>
9395
9396 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9397 * Makefile.in: Regenerate.
bb04269c
DK
9398 * i386.cc (class Target_i386): Define new virtual method to
9399 override do_is_local_label_name in parent.
9400 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9401 local symbols if --discard-locals or -X is given.
9402 * options.h (class General_options): Declare new options
9403 '--discard-locals' and '-X' for discarding locals.
9404 * target.h (class Target): Define new methods is_local_label_name.
9405 Declare new virtual method do_is_local_label_name.
9406 * target.cc: New file.
9407 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9408 (check_SCRIPTS): Add discard_locals_test.sh.
9409 (check_DATA): Add discard_local_tests.syms.
9410 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9411 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9412 * testsuite/Makefile.in: Regenerate.
9413 * testsuite/discard_locals_test.c: New file.
9414 * testsuite/discard_locals_test.sh: Same.
9415
805bb01c
DK
94162009-06-05 Doug Kwan <dougkwan@google.com>
9417
9418 * object.cc (Sized_relobj::Sized_relobj): Initialize
9419 discarded_eh_frame_shndx_ to -1U.
9420 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9421 section.
9422 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9423 a discarded .eh_frame section.
9424 (Sized_relobj::do_finalize_local_symbols): Ditto.
9425 * object.h (class Sized_relobj): Declare new member
9426 discarded_eh_frame_shndx_.
9427 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9428 (local_labels_test.o, local_labels_test): New rules.
9429 * testsuite/Makefile.in: Regenerate.
9430
1dcd334d
DK
94312009-06-04 Doug Kwan <dougkwan@google.com>
9432
9433 * layout.cc (Layout::section_name_mapping): Add mapping for
9434 special ARM sections.
9435
96d49306
DK
94362009-06-03 Doug Kwan <dougkwan@google.com>
9437
9438 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9439 (utils::has_overflow): Same.
9440
dff16297
ILT
94412009-06-03 Ian Lance Taylor <iant@google.com>
9442
9443 * layout.cc (Layout::section_name_mapping): New array, replacing
9444 Layout::linkonce_mapping.
9445 (Layout::section_name_mapping_count): New variable, replacing
9446 Layout::linkonce_mapping_count.
9447 (Layout::linkonce_output_name): Remove.
9448 (Layout::output_section_name): Rewrite.
9449 * layout.h (class Layout): Rename Linkonce_mapping to
9450 Section_name_mapping, linkonce_mapping to section_name_mapping,
9451 linkonce_mapping_count to section_name_mapping_count. Don't
9452 declare linkonce_output_name.
9453
c121c671
DK
94542009-06-03 Doug Kwan <dougkwan@google.com>
9455
9456 * gold/arm.cc (namespace utils): New.
9457 (Target_arm::reloc_is_non_pic): Define new method.
9458 (class Arm_relocate_functions): New.
9459 (Target_arm::Relocate::relocate): Handle relocation types used by
9460 Android.
9461
07800fab
ILT
94622009-06-03 Ian Lance Taylor <iant@google.com>
9463
9464 * arm.cc (Target_arm::scan::global): Use || instead of |.
9465
c121c671
DK
94662009-06-02 Doug Kwan <dougkwan@google.com>
9467
9468 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9469 issued_non_pic_error_.
9470 (class Target_arm::Scan): Declare new method check_non_pic.
9471 Define new method symbol_needs_plt_entry.
9472 Declare new data member issued_non_pic_error_.
9473 (class Target_arm::Relocate): Declare new method
9474 should_apply_static_reloc.
9475 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9476 (Target_arm::Scan::check_non_pic): Define new method.
9477 (Target_arm::Scan::local): Handle a small subset of reloc types used
9478 by Android.
9479 (Target_arm::Scan::local): Same.
9480 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9481
b19b0c6d
ILT
94822009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9483
9484 * incremental.cc (Incremental_inputs::report_command_line): Filter
9485 out --incremental-* options.
9486
94cdfcff
DK
94872009-05-29 Doug Kwan <dougkwan@google.com>
9488
9489 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9490 template class.
9491 (class Target_arm): Update comment.
9492 (Target_arm::Target_arm): Initialize new data members GOT_,
9493 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9494 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9495 and Target_arm::rel_dyn_section.
9496 Declare new_enum Target_arm::Got_type.
9497 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9498 and DYNBSS_.
9499 Update commments for member do_dynsym_value.
9500 (Target_arm::got_size, Target_arm::plt_section,
9501 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9502 new methods inside class defintion.
9503 (Target_arm::got_section): Define new method.
9504 (Target_arm::rel_dyn_section): Same.
9505 (Output_data_plt_arm): New template class.
9506 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9507 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9508 (Output_data_plt_arm::add_entry): Same.
9509 (Output_data_plt_arm::first_plt_entry): Define new
9510 static data member for PLT instruction template.
9511 (Output_data_plt_arm::plt_entry): Same.
9512 (Output_data_plt_arm::do_write): Define new method.
9513 (Target_arm::make_plt_entry): Same.
9514 (Target_arm::do_finalize_sections): Same.
9515 (Target_arm::do_dynsym_value): Same.
9516
4a657b0d
DK
95172009-05-28 Doug Kwan <dougkwan@google.com>
9518
9519 * Makefile.am (TARGETSOURCES): Add arm.cc.
9520 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9521 * Makefile.in: Regenerate.
9522 * arm.cc: New file.
9523 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9524
e7ae8c36
DK
95252009-05-26 Doug Kwan <dougkwan@google.com>
9526
9527 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9528 (General_options::check_excluded_libs): Strip off directories in
9529 archive name before matching like GNU ld does.
9530 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9531 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9532 (exclude_libs_test_LDFLAGS): Add linker option
9533 -Wl,--exclude-libs,libexclude_libs_test_3
9534 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9535 an explicit archive without using -l.
9536 (alt/libexclude_libs_test_3.a): New make rule.
9537 * testsuite/Makefile.in: Regenerate.
9538 * testsuite/exclude_libs_test.c : Declare lib3_default().
9539 (main): Call it.
9540 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9541 * exclude_libs_test_3.c: New file.
9542
f12e7348
NC
95432009-05-26 Nick Clifton <nickc@redhat.com>
9544
9545 * po/id.po: New Indonesian translation.
9546 * po/gold.pot: Updated template file.
9547
4daadc0d
ST
95482009-05-22 Sriraman Tallam <tmsriram@google.com>
9549
e1df38aa 9550 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9551 gc_comdat_test files. Add -Wl,--gc-sections to build
9552 gc_comdat_test.
9553 * testsuite/Makefile.in: Regenerate.
9554 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9555
531813ad
ST
95562009-05-21 Sriraman Tallam <tmsriram@google.com>
9557
9558 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9559 kept comdat section was garbage collected.
9560 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9561 * testsuite/Makefile.in: Regenerate.
9562 * testsuite/gc_comdat_test.sh: New file.
9563 * testsuite/gc_comdat_test_1.cc: New file.
9564 * testsuite/gc_comdat_test_2.cc: New file.
9565
65514900
CC
95662009-05-19 Doug Kwan <dougkwan@google.com>
9567
9568 * archive.cc (Archive::Archive): Move constructor from archive.h
9569 to here. Initialize no_export_.
9570 (Archive::get_elf_object_for_member): Set no_export flag of object.
9571 * archive.h (Archive::Archive): Move constructor body to
9572 archive.cc.
9573 (Archive::no_export): New method.
9574 (Archive::no_export_): New field.
9575 * object.h (Object::Object): Initialize no_export_ to false.
9576 (Object::no_export, Object::set_no_export): New methods.
9577 (Object::no_export_): New field.
9578 * options.cc (General_options::parse_exclude_libs): New method.
9579 (General_options::check_excluded_libs) Same.
9580 * options.h (exclude_libs): New option.
9581 (General_options::check_excluded_libs): New method declaration.
9582 (General_options::excluded_libs_): New field.
9583 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9584 default or protected visibility if an object has no-export flag set.
9585 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9586 (check_SCRIPTS): Add exclude_libs_test.sh.
9587 (check_DATA): Add exclude_libs_test.syms.
9588 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9589 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9590 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9591 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9592 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9593 libexclude_libs_test_2.a): New rules.
9594 * testsuite/Makefile.in: Regenerate.
9595 * testsuite/exclude_libs_test.c: New file.
9596 * testsuite/exclude_libs_test.sh: Ditto.
9597 * testsuite/exclude_libs_test_1.c: Ditto.
9598 * testsuite/exclude_libs_test_2.c: Ditto.
9599
1b77ea50
ILT
96002009-05-15 Ian Lance Taylor <iant@google.com>
9601
9602 * configure.ac: Check for declarations for cases where libiberty.h
9603 checks HAVE_DECL_xxx.
9604 * configure, config.in: Rebuild.
9605
072fe7ce
ILT
96062009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9607
9608 * gold.h (Incremental_argument_list): Remove (invalid) forward
9609 declaration.
9610 * incremental.cc (Incremental_inputs::report_achive): New method.
9611 (Incremental_inputs::report_object): New method.
9612 (Incremental_inputs::report_script): New method.
9613 (Incremental_inputs::finalize_inputs): New method.
9614 (Incremental_inputs::finalize): Call finalize_inputs().
9615 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9616 Create inputs entries.
9617 * incremental.h (Incremental_input_type): New enum.
9618 (Incremental_inputs::Incremental_input): Initialize new fields.
9619 (Incremental_inputs::report_inputs): New method.
9620 (Incremental_inputs::report_achive): New method.
9621 (Incremental_inputs::report_object): New method.
9622 (Incremental_inputs::report_script): New method.
9623 (Incremental_inputs::finalize_inputs): New method.
9624 (Incremental_inputs::Input_info): New struct.
9625 (Incremental_inputs::Input_info_map): New typedef.
9626 (Incremental_inputs::lock_): New field.
9627 (Incremental_inputs::Inputs_): New field.
9628 (Incremental_inputs::Inputs_map): New field.
9629 * main.cc (main): Call Incremental_input::report_inputs.
9630 * options.h (Input_argument_list): Typedef moved from
9631 Input_arguments.
9632 (Input_file_group::Files): Remove, use ::Input_argument_list.
9633 (Input_file_group::Input_argument_list): Remove, use
9634 ::Input_argument_list.
9635 * plugin.cc (Plugin_manager::add_input_file): Add error in
9636 incremental build.
9637 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9638 functions.
9639 * script.cc (read_input_script): Call
9640 Incremental_input::report_script.
9641 * script.h (Script_info): New class.
9642
b0481b0b
ILT
96432009-04-27 Ian Lance Taylor <iant@google.com>
9644
9645 * x86_64.cc (do_adjust_output_section): Set entsize to
9646 plt_entry_size.
9647
b22a5a41 96482009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
9649
9650 * output.cc (Output_file::close): After short writes, continue
9651 writing from the correct offset in the buffer being written.
9652
40fde488
CD
96532009-04-23 Chris Demetriou <cgd@google.com>
9654
9655 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9656 * configure: Regenerate.
9657 * config.in: Regenerate.
9658 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9659 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9660
3ce2c28e
ILT
96612009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9662
9663 * incremental.cc (Incremental_inputs_header_data): Renamed from
9664 Incremental_input_header_data.
9665 (Incremental_inputs_header_data::data_size): New field.
9666 (Incremental_inputs_header_data::put_input_file_count): Renamed
9667 from input_file_count.
9668 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9669 from command_line_offset.
9670 (Incremental_inputs_header_data::put_reserved): Renamed from
9671 put_reserved.
9672 (Incremental_inputs_entry_data): Renamed from
9673 Incremental_input_entry_data.
9674 (Incremental_inputs_entry_data::data_size): New field.
9675 (Incremental_inputs::report_command_line): New method.
9676 (Incremental_inputs::finalize): New method.
9677 (Incremental_inputs::create_incremental_inputs_data): New method.
9678 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9679 * incremental.h: New file.
9680 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9681 (Layout::finalize): Create incremental inputs section in
9682 incremental builds.
9683 (Layout::create_incremental_info_sections): New method.
9684 * layout.h (Layout::incremental_inputs): New method.
9685 (Layout::create_incremental_info_sections): New method.
9686 (Layout::incremental_inputs_): New field.
9687 * main.cc (main): Notify Incremental_input of the command line.
9688
e55bde5e
ILT
96892009-04-01 Ian Lance Taylor <iant@google.com>
9690 Mikolaj Zalewski <mikolajz@google.com>
9691
9692 * gold.h (reserve_unordered_map): Define, three versions, one for
9693 each version of Unordered_map.
9694 * layout.cc (Layout::Layout): Remove options parameter. Add
9695 number_of_input_files parameter. Don't initialize options_.
9696 Initialize number_of_input_files_ and resized_signatures_. Move
9697 sections_are_attached_.
9698 (Layout::layout_group): Reserve space for group_signatures_.
9699 (Layout::find_or_add_kept_section): Change name parameter to be a
9700 reference. Resize signatures_ map when it gets large enough.
9701 (Layout::layout_eh_frame): Use parameters->options() instead of
9702 this->options_.
9703 (Layout::make_output_section): Likewise.
9704 (Layout::attach_allocated_section_to_segment): Likewise.
9705 (Layout::finalize, Layout::create_executable_stack): Likewise.
9706 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9707 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9708 * layout.h (class Layout): Update declarations. Remove options_
9709 field. Add number_of_input_files_ and resized_signatures_
9710 fields. Move sections_are_attached_ field.
9711 * main.cc (main): Pass number of input files to Layout
9712 constructor. Don't pass options.
9713
154b857c
ILT
97142009-03-30 Ian Lance Taylor <iant@google.com>
9715
9716 * ffsll.c (ffsll): Correct implementation.
9717
2f35ab9b
ILT
97182009-03-27 Ian Lance Taylor <iant@google.com>
9719
fd03461a
ILT
9720 * ffsll.c: New file.
9721 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9722 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9723 * ftruncate.c (ftruncate): Declare before definition.
9724 * mremap.c (mremap): Likewise.
9725 * pread.c (pread): Likewise.
9726 * configure, Makefile.in, config.in: Rebuild.
9727
2f35ab9b
ILT
9728 * mremap.c: New file.
9729 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9730 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9731 (mremap): Declare if HAVE_MREMAP is not defined.
9732 * configure, Makefile.in, config.in: Rebuild.
9733
33aea2fd
CC
97342009-03-27 Cary Coutant <ccoutant@google.com>
9735
9736 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9737 position independent.
9738 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9739 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9740
6d479619
CC
97412009-03-24 Cary Coutant <ccoutant@google.com>
9742
9743 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9744 an executable.
9745 (needs_dynamic_reloc): Likewise.
9746
afc06bb8
ILT
97472009-03-24 Ian Lance Taylor <iant@google.com>
9748
9749 * yyscript.y (file_cmd): Recognize EXTERN.
9750 (extern_name_list, extern_name_list_body): New nonterminals.
9751 * script.cc (script_add_extern): Define.
9752 * script-c.h (script_add_extern): Declare.
9753
f6060a4d
ILT
97542009-03-24 Rafael Avila de Espindola <espindola@google.com>
9755
9756 * object.cc (is_elf_object): Define.
9757 * object.h (is_elf_object): Declare.
9758 * archive.cc (Archive::get_elf_object_for_member): Call
9759 is_elf_object.
33aea2fd 9760 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9761
26736d8e
ILT
97622009-03-24 Elliott Hughes <enh@google.com>
9763
9764 * output.cc (Output_file::map_anonymous): Define.
9765 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9766 try an anonymous one. Report the size if the mmap fails.
9767 * output.h (class Output_file): Declare map_anonymous.
9768
22fd9730
ILT
97692009-03-24 Ian Lance Taylor <iant@google.com>
9770
9771 * target-select.cc (instantiate_target): Don't acquire the lock if
9772 the instantiated_target_ field has already been set.
9773
cb010894
ILT
97742009-03-23 Ian Lance Taylor <iant@google.com>
9775
7f055c20
ILT
9776 * gold-threads.h (class Initialize_lock): Define.
9777 * gold-threads.cc (class Initialize_lock_once): Define.
9778 (initialize_lock_control): New static variable.
9779 (initialize_lock_pointer): New static variable.
9780 (initialize_lock_once): New static function.
9781 (Initialize_lock::Initialize_lock): Define.
9782 (Initialize_lock::initialize): Define.
9783 * target-select.h: Include "gold-threads.h".
9784 (class Target_selector): Add lock_ and initialize_lock_ fields.
9785 Don't define instantiate_target, just declare it.
9786 * target-select.cc (Target_selector::Target_selector): Initialize
9787 new fields.
9788 (Target_selector::instantiate_target): Define.
9789 * descriptors.h: Include "gold-threads.h".
9790 (class Descriptors): Add initialize_lock_ field.
9791 * descriptors.cc (Descriptors::Descriptors): Initialize new
9792 field.
9793 (Descriptors::open): Use initialize_lock_ field
9794 * errors.h (class Errors): Add initialize_lock_ field.
9795 * errors.cc (Errors::Errors): Initialize new field.
9796 (Errors::initialize_lock): Use initialize_lock_ field.
9797 * powerpc.cc (class Target_selector_powerpc): Remove
9798 instantiated_target_ field. In do_recognize call
9799 instantiate_target rather than do_instantiate_target. In
9800 do_instantiate_target just allocate a new target.
9801 * sparc.cc (class Target_selector_sparc): Likewise.
9802
36959681
ILT
9803 * freebsd.h: New file.
9804 * i386.cc: Include "freebsd.h".
9805 (Target_i386): Derive from Target_freebsd rather than
9806 Sized_target.
9807 (Target_selector_i386): Derive from Target_selector_freebsd rather
9808 than Target_selector.
9809 * x86_64.cc: Include "freebsd.h".
9810 (Target_x86_64): Derive from Target_freebsd rather than
9811 Sized_target.
9812 (Target_selector_x86_64): Derive from Target_selector_freebsd
9813 rather than Target_selector.
9814 * target.h (class Target): Add adjust_elf_header and
9815 do_adjust_elf_header.
9816 * output.cc (Output_file_header:: do_sized_write): Call target
9817 adjust_elf_header routine.
9818 * configure.tgt: Set targ_osabi.
9819 * configure.ac: Define GOLD_DEFAULT_OSABI.
9820 * parameters.cc (Parameters::default_target): Pass
9821 GOLD_DEFAULT_OSABI to select_target.
9822 * target-select.h (class Target_selector): Make instantiate_target
9823 protected rather than private.
9824 * Makefile.am (HFILES): Add freebsd.h.
9825 * configure, Makefile.in, config.in: Rebuild.
9826
cb010894
ILT
9827 * merge.cc (do_add_input_section): Correct pend value. Change
9828 message about last entry not being null terminated from error to
9829 warning.
9830
0e879927
ILT
98312009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9832
9833 * incremental.cc: New file.
9834 * Makefile.am (CCFILES): Add incremental.cc.
9835 * Makefile.in: Rebuild.
9836
41105937
PP
98372009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9838
9839 * layout.cc (Layout::output_section_name): Preserve names
9840 of '.note.' sections.
e1df38aa 9841
60439920
ILT
98422009-03-19 Ian Lance Taylor <iant@google.com>
9843
9844 * descriptors.cc (Descriptors::open): Check that the options are
9845 valid before using them.
9846
0d371ad3
ILT
98472009-03-18 Ian Lance Taylor <iant@google.com>
9848
9849 * script-sections.h: Include <list>.
9850 (class Script_sections): Change Sections_elements from std::vector
9851 to std::list. Typedef public Elements_iterator. Add
9852 orphan_section_placement_, data_segment_align_start_, and
9853 saw_data_segment_align_ fields. Remove data_segment_align_index_
9854 field.
9855 * script-sections.cc (class Orphan_section_placement): New class.
9856 (class Sections_element): Add virtual functions is_relro and
9857 orphan_section_init. Remove virtual function place_orphan_here.
9858 (class Output_section_definition): Add is_relro and
9859 orphan_section_init. Remove place_orphan_here.
9860 (class Orphan_output_section): Likewise.
9861 (Script_sections::Script_sections): Update for field changes.
9862 (Script_sections::data_segment_align): Set saw_data_segment_align_
9863 and data_segment_align_start_, not data_segment_align_index.
9864 (Script_sections::data_segment_relro_end): Check
9865 saw_data_segment_align_. Use data_segment_align_start_ rather
9866 than data_segment_align_index_.
9867 (Script_sections::place_orphan): Rewrite to use
9868 Orphan_section_placement.
9869
9201d894
ILT
98702009-03-17 Ian Lance Taylor <iant@google.com>
9871
9c5b8369
ILT
9872 * archive.cc (Archive::add_symbols): Check for a version attached
9873 to the symbol name in the archive map.
9874 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9875 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9876 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9877 (ver_test_11.a): New target.
9878 * testsuite/Makefile.in: Rebuild.
9879
9201d894
ILT
9880 * configure.ac: Check for chsize and posix_fallocate. Replace
9881 ftruncate.
9882 * ftruncate.c: New file, from gnulib.
9883 * output.cc (posix_fallocate): Define dummy version if not
9884 HAVE_POSIX_FALLOCATE.
9885 (Output_file::map): Call posix_fallocate rather than lseek and
9886 write.
9887 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9888 * configure, Makefile.in, config.in: Rebuild.
9889
ef4ab7a8 98902009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9891
ef4ab7a8
PP
9892 * layout.h (Layout::create_note): Add section_name parameter.
9893 * layout.cc (Layout::create_note): Likewise.
9894 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9895
8c500701
ILT
98962009-03-17 Ian Lance Taylor <iant@google.com>
9897
e85b18e1
ILT
9898 * descriptors.cc: Include "options.h".
9899 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9900 (Descriptors::open): Always use O_CLOEXEC when opening a new
9901 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9902 then set FD_CLOEXEC.
9903
9efe6174
ILT
9904 * sparc.cc (class Target_sparc): Add has_got_section.
9905 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9906 make sure we have a GOT section.
9907
9908 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9909 (Target_sparc::Scan::local): Likewise.
9910 (Target_sparc::Scan::global): Likewise.
9911 (Target_sparc::Relocate::relocate): Likewise.
9912 (Target_sparc::Relocate::relocate_tls): Likewise.
9913
8c500701
ILT
9914 * symtab.cc (Symbol_table::define_default_version): New function,
9915 broken out of add_from_object.
9916 (Symbol_table::add_from_object): Call define_default_version.
9917 (Symbol_table::define_special_symbol): Add resolve_oldsym
9918 parameter. Change all callers. If the version for a symbol comes
9919 from a version script, resolve it with the symbol with the same
9920 name with no version. Also add the symbol without a version if
9921 appropriate.
9922 (do_define_in_output_data): If resolving with oldsym, don't delete
9923 sym.
9924 (do_define_in_output_segment): Likewise.
9925 (do_define_as_constant): Likewise.
9926 * symtab.h (class Symbol_table): Update declarations.
9927
f1ed28fb
ILT
99282009-03-13 Ian Lance Taylor <iant@google.com>
9929
15f8229b
ILT
9930 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9931 (Read_symbols::requeue): New function.
9932 (Read_symbols::do_read_symbols): If make_elf_object fails because
9933 the target type is not configured, and the file was searched for,
9934 issue a warning and retry with the next directory.
9935 (Add_symbols::run): If the file has an incompatible format, and
9936 it was searched for, requeue the Read_symbols task. On error,
9937 release the object.
9938 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9939 dirindex parameter to constructor. Change all callers. Declare
9940 incompatible_warning and requeue.
9941 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9942 input_argument_ and input_group_ fields. Add them to
9943 constructor. Change all callers.
9944 (class Read_script): Add dirindex_ field. Add it to constructor.
9945 Change all callers.
9946 * archive.cc (Archive::setup): Remove input_objects parameter.
9947 Change all callers.
9948 (Archive::get_file_and_offset): Likewise.
9949 (Archive::read_all_symbols): Likewise.
9950 (Archive::read_symbols): Likewise.
9951 (Archive::get_elf_object_for_member): Remove input_objects
9952 parameter. Add punconfigured parameter. Change all callers.
9953 (Archive::add_symbols): Change return type to bool. Check return
9954 value of include_member.
9955 (Archive::include_all_members): Likewise.
9956 (Archive::include_member): Change return type to bool. Return
9957 false if first included object has incompatible target. Set
9958 included_member_ field.
9959 (Add_archive_symbols::run): If add_symbols returns false, requeue
9960 Read_symbols task.
9961 * archive.h (class Archive): Add included_member_ field.
9962 Initialize it in constructor. Add input_file and searched_for
9963 methods. Update declarations.
9964 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9965 input_argument_ fields. Add them to constructor. Change all
9966 callers.
9967 * script.cc: Include "target-select.h".
9968 (class Parser_closure): Add skip_on_incompatible_target_ and
9969 found_incompatible_target_ fields. Add
9970 skip_on_incompatible_target parameter to constructor. Change all
9971 callers. Add methods skip_on_incompatible_target,
9972 clear_skip_on_incompatible_target, found_incompatible_target, and
9973 set_found_incompatible_target.
9974 (read_input_script): Add dirindex parameter. Change all callers.
9975 If parser finds an incompatible target, requeue Read_symbols
9976 task.
9977 (script_set_symbol): Clear skip_on_incompatible_target in
9978 closure.
9979 (script_add_assertion, script_parse_option): Likewise.
9980 (script_start_sections, script_add_phdr): Likewise.
9981 (script_check_output_format): New function.
9982 * script.h (read_input_script): Update declaration.
9983 * script-c.h (script_check_output_format): Declare.
9984 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9985 (ignore_cmd): Remove OUTPUT_FORMAT.
9986 * fileread.cc (Input_file::Input_file): Add explicit this.
9987 (Input_file::will_search_for): New function.
9988 (Input_file::open): Add pindex parameter. Change all callers.
9989 * fileread.h (class Input_file): Add input_file_argument method.
9990 Declare will_search_for. Update declarations.
9991 * object.cc (make_elf_object): Add punconfigured parameter.
9992 Change all callers.
9993 * object.h (class Object): Make input_file public. Add
9994 searched_for method.
9995 (make_elf_object): Update declaration.
9996 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9997 restart search.
9998 * dirsearch.h (class Dirsearch): Update declaration.
9999 * options.h (class General_options): Add --warn-search-mismatch.
10000 * parameters.cc (Parameters::is_compatible_target): New function.
10001 * parameters.h (class Parameters): Declare is_compatible_target.
10002 * workqueue.cc (Workqueue::add_blocker): New function.
10003 * workqueue.h (class Workqueue): Declare add_blocker.
10004
f1ed28fb
ILT
10005 * fileread.cc (Input_file::open): Remove options parameter.
10006 Change all callers.
10007 (Input_file::open_binary): Likewise.
10008 * script.cc (read_input_script): Likewise.
10009 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10010 options parameter from constructor. Change all callers.
10011 (class Read_script): Likewise.
10012 * fileread.h (class Input_file): Update declarations.
10013 * script.h (read_input_script): Update declaration.
10014
34dd024a
NC
100152009-03-10 Nick Clifton <nickc@redhat.com>
10016
10017 * po/es.po: New Spanish translation.
10018
6d71b17c
CC
100192009-03-06 Cary Coutant <ccoutant@google.com>
10020
10021 * options.cc (parse_short_option): Keep dash_z from registering itself.
10022
031cdbed
ILT
100232009-03-03 Ian Lance Taylor <iant@google.com>
10024
10025 PR 9918
10026 * target-reloc.h (relocate_section): Pass output_section to
10027 relocate.
10028 * i386.cc (Target_i386::should_apply_static_reloc): Add
10029 output_section parameter. Change all callers.
10030 (Target_i386::Relocate::relocate): Add output_section parameter.
10031 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10032 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10033 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10034 * testsuite/two_file_shared.sh: New script.
10035 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10036 (check_DATA): Add two_file_shared.dbg.
10037 (two_file_shared.dbg): New target.
10038 * testsuite/Makefile.in: Rebuild.
10039
15d5fa16
ILT
100402009-03-01 Ian Lance Taylor <iant@google.com>
10041
10042 * configure.ac: Check for byteswap.h.
10043 * configure: Rebuild.
10044 * config.in: Rebuild.
10045
8a4c0b0d
ILT
100462009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10047
10048 * layout.cc (Layout::find_or_add_kept_section): New function.
10049 (Layout::add_comdat): Removed.
10050 * layout.h (struct Kept_section): Move out of class Layout.
10051 Remove trailing underscores from field names. Add group_sections
10052 field. Rename group_ field to is_group. Change all uses.
10053 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10054 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10055 comdat_groups_ field.
10056 (Sized_relobj::include_section_group): Use
10057 find_or_add_kept_section and Kept_section::group_sections.
10058 (Sized_relobj::include_linkonce_section): Likewise.
10059 * object.cc (class Sized_relobj): Don't define Comdat_group or
10060 Comdat_group_table. Remove find_comdat_group and
10061 add_comdat_group. Remove comdat_groups_ field.
10062 * plugin.cc (include_comdat_group): Use
10063 Layout::find_or_add_kept_section.
10064
b4ecf66b
ILT
100652009-02-28 Ian Lance Taylor <iant@google.com>
10066
14359ca0
ILT
10067 * README: --gc-sections and map files are now supported. Document
10068 some build requirements.
10069
b4ecf66b
ILT
10070 PR 6992
10071 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10072 relocatable link set the value of the section symbol to zero.
10073 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10074 relocatable link don't include the section address in the local
10075 symbol value.
10076
0602e05a
ILT
100772009-02-27 Ian Lance Taylor <iant@google.com>
10078
fd9d194f
ILT
10079 PR 6811
10080 * options.h (class Search_directory): Add is_system_directory.
10081 (class General_options): Declare is_in_system_directory.
10082 * options.cc (get_relative_sysroot): Make static.
10083 (get_default_sysroot): Make static.
10084 (General_optoins::is_in_system_directory): New function.
10085 * fileread.cc (Input_file::is_in_system_directory): New function.
10086 * fileread.h (class Input_file): Declare is_in_system_directory.
10087 * object.h (class Object): Add is_in_system_directory.
10088 (class Input_objects): Remove system_library_directory_ field.
10089 * object.cc (Input_objects::add_object): Don't set
10090 system_library_directory_.
10091 (input_objects::found_in_system_library_directory): Remove.
10092 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10093 parameter. Change all callers.
10094 (Symbol_table::sized_write_globals): Likewise.
10095 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10096 Call Object::is_in_system_directory.
10097 * symtab.h (class Symbol_table): Update declarations.
10098
61edd21f
ILT
10099 PR 5990
10100 * descriptors.h (Open_descriptor): Add is_on_stack field.
10101 * descriptors.cc (Descriptors::open): If the descriptor is on the
10102 top of the stack, remove it. Initialize is_on_stack field.
10103 (Descriptors::release): Only add pod to stack if it is not on the
10104 stack already.
10105 (Descriptors::close_some_descriptor): Clear stack_next and
10106 is_on_stack fields.
10107
e29e076a
ILT
10108 PR 7091
10109 * output.cc (Output_section::find_starting_output_address): Rename
10110 from starting_output_address; add PADDR parameter; change return
10111 type.
10112 * output.h (class Output_section): Declare
10113 find_starting_output_address instead of starting_output_address.
10114 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10115 section symbol for which we can't find a merge section.
10116
0602e05a
ILT
10117 PR 9836
10118 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10119 hidden or internal, force the symbol to be local.
10120 * resolve.cc (Symbol::override_visibility): Define.
10121 (Symbol::override_base): Use override_visibility.
10122 (Symbol_table::resolve): Likewise.
10123 (Symbol::override_base_with_special): Likewise.
10124 (Symbol_table::override_with_special): If the visibility is hidden
10125 or internal, force the symbol to be local.
10126 * symtab.h (class Symbol): Add set_visibility and
10127 override_visibility.
10128 * testsuite/ver_test_1.sh: New file.
10129 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10130 (check_DATA): Add ver_test_1.syms.
10131 (ver_test_1.syms): New target.
10132 * testsuite/Makefile.in: Rebuild.
10133
401a9a73
CC
101342009-02-25 Cary Coutant <ccoutant@google.com>
10135
10136 * layout.cc (Layout::choose_output_section): Don't rename sections
10137 when using a linker script that has a SECTIONS clause.
10138 * Makefile.in: Regenerate.
10139
10140 * testsuite/Makefile.am (script_test_5.sh): New test case.
10141 * testsuite/Makefile.in: Regenerate.
10142 * testsuite/script_test_5.cc: New file.
10143 * testsuite/script_test_5.sh: New file.
10144 * testsuite/script_test_5.t: New file.
10145
f488e4b0
CC
101462009-02-13 Rafael Avila de Espindola <espindola@google.com>
10147
10148 * archive.cc (Archive::include_member): Update calls to add_symbols.
10149 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10150 the Layout argument.
10151 * dynobj.h (do_add_symbols): Add the Layout argument.
10152 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10153 Layout argument.
10154 * object.h (Object::add_symbols): Add the Layout argument.
10155 (Object::do_add_symbols): Add the Layout argument.
10156 (Sized_relobj::do_add_symbols): Add the Layout argument.
10157 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10158 Unify the two versions.
10159 (Add_plugin_symbols): Remove.
10160 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10161 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10162 (Add_plugin_symbols): Remove.
10163 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10164 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10165 (Add_symbols::run): Make it work with Pulginobj.
10166
89dd1680
ILT
101672009-02-06 Ian Lance Taylor <iant@google.com>
10168
10169 * object.cc (Sized_relobj::do_layout): Make info message start
10170 with lower case letter.
10171
266d0a74
ILT
101722009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10173
602b464e
ILT
10174 * binary.cc: Fix file comment.
10175
266d0a74
ILT
10176 * options.h (enum Incremental_disposition): Define.
10177 (class General_options): Add new options: --incremental,
10178 --incremental_changed, --incremental_unchanged,
10179 --incremental_unknown. Add incremental_disposition_ and
10180 implicit_incremental_ fields.
10181 (General_options::incremental_disposition): New function.
10182 (class Position_dependent_options): Add incremental_disposition
10183 option.
10184 (Position_dependent_options::copy_from_options): Set incremental
10185 dispositions.
10186 * options.cc (General_options::parse_incremental_changed): New
10187 function.
10188 (General_options::parse_incremental_unchanged): New function.
10189 (General_options::parse_incremental_unknown): New function.
10190 (General_options::General_options): Initialize new fields
10191 incremental_disposition_ and implicit_incremental_.
10192 (General_options::finalize): Check for uasge of --incremental-*
10193 without --incremental.
10194
f073bbf7
CD
101952009-02-06 Chris Demetriou <cgd@google.com>
10196
10197 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10198 pointer and to report location as the file name associated with
10199 the symbol.
10200 (gold_undefined_symbol_at_location): New function to replace the
10201 old gold_undefined_symbol functionality.
10202 * target-reloc.h (relocate_section): Update to use
10203 gold_undefined_symbol_at_location.
10204 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10205 Call gold_undefined_symbol function rather than gold_error.
10206 * errors.h (Errors::undefined_symbol): Take location as a
10207 string, rather than calculating it from a relocation.
10208 * errors.cc (Errors::fatal): Print "fatal error:" before the
10209 formatted message.
10210 (Errors::error, Errors::error_at_location): Print "error: "
10211 before the formatted message.
10212 (Errors::undefined_symbol): Take location as a string, rather
10213 than calculating it from a relocation.
10214 (gold_undefined_symbol_at_location): New function akin to
10215 old gold_undefined_symbol, calculates location from relocation.
10216 (gold_undefined_symbol): Change to take only a Symbol pointer
10217 and to report location as the file name associated with the symbol.
10218 * testsuite/debug_msg.sh: Update for changed error messages.
10219 * testsuite/undef_symbol.sh: Likewise.
10220
8e94a90c
ILT
102212009-02-04 Duncan Sands <baldrick@free.fr>
10222
10223 PR 9812
10224 * reduced_debug_output.h
10225 (Output_reduced_debug_abbrev_section::failed): Use format for
10226 gold_warning.
10227 (Output_reduced_debug_info_section::faild): Likewise.
10228
88a0e15b
ILT
102292009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10230
10231 * script.cc (Lazy_demangler): New class.
10232 (Version_script_info::get_symbol_version_helper): Demangle a
10233 symbol only once.
10234
5efc7cd2
CC
102352009-01-29 Cary Coutant <ccoutant@google.com>
10236
10237 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10238 to __tls_get_addr.
10239 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10240
e0ebcf42
ILT
102412009-01-28 Ian Lance Taylor <iant@google.com>
10242
5efc7cd2 10243 * version.cc (version_string): Bump to 1.9.
75fe7426 10244
e0ebcf42
ILT
10245 * gold.h: Include <cstring> and <stdint.h>.
10246 * version.cc: Include <cstdio>.
10247 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10248 warning.
10249 * reduced_debug_output.cc (insert_into_vector): Rename from
10250 Insert_into_vector; change all callers. Use Swap_unaligned to
10251 avoid aliasing issue; remove union since it is unnecessary.
10252
8e2813be 102532009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10254
10255 * Makefile.am (CCFILES): Add gc.cc.
10256 (HFILES): Add gc.h.
10257 * Makefile.in: Regenerate.
10258 * gold.cc (Gc_runner): New class.
10259 (queue_initial_tasks): Call garbage collection related tasks
10260 when corresponding options are invoked.
10261 (queue_middle_gc_tasks): New function.
10262 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10263 processed early before laying out sections during garbage collection.
10264 * gold.h (queue_middle_gc_tasks): New function.
10265 (is_prefix_of): Move from "layout.cc".
10266 * i386.cc (Target_i386::gc_process_relocs): New function.
10267 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10268 * main.cc (main): Create object of class "Garbage_collection".
10269 * object.cc (Relobj::copy_symbols_data): New function.
10270 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10271 (Sized_relobj::do_layout): Allow this function to be called twice
10272 during garbage collection and defer layout of section during the
6d03d481
ST
10273 first call.
10274 * object.h (Relobj::get_symbols_data): New function.
10275 (Relobj::is_section_name_included): New function.
10276 (Relobj::copy_symbols_data): New function.
10277 (Relobj::set_symbols_data): New function.
10278 (Relobj::get_relocs_data): New function.
10279 (Relobj::set_relocs_data): New function.
10280 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10281 (Relobj::gc_process_relocs): New function.
10282 (Relobj::do_gc_process_relocs): New pure virtual function.
10283 (Relobj::sd_): New data member.
10284 (Sized_relobj::is_output_section_offset_invalid): New function.
10285 (Sized_relobj::do_gc_process_relocs): New function.
10286 * options.h (General_options::gc_sections): Modify to not be a no-op.
10287 (General_options::print_gc_sections): New option.
10288 * plugin.cc (Plugin_finish::run): Remove function call to
10289 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10290 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10291 * reloc.cc (Read_relocs::run): Add task to process relocs and
10292 determine unreferenced sections when doing garbage collection.
10293 (Gc_process_relocs): New class.
10294 (Sized_relobj::do_gc_process_relocs): New function.
10295 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10296 sections that are garbage collected.
10297 * reloc.h (Gc_process_relocs): New class.
10298 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10299 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10300 symbols whose corresponding sections are garbage collected.
10301 (Symbol_table::Symbol_table): Add new parameter for the garbage
10302 collection object.
10303 (Symbol_table::gc_mark_undef_symbols): New function.
10304 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10305 (Symbol_table::gc_mark_dyn_syms): New function.
10306 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10307 as garbage.
10308 (Symbol_table::add_from_object): Likewise.
10309 (Symbol_table::add_from_relobj): When building shared objects, do not
10310 treat externally visible symbols as garbage.
10311 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10312 table information for static and relocatable links.
10313 * symtab.h (Symbol_table::set_gc): New function.
10314 (Symbol_table::gc): New function.
10315 (Symbol_table::gc_mark_undef_symbols): New function.
10316 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10317 (Symbol_table::gc_mark_dyn_syms): New function.
10318 (Symbol_table::gc_): New data member.
e1df38aa 10319 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10320 function.
10321 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10322 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10323
3b293544
CF
103242009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10325
10326 * options.h (General_options::gc_sections): Define as a no-op for now.
10327 (General_options::no_keep_memory): Ditto.
10328 (General_options::Bshareable): Define.
10329 * options.cc (General_options::finalize): Honor -Bshareable.
10330
83d22aa8
AS
103312009-01-20 Andreas Schwab <schwab@suse.de>
10332
10333 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10334 read the value in the contents, since we don't use it. Use the
10335 template endianness when writing.
10336 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10337
cd536b21
AS
103382009-01-19 Andreas Schwab <schwab@suse.de>
10339
10340 * configure.tgt (powerpc64-*): Fix targ_obj.
10341
99e9a495
ILT
103422009-01-15 Ian Lance Taylor <iant@google.com>
10343
10344 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10345 local symbols when stripping all symbols.
10346
bbbfea06
CC
103472009-01-14 Cary Coutant <ccoutant@google.com>
10348
99e9a495 10349 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10350
0f7c0701
CC
103512009-01-14 Cary Coutant <ccoutant@google.com>
10352
10353 * archive.cc (Archive::get_elf_object_for_member): Remove call
10354 to File_read::claim_for_plugin.
10355 * descriptors.cc (Descriptors::open): Remove reference to
10356 is_claimed.
10357 (Descriptors::claim_for_plugin): Remove.
10358 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10359 (Descriptors::is_claimed): Remove.
10360 (claim_descriptor_for_plugin): Remove.
10361 * fileread.cc (File_read::claim_for_plugin): Remove.
10362 * fileread.h (File_read::claim_for_plugin): Remove.
10363 (File_read::descriptor): Reopen descriptor if necessary.
10364 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10365 (Plugin_manager::all_symbols_read): Add task parameter. Change
10366 all callers.
10367 (Plugin_manager::get_input_file): New function.
10368 (Plugin_manager::release_input_file): New function.
10369 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10370 corresponding data member.
10371 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10372 and pass to base constructor. Change all callers.
10373 (get_input_file, release_input_file): New functions.
10374 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10375 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10376 (Plugin_manager::all_symbols_read): Add task parameter.
10377 (Plugin_manager::get_input_file): New function.
10378 (Plugin_manager::release_input_file): New function.
10379 (Plugin_manager::task_): New data member.
10380 (Pluginobj::Pluginobj): Add filesize parameter.
10381 (Pluginobj::filename): New function.
10382 (Pluginobj::descriptor): New function.
10383 (Pluginobj::filesize): New function.
10384 (Pluginobj::filesize_): New data member.
10385 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10386 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10387 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10388
10389 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10390 with archive libraries.
10391 * testsuite/Makefile.in: Regenerate.
10392 * testsuite/plugin_test.c (struct sym_info): New type.
10393 (get_input_file, release_input_file): New static variables.
10394 (onload): Capture new transfer vector entries.
10395 (claim_file_hook): Stop reading at end of file according to filesize.
10396 Factor out parsing of readelf output into separate function.
10397 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10398 APIs and get the source file name from the symbol table. Convert
10399 source file name to corresponding object file name. Print info
10400 message when adding new input files.
10401 (parse_readelf_line): New function.
10402 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10403 * testsuite/plugin_test_2.sh: Likewise.
10404 * testsuite/plugin_test_3.sh: Likewise.
10405 * testsuite/plugin_test_4.sh: New test case.
10406
62a6d109
ILT
104072009-01-07 Ian Lance Taylor <iant@google.com>
10408
10409 * version.cc (version_string): Bump to 1.8.
10410
483620e8
CC
104112008-12-23 Cary Coutant <ccoutant@google.com>
10412
10413 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10414 * plugin.cc (Plugin_manager::finish): Rename as
10415 layout_deferred_objects. Move cleanup to separate function.
10416 (Plugin_manager::cleanup): New function.
10417 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10418 separately.
10419 * plugin.h (Plugin_manager::finish): Rename as
10420 layout_deferred_objects.
10421 (Plugin_manager::cleanup): New function.
10422 (Plugin_manager::cleanup_done): New field.
10423
d66a9eb3
CC
104242008-12-23 Cary Coutant <ccoutant@google.com>
10425
10426 * plugin.cc (is_visible_from_outside): New function.
10427 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10428 so we don't return "IR only" status for exported symbols or -r links.
10429
10430 * testsuite/Makefile.am (plugin_test_3): New test case.
10431 * testsuite/Makefile.in: Regenerate.
10432 * testsuite/plugin_test_3.sh: New file.
10433
5995b570
CC
104342008-12-22 Cary Coutant <ccoutant@google.com>
10435
10436 * object.cc (Sized_relobj::layout_section): New function.
10437 (Sized_relobj::do_layout): Defer layout of input sections until after
10438 plugin has provided replacement files.
10439 (Sized_relobj::do_layout_deferred_sections): New function.
10440 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10441 (Relobj::layout_deferred_sections): New function.
10442 (Relobj::do_layout_deferred_sections): New function.
10443 (Sized_relobj::do_layout_deferred_sections): New function.
10444 (Sized_relobj::layout_section): New function.
10445 (Sized_relobj::Deferred_layout): New structure.
10446 (Sized_relobj::deferred_layout_): New field.
10447 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10448 Change all callers. Layout deferred sections.
10449 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10450 references.
10451 (Plugin_hook::run): Move code from do_plugin_hook inline.
10452 (Plugin_hook::do_plugin_hook): Remove.
10453 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10454 (Plugin_manager::finish): Renamed, was cleanup.
10455 (Plugin_manager::should_defer_layout): New function.
10456 (Plugin_manager::add_deferred_layout_object): New function.
10457 (Plugin_manager::Deferred_layout_list): New type.
10458 (Plugin_manager::deferred_layout_objects_): New field.
10459 (Plugin_hook::do_plugin_hook): Remove.
10460
ee769c88
ILT
104612008-12-17 Ian Lance Taylor <iant@google.com>
10462
10463 * options.h (class General_options): Add --no case for
10464 --export-dynamic.
10465
abc8dcba
CC
104662008-12-16 Cary Coutant <ccoutant@google.com>
10467
10468 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10469 vector.
10470 (Plugin_manager::claim_file): Create plugin object even if
10471 plugin did not call the add_symbols callback.
10472 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10473 asking for more symbols than were added.
10474 * testsuite/Makefile.am (plugin_test_1): Add test case with
10475 no global symbols.
10476 (empty.syms): New target.
10477 * testsuite/Makefile.in: Regenerate.
10478 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10479 message. Don't call add_symbols if no globals.
10480 (all_symbols_read_hook): Don't provide replacement for empty
10481 claimed file.
10482
b0074644
ILT
104832008-12-12 Ian Lance Taylor <iant@google.com>
10484
68943102
ILT
10485 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10486 r_type == 0 for a local symbol with r_sym == 0.
10487 (scan_relocatable_relocs): Pass r_sym to
10488 local_non_section_strategy.
10489 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10490 r_sym parameter.
10491
b0074644
ILT
10492 * configure.ac: Update test for TLS descriptors: they are
10493 supported as of glibc 2.9.
10494 * configure: Rebuild.
10495
c2508178
ILT
104962008-12-11 Ian Lance Taylor <iant@google.com>
10497
10498 PR 7091
10499 * target-reloc.h (Default_scan_relocatable_relocs): For each
10500 function, map r_type == 0 to RELOC_DISCARD.
10501
2756a258
CC
105022008-12-10 Cary Coutant <ccoutant@google.com>
10503
10504 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10505 object to override a kept COMDAT group from a plugin object.
10506
bb6f53d3
ILT
105072008-12-09 Ian Lance Taylor <iant@google.com>
10508
fbc558e1
ILT
10509 PR 7088
10510 * yyscript.y (file_cmd): Handle INPUT.
10511
bb6f53d3
ILT
10512 * testsuite/initpri1.c: Change all declarations to be full
10513 prototypes by adding void, to avoid compiler warnings.
10514
4674ecfc
CC
105152008-12-05 Rafael Avila de Espindola <espindola@google.com>
10516
10517 * options.cc (General_options::parse_plugin_opt): New.
10518 (General_options::add_plugin): The argument now is just the filename.
10519 (General_options::add_plugin_option): New.
10520 * options.h (plugin_opt): New.
10521 (add_plugin): Change argument name.
10522 (add_plugin_option): New.
10523 * plugin.cc (Plugin::load): Don't parse the plugin option.
10524 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10525 (Plugin::add_option): New.
10526 (Plugin::args_): Change type.
10527 (Plugin::filename_): New.
10528 (Plugin_manager::add_plugin_option): New.
10529 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10530 * testsuite/Makefile.in: Regenerate.
10531
fd06b4aa
CC
105322008-12-05 Cary Coutant <ccoutant@google.com>
10533
10534 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10535 Handle --strip-lto-sections option.
10536 * options.h (strip_lto_sections): New option.
10537
6c52134c
CC
105382008-12-01 Cary Coutant <ccoutant@google.com>
10539
10540 * plugin.cc (ld_plugin_message): Change format parameter to const.
10541 Fix mismatch between new[] and delete.
10542
a45248e0
CC
105432008-11-14 Cary Coutant <ccoutant@google.com>
10544
10545 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10546 instead of -1U.
10547
c82fbeee
CS
105482008-11-05 Craig Silverstein <csilvers@google.com>
10549
10550 * options.cc (General_options::parse_dynamic_list): New function.
10551 * options.h (General_options): New flags dynamic_list,
10552 dynamic_list_data, dynamic_list_cpp_new, and
10553 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10554 (General_options::in_dynamic_list): New function.
10555 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10556 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10557 (Lex::can_continue_name): Likewise.
10558 (yylex): Likewise.
10559 (read_script_file): New parameter script_options.
10560 (read_dynamic_list): New function.
10561 (Script_options::define_dynamic_list): New function.
10562 (dynamic_list_keyword_parsecodes): New variable.
10563 (dynamic_list_keywords): New variable.
10564 * script.h (Script_options::define_dynamic_list): New function
10565 prototype.
10566 (read_dynamic_list): New function prototype.
10567 * symtab.cc (strprefix): New macro.
10568 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10569 dynamic_list_data, dynamic_list_cpp_new, and
10570 dynamic_list_cpp_typeinfo.
10571 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10572 (dynamic_list_expr): New rule.
10573 (dynamic_list_nodes): Likewise.
10574 (dynamic_list_node): Likewise.
10575 * testsuite/Makefile.am (dynamic_list): New test.
10576 * testsuite/Makefile.in: Regenerated.
10577 * testsuite/dynamic_list.t: New file.
10578 * testsuite/dynamic_list.sh: New file.
10579
e0bb29a5
CS
105802008-11-05 Craig Silverstein <csilvers@google.com>
10581
10582 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10583 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10584 (t11_last): Likewise.
10585 * testsuite/ver_test_6.c (main): Likewise.
10586
4e1e25e0
CC
105872008-10-07 Cary Coutant <ccoutant@google.com>
10588
10589 * options.c (General_options::finalize): Add check for -static and
10590 -shared.
10591 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10592 is not empty.
10593
92f03fcb
CC
105942008-10-02 Cary Coutant <ccoutant@google.com>
10595
10596 * plugin.cc (make_sized_plugin_object): Fix conditional
10597 compilation to work when not all targets are enabled.
10598
fbd8a257
CC
105992008-09-29 Cary Coutant <ccoutant@google.com>
10600
10601 * archive.cc (Archive::get_file_and_offset): Use filename instead
10602 of name to get library path.
10603 (Archive::include_member): Unlock external member of a thin archive.
10604
10605 * testsuite/Makefile.am (TEST_AR): New variable.
10606 (thin_archive_test_1): New test.
10607 (thin_archive_test_2): New test.
81636b3f
CC
10608 * testsuite/Makefile.in: Regenerate.
10609 * testsuite/thin_archive_main.cc: New file.
10610 * testsuite/thin_archive_test_1.cc: New file.
10611 * testsuite/thin_archive_test_2.cc: New file.
10612 * testsuite/thin_archive_test_3.cc: New file.
10613 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 10614
eff45813
CC
106152008-09-29 Cary Coutant <ccoutant@google.com>
10616
10617 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10618 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10619 instead of -1U.
10620 (Sized_relobj::do_finalize_local_symbols): Likewise.
10621 (Sized_relobj::map_to_kept_section): Likewise.
10622 * object.h (Sized_relobj::invalid_address): New constant.
10623 (Sized_relobj::do_output_section_offset): Check for invalid_address
10624 and return -1ULL.
10625 * output.cc (Output_reloc::local_section_offset): Use constant
10626 invalid_address instead of -1U.
10627 (Output_reloc::get_address): Likewise.
10628 (Output_section::output_address): Change -1U to -1ULL.
10629 * output.h (Output_reloc::invalid_address): New constant.
10630 * reloc.cc (Sized_relobj::write_sections): Use constant
10631 invalid_address instead of -1U.
10632 (Sized_relobj::relocate_sections): Likewise.
10633 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10634 values for merge sections.
10635 * target-reloc.h (relocate_for_relocatable): Use constant
10636 invalid_address instead of -1U.
10637
89fc3421
CC
106382008-09-19 Cary Coutant <ccoutant@google.com>
10639
10640 Add plugin functionality for link-time optimization (LTO).
10641 * configure.ac (plugins): Add --enable-plugins option.
10642 * configure: Regenerate.
10643 * config.in: Regenerate.
10644 * Makefile.am (LIBDL): New variable.
10645 (CCFILES): Add plugin.cc.
10646 (HFILES): Add plugin.h.
10647 (ldadd_var): Add LIBDL.
10648 * Makefile.in: Regenerate.
10649
10650 * archive.cc: Include "plugin.h".
10651 (Archive::setup): Don't preread archive symbols when using a plugin.
10652 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10653 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10654 files.
10655 (Archive::include_member): Add symbols from plugin objects.
10656 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10657 * descriptors.cc (Descriptors::open): Check for file descriptors
10658 abandoned by plugins.
10659 (Descriptors::claim_for_plugin): New function.
10660 * descriptors.h (Descriptors::claim_for_plugin): New function.
10661 (Open_descriptor::is_claimed): New field.
10662 (claim_descriptor_for_plugin): New function.
10663 * fileread.cc (File_read::claim_for_plugin): New function.
10664 * fileread.h (File_read::claim_for_plugin): New function.
10665 (File_read::descriptor): New function.
10666 * gold.cc: Include "plugin.h".
10667 (queue_initial_tasks): Add task to call plugin hooks for generating
10668 new object files.
10669 * main.cc: Include "plugin.h".
10670 (main): Load plugin libraries.
10671 * object.h (Pluginobj): Declare.
10672 (Object::pluginobj): New function.
10673 (Object::do_pluginobj): New function.
10674 (Object::set_target): New function.
10675 * options.cc: Include "plugin.h".
10676 (General_options::parse_plugin): New function.
10677 (General_options::General_options): Initialize plugins_ field.
10678 (General_options::add_plugin): New function.
10679 * options.h (Plugin_manager): Declare.
10680 (General_options): Add --plugin option.
10681 (General_options::has_plugins): New function.
10682 (General_options::plugins): New function.
10683 (General_options::add_plugin): New function.
10684 (General_options::plugins_): New field.
10685 * plugin.cc: New file.
10686 * plugin.h: New file.
10687 * readsyms.cc: Include "plugin.h".
10688 (Read_symbols::do_read_symbols): Check for archive before checking
10689 for ELF file. Call plugin hooks to claim files.
10690 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10691 from a real object file; force override when processing replacement
10692 files.
10693 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10694 (Symbol::init_base_object): Likewise.
10695 (Symbol::init_base_output_data): Likewise.
10696 (Symbol::init_base_output_segment): Likewise.
10697 (Symbol::init_base_constant): Likewise.
10698 (Symbol::init_base_undefined): Likewise.
10699 (Symbol::output_section): Assert that object is not a plugin.
10700 (Symbol_table::add_from_pluginobj): New function.
10701 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10702 undefined.
10703 (Symbol_table::sized_write_globals): Likewise.
10704 (Symbol_table::add_from_pluginobj): Instantiate template.
10705 * symtab.h (Sized_pluginobj): Declare.
10706 (Symbol::in_real_elf): New function.
10707 (Symbol::set_in_real_elf): New function.
10708 (Symbol::in_real_elf_): New field.
10709 (Symbol_table::add_from_pluginobj): New function.
10710
10711 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10712 (LIBDL): New variable.
10713 (LDADD): Add LIBDL.
10714 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10715 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10716 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10717 (MOSTLYCLEANFILES): Likewise.
10718 * testsuite/Makefile.in: Regenerate.
10719 * testsuite/plugin_test.c: New file.
10720 * testsuite/plugin_test_1.sh: New file.
10721 * testsuite/plugin_test_2.sh: New file.
10722
de31bda5
ILT
107232008-09-16 Ian Lance Taylor <iant@google.com>
10724
9c2d0ef9
ILT
10725 * target-reloc.h (relocate_section): Check whether a symbol is
10726 defined by the ABI before reporting an undefined symbol error.
10727 * target.h (Target::is_defined_by_abi): Make parameter const.
10728 (Target::do_is_defined_by_abi): Likewise.
10729 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10730 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10731 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10732 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10733 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10734 * testsuite/Makefile.in: Rebuild.
10735
de31bda5
ILT
10736 * fileread.cc (make_view): Add casts to avoid warning.
10737
9fa33bee
AO
107382008-09-16 Alexandre Oliva <aoliva@redhat.com>
10739
10740 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10741 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10742
183fd0e3
AO
107432008-09-16 Alexandre Oliva <aoliva@redhat.com>
10744
10745 * options.h (General_options::output_is_executable): New.
10746 (General_options::output_is_pie): New.
10747 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10748 for shared libraries.
10749 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10750
7be8330a
CD
107512008-09-11 Chris Demetriou <cgd@google.com>
10752
10753 * options.h (origin): New -z option.
10754 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10755 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10756 in DT_FLAGS_1.
10757
a9caad02
CC
107582008-09-05 Cary Coutant <ccoutant@google.com>
10759
10760 * fileread.cc (File_read::make_view): Add check for attempt to map
10761 beyond end of file.
10762
ae6dce4d
CC
107632008-09-05 Cary Coutant <ccoutant@google.com>
10764
10765 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10766 explicit instantiations.
10767
d7ab2a47
KVH
107682008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10769
10770 PR gold/6858
10771 * options.cc (General_options::finalize): Allow undefined symbols
10772 in shlibs if linking -shared.
10773
10774 PR gold/6859
10775 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10776 symbols as not needing a dynsym entry.
10777
1e52a9c1
CS
107782008-08-20 Craig Silverstein <csilvers@google.com>
10779
10780 * fileread.cc (File_read::open): Do not lock the file unless it
10781 was successfully opened.
10782
d85c80a3
CC
107832008-08-14 Cary Coutant <ccoutant@google.com>
10784
10785 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10786 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10787 * testsuite/tls_test.cc (struct int128): 128-bit struct
10788 for testing TLS relocs with non-zero addend.
10789 (v12): New TLS variable.
10790 (t12): New test.
10791 (t_last): Add check for v12.
10792 * testsuite/tls_test.h (t12): New function.
10793 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10794
2d924fd9
ILT
107952008-08-13 Ian Lance Taylor <iant@google.com>
10796
10797 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10798 set tls_segment_ or relro_segment_.
10799 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10800 when appropriate.
10801 * output.h (Output_section::clear_is_relro): New function.
10802 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10803 sections specially even when output_data_ is empty.
10804 (Output_segment::maximum_alignment): When first section is relro,
10805 only force alignment for PT_LOAD segments.
10806 * script.cc (script_data_segment_align): New function.
10807 (script_data_segment_relro_end): New function.
10808 * script-c.h (script_data_segment_align): Declare.
10809 (script_data_segment_relro_end): Declare.
10810 * script-sections.h (class Script_sections): Declare
10811 data_segment_align and data_segment_relro_end. Add fields
10812 segment_align_index_ and saw_relro_end_.
10813 * script-sections.cc (class Sections_element): Add set_is_relro
10814 virtual function. Add new bool* parameter to place_orphan_here.
10815 Add get_output_section virtual function.
10816 (class Output_section_definition): Add set_is_relro. Add new
10817 bool* parameter to place_orphan_here. Add get_output_section.
10818 Add is_relro_ field.
10819 (Output_section_definition::Output_section_definition): Initialize
10820 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10821 and is_relro_ fields.
10822 (Output_section_definition::place_orphan_here): Add is_relro
10823 parameter.
10824 (Output_section_definition::set_section_addresses): Set relro for
10825 output section.
10826 (Output_section_definition::alternate_constraint): Likewise.
10827 (class Orphan_output_section): Add new bool* parameter to
10828 place_orphan_here. Add get_output_section.
10829 (Orphan_output_section::place_orphan_here): Add is_relro
10830 parameter.
10831 (Script_sections::Script_sections): Initialize
10832 data_segment_align_index_ and saw_relro_end_.
10833 (Script_sections::data_segment_align): New function.
10834 (Script_sections::data_segment_relro_end): New function.
10835 (Script_sections::place_orphan): Set or clear is_relro.
10836 (Script_sections::set_section_addresses): Force alignment of first
10837 TLS section.
10838 * yyscript.y (exp): Call script_data_segment_align and
10839 script_data_segment_relro_end.
10840 * testsuite/relro_script_test.t: New file.
10841 * testsuite/relro_test.cc (using_script): Declare.
10842 (t1, t2): Test using_script.
10843 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10844 (relro_script_test_SOURCES): Define.
10845 (relro_script_test_DEPENDENCIES): Define.
10846 (relro_script_test_LDFLAGS): Define.
10847 (relro_script_test_LDADD): Define.
10848 (relro_script_test.so): New target.
10849 * testsuite/Makefile.in: Rebuild.
10850
f827c9a9
CC
108512008-08-06 Cary Coutant <ccoutant@google.com>
10852
10853 * archive.cc (Archive::total_archives, Archive::total_members)
10854 (Archive::total_members_loaded): New variables.
10855 (Archive::setup): Add parameter. Add option to preread
10856 archive symbols.
10857 (Archive::read_armap): Add counter.
10858 (Archive::get_file_and_offset): New function.
10859 (Archive::get_elf_object_for_member): New function.
10860 (Archive::read_all_symbols): New function.
10861 (Archive::read_symbols): New function.
10862 (Archive::add_symbols): Add counters.
10863 (Archive::include_all_members): Use armap to find members if it's
10864 already built.
10865 (Archive::include_member): Skip reading symbols if already read.
10866 Factored code into Archive::get_file_and_offset and
10867 Archive::get_elf_object_for_member. Changed call to
10868 Mapfile::report_include_archive_member.
10869 (Archive::print_stats): New function.
10870 * archive.h: Declare Object and Read_symbols_data classes.
10871 (Archive::Archive): Add initializers for new members.
10872 (Archive::setup): Add parameter.
10873 (Archive::print_stats): New function.
10874 (Archive::total_archives, Archive::total_members)
10875 (Archive::total_members_loaded): New variables.
10876 (Archive::get_file_and_offset): New function.
10877 (Archive::get_elf_object_for_member): New function.
10878 (Archive::read_all_symbols): New function.
10879 (Archive::read_symbols): New function.
10880 (Archive::Archive_member): New class.
10881 (Archive::members_): New member.
10882 (Archive::num_members_): New member.
10883 * main.cc: Include archive.h.
10884 (main): Call Archive::print_stats.
10885 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10886 archive parameter; member_name is now the fully-decorated name.
10887 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10888 * options.h: (General_options): Add --preread-archive-symbols option.
10889 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10890 Archive::setup.
10891
de4c45bd
ILT
108922008-08-04 Ian Lance Taylor <iant@google.com>
10893
10894 * symtab.h (Symbol::use_plt_offset): New function.
10895 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10896 * powerpc.cc (Relocate::relocate): Likewise.
10897 * sparc.cc (Relocate::relocate): Likewise.
10898 * x86_64.cc (Relocate::relocate): Likewise.
10899 * testsuite/weak_plt.sh: New test.
10900 * testsuite/weak_plt_main.cc: New test.
10901 * testsuite/weak_plt_shared.cc: New test.
10902 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10903 (check_PROGRAMS): Add weak_plt.
10904 (check_DATA): Add weak_plt_shared.so.
10905 (weak_plt_main_pic.o, weak_plt): New targets.
10906 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10907 * testsuite/Makefile.in: Rebuild.
10908
10909 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10910 gcctestdir/ld.
10911 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10912 * testsuite/Makefile.in: Rebuild.
10913
323ee3f4
AM
109142008-08-04 Alan Modra <amodra@bigpond.net.au>
10915
10916 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10917 * Makefile.in: Regenerate.
10918 * po/POTFILES.in: Regenerate.
10919
7c07ecec
ILT
109202008-07-29 Ian Lance Taylor <iant@google.com>
10921
10922 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10923 symbols before other symbols.
10924 * testsuite/script_test_2.cc (test_addr): Declare.
10925 (test_addr_alias): Declare.
10926 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10927 values.
7c07ecec
ILT
10928 * testsuite/script_test_2.t: Define test_addr_alias and
10929 test_addr.
10930
5778530e
ILT
109312008-07-24 Ian Lance Taylor <iant@google.com>
10932
2a00e4fb
ILT
10933 PR 5990
10934 * descriptors.cc: New file.
10935 * descriptors.h: New file.
10936 * gold-threads.h (class Hold_optional_lock): New class.
10937 * fileread.cc: Include "descriptors.h".
10938 (File_read::~File_read): Release descriptor rather than closing
10939 it.
10940 (File_read::open) [file]: Call open_descriptor rather than open.
10941 Set is_descriptor_opened_.
10942 (File_read::open) [memory]: Assert that descriptor is not open.
10943 (File_read::reopen_descriptor): New function.
10944 (File_read::release): Release descriptor.
10945 (File_read::do_read): Make non-const. Reopen descriptor.
10946 (File_read::read): Make non-const.
10947 (File_read::make_view): Reopen descriptor.
10948 (File_read::do_readv): Likewise.
10949 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10950 Update declarations.
10951 * layout.cc: Include "descriptors.h".
10952 (Layout::create_build_id): Use open_descriptor rather than open.
10953 * output.cc: Include "descriptors.h".
10954 (Output_file::open): Use open_descriptor rather than open.
10955 * archive.cc (Archive::const_iterator): Change Archive to be
10956 non-const.
10957 (Archive::begin, Archive::end): Make non-const.
10958 (Archive::count_members): Likewise.
10959 * archive.h (class Archive): Update declarations.
10960 * object.h (Object::read): Make non-const.
10961 * Makefile.am (CCFILES): Add descriptors.cc.
10962 (HFILES): Add descriptors.h.
10963 * Makefile.in: Rebuild.
10964
801647d1
ILT
10965 PR 6716
10966 * gold.h: Always include <clocale>. Add Solaris workarounds
10967 following code in binutils/sysdep.h.
10968
5edd166e
ILT
10969 PR 6048
10970 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10971 this->eh_frame_hdr_ is NULL before using it.
10972
c89ad728
ILT
10973 * dynobj.cc (Versions::Versions): Update comment.
10974
aa86f06b
ILT
10975 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10976 the base version name.
10977
5778530e
ILT
10978 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10979 array size plus one.
10980 (Stringpool_template::set_string_offsets): Subtract one from key
10981 before using it as an array index.
10982 (Stringpool_template::get_offset_with_length): Likewise.
10983 (Stringpool_template::write_to_buffer): Likewise.
10984 * stringpool.h (Stringpool_template::get_offset_from_key):
10985 Likewise.
10986
057ead22
ILT
109872008-07-23 Ian Lance Taylor <iant@google.com>
10988
7f649c59
ILT
10989 PR 6658
10990 * object.h (Merged_symbol_value::value): Do our best to handle a
10991 negative addend.
10992
057ead22
ILT
10993 PR 6647
10994 * script.cc (Version_script_info::get_versions): Don't add empty
10995 version tag to return value.
10996 (Version_script_info::get_symbol_version_helper): Change return
10997 type to bool. Add pversion parameter. Change all callers.
10998 (script_register_vers_node): Don't require a non-NULL tag.
10999 * script.h (class Version_script_info): Update declarations.
11000 (Version_script_info::get_symbol_version): Change return type to
11001 bool. Add version parameter. Change all callers.
11002 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11003 handling. Handle an empty version from a version script.
11004 (Symbol_table::define_special_symbol): Likewise.
11005 * testsuite/ver_test_10.script: New file.
11006 * testsuite/ver_test_10.sh: New file.
11007 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11008 (check_DATA): Add ver_test_10.syms.
11009 (ver_test_10.syms, ver_test_10.so): New target.
11010 * testsuite/Makefile.in: Rebuild.
11011
58e54ac2
CD
110122008-07-23 Simon Baldwin <simonb@google.com>
11013
11014 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11015 to zero for undefined symbols from dynamic libraries.
11016
95d14cd3
ILT
110172008-07-23 Ian Lance Taylor <iant@google.com>
11018
11019 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11020 Change all callers.
11021 * symtab.h (class Symbol_table): Update declaration.
11022 * testsuite/ver_test_9.cc: New file.
11023 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11024 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11025 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11026 (ver_test_9.so, ver_test_9.o): New targets.
11027 * testsuite/Makefile.in: Rebuild.
11028
92de84a6
ILT
110292008-07-22 Ian Lance Taylor <iant@google.com>
11030
34810851
ILT
11031 * options.h (class General_options): Define --check-sections.
11032 * layout.cc (Layout::set_segment_offsets): Handle
11033 --check-sections.
11034
af6156ef
ILT
11035 * options.h (class General_options): Define -n/--nmagic and
11036 -N/--omagic.
11037 * options.cc (General_options::finalize): For -n/--nmagic or
11038 -N/--omagic, set -static.
11039 * layout.cc (Layout::attach_allocated_section_to_segment): If
11040 -N/--omagic, don't put read-only and read-write sections in
11041 different segments.
11042 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11043 finding a read-only segment.
11044 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11045 don't set the minimum segment alignment to the common page size,
11046 and don't set the file offset to the address modulo the page size.
11047 * script-sections.cc (Script_sections::create_segments): If
11048 -n/--omagic, don't put read-only and read-write sections in
11049 different segments.
11050
92de84a6
ILT
11051 * cref.cc: New file.
11052 * cref.h: New file.
11053 * options.h (class General_options): Add --print-symbol-counts.
11054 * main.cc (main): Issue defined symbol report if requested.
11055 * archive.cc (Archive::interpret_header): Make into a const member
11056 function.
11057 (Archive::add_symbols): Call Input_objects::archive_start and
11058 archive_stop.
11059 (Archive::const_iterator): Define new class.
11060 (Archive::begin, Archive::end): New functions.
11061 (Archive::include_all_members): Rewrite to use iterator.
11062 (Archive::count_members): New function.
11063 * archive.h (class Archive): Update declarations.
11064 (Archive::filename): New function.
11065 * object.cc: Include "cref.h".
11066 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11067 (Sized_relobj::do_get_global_symbol_counts): New function.
11068 (Input_objects::add_object): Add object to cross-referencer.
11069 (Input_objects::archive_start): New function.
11070 (Input_objects::archive_stop): New function.
11071 (Input_objects::print_symbol_counts): New function.
11072 * object.h: Declare Cref and Archive.
11073 (Object::get_global_symbol_counts): New function.
11074 (Object::do_get_global_symbol_counts): New pure virtual function.
11075 (class Sized_relobj): Add defined_count_ field. Update
11076 declarations.
11077 (class Input_objects): Add cref_ field. Update constructor.
11078 Update declarations.
11079 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11080 defined_count_.
11081 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11082 symbol counts.
11083 (Sized_dynobj::do_get_global_symbol_counts): New function.
11084 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11085 defined_count_. Update declarations. Define Symbols typedef.
11086 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11087 parameter. Change all callers.
11088 (Symbol_table::add_from_dynobj): Add sympointers and defined
11089 parameters. Change all callers.
11090 * symtab.h (class Symbol_table): Update declarations.
11091 * Makefile.am (CCFILES): Add cref.cc.
11092 (HFILES): Add cref.h.
11093 * Makefile.in: Rebuild.
11094
3f7c5e1d
CD
110952008-07-22 Simon Baldwin <simonb@google.com>
11096
11097 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11098 to zero when writing undefined symbols.
11099
e0b64032
ILT
111002008-07-22 Ian Lance Taylor <iant@google.com>
11101
11102 * output.cc (Output_section::add_input_section): Don't try to
11103 merge empty merge sections.
11104
096b02cf
CS
111052008-07-21 Craig Silverstein <csilvers@google.com>
11106
11107 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11108 Include symbol version in error message.
cd536b21 11109
1d1f116d
CD
111102008-07-20 Chris Demetriou <cgd@google.com>
11111
cd536b21 11112 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11113 (RANDOM_SEED_CFLAGS): New substituted variable.
11114 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11115 * configure: Rebuild.
11116 * Makefile.in: Likewise.
11117 * testsuite/Makefile.in: Likewise.
11118
a18f591e
ILT
111192008-07-18 Ian Lance Taylor <iant@google.com>
11120
11121 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11122 where we see NAME/NULL and NAME/VERSION as separate symbols.
11123 * testsuite/ver_test_main.cc (main): Call t4.
11124 (t4, t4_2a): Define.
11125 * testsuite/ver_test_2.cc (t4_2): Define.
11126 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11127 * testsuite/ver_test_4.cc (t4_2a): Define.
11128 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11129 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11130
c6e3f6ed
ILT
111312008-07-17 Ian Lance Taylor <iant@google.com>
11132
11133 * dynobj.cc (Versions::add_def): If we give an error about a
11134 missing version, go ahead and create the version anyhow.
11135
ef9beddf
ILT
111362008-07-10 Ian Lance Taylor <iant@google.com>
11137
11138 Handle output sections with more than 0x7fffffff bytes.
11139 * object.h (class Relobj): Change map_to_output_ to
11140 output_sections_, and just keep a section pointer. Change all
11141 uses. Move comdat group support to Sized_relobj.
11142 (Relobj::is_section_specially_mapped): Remove.
11143 (Relobj::output_section): Remove poff parameter. Change all
11144 callers.
11145 (Relobj::output_section_offset): New function.
11146 (Relobj::set_section_offset): Rewrite.
11147 (Relobj::map_to_output): Remove.
11148 (Relobj::output_sections): New function.
11149 (Relobj::do_output_section_offset): New pure virtual function.
11150 (Relobj::do_set_section_offset): Likewise.
11151 (class Sized_relobj): Add section_offsets_ field. Add comdat
11152 group support from Relobj. Update declarations.
11153 (Sized_relobj::get_output_section_offset): New function.
11154 (Sized_relobj::do_output_section_offset): New function.
11155 (Sized_relobj::do_set_section_offset): New function.
11156 * object.cc (Relobj::output_section_address): Remove.
11157 (Sized_relobj::Sized_relobj): Initialize new fields.
11158 (Sized_relobj::include_section_group): Cast find_kept_object to
11159 Sized_relobj.
11160 (Sized_relobj::include_linkonce_section): Likewise.
11161 (Sized_relobj::do_layout): Use separate arrays for output section
11162 and output offset.
11163 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11164 output_sections.
11165 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11166 output_sections and section_offsets.
11167 (Sized_relobj::write_local_symbols): Likewise.
11168 (map_to_kept_section): Compute output address directly.
11169 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11170 output_sections and section_offsets.
11171 (Sized_relobj::write_sections): Likewise.
11172 (Sized_relobj::relocate_sections): Likewise.
11173 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11174 * output.h (class Output_reloc): Update declarations. Change
11175 u2_.relobj to Sized_relobj*.
11176 (class Output_data_reloc): Change add functions to use
11177 Sized_relobj*.
11178 * output.cc (Output_reloc::Output_reloc): Change relobj to
11179 Sized_relobj*.
11180 (Output_reloc::local_section_offset): Change return type to
11181 Elf_Addr. Use get_output_section_offset.
11182 (Output_reloc::get_address): Likewise.
11183 (Output_section::is_input_address_mapped): Don't call
11184 is_section_specially_mapped.
11185 (Output_section::output_offset): Likewise.
11186 (Output_section::output_address): Likewise.
11187 (Output_section::starting_output_address): Likewise.
11188 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11189 parameter to Sized_relobj*.
11190 (Copy_relocs::need_copy_reloc): Likewise.
11191 (Copy_relocs::save): Likewise.
11192 * copy-relocs.h (class Copy_relocs): Update declarations.
11193 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11194 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11195 * target-reloc.h (relocate_for_relocatable): Change
11196 offset_in_output_section type to Elf_Addr. Change code that uses
11197 it as well.
11198 * layout.cc (Layout::layout): Always set *off.
11199 * mapfile.cc (Mapfile::print_input_section): Use
11200 output_section_offset.
11201 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11202 Sized_relobj*.
11203 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11204 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11205 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11206
5cb66f97
ILT
112072008-07-03 Ian Lance Taylor <iant@google.com>
11208
11209 * layout.cc (Layout::include_section): Do not discard unrecognized
11210 SHT_STRTAB sections.
11211
afe47622
CS
112122008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11213
11214 * script.cc (Lex::can_continue_name): Make '?' allowable in
11215 version-script names.
11216 * testsuite/version_script.map: Change glob pattern to use '?'
11217
5adf9721
ILT
112182008-06-30 Manish Singh <yosh@gimp.org>
11219
11220 PR 6585
11221 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11222 Correct typo.
11223
e6fde208
ILT
112242008-06-30 Ian Lance Taylor <iant@google.com>
11225
11226 PR 6660
11227 PR 6682
11228 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11229 versions]: Don't try to read the value in the contents, since we
11230 don't use it. Use the template endianness when writing.
11231
3f2e6a2d
CC
112322008-06-25 Cary Coutant <ccoutant@google.com>
11233
11234 * fileread.cc (File_read::make_view): Assert on zero-length view.
11235 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11236 symbol table when there are no symbols to read.
11237
c43d3a48
CS
112382008-06-23 Craig Silverstein <csilvers@google.com>
11239
11240 * version.cc (version_string): Bump to 1.7
11241
5f494ea0
CS
112422008-06-18 Craig Silverstein <csilvers@google.com>
11243
11244 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11245 constant 0xFFFF to type Valtype.
11246 (Powerpc_relocate_functions::rel16_ha): Likewise.
11247
c42e122e
ILT
112482008-06-17 Ian Lance Taylor <iant@google.com>
11249
f34787f8
ILT
11250 * output.h (Output_section::Input_section): Initialize p2align_ to
11251 zero for Output_section_data constructors.
11252 (Output_section::Input_section::addralign): If not an input
11253 section, return the alignment of the Output_section_data.
11254 * testsuite/copy_test.cc: New file.
11255 * testsuite/copy_test_1.cc: New file.
11256 * testsuite/copy_test_2.cc: New file.
11257 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11258 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11259 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11260 (copy_test_1_pic.o, copy_test_1.so): New targets.
11261 (copy_test_2_pic.o, copy_test_2.so): New targets.
11262 * testsuite/Makefile.in: Rebuild.
11263
c42e122e
ILT
11264 * script-sections.cc (Script_sections::place_orphan): Initialize
11265 local variable exact.
11266
ce3ac18a
DE
112672008-06-13 David Edelsohn <edelsohn@gnu.org>
11268
11269 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11270
42cacb20
DE
112712008-06-12 David Edelsohn <edelsohn@gnu.org>
11272 David S. Miller <davem@davemloft.net>
11273
11274 * powerpc.cc: New file.
11275 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11276 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11277 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11278 * Makefile.in: Rebuild.
11279
7b308235
ILT
112802008-06-09 Ian Lance Taylor <iant@google.com>
11281
11282 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11283 <exception>.
11284 (throwing, orig_terminate): New static variables.
11285 (terminate_handler): New static function.
11286 (t2): Set terminate handler.
11287
f0b886e3
ILT
112882008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11289
11290 PR 6584
cd536b21 11291 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11292 alignment.
11293
3e90f135
CC
112942008-05-30 Cary Coutant <ccoutant@google.com>
11295
11296 * archive.cc (Archive::include_all_members) Correct to step
11297 over symbol table and extended name table in thin archives.
11298
e09ad04a
ILT
112992008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11300
11301 PR 6407
11302 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11303 calculation.
11304
62b01cb5
ILT
113052008-05-28 Caleb Howe <cshowe@google.com>
11306
11307 * reduced_debug_output.cc: New file.
11308 * reduced_debug_output.h: New file.
92de84a6 11309 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11310 * options.cc (General_options::finalize): Add strip_debug_non_line
11311 to the strip heirarchy.
11312 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11313 fields.
11314 * layout.cc: Include "reduced_debug_output.h".
11315 (Layout::Layout): Initialize new fields.
11316 (line_only_debug_sections): New static array.
11317 (is_lines_only_debug_sections): New static inline function.
11318 (Layout::include_section): Handle --strip-debug-non-line.
11319 (Layout::make_output_section): If --strip-debug-non-line, build
11320 new output sections for .debug_abbrev and .debug_info.
11321 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11322 gold. Warn about possible overflow.
11323 (read_signed_LEB_128): Likewise.
11324 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11325 (read_signed_LEB_128): Declare.
11326 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11327 (HFILES): Add reduced_debug_output.h.
11328 * Makefile.in: Rebuild.
11329
7d9e3d98
ILT
113302008-05-21 Ian Lance Taylor <iant@google.com>
11331
11332 * mapfile.cc: New file.
11333 * mapfile.h: New file.
11334 * options.h (class General_options): Add -M/--print-map and -Map.
11335 * options.cc (General_options::finalize): Make -M equivalent to
11336 -Map -.
11337 * main.cc: Include <cstdio> and "mapfile.h".
11338 (main): Open mapfile if requested.
11339 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11340 constructor. Change caller.
11341 (queue_initial_tasks): Add mapfile parameter. Change caller.
11342 (queue_middle_tasks): Likewise.
11343 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11344 declarations.
11345 * archive.cc: Include "mapfile.h".
11346 (Archive::add_symbols): Add mapfile parameter. Change all
11347 callers. Pass mapfile, symbol, and reason to include_member.
11348 (Archive::include_all_members): Add mapfile parameter. Change all
11349 callers.
11350 (Archive::include_member): Add mapfile, sym, and why parameters.
11351 Change all callers. Report inclusion to map file.
11352 * archive.h: Include "fileread.h".
11353 (class Archive): Update declarations.
11354 (Archive::file): New const method.
11355 (class Add_archive_symbols): Add mapfile_ field. Update
11356 constructor. Change all callers.
11357 * readsyms.h (class Read_symbols): Likewise.
11358 (class Finish_group): Likewise.
11359 (class Read_script): Likewise.
11360 * common.cc: Include "mapfile.h".
11361 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11362 all callers.
11363 (Symbol_table::do_allocate_commons): Likewise.
11364 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11365 symbol allocation to mapfile.
11366 * common.h (class Allocate_commons_task): Add mapfile_ field.
11367 Update constructor. Change all callers.
11368 * symtab.h (class Symbol_table): Update declarations.
11369 * layout.cc: Include "mapfile.h".
11370 (Layout_task_runner::run): Print information to mapfile.
11371 (Layout::create_gold_note): Change Output_data_fixed_space to
11372 Output_data_zero_fill.
11373 (Layout::create_build_id): Likewise.
11374 (Layout::print_to_mapfile): New function.
11375 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11376 constructor. Change caller.
11377 (class Layout): Declare print_to_mapfile.
11378 * output.cc (Output_section::Input_section::print_to_mapfile): New
11379 function.
11380 (Output_section::add_input_section): If producing a map, always
11381 add to input_sections_ list.
11382 (Output_section::do_print_to_mapfile): New function.
11383 (Output_segment::print_sections_to_mapfile): New function.
11384 (Output_segment::print_section_list_to_mapfile): New function.
11385 * output.h: Include "mapfile.h".
11386 (Output_data::print_to_mapfile): New function.
11387 (Output_data::do_print_to_mapfile): New virtual function.
11388 (Output_segment_headers::do_print_to_mapfile): New function.
11389 (Output_file_header::do_print_to_mapfile): New function.
11390 (Output_data_const::do_print_to_mapfile): New function.
11391 (class Output_data_const_buffer): Add map_name_ field. Update
11392 constructor. Change all callers. Add do_print_to_mapfile
11393 function.
11394 (class Output_data_fixed_space): Likewise.
11395 (class Output_data_space): Likewise.
11396 (class Output_data_zero_fill): New class.
11397 (Output_data_strtab::do_print_to_mapfile): New function.
11398 (Output_data_reloc_base::do_print_to_mapfile): New function.
11399 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11400 (Output_data_group::do_print_to_mapfile): New function.
11401 (Output_data_got::do_print_to_mapfile): New function.
11402 (Output_data_dynamic::do_print_to_mapfile): New function.
11403 (Output_symtab_xindex::do_print_to_mapfile): New function.
11404 (class Output_section): Declare do_print_to_mapflie. Declare
11405 print_to_mapfile in Input_section.
11406 (class Output_segment): Declare new functions.
11407 * object.h (Sized_relobj::symbol_count): New function.
11408 * script-sections.cc
11409 (Output_section_element_dot_assignment::set_section_addresses):
11410 Change Output_data_fixed_space to Output_data_zero_fill.
11411 (Output_data_expression::do_print_to_mapfile): New function.
11412 * script.cc (read_input_script): Add mapfile parameter. Change
11413 all callers.
11414 * script.h (read_input_script): Update declaration.
11415 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11416 (Eh_frame::do_print_to_mapfile): New function.
11417 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11418 (Output_merge_string::do_print_to_mapfile): New function.
11419 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11420 function.
11421 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11422 function.
11423 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11424 function.
11425 * Makefile.am (CCFILES): Add mapfile.cc.
11426 (HFILES): Add mapfile.h.
11427 * Makefile.in: Rebuild.
11428
9f1d377b
ILT
114292008-05-19 Ian Lance Taylor <iant@google.com>
11430
11431 * options.h (class General_options): Add -z relro.
11432 * layout.cc (Layout::Layout): Initialize relro_segment_.
11433 (Layout::add_output_section_data): Return the output section.
11434 (Layout::make_output_section): Rcognize relro sections and mark
11435 them appropriately.
11436 (Layout::attach_allocated_section_to_segment): Put relro sections
11437 in a PT_GNU_RELRO segment.
11438 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11439 section as relro.
11440 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11441 PT_TLS segments.
11442 (Layout::linkonce_mapping): Map d.rel.ro.local to
11443 .data.rel.ro.local.
11444 (Layout::output_section_name): Us .data.rel.ro.local for any
11445 section which begins with that.
11446 * layout.h (class Layout): Update add_output_section_data
11447 declaration. Add relro_segment_ field.
11448 * output.cc (Output_section::Output_section): Initialize is_relro_
11449 and is_relro_local_ fields.
11450 (Output_segment::add_output_section): Group relro sections.
11451 (Output_segment::is_first_section_relro): New function.
11452 (Output_segment::maximum_alignment): If there is a relro section,
11453 align the segment to the common page size.
11454 (Output_segment::set_section_addresses): Track whether we are
11455 looking at relro sections. If the last section is a relro
11456 section, align to the common page size.
11457 (Output_segment::set_section_list_addresses): Add in_relro
11458 parameter. Change all callers. Align to the page size when
11459 moving from relro to non-relro section.
11460 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11461 segment.
11462 * output.h (class Output_section): Add is_relro_ and
11463 is_relro_local_ fields.
11464 (Output_section::is_relro): New function.
11465 (Output_section::set_is_relro): New function.
11466 (Output_section::is_relro_local): New function.
11467 (Output_section::set_is_relro_local): New function.
11468 (class Output_segment): Update declarations.
11469 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11470 * sparc.cc (Target_sparc::got_section): Likewise.
11471 * x86_64.cc (Target_x86_64::got_section): Likewise.
11472 * testsuite/relro_test_main.cc: New file.
11473 * testsuite/relro_test.cc: New file.
11474 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11475 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11476 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11477 (relro_test.so, relro_test_pic.o): New targets.
11478 * testsuite/Makefile.in: Rebuild.
11479
a984ee1d
ILT
114802008-05-16 Ian Lance Taylor <iant@google.com>
11481
01676dcd
ILT
11482 * output.cc (Output_segment::add_output_section): Remove front
11483 parameter.
11484 * output.h (class Output_segment): Remove
11485 add_initial_output_section and overloaded add_output_section.
11486 Update declaration of remaining add_output_section.
11487 * layout.cc (Layout::create_interp): Call add_output_section
11488 rather than add_initial_output_section.
11489 (Layout::finish_dynamic_section): Likewise.
11490
497897f9
ILT
11491 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11492 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11493 know the dynamic type.
11494 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11495 field. Initialize it in constructor.
11496 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11497 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11498 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11499 reloc.
11500
a984ee1d
ILT
11501 * output.cc (Output_reloc::get_address): Change return type to
11502 Elf_Addr.
11503 * output.h (class Output_reloc): Update get_address declaration.
11504 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11505 for section addresses.
11506
55ba0940
ILT
115072008-05-09 Ian Lance Taylor <iant@google.com>
11508
11509 PR 6493
11510 * gold.cc (gold_nomem): Use return value of write.
11511
75517b77
ILT
115122008-05-08 Ian Lance Taylor <iant@google.com>
11513
11514 * symtab.c (Symbol::init_base_output_data): Add version
11515 parameter. Change all callers.
11516 (Symbol::init_base_output_segment): Likewise.
11517 (Symbol::init_base_constant): Likewise.
11518 (Symbol::init_base_undefined): Likewise.
11519 (Sized_symbol::init_output_data): Likewise.
11520 (Sized_symbol::init_output_segment): Likewise.
11521 (Sized_symbol::init_constant): Likewise.
11522 (Sized_symbol::init_undefined): Likewise.
11523 (Symbol_table::do_define_in_output_data): If the new symbol has a
11524 version, mark it as the default.
11525 (Symbol_table::do_define_in_output_segment): Likewise.
11526 (Symbol_table::do_define_as_constant): Likewise.
11527 * symtab.h (class Symbol): Update declarations.
11528 (class Sized_symbol): Likewise.
11529 * resolve.cc (Symbol::override_version): New function.
c42e122e 11530 (Symbol::override_base): Call override_version.
75517b77
ILT
11531 (Symbol::override_base_with_special): Likewise.
11532 * testsuite/ver_script_8.script: New file.
11533 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11534 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11535 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11536 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11537
f1f70eae
ILT
115382008-05-06 Ian Lance Taylor <iant@google.com>
11539
f3e9c5c5
ILT
11540 PR 6049
11541 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11542 functions.
11543 (class General_options): Remove existing --undefined, and add
11544 --no-undefined instead. Add new --undefined as synonym for -u.
11545 * archive.cc (Archive::add_symbols): Check whether symbol was
11546 named with -u.
11547 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11548 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11549 all uses. Add IS_UNDEFINED. Update declarations to split
11550 different versions of init_base. Declare init_base_undefined.
11551 (Symbol::is_defined): Handle IS_UNDEFINED.
11552 (Symbol::is_undefined): Likewise.
11553 (Symbol::is_weak_undefined): Call is_undefined.
11554 (Symbol::is_absolute): Handle IS_CONSTANT.
11555 (class Sized_symbol): Update declarations to split different
11556 versions of init. Declare init_undefined.
11557 (class Symbol_table): Declare new functions.
11558 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11559 Change all callers.
11560 (Symbol::init_base_output_data): Likewise.
11561 (Symbol::init_base_output_segment): Likewise.
11562 (Symbol::init_base_constant): Likewise.
11563 (Symbol::init_base_undefined): New function.
11564 (Sized_symbol::init_object): Rename from init. Change all
11565 callers.
11566 (Sized_symbol::init_output_data): Likewise.
11567 (Sized_symbol::init_output_segment): Likewise.
11568 (Sized_symbol::init_constant): Likewise.
11569 (Sized_symbol::init_undefined): New function.
11570 (Symbol_table::add_undefined_symbols_from_command_line): New
11571 function.
11572 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11573 function.
11574 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11575 (Symbol::output_section): Likewise.
11576 (Symbol::set_output_section): Likewise.
11577 (Symbol_table::sized_finalize_symbol): Likewise.
11578 (Symbol_table::sized_write_globals): Likewise.
11579 * resolve.cc (Symbol_table::should_override): Likewise.
11580 (Symbol::override_base_with_special): Likewise.
11581
8bdcdf2c
ILT
11582 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11583 symbol, change it to have default visibility.
11584 * testsuite/protected_1.cc: New file.
11585 * testsuite/protected_2.cc: New file.
11586 * testsuite/protected_3.cc: New file.
11587 * testsuite/protected_main_1.cc: New file.
11588 * testsuite/protected_main_2.cc: New file.
11589 * testsuite/protected_main_3.cc: New file.
11590 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11591 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11592 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11593 (protected_1.so): New target.
11594 (protected_1_pic.o, protected_2_pic.o): New targets.
11595 (protected_3_pic.o): New target.
11596 (check_PROGRAMS): Add protected_2.
11597 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11598 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11599 * testsuite/Makefile.in: Rebuild.
11600
2b706932
ILT
11601 * options.h (DEFINE_var): Add set_user_set_##varname__.
11602 (DEFINE_bool_alias): New macro.
11603 (class General_options): Define -Bstatic using DEFINE_bool_alias
11604 rather than DEFINE_special. Add --undefined as an alias for -z
11605 defs.
11606 * options.cc (General_options::parse_Bstatic): Remove.
11607
d82a5bcc
ILT
11608 * options.h (class General_options): Add --fatal-warnings.
11609 * main.cc (main): Implement --fatal-warnings.
11610 * errors.h (Errors::warning_count): New function.
11611
f1f70eae
ILT
11612 * options.h (class General_options): Add -Bsymbolic-functions.
11613 * symtab.h (Symbol::is_preemptible): Check for
11614 -Bsymbolic-functions.
11615
8825ac63
ILT
116162008-05-05 Ian Lance Taylor <iant@google.com>
11617
d98bc257
ILT
11618 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11619 as noVARNAME rather than no-VARNAME.
11620 (class General_options): Add option -z combreloc.
11621 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11622 get_address.
11623 (Output_reloc::sort_before) [SHT_REL]: New function.
11624 (Output_reloc::sort_before) [SHT_RELA]: New function.
11625 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11626 Sort_relocs_comparison.
11627 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11628 parameter. Change all callers.
11629 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11630 sort_relocs parameter. Change all callers.
11631 * output.cc (Output_reloc::get_address): New function, broken out
11632 of write_rel.
11633 (Output_reloc::write_rel): Call it.
11634 (Output_reloc::compare): New function.
11635 (Output_data_reloc_base::do_write): Optionally sort relocs.
11636
60b2b4e7
ILT
11637 * configure.ac: If targ_extra_obj is set, link it in.
11638 * configure.tgt: Initialize all variables.
11639 (x86_64*): Set targ_extra_obj and targ_extra_size.
11640 * configure: Rebuild.
11641
8825ac63
ILT
11642 * object.cc (Sized_relobj::include_section_group): Adjust section
11643 indexes read from group data. Build vector to pass to
11644 layout_group.
11645 * layout.cc (Layout::layout_group): Add flags and shndxes
11646 parameters. Remove contents parameter. Change caller. Update
11647 explicit instantiations.
11648 * layout.h (class Layout): Update layout_group declaration.
11649 * output.cc (Output_data_group::Output_data_group): Add flags and
11650 input_shndxes parameters. Remove contents parameter. Change
11651 caller.
11652 (Output_data_group::do_write): Change input_sections_ to
11653 input_shndxes_.
11654 * output.h (class Output_data_group): Update constructor
11655 declaration. Rename input_sections_ to input_shndxes_.
11656 * testsuite/many_sections_test.cc: Add template.
11657
e94cf127
CC
116582008-04-30 Cary Coutant <ccoutant@google.com>
11659
4418b2d5
CC
11660 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11661
e94cf127
CC
11662 * layout.cc (Layout::include_section): Refactored check for debug
11663 info section.
11664 (Layout::add_comdat): Add new parameters. Change type
11665 of signature parameter. Add object and shndx to signatures table.
11666 (Layout::find_kept_object): New function.
11667 * layout.h: Include <cstring>.
11668 (Layout::is_debug_info_section): New function.
11669 (Layout::add_comdat): Add new parameters.
11670 (Layout::find_kept_object): New function.
11671 (Layout::Kept_section): New struct.
11672 (Layout::Signatures): Change type of map range.
11673 * object.cc (Relobj::output_section_address): New function.
11674 (Sized_relobj::include_section_group): Add new parameters. Change
11675 calls to Layout::add_comdat. Change to build table of kept comdat
11676 groups and table mapping discarded sections to kept sections.
11677 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11678 (Sized_relobj::do_layout): Change calls to include_section_group and
11679 include_linkonce_section.
11680 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11681 value to zero when section is discarded.
11682 (Sized_relobj::map_to_kept_section): New function.
11683 * object.h (Relobj::output_section_address): New function.
11684 (Relobj::Comdat_group): New type.
11685 (Relobj::find_comdat_group): New function.
11686 (Relobj::Comdat_group_table): New type.
11687 (Relobj::Kept_comdat_section): New type.
11688 (Relobj::Kept_comdat_section_table): New type.
11689 (Relobj::add_comdat_group): New function.
11690 (Relobj::set_kept_comdat_section): New function.
11691 (Relobj::get_kept_comdat_section): New function.
11692 (Relobj::comdat_groups_): New field.
11693 (Relobj::kept_comdat_sections_): New field.
11694 (Symbol_value::input_value): Update comment.
11695 (Sized_relobj::map_to_kept_section) New function.
11696 (Sized_relobj::include_linkonce_section): Add new parameter.
11697 * target-reloc.h (Comdat_behavior): New type.
11698 (get_comdat_behavior): New function.
11699 (relocate_section): Add code to map a discarded section to the
11700 corresponding kept section when applying a relocation.
11701
e4e5049b
CS
117022008-04-30 Craig Silverstein <csilvers@google.com>
11703
11704 * dwarf_reader.cc (next_generation_count): New static var.
11705 (Addr2line_cache_entry): New struct.
11706 (addr2line_cache): New static var.
11707 (Dwarf_line_info::one_addr2line): Added caching.
11708 (Dwarf_line_info::clear_addr2line_cache): New function.
11709 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11710 cache-size parameter.
11711 (Dwarf_line_info::one_addr2line_cache): New function.
11712 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11713 new cache-size argument to one_addr2line(), and clear cache.
11714
d09e9154
CC
117152008-04-28 Cary Coutant <ccoutant@google.com>
11716
11717 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11718 R_386_PC8 relocations.
11719
7ef73768
ILT
117202008-04-23 Ian Lance Taylor <iant@google.com>
11721
55438702
ILT
11722 * object.cc (Sized_relobj::include_section_group): Check for
11723 invalid section group.
11724
c165fb93
ILT
11725 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11726 header size.
11727
7ef73768
ILT
11728 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11729 than read for file header.
11730 * archive.cc (Archive::include_member): Likewise.
11731
6194aaab
L
117322008-04-23 Paolo Bonzini <bonzini@gnu.org>
11733
11734 * aclocal.m4: Regenerate.
11735 * configure: Regenerate.
11736
d491d34e
ILT
117372008-04-19 Ian Lance Taylor <iant@google.com>
11738
5ea2bac6
ILT
11739 * version.cc (version_string): Bump to 1.6.
11740
7bc3e21a
ILT
11741 * testsuite/Makefile.am (many_sections_r_test): New target.
11742 (many_sections_r_test_SOURCES): Remove.
11743 (many_sections_r_test_DEPENDENCIES): Remove.
11744 (many_sections_r_test_LDFLAGS): Remove.
11745 (many_sections_r_test_LDADD): Remove.
11746
7fcd3aa9
ILT
11747 * object.cc (Sized_relobj::do_add_symbols): Always pass
11748 local_symbol_count_ to add_from_relobj.
11749
4c94d6ae
ILT
11750 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11751 every thousand variables.
11752 * testsuite/Makefile.in: Rebuild.
11753
d491d34e
ILT
11754 * object.cc (Xindex::initialize_symtab_xindex): New function.
11755 (Xindex::read_symtab_xindex): New function.
11756 (Xindex::sym_xindex_to_shndx): New function.
11757 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11758 available.
11759 (Sized_relobj::do_initialize_xindex): New function.
11760 (Sized_relobj::do_read_symbols): Adjust section links.
11761 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11762 parameter. Change all callers.
11763 (Sized_relobj::include_section_group): Adjust section links and
11764 symbol section indexes.
11765 (Sized_relobj::do_layout): Adjust section links.
11766 (Sized_relobj::do_count_local_symbols): Adjust section links and
11767 symbol section indexes.
11768 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11769 ordinary and special symbols.
11770 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11771 dynsym_xindex parameters. Change all callers. Adjust section
11772 links. Use SHN_XINDEX when needed.
11773 (Sized_relobj::get_symbol_location_info): Adjust section links.
11774 Don't get fooled by special symbols.
11775 * object.h (class Xindex): Define.
11776 (class Object): Add xindex_ parameter. Declare virtual functoin
11777 do_initialize_xindex.
11778 (Object::adjust_sym_shndx): New function.
11779 (Object::set_xindex): New protected function.
11780 (class Symbol_value): Add is_ordinary_shndx_ field.
11781 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11782 (Symbol_value::value): Assert ordinary section.
11783 (Symbol_value::initialize_input_to_output_map): Likewise.
11784 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11785 Change all callers.
11786 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11787 all callers.
11788 (class Sized_relobj): Update declarations.
11789 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11790 parameter. Change all callers.
11791 (Sized_relobj::adjust_shndx): New function.
11792 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11793 field.
11794 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11795 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11796 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11797 (Sized_dynobj::read_dynsym_section): Adjust section links.
11798 (Sized_dynobj::read_dynamic): Likewise.
11799 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11800 section links.
11801 (Sized_dynobj::do_initialize_xindex): New function.
11802 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11803 do_initialize_xindex.
11804 (Sized_dynobj::adjust_shndx): New function.
11805 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11806 dynsym_xindex_ fields.
11807 (Layout::finalize): Add a call to set_section_indexes before
11808 creating the symtab sections.
11809 (Layout::set_section_indexes): Don't do anything if the section
11810 already has a section index.
11811 (Layout::create_symtab_sections): Add shnum parameter. Change
11812 caller. Create .symtab_shndx section if needed.
11813 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11814 caller.
11815 (Layout::allocated_output_section_count): New function.
11816 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11817 needed.
11818 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11819 fields. Update declarations.
11820 (Layout::symtab_xindex): New function.
11821 (Layout::dynsym_xindex): New function.
11822 (class Write_symbols_task): Add layout_ field.
11823 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11824 Change caller.
11825 * output.cc (Output_section_headers::Output_section_headers): Add
11826 shstrtab_section parameter. Change all callers.
11827 (Output_section_headers::do_sized_write): Store overflow values
11828 for section count and section string table section index in
11829 section header zero.
11830 (Output_file_header::do_sized_write): Check for overflow of
11831 section count and section string table section index.
11832 (Output_symtab_xindex::do_write): New function.
11833 (Output_symtab_xindex::endian_do_write): New function.
11834 * output.h (class Output_section_headers): Add shstrtab_section_.
11835 Update declarations.
11836 (class Output_symtab_xindex): Define.
11837 (Output_section::has_out_shndx): New function.
11838 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11839 field.
11840 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11841 Change all callers.
11842 (Sized_symbol::init): Likewise.
11843 (Symbol::output_section): Check for ordinary symbol.
11844 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11845 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11846 callers.
11847 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11848 Change all callers. Simplify handling of symbols from sections
11849 not included in the link.
11850 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11851 distinction.
11852 (Weak_alias_sorter::operator()): Assert that symbols are
11853 ordinary.
11854 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11855 distinction.
11856 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11857 parameters. Change all callers.
11858 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11859 symbol distinction. Use SHN_XINDEX when needed.
11860 (Symbol_table::write_section_symbol): Add symtab_xindex
11861 parameter. Change all callers.
11862 (Symbol_table::sized_write_section_symbol): Likewise. Use
11863 SHN_XINDEX when needed.
11864 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11865 declarations.
11866 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11867 (Symbol::is_defined): Check is_ordinary.
11868 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11869 (Symbol::is_absolute, Symbol::is_common): Likewise.
11870 (class Sized_symbol): Update declarations.
11871 (class Symbol_table): Update declarations.
11872 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11873 parameters. Change all callers.
11874 (Sized_symbol::override): Likewise.
11875 (Symbol_table::override): Likewise.
11876 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11877 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11878 is_ordinary, and orig_st_shndx parameters. Change all callers.
11879 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11880 to be in an ordinary section.
11881 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11882 object and is_ordinary parameters. Change all callers.
11883 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11884 Change all callers. Don't add undefined or non-ordinary symbols
11885 to reloc_map_.
11886 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11887 Change all callers.
11888 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11889 declarations.
11890 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11891 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11892 (Sized_relobj::relocate_sections): Likewise.
11893 * target-reloc.h (scan_relocs): Adjust section symbol index.
11894 (scan_relocatable_relocs): Likewise.
11895 * i386.cc (Scan::local): Check for ordinary symbols.
11896 * sparc.cc (Scan::local): Likewise.
11897 * x86_64.cc (Scan::local): Likewise.
11898 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11899 to symbol_section_and_value.
11900 * testsuite/many_sections_test.cc: New file.
11901 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11902 (check_PROGRAMS): Add many_sections_test.
11903 (many_sections_test_SOURCES): Define.
11904 (many_sections_test_DEPENDENCIES): Define.
11905 (many_sections_test_LDFLAGS): Define.
11906 (BUILT_SOURCES): Add many_sections_define.h.
11907 (many_sections_define.h): New target.
11908 (BUILT_SOURCES): Add many_sections_check.h.
11909 (many_sections_check.h): New target.
11910 (check_PROGRAMS): Add many_sections_r_test.
11911 (many_sections_r_test_SOURCES): Define.
11912 (many_sections_r_test_DEPENDENCIES): Define.
11913 (many_sections_r_test_LDFLAGS): Define.
11914 (many_sections_r_test_LDADD): Define.
11915 (many_sections_r_test.o): New target.
11916 * testsuite/Makefile.in: Rebuild.
11917
c5818ff1
CC
119182008-04-17 Cary Coutant <ccoutant@google.com>
11919
11920 * errors.cc (Errors::info): New function.
11921 (gold_info): New function.
11922 * errors.h (Errors::info): New function.
11923 * gold.h (gold_info): New function.
11924 * object.cc (Input_objects::add_object): Print trace output.
11925 * options.cc (options::parse_set): New function.
11926 (General_options::parse_wrap): Deleted.
11927 (General_options::General_options): Deleted initializer.
11928 * options.h (options::String_set): New typedef.
11929 (options::parse_set): New function.
11930 (DEFINE_set): New macro.
11931 (General_options::wrap): Changed to use DEFINE_set. Changed
11932 callers of any_wrap_symbols and is_wrap_symbol.
11933 (General_options::trace, General_options::trace_symbol):
11934 New options.
11935 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11936 (General_options::wrap_symbols_): Deleted.
11937 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11938
b5be4a7c
DM
119392008-04-17 David S. Miller <davem@davemloft.net>
11940
11941 * options.cc (General_options::parse_V): New function.
11942 * options.h: Add entries for -V and -Qy.
11943
155a0dd7
ILT
119442008-04-17 Ian Lance Taylor <iant@google.com>
11945
11946 * common.cc (Symbol_table::allocate_commons): Remove options
11947 parameter. Change caller.
11948 (Symbol_table::do_allocate_commons): Remove options parameter.
11949 Change caller. Just call do_allocate_commons_list twice.
11950 (Symbol_table::do_allocate_commons_list): New function, broken out
11951 of do_allocate_commons.
11952 * common.h (class Allocate_commons_task): Remove options_ field.
11953 Update constructor.
11954 * symtab.cc (Symbol_table::Symbol_table): Initialize
11955 tls_commons_.
11956 (Symbol_table::add_from_object): Put TLS common symbols on
11957 tls_commons_ list.
11958 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11959 which are IN_OUTPUT_DATA.
11960 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11961 allocate_commons and do_allocate_commons declarations. Declare
11962 do_allocate_commons_list.
11963 * gold.cc (queue_middle_tasks): Update creation of
11964 Allocate_commons_task to not pass options.
11965 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11966 (TLS_TEST_C_FLAGS): New variable.
11967 (tls_test_c_pic.o): New target.
11968 (tls_test_shared.so): Link in tls_test_c_pic.o.
11969 (tls_test_c_pic_ie.o): New target.
11970 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11971 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11972 (tls_test_c.o): New target.
11973 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11974 (tls_pic_test_LDADD): Likewise.
11975 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11976 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11977 (tls_test_c_gnu2.o): New target.
11978 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11979 tls_test_c_gnu2.o.
11980 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11981 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11982 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11983 * testsuite/tls_test.cc: Include "config.h".
11984 (t_last): Call t11_last.
11985 * testsuite/tls_test.h (t11, t11_last): Declare.
11986 * testsuite/tls_test_c.c: New file.
11987 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11988 * configure.ac: Check for OpenMP support.
11989 * configure, config.in, Makefile.in: Rebuild.
11990 * testsuite/Makefile.in: Rebuild.
11991
edfbb029
CC
119922008-04-16 Cary Coutant <ccoutant@google.com>
11993
11994 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11995 (Target_i386::tls_base_symbol_defined_): New field.
11996 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11997 (Target_i386::Scan::global): Likewise.
11998 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11999 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12000 (Target_x86_64::tls_base_symbol_defined_): New field.
12001 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12002 (Target_x86_64::Scan::global): Likewise.
12003
f3c69fca
CC
120042008-04-16 Cary Coutant <ccoutant@google.com>
12005
12006 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12007 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12008 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12009 building shared libraries.
12010 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12011 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12012 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12013 * testsuite/Makefile.in: Rebuild.
12014 * testsuite/weak_undef.h: New file.
12015 * testsuite/weak_undef_file1.cc: Add extra test cases.
12016 * testsuite/weak_undef_file2.cc: Likewise.
12017 * testsuite/weak_undef_test.cc: Likewise.
12018
7c414435
DM
120192008-04-16 David S. Miller <davem@davemloft.net>
12020
32b769e1
DM
12021 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12022 Add issued_non_pic_error_ field. Declare check_non_pic.
12023 (Target_sparc::Scan::check_non_pic): New function.
12024 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12025 (Target_sparc::Scan::global): Likewise.
12026
11936fb1
DM
12027 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12028 * configure: Rebuild.
12029
7c414435
DM
12030 * options.h (DEFINE_enable): New macro.
12031 (new_dtags): New enable option.
12032 (initfirst, interpose, loadfltr, nodefaultlib,
12033 nodelete, nodlopen, nodump): New -z options.
12034 * layout.cc (Layout:finish_dynamic_section): If new
12035 dtags enabled, emit DT_RUNPATH. Also, emit a
12036 DT_FLAGS_1 containing any specified -z flags.
12037
85c7bf8b
ILT
120382008-04-16 Ian Lance Taylor <iant@google.com>
12039
12c0daef
ILT
12040 * copy-relocs.cc: New file.
12041 * copy-relocs.h: New file.
12042 * reloc.cc: Remove Copy_relocs code.
12043 * reloc.h: Likewise.
12044 * reloc-types.h (struct Reloc_types) [both versions]: Add
12045 get_reloc_addend_noerror.
12046 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12047 variants of add_global which take an addend which must be zero.
12048 * i386.cc: Include "copy-relocs.h".
12049 (class Target_i386): Change type of copy_relocs_ to variable,
12050 update initializer.
12051 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12052 Change all callers.
12053 (Target_i386::do_finalize_sections): Change handling of
12054 copy_relocs_.
12055 * sparc.cc: Include "copy-relocs.h".
12056 (class Target_sparc): Change type of copy_relocs_ to variable,
12057 update initializer.
12058 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12059 Change all callers.
12060 (Target_sparc::do_finalize_sections): Change handling of
12061 copy_relocs_.
12062 * x86_64.cc: Include "copy-relocs.h".
12063 (class Target_x86_64): Change type of copy_relocs_ to variable,
12064 update initializer.
12065 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12066 class. Change all callers.
12067 (Target_x86_64::do_finalize_sections): Change handling of
12068 copy_relocs_.
12069 * Makefile.am (CCFILES): Add copy-relocs.cc.
12070 (HFILES): Add copy-relocs.h.
12071
4f4995b6
ILT
12072 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12073
85c7bf8b
ILT
12074 * testsuite/script_test_4.sh: Permit leading zeroes.
12075
4f2a9edd
ILT
120762008-04-15 Ian Lance Taylor <iant@google.com>
12077
e6188289
ILT
12078 * script-sections.cc (Script_sections::create_segments): Use
12079 header_size_adjustment even when there is enough room for the
12080 headers.
12081 * testsuite/script_test_4.sh: New file.
12082 * testsuite/script_test_4.t: New file.
12083 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12084 (check_DATA): Add script_test_4.stdout.
12085 (MOSTLYCLEANFILES): Likewise.
12086 (script_test_4): New target.
12087 (script_test_4.stdout): New target.
12088 * testsuite/Makefile.in: Rebuild.
12089
4f2a9edd
ILT
12090 * sparc.cc: Add definitions for Output_data_plt_sparc class
12091 constants.
12092
f5314dd5
DM
120932008-04-14 David S. Miller <davem@davemloft.net>
12094
12095 * sparc.cc: New file.
12096 * Makefile.am (TARGETSOURCES): Add sparc.cc
12097 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12098 * configure.tgt: Document targ_extra_size and
12099 targ_extra_big_endian. Add entries for sparc-* and
12100 sparc64-*.
12101 * configure.ac: Handle targ_extra_size and
12102 targ_extra_big_endian.
12103 * Makefile.in: Rebuild.
12104 * configure: Likewise.
12105 * po/POTFILES.in: Likewise.
12106 * po/gold.pot: Likewise.
12107
154e0e9a
ILT
121082008-04-14 Ian Lance Taylor <iant@google.com>
12109
12110 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12111 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12112 in the name/type/flags to section mapping. Don't call
12113 allocate_output_section.
12114 (Layout::choose_output_section): Change parameter from adjust_name
12115 to is_input_section. Don't permit input sections after sections
12116 are attached to segments. Don't call allocate_output_section.
12117 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12118 not write_enable_output_section.
12119 (Layout::make_output_section): Don't push to
12120 unattached_section_list_ nor call attach_to_segment. Call
12121 attach_section_to_segment if sections are attached.
12122 (Layout::attach_sections_to_segments): New function.
12123 (Layout::attach_section_to_segment): New function.
12124 (Layout::attach_allocated_section_to_segment): Rename from
12125 attach_to_segment. Remove flags parameter.
12126 (Layout::allocate_output_section): Remove function.
12127 (Layout::write_enable_output_section): Remove function.
12128 * layout.h (class Layout): Update for above changes. Add new
12129 field sections_are_attached_.
12130 * output.h (Output_section::update_flags_for_input_section): New
12131 function.
12132 * output.cc (Output_section::add_input_section): Call
12133 update_flags_for_input_section.
12134 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12135
009a67a2
CC
121362008-04-11 Cary Coutant <ccoutant@google.com>
12137
12138 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12139 thought unnecessary.
12140 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12141
759b1a24
ILT
121422008-04-11 Ian Lance Taylor <iant@google.com>
12143
12144 * output.h (class Output_section_data): Remove inline definition
12145 of set_addralign.
12146 * output.cc (Output_section_data::set_addralign): New function.
12147
c2b45e22
CC
121482008-04-11 Cary Coutant <ccoutant@google.com>
12149
12150 Add support for TLS descriptors for i386 and x86_64.
12151 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12152 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12153 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12154 GOT_TYPE_TLS_DESC.
12155 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12156 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12157 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12158 relocations.
12159 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12160 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12161 Fix problem with initial-exec relocations.
12162 (Target_i386::Relocate::relocate_tls): Likewise.
12163 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12164 relaxation.
12165 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12166 support for section-plus-offset dynamic table entries.
12167 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12168 (Output_data_dynamic::Dynamic_entry): Add support for
12169 section-plus-offset dynamic table entries.
12170 (Output_data_dynamic::Classification): Likewise.
12171 (Output_data_dynamic::classification_): Renamed offset_.
12172 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12173 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12174 (Target_x86_64::make_plt_section): New function.
12175 (Target_x86_64::reserve_tlsdesc_entries): New function.
12176 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12177 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12178 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12179 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12180 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12181 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12182 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12183 add extra PLT entry for TLS descriptors.
12184 (Output_data_plt_x86_64::got_): New field.
12185 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12186 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12187 fields.
12188 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12189 descriptors.
12190 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12191 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12192 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12193 R_386_TLS_DESC_CALL relocations.
12194 (Target_x86_64::Scan::global): Likewise.
12195 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12196 for TLS descriptors.
12197 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12198 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12199 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12200 GD-to-IE relaxation.
12201 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12202 and TLS_DESCRIPTORS.
12203 * Makefile.in: Rebuild.
12204 * configure: Rebuild.
12205 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12206 (tls_test_shared2.so): New target.
12207 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12208 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12209 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12210 (tls_shared_gd_to_ie_test_LDADD): New variable.
12211 (tls_shared_gnu2_gd_to_ie_test): New target.
12212 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12213 New targets.
12214 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12215 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12216 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12217 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12218 (tls_shared_gnu2_test): New target.
12219 (tls_test_gnu2_shared.so): New target.
12220 (tls_shared_gnu2_test_SOURCES): New variable.
12221 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12222 (tls_shared_gnu2_test_LDFLAGS): New variable.
12223 (tls_shared_gnu2_test_LDADD): New variable.
12224 * testsuite/Makefile.in: Rebuild.
12225 * testsuite/Makefile.
12226
83bfb6b7
ILT
122272008-04-11 Ian Lance Taylor <iant@google.com>
12228
12229 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12230 justsyms.t.
12231 * testsuite/Makefile.in: Rebuild.
12232
12233 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12234 long.
12235 * testsuite/script_test_2.cc (main): Adjust test.
12236
706e1f5e
ILT
122372008-04-11 David S. Miller <davem@davemloft.net>
12238 Ian Lance Taylor <iant@google.com>
12239
12240 * options.h (General_options): Add entries for '-Y' and
12241 '-relax'.
12242 * options.cc (General_options:finalize): If -Y was used, add those
12243 entries to the library path instead of the default "/lib" and
12244 "/usr/lib".
12245
7c98e6bb
DM
122462008-04-11 David S. Miller <davem@davemloft.net>
12247
12248 * testsuite/justsyms.t: Start at 0x100.
12249 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12250 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12251 long.
12252 * testsuite/script_test_2.cc: Adjust string and section length
12253 checks.
7c98e6bb 12254
99a37bfd
ILT
122552008-04-09 Ian Lance Taylor <iant@google.com>
12256
2cefc357
ILT
12257 PR gold/5996
12258 * script-sections.cc (Sections_element::allocate_to_segment): Add
12259 orphan parameter.
12260 (Output_section_definition::allocate_to_segment): Likewise.
12261 (Orphan_output_section::allocate_to_segment): Likewise.
12262 (Script_sections::attach_sections_using_phdrs_clause): Don't
12263 propagate non-PT_LOAD segments to orphan sections.
12264 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12265 readelf rather than objdump.
12266 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12267 .interp section and PT_INTERP segment are the same size.
12268 * testsuite/Makefile.in: Rebuild.
12269
99a37bfd
ILT
12270 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12271 aliases for symbols defined in the same object.
12272 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12273 (weak_alias_test_SOURCES): New variable.
12274 (weak_alias_test_DEPENDENCIES): New variable.
12275 (weak_alias_test_LDFLAGS): New variable.
12276 (weak_alias_test_LDADD): New variable.
12277 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12278 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12279 (weak_alias_test_3.o): New target.
12280 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12281 * testsuite/weak_alias_test_main.cc: New file.
12282 * testsuite/weak_alias_test_1.cc: New file.
12283 * testsuite/weak_alias_test_2.cc: New file.
12284 * testsuite/weak_alias_test_3.cc: New file.
12285
780e49c5
ILT
122862008-04-08 Ian Lance Taylor <iant@google.com>
12287
cdb0b8f5
ILT
12288 * options.h (class General_options): Add --noinhibit-exec option.
12289 * main.cc (main): Check --noinhibit-exec.
12290
0864d551
ILT
12291 * options.h (class General_options): Define --wrap as a special
12292 option. Add wrap_symbols_ field.
12293 (General_options::any_wrap_symbols): New function.
12294 (General_options::is_wrap_symbol): New function.
12295 * options.cc (General_options::parse_wrap): New function.
12296 (General_options::General_options): Initialize wrap_symbols_.
12297 * symtab.cc (Symbol_table::wrap_symbol): New function.
12298 (Symbol_table::add_from_object): Handle --wrap.
12299 * symtab.h (class Symbol_table): Declare wrap_symbol.
12300 * target.h (Target::wrap_char): New function.
12301 (Target::Target_info): Add wrap_char field.
12302 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12303 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12304 * testsuite/testfile.cc (Target_test::test_target_info):
12305 Likewise.
12306
789aa6de
ILT
12307 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12308 there is one.
12309
2c38906f
ILT
12310 * layout.h (class Layout): Add added_eh_frame_data_ field.
12311 * layout.cc (Layout::Layout): Initialize new field.
12312 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12313 output section until we find a section we merged successfully.
12314 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12315 that the size be non-zero.
12316
780e49c5
ILT
12317 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12318 qualifier.
12319
7fcd0256
ILT
123202008-04-08 Craig Silverstein <csilvers@google.com>
12321
12322 * configure.ac: Export new conditional variable HAVE_ZLIB.
12323 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12324 on HAVE_ZLIB.
12325 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12326 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12327
6835af53
ILT
123282008-04-07 Ian Lance Taylor <iant@google.com>
12329
e24f324c
ILT
12330 * version.cc (version_string): Set to "1.5".
12331
a036edd8
ILT
12332 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12333 Add issued_non_pic_error_ field. Declare check_non_pic.
12334 (Target_x86_64::Scan::check_non_pic): New function.
12335 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12336 (Target_x86_64::Scan::global): Likewise.
12337
624f8810
ILT
12338 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12339 addend parameter. Change caller. Handle merge sections.
12340 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12341 Address to Addend. Don't add in the result of
12342 local_section_offset, pass down the addend and use the returned
12343 value.
12344 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12345 Update declarations of local_section_offset and symbol_value.
12346 * testsuite/two_file_test_1.cc (t18): New function.
12347 * testsuite/two_file_test_2.cc (f18): New function.
12348 * testsuite/two_file_test_main.cc (main): Call t18.
12349 * testsuite/two_file_test.h (t18, f18): Declare.
12350
6835af53
ILT
12351 * configure.ac: Don't test for objdump, c++filt, or readelf.
12352 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12353 conditionals.
12354 (TEST_READELF): New variable.
12355 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12356 (check_PROGRAMS): Add two_file_strip_test.
12357 (two_file_strip_test): New target.
12358 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12359 (two_file_same_shared_strip_test_SOURCES): New variable.
12360 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12361 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12362 (two_file_same_shared_strip_test_LDADD): New variable.
12363 (two_file_shared_strip.so): New target.
12364 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12365 (ver_test_5.syms, ver_test_7.syms): Likewise.
12366 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12367 (strip_test_3.stdout): Use TEST_OBJDUMP.
12368 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12369
86925eef
CC
123702008-04-04 Cary Coutant <ccoutant@google.com>
12371
12372 * symtab.h (Symbol::is_weak_undefined): New function.
12373 (Symbol::is_strong_undefined): New function.
12374 (Symbol::is_absolute): New function.
12375 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12376 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12377 absolute symbols.
12378 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12379 (weak_undef_test): New target.
12380 * testsuite/Makefile.in: Rebuild.
12381 * testsuite/weak_undef_file1.cc: New file.
12382 * testsuite/weak_undef_file2.cc: New file.
12383 * testsuite/weak_undef_test.cc: New file.
12384
126f3ece
ILT
123852008-04-03 Craig Silverstein <csilvers@google.com>
12386
12387 * compressed_output.h (class Output_compressed_section): Use
12388 unsigned buffer.
12389 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12390 add zlib header.
12391 (zlib_compressed_suffix): Removed.
12392 (Output_compressed_section::set_final_data_size): Use unsigned
12393 buffers.
12394 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12395 Fix linker invocation.
12396 (flagstest_o_specialfile_and_compress_debug_sections):
12397 Likewise.
12398 * testsuite/Makefile.in: Regenerated.
12399
deae2a14
DM
124002008-04-02 David S. Miller <davem@davemloft.net>
12401
12402 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12403 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12404
70752818
ILT
124052008-04-02 Craig Silverstein <csilvers@google.com>
12406
12407 * TODO: New file.
12408
39d0cb0e
ILT
124092008-04-02 Ian Lance Taylor <iant@google.com>
12410
12411 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12412 parameters. Update for new key type to views_. Change all
12413 callers.
12414 (File_read::read): Adjust for byteshift in returned view.
12415 (File_read::add_view): New function, broken out of
12416 find_and_make_view.
12417 (File_read::make_view): New function, broken out of
12418 find_and_make_view.
12419 (File_read::find_or_make_view): Add offset and aligned
12420 parameters. Rewrite accordingly. Change all callers.
12421 (File_read::get_view): Add offset and aligned parameters. Adjust
12422 for byteshift in return value.
12423 (File_read::get_lasting_view): Likewise.
12424 * fileread.h (class File_read): Update declarations.
12425 (class File_read::View): Add byteshift_ field. Add byteshift to
12426 constructor. Add byteshift method.
12427 * archive.h (Archive::clear_uncached_views): New function.
12428 (Archive::get_view): Add aligned parameter. Change all callers.
12429 * object.h (Object::get_view): Add aligned parameter. Change all
12430 callers.
12431 (Object::get_lasting_view): Likewise.
12432
12433 * fileread.cc (File_read::release): Don't call clear_views if
12434 there are multiple objects.
12435 * fileread.h (File_read::clear_uncached_views): New function.
12436 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12437 on the archive.
12438
a1207466
CC
124392008-03-31 Cary Coutant <ccoutant@google.com>
12440
12441 Add thin archive support.
12442 * archive.cc (Archive::armagt): New const.
12443 (Archive::setup): Remove task parameter and calls to unlock.
12444 (Archive::unlock_nested_archives): New function.
12445 (Archive::read_header): Add nested_off parameter. Change
12446 all callers.
12447 (Archive::interpret_header): Likewise.
12448 (Archive::include_all_members): Change to handle thin
12449 archives.
12450 (Archive::include_member): Likewise.
12451 * archive.h (Archive::Archive): Add new parameters and
12452 initializers.
12453 (Archive::armagt): New const.
12454 (Archive::setup): Remove task parameter.
12455 (Archive::unlock_nested_archives): New function.
12456 (Archive::read_header): Add nested_off parameter.
12457 (Archive::interpret_header): Likewise.
12458 (Archive::Nested_archive_table): New typedef.
12459 (Archive::is_thin_archive_): New field.
12460 (Archive::nested_archives_): New field.
12461 (Archive::options_): New field.
12462 (Archive::dirpath_): New field.
12463 (Archive::task_): New field.
12464 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12465 for thin archives. Pass additional parameters to
12466 Archive::Archive. Unlock the archive file after calling
12467 Archive::setup.
cd536b21 12468
479f6503
ILT
124692008-03-29 Ian Lance Taylor <iant@google.com>
12470
686c8caf
ILT
12471 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12472 version symbol to be local.
12473 * testsuite/ver_test_4.sh: New file.
12474 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12475 (check_DATA): Add ver_test_4.syms.
12476 (ver_test_4.syms): New target.
12477 * testsuite/Makefile.in: Rebuild.
12478
ab794b6b
ILT
12479 * output.cc
12480 (Output_section::Input_section_sort_entry::has_priority): New
12481 function.
12482 (Output_section::Input_section_sort_entry::match_file_name): New
12483 function.
12484 (Output_section::Input_section_sort_entry::match_section_name):
12485 Remove.
12486 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12487 Remove.
12488 (Output_section::Input_section_sort_entry::match_section_file):
12489 Remove.
12490 (Output_section::Input_section_sort_compare::operator()): Rewrite
12491 using new Input_section_sort_entry functions. Sort crtbegin and
12492 crtend first. Sort sections with no priority before sections with
12493 a priority.
12494 * testsuite/initpri1.c (d3): Check j != 4.
12495 (cd5): New constructor/destructor function.
12496 (main): Check j != 2.
12497
479f6503
ILT
12498 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12499 new symbol when resolving, don't call set_is_default.
12500 * testsuite/ver_test_7.cc: New file.
12501 * testsuite/ver_test_7.sh: New file.
12502 * testsuite/Makefile.am (ver_test_7.so): New target.
12503 (ver_test_7.o): New target.
12504 (check_SCRIPTS): Add ver_test_7.sh.
12505 (check_DATA): Add ver_test_7.syms.
12506 (ver_test_7.syms): New target.
12507
2fd32231
ILT
125082008-03-28 Ian Lance Taylor <iant@google.com>
12509
12510 * layout.cc (Layout::layout): If we see an input section with a
12511 name that needs sorting, set the must_sort flag for the output
12512 section.
12513 (Layout::make_output_section): If the name of the output section
12514 indicates that it might require sorting, set the may_sort flag.
12515 * output.h (Output_section::may_sort_attached_input_sections): New
12516 function.
12517 (Output_section::set_may_sort_attached_input_sections): New
12518 function.
12519 (Output_section::must_sort_attached_input_sections): New
12520 function.
12521 (Output_section::set_must_sort_attached_input_sections): New
12522 function.
12523 (class Output_section): Declare Input_section_sort_entry. Define
12524 Input_section_sort_compare. Declare
12525 sort_attached_input_sections. Add new fields:
12526 may_sort_attached_input_sections_,
12527 must_sort_attached_input_sections_,
12528 attached_input_sections_are_sorted_.
12529 * output.cc (Output_section::Output_section): Initialize new
12530 fields.
12531 (Output_section::add_input_section): Add an entry to
12532 input_sections_ if may_sort or must_sort are true.
12533 (Output_section::set_final_data_size): Call
12534 sort_attached_input_sections if necessary.
12535 (Output_section::Input_section_sort_entry): Define new class.
12536 (Output_section::Input_section_sort_compare::operator()): New
12537 function.
12538 (Output_section::sort_attached_input_sections): New function.
12539 * configure.ac: Check whether the compiler supports constructor
12540 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12541 * testsuite/initpri1.c: New file.
12542 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12543 CONSTRUCTOR_PRIORITY.
12544 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12545 (initpri1_LDFLAGS): New variable.
12546 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12547
18e6b24e
ILT
125482008-03-27 Ian Lance Taylor <iant@google.com>
12549
49bdd526
ILT
12550 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12551 * testsuite/common_test_1.c: New file.
12552 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12553 (common_test_1_SOURCES): New variable.
12554 (common_test_1_DEPENDENCIES): New variable.
12555 (common_test_1_LDFLAGS): New variable.
12556
18e6b24e
ILT
12557 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12558 and commons_ correctly when NAME/VERSION does not override
12559 NAME/NULL.
12560 * testsuite/ver_test_6.c: New file.
12561 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12562 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12563 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12564
04bf7072
ILT
125652008-03-26 Ian Lance Taylor <iant@google.com>
12566
5871526f
ILT
12567 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12568 of an undefined symbol from a version script.
12569 * testsuite/Makefile.am (ver_test_5.so): New target.
12570 (ver_test_5.o): New target.
12571 (check_SCRIPTS): Add ver_test_5.sh.
12572 (check_DATA): Add ver_test_5.syms.
12573 (ver_test_5.syms): New target.
12574 * testsuite/ver_test_5.cc: New file.
12575 * testsuite/ver_test_5.script: New file.
12576 * testsuite/ver_test_5.sh: New file.
12577 * Makefile.in, testsuite/Makefile.in: Rebuild.
12578
04bf7072
ILT
12579 PR gold/5986
12580 Fix problems building gold with gcc 4.3.0.
12581 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12582 (gold_error_at_location, gold_warning_at_location): Use it.
12583 * configure.ac: Check whether we can compile and use a template
12584 function with a printf attribute.
12585 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12586 when jumping over bytes.
12587 * object.cc: Instantiate Object::read_section_data.
12588 * debug.h: Include <cstring>
12589 * dwarf_reader.cc: Include <algorithm>
12590 * main.cc: Include <cstring>.
12591 * options.cc: Include <cstring>.
12592 * output.cc: Include <cstring>.
12593 * script.cc: Include <cstring>.
12594 * script.h: Include <string>.
12595 * symtab.cc: Include <cstring> and <algorithm>.
12596 * target-select.cc: Include <cstring>.
12597 * version.cc: Include <string>.
12598 * testsuite/testmain.cc: Include <cstdlib>.
12599 * configure, config.in: Rebuild.
12600
874c5b28
ILT
126012008-03-25 Ian Lance Taylor <iant@google.com>
12602
819d6c3a
ILT
12603 * options.cc: Include "../bfd/bfdver.h".
12604 (options::help): Print bug reporting address.
12605
f4b2c6f5
ILT
12606 * version.cc (print_version): Adjust output for current value of
12607 BFD_VERSION_STRING.
12608
12609 * NEWS: New file.
12610
e96caa79
ILT
12611 * options.cc (options::help): Print list of supported targets.
12612 * target-select.h: Include <vector>.
12613 (class Target_selector): Make machine_, size_, and is_big_endian_
12614 fields const. Add bfd_name_ and instantiated_target_ fields.
12615 (Target_selector::Target_selector): Add bfd_name parameter.
12616 (Target_selector::recognize): Make non-virtual, call
12617 do_recognize.
12618 (Target_selector::recognize_by_name): Make non-virtual, call
12619 do_recognize_by_name.
12620 (Target_selector::supported_names): New function.
12621 (Target_selector::bfd_name): New function.
12622 (Target_selector::do_instantiate_target): New pure virtual
12623 function.
12624 (Target_selector::do_recognize): New virtual function.
12625 (Target_selector::do_recognize_by_name): New virtual function.
12626 (Target_selector::instantiate_target): New private function.
12627 (supported_target_names): Declare.
12628 * target-select.cc (Target_selector::Target_selector): Update for
12629 new parameter and fields.
12630 (select_target_by_name): Check that the name matches before
12631 calling recognize_by_name.
12632 (supported_target_names): New function.
12633 * i386.cc (class Target_selector_i386): Update Target_selector
12634 constructor call. Remove recognize and recognize_by_name. Add
12635 do_instantiate_target.
12636 * x86_64.cc (class Target_selector_x86_64): Likewise.
12637 * testsuite/testfile.cc (class Target_selector_test): Update for
12638 changes to Target_selector.
12639
874c5b28
ILT
12640 * README: Rewrite, with some notes on unsupported features.
12641
0a65a3a7
CC
126422008-03-24 Cary Coutant <ccoutant@google.com>
12643
12644 * i386.cc (Target_i386::Got_type): New enum declaration.
12645 (Target_i386::Scan::local): Updated callers of Output_data_got
12646 member functions.
12647 (Target_i386::Scan::global): Likewise.
12648 (Target_i386::Relocate::relocate): Likewise.
12649 (Target_i386::Relocate::relocate_tls): Likewise.
12650 * object.h (Got_offset_list): New class.
12651 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12652 (Sized_relobj::local_got_offset): Likewise.
12653 (Sized_relobj::set_local_got_offset): Likewise.
12654 (Sized_relobj::local_has_tls_got_offset): Removed.
12655 (Sized_relobj::local_tls_got_offset): Removed.
12656 (Sized_relobj::set_local_tls_got_offset): Removed.
12657 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12658 * output.cc (Output_data_got::add_global): Added got_type parameter.
12659 (Output_data_got::add_global_with_rel): Likewise.
12660 (Output_data_got::add_global_with_rela): Likewise.
12661 (Output_data_got::add_global_pair_with_rel): New function.
12662 (Output_data_got::add_global_pair_with_rela): New function.
12663 (Output_data_got::add_local): Added got_type parameter.
12664 (Output_data_got::add_local_with_rel): Likewise.
12665 (Output_data_got::add_local_with_rela): Likewise.
12666 (Output_data_got::add_local_pair_with_rel): New function.
12667 (Output_data_got::add_local_pair_with_rela): New function.
12668 (Output_data_got::add_global_tls): Removed.
12669 (Output_data_got::add_global_tls_with_rel): Removed.
12670 (Output_data_got::add_global_tls_with_rela): Removed.
12671 (Output_data_got::add_local_tls): Removed.
12672 (Output_data_got::add_local_tls_with_rel): Removed.
12673 (Output_data_got::add_local_tls_with_rela): Removed.
12674 * output.h (Output_data_got::add_global): Added got_type parameter.
12675 (Output_data_got::add_global_with_rel): Likewise.
12676 (Output_data_got::add_global_with_rela): Likewise.
12677 (Output_data_got::add_global_pair_with_rel): New function.
12678 (Output_data_got::add_global_pair_with_rela): New function.
12679 (Output_data_got::add_local): Added got_type parameter.
12680 (Output_data_got::add_local_with_rel): Likewise.
12681 (Output_data_got::add_local_with_rela): Likewise.
12682 (Output_data_got::add_local_pair_with_rel): New function.
12683 (Output_data_got::add_local_pair_with_rela): New function.
12684 (Output_data_got::add_global_tls): Removed.
12685 (Output_data_got::add_global_tls_with_rel): Removed.
12686 (Output_data_got::add_global_tls_with_rela): Removed.
12687 (Output_data_got::add_local_tls): Removed.
12688 (Output_data_got::add_local_tls_with_rel): Removed.
12689 (Output_data_got::add_local_tls_with_rela): Removed.
12690 * resolve.cc (Symbol::override_base_with_special): Removed
12691 reference to has_got_offset_ field.
12692 * symtab.cc (Symbol::init_fields): Replaced initialization
12693 of got_offset_ with got_offsets_. Removed initialization
12694 of has_got_offset_
53fcba31 12695 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
12696 (Symbol::got_offset): Likewise.
12697 (Symbol::set_got_offset): Likewise.
12698 (Symbol::has_tls_got_offset): Removed.
12699 (Symbol::tls_got_offset): Removed.
12700 (Symbol::set_tls_got_offset): Removed.
12701 (Symbol::got_offset_): Removed.
12702 (Symbol::tls_mod_got_offset_): Removed.
12703 (Symbol::tls_pair_got_offset_): Removed.
12704 (Symbol::got_offsets_): New field.
12705 (Symbol::has_got_offset): Removed.
12706 (Symbol::has_tls_mod_got_offset): Removed.
12707 (Symbol::has_tls_pair_got_offset): Removed.
12708 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12709 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12710 member functions.
12711 (Target_x86_64::Scan::global): Likewise.
12712 (Target_x86_64::Relocate::relocate): Likewise.
12713 (Target_x86_64::Relocate::relocate_tls): Likewise.
12714
bd52eafb
BE
127152008-03-25 Ben Elliston <bje@au.ibm.com>
12716
12717 * yyscript.y: Fix spelling error in comment.
12718
8b105e34
ILT
127192008-03-24 Ian Lance Taylor <iant@google.com>
12720
8ed814a9
ILT
12721 * options.h (class General_options): Define build_id option.
12722 * layout.h (class Layout): Declare write_build_id, create_note,
12723 create_build_id. Add build_id_note_ member.
12724 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12725 "libiberty.h", "md5.h", "sha1.h".
12726 (Layout::Layout): Initialize eh_frame_data_,
12727 eh_frame_hdr_section_, and build_id_note_.
12728 (Layout::finalize): Call create_build_id.
12729 (Layout::create_note): New function, broken out of
12730 Layout::create_gold_note.
12731 (Layout::create_gold_note): Call create_note.
12732 (Layout::create_build_id): New function.
12733 (Layout::write_build_id): New function.
12734 (Close_task_runner::run): Call write_build_id.
12735
8b105e34
ILT
12736 * x86_64.cc: Correct license to GPLv3.
12737
086a1841
ILT
127382008-03-23 Ian Lance Taylor <iant@google.com>
12739
12740 * options.cc: Include "demangle.h".
12741 (parse_optional_string): New function.
12742 (parse_long_option): Handle takes_optional_argument.
12743 (parse_short_option): Update dash_z initializer. Handle
12744 takes_optional_argument.
12745 (General_options::General_options): Initialize do_demangle_.
12746 (General_options::finalize): Set do_demangle_. Handle demangling
12747 style.
12748 * options.h (parse_optional_string): Declare.
12749 (struct One_option): Add optional_arg field. Update constructor.
12750 Update call constructor calls. Add takes_optional_argument
12751 function.
12752 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12753 (DEFINE_optional_string): Define.
12754 (General_options::demangle): Change from DEFINE_bool to
12755 DEFINE_optional_string.
12756 (General_options::no_demangle): New function.
12757 (General_options::do_demangle): New function.
12758 (General_options::set_do_demangle): New function.
12759 (General_options::execstack_status_): Move definition to end of
12760 class definition.
12761 (General_options::static_): Likewise.
12762 (General_options::do_demangle_): New field.
12763 * object.cc (big_endian>::get_symbol_location_info): Call
12764 Options::do_demangle, not Options::demangle.
12765 * symtab.cc (demangle): Likewise.
12766
cbb93e63
ILT
127672008-03-22 Ian Lance Taylor <iant@google.com>
12768
12769 * gold.h: Include <cstddef> and <sys/types.h>
12770 * options.h: Include <cstring>.
12771
ec531623
ILT
127722008-03-21 Ian Lance Taylor <iant@google.com>
12773
12774 * Added source code to GNU binutils.
This page took 0.759291 seconds and 4 git commands to generate.