gold: Allow use_plt_offset to be specified for global relocations.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
13cf9988
DM
12012-04-16 David S. Miller <davem@davemloft.net>
2
3 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
6 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
7 global relocs too.
8 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
9 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
10 calls.
11 * sparc.cc (Target_sparc::Scan::global): Likewise.
12 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
13
31821be0
CC
142012-04-16 Cary Coutant <ccoutant@google.com>
15
16 * archive.cc (Library_base::should_include_member): Check for
17 --export-dynamic-symbol.
18 * options.h (class General_options): Add --export-dynamic-symbol.
19 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
20 --export-dynamic-symbol.
21 (Symbol_table::gc_mark_undef_symbols): Likewise.
22 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
23
2615994e
DM
242012-04-12 David S. Miller <davem@davemloft.net>
25
26 * sparc.cc (Reloc::wdisp10): New relocation method.
27 (Reloc::h34): Likewise.
28 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
29 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
30 R_SPARC_WDISP10.
31 (Target_sparc::Scan::local): Likewise.
32 (Target_sparc::Scan::global): Likewise.
33 (Target_sparc::Relocate::relocate): Likewise.
34
6782735d
CC
352012-04-09 Cary Coutant <ccoutant@google.com>
36
37 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
38 low_pc == 0.
39
8c7a0b00
ILT
402012-04-06 Ian Lance Taylor <iant@google.com>
41
42 * timer.cc: #include <unistd.h>.
43
58797674
RM
442012-04-06 Roland McGrath <mcgrathr@google.com>
45
46 * configure.in (AC_CHECK_HEADERS): Add locale.h.
47 * config.in: Regenerate.
48 * configure: Regenerate.
49
44350750
NC
502012-04-05 Nick Clifton <nickc@redhat.com>
51
52 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
53 (AM_LC_MESSAGES): Add.
54 * aclocal.m4: Regenerate.
55 * config.in: Regenerate.
56 * configure: Regenerate.
57
c1027032
CC
582012-03-21 Cary Coutant <ccoutant@google.com>
59
60 * Makefile.am: Add gdb-index.cc, gdb-index.h.
61 * Makefile.in: Regenerate.
62 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
63 (Sized_elf_reloc_mapper::symbol_section): New function.
64 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
65 (make_elf_reloc_mapper): New function.
66 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
67 (Dwarf_abbrev_table::do_read_abbrevs): New function.
68 (Dwarf_abbrev_table::do_get_abbrev): New function.
69 (Dwarf_ranges_table::read_ranges_table): New function.
70 (Dwarf_ranges_table::read_range_list): New function.
71 (Dwarf_pubnames_table::read_section): New function.
72 (Dwarf_pubnames_table::read_header): New function.
73 (Dwarf_pubnames_table::next_name): New function.
74 (Dwarf_die::Dwarf_die): New function.
75 (Dwarf_die::read_attributes): New function.
76 (Dwarf_die::skip_attributes): New function.
77 (Dwarf_die::set_name): New function.
78 (Dwarf_die::set_linkage_name): New function.
79 (Dwarf_die::attribute): New function.
80 (Dwarf_die::string_attribute): New function.
81 (Dwarf_die::int_attribute): New function.
82 (Dwarf_die::uint_attribute): New function.
83 (Dwarf_die::ref_attribute): New function.
84 (Dwarf_die::child_offset): New function.
85 (Dwarf_die::sibling_offset): New function.
86 (Dwarf_info_reader::check_buffer): New function.
87 (Dwarf_info_reader::parse): New function.
88 (Dwarf_info_reader::do_parse): New function.
89 (Dwarf_info_reader::do_read_string_table): New function.
90 (Dwarf_info_reader::lookup_reloc): New function.
91 (Dwarf_info_reader::get_string): New function.
92 (Dwarf_info_reader::visit_compilation_unit): New function.
93 (Dwarf_info_reader::visit_type_unit): New function.
94 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
95 Sized_elf_reloc_mapper.
96 (Sized_dwarf_line_info::symbol_section): Remove function.
97 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
98 (Sized_dwarf_line_info::read_line_mappings): Remove object
99 parameter, adjust callers.
100 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
101 * dwarf_reader.h: Include <sys/types.h>.
102 (class Track_relocs): Remove forward declaration.
103 (class Elf_reloc_mapper): New class.
104 (class Sized_elf_reloc_mapper): New class.
105 (class Dwarf_abbrev_table): New class.
106 (class Dwarf_range_list): New class.
107 (class Dwarf_ranges_table): New class.
108 (class Dwarf_pubnames_table): New class.
109 (class Dwarf_die): New class.
110 (class Dwarf_info_reader): New class.
111 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
112 (Sized_dwarf_line_info::symbol_section): Remove member function.
113 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
114 base class.
115 * gdb-index.cc: New source file.
116 * gdb-index.h: New source file.
117 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
118 and .debug_types sections, call Layout::add_to_gdb_index.
119 (Sized_relobj_incr::do_section_name): Implement.
120 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
121 return type; Implement.
122 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
123 return type.
124 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
125 parameter list and return type.
126 (Sized_incr_dynobj::do_section_contents): Likewise.
127 * layout.cc: Include gdb-index.h.
128 (Layout::Layout): Initialize gdb_index_data_.
129 (Layout::init_fixed_output_section): Check for .gdb_index section.
130 (Layout::add_to_gdb_index): New function. Instantiate.
131 * layout.h: Add forward declaration for class Gdb_index.
132 (Layout::add_to_gdb_index): New member function.
133 (Layout::gdb_index_data_): New data member.
134 * main.cc: Include gdb-index.h.
135 (main): Print statistics for gdb index.
136 * object.cc (Object::section_contents): Move code into
137 do_section_contents.
138 (need_decompressed_section): Check for sections needed when building
139 gdb index.
140 (build_compressed_section_map): Likewise.
141 (Sized_relobj_file::do_read_symbols): Need local symbols when building
142 gdb index.
143 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
144 sections; call Layout::add_to_gdb_index.
145 (Sized_relobj_file::do_decompressed_section_contents): Call
146 do_section_contents directly.
147 * object.h (Object::do_section_contents): Adjust parameter list and
148 return type.
149 (Object::do_decompressed_section_contents): Call do_section_contents
150 directly.
151 (Sized_relobj_file::do_section_contents): Adjust parameter list and
152 return type.
153 * options.h (class General_options): Add --gdb-index option.
154 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
155 list and return type.
156 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
157 * reloc.h (Track_relocs::checkpoint): New function.
158 (Track_relocs::reset): New function.
159
160 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
161 New test cases.
162 * testsuite/Makefile.in: Regenerate.
163 * testsuite/gdb_index_test.cc: New test source file.
164 * testsuite/gdb_index_test_1.sh: New test source file.
165 * testsuite/gdb_index_test_2.sh: New test source file.
166
647f1574
DK
1672012-03-19 Doug Kwan <dougkwan@google.com>
168
169 * arm.cc (Target_arm::do_define_standard_symbols): New method.
170 (Target_arm::do_finalize_sections): Remove code which defines
171 __exidx_start and __exidx_end. Make symbol table parameter
172 anonymous as it is not used.
173 * gold.cc (queue_middle_tasks): Call target hook to define any
174 target-specific symbols.
175 * target.h (Target::define_standard_symbols): New method.
176 (Target::do_define_standard_symbols): Same.
177 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
178 * testsuite/Makefile.in: Regenerate.
179 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
180 and __exidx_end.
181 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
182 relocations are generated for __exidx_start and __exidx_end.
183
7c6109da
DK
1842012-03-16 Doug Kwan <dougkwan@google.com>
185
186 * testsuite/Makefile.am: Disable test initpri3b.
187 * testsuite/Makefile.in: Regenerate.
188
7b8957f8
DK
1892012-03-15 Doug Kwan <dougkwan@google.com>
190
191 * arm.cc (Target_arm::got_section): Make .got section read-only
192 if -z now is given.
193
14dc9ef7
ILT
1942012-03-15 Ian Lance Taylor <iant@google.com>
195
196 PR gold/13850
197 * layout.cc (Layout::make_output_section): Correctly mark
198 SHT_INIT_ARRAY, et. al., as relro.
199
fa40b62a
DK
2002012-03-14 Doug Kwan <dougkwan@google.com>
201
202 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
203 dynamic relocations for protected symbols in shared objects.
204
fd325007
ILT
2052012-03-13 Ian Lance Taylor <iant@google.com>
206
207 * resolve.cc (Symbol_table::resolve): When merging common symbols,
208 keep the larger alignment.
209
e8dd54e1
CC
2102012-03-12 Cary Coutant <ccoutant@google.com>
211
212 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
213 handling of DW_LNE_define_file.
214
feb5f3b0
CC
2152012-03-12 Cary Coutant <ccoutant@google.com>
216
217 * reduced_debug_output.cc
218 (Output_reduced_debug_info_section::get_die_end): Add new FORM
219 codes to switch.
220
a1fb4256
CC
2212012-02-29 Cary Coutant <ccoutant@google.com>
222
223 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
224
5dd8762a
CC
2252012-02-29 Cary Coutant <ccoutant@google.com>
226
227 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
228 Call Object::decompressed_section_contents.
229 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
230 New dtor.
231 (Sized_dwarf_line_info::buffer_start_): New data member.
232 * merge.cc (Output_merge_data::do_add_input_section): Call
233 Object::decompressed_section_contents.
234 (Output_merge_string::do_add_input_section): Likewise.
235 * object.cc (need_decompressed_section): New function.
236 (build_compressed_section_map): Decompress sections needed later.
237 (Sized_relobj_file::do_decompressed_section_contents): New function.
238 (Sized_relobj_file::do_discard_decompressed_sections): New function.
239 * object.h (Object::decompressed_section_contents): New function.
240 (Object::discard_decompressed_sections): New function.
241 (Object::do_decompressed_section_contents): New function.
242 (Object::do_discard_decompressed_sections): New function.
243 (Compressed_section_info): New type.
244 (Compressed_section_map): Include decompressed section contents.
245 (Sized_relobj_file::do_decompressed_section_contents): New function.
246 (Sized_relobj_file::do_discard_decompressed_sections): New function.
247
7b5de7ee
CC
2482012-02-16 Cary Coutant <ccoutant@google.com>
249
250 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
251 * testsuite/Makefile.in: Regenerate.
252
f9fa4a63
CC
2532012-02-14 Cary Coutant <ccoutant@google.com>
254
255 * options.cc (General_options::finalize): Disallow -pie and -static.
256
2c175ebc
DK
2572012-02-03 Doug Kwan <dougkwan@google.com>
258
259 * arm.cc (Arm_relocate_functions::abs8,
260 Arm_relocate_functions::abs16): Use
261 Bits::has_signed_unsigned_overflow32.
262 (Arm_relocate_functions::thm_abs8): Correct range of
263 overflow check.
264 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
265 in assertions.
266
90cff06f
DK
2672012-02-02 Doug Kwan <dougkwan@google.com>
268
269 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
270 position independent outputs, not just shared objects.
271
63887f3d
L
2722012-01-30 H.J. Lu <hongjiu.lu@intel.com>
273
274 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
275 * configure: Regenerated.
276
bef2b434
ILT
2772012-01-27 Ian Lance Taylor <iant@google.com>
278
279 * reloc.h (Bits): New class with static functions, copied from
280 namespace utils in arm.cc.
281 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
282 instead.
283
c335b55d
L
2842012-01-27 H.J. Lu <hongjiu.lu@intel.com>
285
286 * incremental.cc (write_info_blocks): Correct relocation offset.
287
41194d9f
L
2882012-01-27 H.J. Lu <hongjiu.lu@intel.com>
289
290 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
291 (Relocate::tls_gd_to_le): Likewise.
292
1bae613c
L
2932012-01-27 H.J. Lu <hongjiu.lu@intel.com>
294
295 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
296
24482ca0
L
2972012-01-27 H.J. Lu <hongjiu.lu@intel.com>
298
299 * configure.ac: Check if -mcmodel=medium works.
300 * configure: Regenerated.
301
c2c7840a
CC
3022012-01-24 Cary Coutant <ccoutant@google.com>
303
304 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
305 definition and ...
306 (read_unsigned_LEB_128_x): ... this new function.
307 (read_signed_LEB_128): Replaced with inline definition and ...
308 (read_signed_LEB_128_x): ... this new function.
309 * int_encoding.h (read_unsigned_LEB_128_x): New function.
310 (read_unsigned_LEB_128): Add inline definition.
311 (read_signed_LEB_128_x): New function.
312 (read_signed_LEB_128): Add inline definition.
313 * testsuite/Makefile.am (leb128_unittest): New unit test.
314 * testsuite/Makefile.in: Regenerate.
315 * testsuite/leb128_unittest.cc: New unit test.
316
833de760 3172012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
318
319 PR gold/13617
320 * i386.cc (Target_i386::do_code_fill): When using a jmp
321 instruction, pad with nop instructions.
322 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
323
618d6666
L
3242012-01-22 H.J. Lu <hongjiu.lu@intel.com>
325
326 * x86_64.cc (gc_process_relocs): Add typename on types used in
327 template.
328 (scan_relocs): Likewise.
329 (relocate_section): Likewise.
330 (apply_relocation): Likewise.
331
3660ff06
L
3322012-01-10 H.J. Lu <hongjiu.lu@intel.com>
333
334 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
335 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
336 under x32.
337
fc51264f
L
3382012-01-09 H.J. Lu <hongjiu.lu@intel.com>
339
340 * x86_64.cc: Initial support for x32.
341
dd74ae06
CC
3422012-01-03 Cary Coutant <ccoutant@google.com>
343
344 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
345 Use abstract base class for GOT.
346 * gold/output.h (class Output_data_got_base): New abstract base class.
347 (class Output_data_got): Derive from new base class, adjust ctors.
348 (Output_data_got::reserve_slot): Make virtual; rename to
349 do_reserve_slot; Adjust callers.
350 * gold/target.h (Sized_target::init_got_plt_for_update): Return
351 pointer to abstract base class.
352 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
353
83896202
ILT
3542011-12-18 Ian Lance Taylor <iant@google.com>
355
356 * object.h (Relobj::local_symbol_value): New function.
357 (Relobj::local_plt_offset): New function.
358 (Relobj::local_has_got_offset): New function.
359 (Relobj::local_got_offset): New function.
360 (Relobj::set_local_got_offset): New function.
361 (Relobj::do_local_symbol_value): New pure virtual function.
362 (Relobj::do_local_plt_offset): Likewise.
363 (Relobj::do_local_has_got_offset): Likewise.
364 (Relobj::do_local_got_offset): Likewise.
365 (Relobj::do_set_local_got_offset): Likewise.
366 (Sized_relobj::do_local_has_got_offset): Rename from
367 local_has_got_offset.
368 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
369 (Sized_relobj::do_set_local_got_offset): Rename from
370 set_local_got_offset.
371 (Sized_relobj_file::do_local_plt_offset): Rename from
372 local_plt_offset.
373 (Sized_relobj_file::do_local_symbol_value): New function.
374 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
375 local_plt_offset.
376 * output.cc (Output_data_got::Got_entry::write): Change object to
377 Relobj. Use local_symbol_value.
378 (Output_data_got::add_global_with_rel): Change rel_dyn to
379 Output_data_reloc_generic*. Use add_global_generic.
380 (Output_data_got::add_global_with_rela): Remove. Change all
381 callers to use add_global_with_rel.
382 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
383 Output_data_reloc_generic*. Use add_global_generic.
384 (Output_data_got::add_global_pair_with_rela): Remove. Change all
385 callers to use add_global_pair_with_rel.
386 (Output_data_got::add_local): Change object to Relobj*.
387 (Output_data_got::add_local_plt): Likewise.
388 (Output_data_got::add_local_with_rel): Change object to Relobj*,
389 change rel_dyn to Output_data_reloc_generic*. Use
390 add_local_generic.
391 (Output_data_got::add_local_with_rela): Remove. Change all
392 callers to use all_local_with_rel.
393 (Output_data_got::add_local_pair_with_rel): Change object to
394 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
395 add_output_section_generic.
396 (Output_data_got::add_local_pair_with_rela): Remove. Change all
397 callers to use add_local_pair_with_rel.
398 (Output_data_got::reserve_local): Change object to Relobj*.
399 * output.h: (class Output_data_reloc_generic): Add pure virtual
400 declarations for add_global_generic, add_local_generic,
401 add_output_section_generic.
402 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
403 functions for Output_data_reloc_generic. Update declarations for
404 changes listed in output.cc.
405 (class Output_data_got): Change template parameter to got_size.
406 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
407 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
408 function.
409 (Sized_relobj_incr::do_local_plt_offset): New function.
410 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
411 add_global_generic.
412
76677ad0
CC
4132011-12-17 Cary Coutant <ccoutant@google.com>
414
415 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
416 * resolve.cc (Symbol_table::resolve): Likewise.
417 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
418 arrays.
419 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
420
8b8dd8d5
ILT
4212011-12-16 Ian Lance Taylor <iant@google.com>
422
423 * output.h (Output_data_reloc_generic::add): Only call
424 add_dynamic_reloc if this is a dynamic reloc section.
425
d55525b9
L
4262011-12-15 H.J. Lu <hongjiu.lu@intel.com>
427
428 PR gold/13505
429 * target-reloc.h (apply_relocation): Replace <64, false> with
430 <size, big_endian>.
431
ff81c7c1
NC
4322011-11-25 Nick Clifton <nickc@redhat.com>
433
434 * po/it.po: New Italian translation.
435
628f39be
SA
4362011-11-17 Sterling Augustine <saugustine@google.com>
437
438 * script.cc (script_include_directive): Implement.
439 (read_script_file): New local variables name and search_path. Update
440 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
441 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
442 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
443
98ef3ea4
SA
4442011-11-11 Sterling Augustine <saugustine@google.com>
445
446 * yyscript.y (section_cmd): Add support for INCLUDE directive.
447 (file_or_sections_cmd): Likewise.
448
f4a8b6d7
DK
4492011-11-11 Doug Kwan <dougkwan@google.com>
450
451 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
452 if --just-symbols is given.
453
29ab395d
DK
4542011-11-10 Doug Kwan <dougkwan@google.com>
455
456 PR gold/13362
457 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
458 when processing data relocs.
459 * reloc.h (Relocate_functions::rel_unaligned): New method.
460 (Relocate_functions::pcrel_unaligned): Ditto.
461 (Relocate_functions::rel32_unaligned): Ditto.
462 (Relocate_functions::pcrel32_unaligned): Ditto.
463
2c339f71
DK
4642011-11-09 Doug Kwan <dougkwan@google.com>
465
466 PR gold/13362
467 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
468 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
469 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
470 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
471 (Relocate_functions::rel_unaligned): New.
472 (Relocate_functions::rel32_unaligned): New.
473 * target-reloc.h (relocate_for_relocatable): Add code to handle
474 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
475 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
476 arm_unaligned_reloc_r): New targets.
477 * testsuite/Makefile.in: Regenerate.
478 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
479 linking.
480
3f3cddf1
ILT
4812011-11-02 Ian Lance Taylor <iant@google.com>
482
483 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
484 NATIVE_LINKER.
485 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
486 * options.cc (General_options::finalize): Use library search path
487 from configure script if specified. If not native and no sysroot,
488 only search TOOLLIBDIR.
489 * options.h (Search_directory::Search_directory): Change name to
490 const std::string&.
491 (General_options::add_to_library_path_with_sysroot): Change arg to
492 const std::string&.
493 * configure, Makefile.in, config.in: Rebuild.
494
a8e2273b
ILT
4952011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
496
497 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
498 we are working around the ARM1176 Erratum.
499 * options.h (General_options::fix_arm1176): Add option.
500 * testsuite/Makefile.am: Add testcases, and keep current ones
501 working.
502 * testsuite/Makefile.in: Regenerate.
503 * testsuite/arm_fix_1176.s: New file.
504 * testsuite/arm_fix_1176.sh: Likewise.
505
cd6eab1c
ILT
5062011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
507
508 * arm.cc (Target_arm::Target_arm): Remove initialisation of
509 may_use_blx_.
510 (Target_arm::may_use_blx): Remove method.
511 (Target_arm::set_may_use_blx): Likewise.
512 (Target_arm::may_use_v4t_interworking): New method.
513 (Target_arm::may_use_v5t_interworking): Likewise.
514 (Target_arm::may_use_blx_): Remove member variable.
515 (Arm_relocate_functions::arm_branch_common): Check for v5T
516 interworking.
517 (Arm_relocate_functions::thumb_branch_common): Likewise.
518 (Reloc_stub::stub_type_for_reloc): Likewise.
519 (Target_arm::do_finalize_sections): Correct interworking checks.
520 * testsuite/Makefile.am: Add new tests.
521 * testsuite/Makefile.in: Regenerate.
522 * testsuite/arm_farcall_arm_arm.s: New test.
523 * testsuite/arm_farcall_arm_arm.sh: Likewise.
524 * testsuite/arm_farcall_arm_thumb.s: Likewise.
525 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
526 * testsuite/arm_farcall_thumb_arm.s: Likewise.
527 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
528 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
529 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
530
286adcf4
CC
5312011-10-31 Cary Coutant <ccoutant@google.com>
532
533 PR gold/13023
534 * expression.cc (Expression::eval_with_dot): Add
535 is_section_dot_assignment parameter.
536 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
537 absolute and assigning to dot within a section.
538 * script-sections.cc
539 (Output_section_element_assignment::set_section_addresses): Pass
540 dot_section to set_if_absolute.
541 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
542 as is_section_dot_assignment flag to eval_with_dot.
543 (Output_section_element_dot_assignment::set_section_addresses):
544 Likewise.
545 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
546 parameter. Also set value if relative to dot_section; set the
547 symbol's output_section.
548 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
549 parameter. Adjust all callers.
550 (Expression::eval_maybe_dot): Likewise.
551 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
552 Adjust all callers.
553 * testsuite/script_test_2.t: Test assignment of an absolute value
554 to dot within an output section element.
555
9634ed06
CC
5562011-10-31 Cary Coutant <ccoutant@google.com>
557
558 * options.h (class General_options): Add --[no-]gnu-unique options.
559 * symtab.cc (Symbol_table::sized_write_globals): Convert
560 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
561
de4101c7
CC
5622011-10-31 Cary Coutant <ccoutant@google.com>
563
564 PR gold/13359
565 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
566 unnecessary assertion.
567 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
568
7257cc92
ST
5692011-10-31 Sriraman Tallam <tmsriram@google.com>
570
571 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
572 gc_mark_symbol.
573 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
574 gc_mark_symbol.
575 Change to just keep the section associated with symbol.
576 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
577 they are externally visible and --export-dynamic is turned on.
578 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
579
bfc34b3f
ILT
5802011-10-19 Ian Lance Taylor <iant@google.com>
581
582 PR gold/13163
583 * script-sections.cc
584 (Output_section_element_dot_assignment::needs_output_section): New
585 function.
586
ea0d8c47
ILT
5872011-10-19 Ian Lance Taylor <iant@google.com>
588
589 PR gold/13204
590 * layout.cc (Layout::segment_precedes): Don't assert failure if a
591 --section-start option was seen.
592 * options.h (General_options::any_section_start): New function.
593
abd242a9
DM
5942011-10-18 David S. Miller <davem@davemloft.net>
595
596 PR binutils/13301
597 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
598 member to track relocation locations that have moved during TLS
599 reloc optimizations.
600 (Target_sparc::Relocate::Relocate): Initialize to NULL.
601 (Target_sparc::Relocate::relocate): Adjust view down by 4
602 bytes if it matches reloc_adjust_addr_.
603 (Target_sparc::Relocate::relocate_tls): Always move the
604 __tls_get_addr call delay slot instruction forward 4 bytes when
605 performing relaxation.
606
bab9090f
CC
6072011-10-18 Cary Coutant <ccoutant@google.com>
608
609 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
610 (Output_file::map_no_anonymous): Check for non-zero
611 return code from posix_fallocate.
612
f7c5b166
CC
6132011-10-17 Cary Coutant <ccoutant@google.com>
614
615 PR gold/13245
616 * plugin.cc (is_visible_from_outside): Check for symbols
617 referenced from dynamic objects.
618 * resolve.cc (Symbol_table::resolve): Don't count references
619 from dynamic objects as references from real ELF files.
620 * testsuite/plugin_test_2.sh: Adjust expected result.
621
b490c0bb
CC
6222011-10-17 Cary Coutant <ccoutant@google.com>
623
624 * gold.cc: Include timer.h.
625 (queue_middle_tasks): Stamp time.
626 (queue_final_tasks): Likewise.
627 * main.cc (main): Store timer in parameters. Print timers
628 for each pass.
629 * parameters.cc (Parameters::Parameters): Initialize timer_.
630 (Parameters::set_timer): New function.
631 (set_parameters_timer): New function.
632 * parameters.h (Parameters::set_timer): New function.
633 (Parameters::timer): New function.
634 (Parameters::timer_): New data member.
635 (set_parameters_timer): New function.
636 * timer.cc (Timer::stamp): New function.
637 (Timer::get_pass_time): New function.
638 * timer.h (Timer::stamp): New function.
639 (Timer::get_pass_time): New function.
640 (Timer::pass_times_): New data member.
641
f475cf7b
CC
6422011-10-17 Cary Coutant <ccoutant@google.com>
643
644 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
645 task for members of lib groups.
646
cdd7e244
CC
6472011-10-17 Cary Coutant <ccoutant@google.com>
648
649 PR gold/13288
4f95c8b4 650 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
651 (File_read::make_view): Move bounds check (replace with assert)...
652 (File_read::find_or_make_view): ... to here.
653
dfb45471
CC
6542011-10-12 Cary Coutant <ccoutant@google.com>
655
4f95c8b4 656 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
657 ::read returns less than requested size.
658
53bbcc1b
CC
6592011-10-10 Cary Coutant <ccoutant@google.com>
660
4f95c8b4 661 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
662 Initialize defined_count_.
663 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
664 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
665 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
666 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
667 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 668 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
669 member.
670 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 671 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
672 Return zeroes instead of internal error.
673
397b129b
CC
6742011-10-10 Cary Coutant <ccoutant@google.com>
675
676 PR gold/13249
4f95c8b4 677 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 678 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 679 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
680 (Output_reloc::type_): Adjust size of bit field.
681 (Output_reloc::use_plt_offset_): New bit field.
682 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
683 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
684 flag. Adjust all callers.
4f95c8b4 685 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
686 creating RELATIVE relocations.
687
d5698657
NC
6882011-10-10 Nick Clifton <nickc@redhat.com>
689
690 * po/es.po: Updated Spanish translation.
691 * po/fi.po: Updated Finnish translation.
692
6a59a5c2
DN
6932011-10-03 Diego Novillo <dnovillo@google.com>
694
695 * options.cc (parse_uint): Fix dereference of RETVAL.
696
f0558624
ST
6972011-09-29 Sriraman Tallam <tmsriram@google.com>
698
699 * layout.h (section_order_map_): New member.
700 (get_section_order_map): New member function.
701 * output.cc (Output_section::add_input_section): Check for patterns
702 only when --section-ordering-file is specified.
703 * gold.cc (queue_middle_tasks): Delay updating order of sections till
704 output_sections have been formed.
705 * layout.cc (Layout_Layout): Initialize section_order_map_.
706 * plugin.cc (update_section_order): Store order in order_map. Do not
707 update the order.
708 * testsuite/Makefile.am: Add test case for plugin_final_layout.
709 * testsuite/Makefile.in: Regenerate.
710 * testsuite/plugin_section_order.c: New file.
711 * testsuite/plugin_final_layout.cc: New file.
712 * testsuite/plugin_final_layout.sh: New file.
713
a7dac153
CC
7142011-09-29 Cary Coutant <ccoutant@google.com>
715
4f95c8b4 716 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 717 Check for NULL.
4f95c8b4 718 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
719 symbols during incremental update.
720 (Symbol_table::add_from_dynobj): Likewise.
721
eebd87a5
ILT
7222011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
723 Ian Lance Taylor <iant@google.com>
724
725 * symtab.cc (Symbol_table::define_special_symbol): Always
726 canonicalize version string.
727
403a3331
CC
7282011-09-26 Cary Coutant <ccoutant@google.com>
729
4f95c8b4
CC
730 * gold.cc (queue_initial_tasks): Move option checks ...
731 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
732 some options; make others fatal.
733
235061c2
CC
7342011-09-26 Cary Coutant <ccoutant@google.com>
735
736 gcc PR lto/47247
737 * plugin.cc (get_symbols_v2): New function.
738 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
739 (is_referenced_from_outside): New function.
740 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
741 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
742 (get_symbols): Pass version parameter.
743 (get_symbols_v2): New function.
744 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
745 parameter.
746 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
747 (onload): Add LDPT_GET_SYMBOLS_V2.
748 (all_symbols_read_hook): Use get_symbols_v2; check for
749 LDPR_PREVAILING_DEF_IRONLY_EXP.
750 * testsuite/plugin_test_3.sh: Update expected results.
751
dc87f620
ILT
7522011-09-23 Simon Baldwin <simonb@google.com>
753
754 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
755 configuration options.
756 * configure: Regenerate.
757 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
758 * Makefile.in: Regenerate.
759 * testsuite/Makefile.in: Regenerate.
760
a8279f82
ST
7612011-09-19 Sriraman Tallam <tmsriram@google.com>
762
763 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
764
0c9350c8
CC
7652011-09-19 Cary Coutant <ccoutant@google.com>
766
767 * incremental.cc (can_incremental_update): Fix typo in comment.
768 * incremental.h (can_incremental_update): Likewise.
769
aa06ae28
CC
7702011-09-18 Cary Coutant <ccoutant@google.com>
771
772 * incremental.cc (can_incremental_update): New function.
773 * incremental.h (can_incremental_update): New function.
774 * layout.cc (Layout::init_fixed_output_section): Call it.
775 (Layout::make_output_section): Don't allow patch space in .eh_frame.
776 * object.cc (Sized_relobj_file::do_layout): Call
777 can_incremental_update.
778
ebb300b2
CC
7792011-09-13 Cary Coutant <ccoutant@google.com>
780
781 * configure.ac: Check for glibc support for gnu_indirect_function
782 support with static linking, setting automake conditional
783 IFUNC_STATIC.
784 * Makefile.in: Regenerate.
785 * configure: Regenerate.
786
787 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
788 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
789 for IFUNC_STATIC.
790 * testsuite/Makefile.in: Regenerate.
791
1206d0d5
CC
7922011-09-13 Cary Coutant <ccoutant@google.com>
793
794 * incremental.cc (Sized_relobj_incr::do_layout): Call
795 report_comdat_group for kept comdat sections.
796 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
797 * testsuite/Makefile.in: Regenerate.
798 * testsuite/incr_comdat_test_1.cc: New source file.
799 * testsuite/incr_comdat_test_2_v1.cc: New source file.
800 * testsuite/incr_comdat_test_2_v2.cc: New source file.
801 * testsuite/incr_comdat_test_2_v3.cc: New source file.
802
40b29874
ILT
8032011-09-13 Ian Lance Taylor <iant@google.com>
804
805 * object.cc (Sized_relobj_file::do_layout): Remove unused local
806 variable external_symbols_offset.
807
1b045aac
ILT
8082011-09-12 Ian Lance Taylor <iant@google.com>
809
810 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
811 triggered if object has no symbols.
812
24c6c55a
DM
8132011-09-09 David S. Miller <davem@davemloft.net>
814
815 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
816 (Output_fill_debug_line::do_write): Likewise.
817
66570254
CC
8182011-08-29 Cary Coutant <ccoutant@google.com>
819
820 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
821 casts to match formatting specs.
822 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
823
8ea8cd50
CC
8242011-08-26 Cary Coutant <ccoutant@google.com>
825
826 * layout.cc (Free_list::allocate): Provide guarantee of minimum
827 remaining hole size when allocating.
828 (Layout::make_output_section): Set fill methods for debug sections.
829 * layout.h (Free_list::Free_list_node): Move from private to
830 public.
831 (Free_list::set_min_hole_size): New function.
832 (Free_list::begin, Free_list::end): New functions.
833 (Free_list::min_hole_): New data member.
834 * output.cc: Include dwarf.h.
835 (Output_fill_debug_info::do_minimum_hole_size): New function.
836 (Output_fill_debug_info::do_write): New function.
837 (Output_fill_debug_line::do_minimum_hole_size): New function.
838 (Output_fill_debug_line::do_write): New function.
839 (Output_section::Output_section): Initialize new data member.
840 (Output_section::set_final_data_size): Ensure patch space is larger
841 than minimum hole size.
842 (Output_section::do_write): Fill holes in debug sections.
843 * output.h (Output_fill): New class.
844 (Output_fill_debug_info): New class.
845 (Output_fill_debug_line): New class.
846 (Output_section::set_free_space_fill): New function.
847 (Output_section::free_space_fill_): New data member.
848 * testsuite/Makefile.am (incremental_test_3): Add
849 --incremental-patch option.
850 (incremental_test_4): Likewise.
851 (incremental_test_5): Likewise.
852 (incremental_test_6): Likewise.
853 (incremental_copy_test): Likewise.
854 (incremental_common_test_1): Likewise.
855 * testsuite/Makefile.in: Regenerate.
856
7cf80422
NC
8572011-08-26 Nick Clifton <nickc@redhat.com>
858
859 * po/es.po: Updated Spanish translation.
860
c3f7b0e5
CC
8612011-08-01 Cary Coutant <ccoutant@google.com>
862
863 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
864 * gold/testsuite/Makefile.in: Regenerate.
865 * gold/testsuite/justsyms_exec.c: New source file.
866 * gold/testsuite/justsyms_lib.c: New source file.
867
9590bf25
CC
8682011-08-01 Cary Coutant <ccoutant@google.com>
869
870 * layout.cc (Layout::set_segment_offsets): Don't realign text
871 segment if -Ttext was specified.
872 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
873 file type.
874 * object.h (Sized_relobj_file::e_type): New function.
875 (Sized_relobj_file::e_type_): New data member.
876 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
877 base address for ET_EXEC files.
878 * target.cc (Target::do_make_elf_object_implementation): Allow
879 ET_EXEC files with --just-symbols option.
880
dcd8d12e
CC
8812011-07-28 Cary Coutant <ccoutant@google.com>
882
883 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
884 Add thread_number parameter.
885 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
886 * workqueue-threads.cc
887 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
888 current thread if its thread number is greater than desired thread
889 count.
890 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
891 Add thread_number parameter.
892 (Workqueue::should_cancel_thread): Likewise.
893 (Workqueue::find_runnable_or_wait): Pass thread_number to
894 should_cancel_thread.
895 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
896 parameter.
897
804eb480
ST
8982011-07-22 Sriraman Tallam <tmsriram@google.com>
899
900 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
901 only after checking if it cannot be forced local.
902 * symtab.h (is_externally_visible): Check if the symbol is not forced
903 local.
904
f1ddb600
ILT
9052011-07-15 Ian Lance Taylor <iant@google.com>
906
907 * options.h (class General_options): Add --print-output-format.
908 Move -EL next to -EB, for better --help output.
909 * target-select.cc: Include <cstdio>, "options.h", and
910 "parameters.h".
911 (Target_selector::do_target_bfd_name): New function.
912 (print_output_format): New function.
913 * target-select.h (class Target_selector): Update declarations.
914 (Target_selector::target_bfd_name): New function.
915 (print_output_format): Declare.
916 * main.cc: Include "target-select.h".
917 (main): Handle --print-output-format.
918 * gold.cc: Include "target-select.h".
919 (queue_initial_tasks): Handle --print-output-format when there are
920 no input files.
921 * parameters.cc (parameters_force_valid_target): Give a better
922 error message if -EB/-EL does not match target.
923 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
924 function.
925
7d172687
ILT
9262011-07-15 Ian Lance Taylor <iant@google.com>
927
928 * i386.cc (class Output_data_plt_i386): Add layout_ field.
929 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
930 (Output_data_plt_i386::do_write): Write address of .dynamic
931 section to first entry in .got.plt section.
932 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
933 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
934 Initialize layout_.
935 (Output_data_plt_x86_64::do_write): Write address of .dynamic
936 section to first entry in .got.plt section.
937 * layout.h (Layout::dynamic_section): New function.
938
e9552f7e
ST
9392011-07-13 Sriraman Tallam <tmsriram@google.com>
940
941 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
942 to claim_file call.
943 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
944 input_section_position_, and input_section_glob_.
945 (read_layout_from_file): Call function section_ordering_specified.
946 * layout.h (is_section_ordering_specified): New function.
947 (section_ordering_specified): New function.
948 (section_ordering_specified_): New boolean member.
949 * main.cc(main): Call load_plugins after layout object is defined.
950 * output.cc (Output_section::add_input_section): Use
951 function section_ordering_specified to check if section ordering is
952 needed.
953 * output.cc (Output_section::add_relaxed_input_section): Use
954 function section_ordering_specified to check if section ordering is
955 needed.
956 (Output_section::update_section_layout): New function.
957 (Output_section::sort_attached_input_sections): Check if input section
958 must be reordered.
959 * output.h (Output_section::update_section_layout): New function.
960 * plugin.cc (get_section_count): New function.
961 (get_section_type): New function.
962 (get_section_name): New function.
963 (get_section_contents): New function.
964 (update_section_order): New function.
58797674 965 (allow_section_ordering): New function.
e9552f7e
ST
966 (Plugin::load): Add the new interfaces to the transfer vector.
967 (Plugin_manager::load_plugins): New parameter.
968 (Plugin_manager::all_symbols_read): New parameter.
969 (Plugin_manager::claim_file): New parameter. Save the elf object for
970 unclaimed objects.
971 (Plugin_manager::get_elf_object): New function.
972 (Plugin_manager::get_view): Change to directly use the bool to check
973 if get_view is called from claim_file_hook.
974 * plugin.h (input_objects): New function
975 (Plugin__manager::load_plugins): New parameter.
976 (Plugin_manager::claim_file): New parameter.
977 (Plugin_manager::get_elf_object): New function.
978 (Plugin_manager::in_claim_file_handler): New function.
979 (Plugin_manager::in_claim_file_handler_): New member.
980 (layout): New function.
981 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
982 handler with an extra parameter. Make the elf object before calling
983 claim_file handler.
984 * testsuite/plugin_test.c (get_section_count): New function pointer.
985 (get_section_type): New function pointer.
986 (get_section_name): New function pointer.
987 (get_section_contents): New function pointer.
988 (update_section_order): New function pointer.
989 (allow_section_ordering): New function pointer.
990 (onload): Check if the new interfaces exist.
991
9446efde
ILT
9922011-07-13 Ian Lance Taylor <iant@google.com>
993
994 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
995 relro section.
996 * x86_64.cc (Target_x86_64::got_section): Likewise.
997 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
998 (relro_now_test_SOURCES): New variable.
999 (relro_now_test_DEPENDENCIES): New variable.
1000 (relro_now_test_LDFLAGS): New variable.
1001 (relro_now_test_LDADD): New variable.
1002 (relro_now_test.so): New target.
1003 * testsuite/Makefile.in: Rebuild.
1004
07aa62f2
ILT
10052011-07-12 Ian Lance Taylor <iant@google.com>
1006
1007 PR gold/12980
1008 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1009 GLOB_DAT relocation rather than a RELATIVE relocation for a
1010 protected symbol when creating a shared library.
1011 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1012 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1013 * testsuite/protected_main_1.cc (main): Test that protected
1014 function has same address.
1015
e2153196
ILT
10162011-07-11 Ian Lance Taylor <iant@google.com>
1017
1018 PR gold/12979
1019 * options.h (class General_options): Add -Bgroup.
1020 * options.cc (General_options::finalize): If -Bgroup is set,
1021 default to --unresolved-symbols=report-all.
1022 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1023 * target-reloc.h (issue_undefined_symbol_error): Handle
1024 --unresolved-symbols=report-all.
1025
6daf5215
ILT
10262011-07-08 Ian Lance Taylor <iant@google.com>
1027
1028 PR gold/11985
1029 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1030 if linker script discards key sections.
1031 (Layout::create_dynamic_symtab): Likewise.
1032 (Layout::assign_local_dynsym_offsets): Likewise.
1033 (Layout::sized_create_version_sections): Likewise.
1034 (Layout::create_interp): Likewise.
1035 (Layout::finish_dynamic_section): Likewise.
1036 (Layout::set_dynamic_symbol_size): Likewise.
1037
beabb2c6
ILT
10382011-07-08 Ian Lance Taylor <iant@google.com>
1039
1040 PR gold/12386
1041 * options.h (class General_options): Add --unresolved-symbols.
1042 * target-reloc.h (issue_undefined_symbol_error): Check
1043 --unresolved-symbols. Add comments.
1044
9c16daf1
ILT
10452011-07-08 Ian Lance Taylor <iant@google.com>
1046
1047 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1048 expression more complex.
1049
191f1a2d
ILT
10502011-07-08 Ian Lance Taylor <iant@google.com>
1051
1052 PR gold/11317
1053 * target-reloc.h (issue_undefined_symbol_error): New inline
1054 function, broken out of relocate_section.
1055 (relocate_section): Call issue_undefined_symbol_error.
1056 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1057 there is no TLS segment if we are about to issue an undefined
1058 symbol error.
1059 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1060
62855347
ILT
10612011-07-08 Ian Lance Taylor <iant@google.com>
1062
1063 PR gold/12279
1064 * resolve.cc (Symbol_table::should_override): Add fromtype
1065 parameter. Change all callers. Give error when linking together
1066 TLS and non-TLS symbol.
1067 (Symbol_table::should_override_with_special): Add fromtype
1068 parameter. Change all callers.
1069 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1070 there is no TLS segment if we have reported some errors.
1071 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1072
67181c72
ILT
10732011-07-08 Ian Lance Taylor <iant@google.com>
1074
1075 PR gold/12372
1076 * target.h (Target::plt_address_for_global): New function.
1077 (Target::plt_address_for_local): New function.
1078 (Target::plt_section_for_global): Remove.
1079 (Target::plt_section_for_local): Remove.
1080 (Target::do_plt_address_for_global): New virtual function.
1081 (Target::do_plt_address_for_local): New virtual function.
1082 (Target::do_plt_section_for_global): Remove.
1083 (Target::do_plt_section_for_local): Remove.
1084 (Target::register_global_plt_entry): Add Symbol_table and Layout
1085 parameters.
1086 * output.cc (Output_data_got::Got_entry::write): Use
1087 plt_address_for_global and plt_address_for_local.
1088 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1089 address of output section.
1090 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1091 got_irelative_, and irelative_count_ fields. Update
1092 declarations.
1093 (Output_data_plt_i386::has_irelative_section): New function.
1094 (Output_data_plt_i386::entry_count): Add irelative_count_.
1095 (Output_data_plt_i386::set_final_data_size): Likewise.
1096 (class Target_i386): Add got_irelative_ and rel_irelative_
1097 fields. Update declarations.
1098 (Target_i386::Target_i386): Initialize new fields.
1099 (Target_i386::do_plt_address_for_global): New function replacing
1100 do_plt_section_for_global.
1101 (Target_i386::do_plt_address_for_local): New function replacing
1102 do_plt_section_for_local.
1103 (Target_i386::got_section): Create got_irelative_.
1104 (Target_i386::rel_irelative_section): New function.
1105 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1106 fields. Don't define __rel_iplt_{start,end}.
1107 (Output_data_plt_i386::add_entry): Add symtab and layout
1108 parameters. Change all callers. Use different PLT and GOT for
1109 IFUNC symbols.
1110 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1111 layout parameters. Change all callers. Use different PLT and
1112 GOT.
1113 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1114 (Output_data_plt_i386::rel_irelative): New function.
1115 (Output_data_plt_i386::address_for_global): New function.
1116 (Output_data_plt_i386::address_for_local): New function.
1117 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1118 IRELATIVE GOT when changing IFUNC GOT entries.
1119 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1120 reloc.
1121 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1122 if we didn't create an IRELATIVE GOT.
1123 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1124 plt_address_for_local.
1125 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1126 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1127 got_irelative_, and irelative_count_ fields. Update
1128 declarations.
1129 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1130 Initialize new fields. Remove symtab parameter. Change all
1131 callers.
1132 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1133 irelative_count_.
1134 (Output_data_plt_x86_64::has_irelative_section): New function.
1135 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1136 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1137 fields. Update declarations.
1138 (Target_x86_64::Target_x86_64): Initialize new fields.
1139 (Target_x86_64::do_plt_address_for_global): New function replacing
1140 do_plt_section_for_global.
1141 (Target_x86_64::do_plt_address_for_local): New function replacing
1142 do_plt_section_for_local.
1143 (Target_x86_64::got_section): Create got_irelative_.
1144 (Target_x86_64::rela_irelative_section): New function.
1145 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1146 all callers. Don't create __rel_iplt_{start,end}.
1147 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1148 parameters. Change all callers. Use different PLT and GOT for
1149 IFUNC symbols.
1150 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1151 layout parameters. Change all callers. Use different PLT and
1152 GOT.
1153 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1154 parameters. Change all callers. Use different PLT and GOT for
1155 IFUNC symbols.
1156 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1157 (Output_data_plt_x86_64::rela_irelative): New function.
1158 (Output_data_plt_x86_64::address_for_global): New function.
1159 (Output_data_plt_x86_64::address_for_local): New function.
1160 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1161 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1162 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1163 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1164 parameters.
1165 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1166 reloc.
1167 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1168 symbols if we didn't create an IRELATIVE GOT.
1169 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1170 plt_address_for_local.
1171 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1172 * testsuite/ifuncvar1.c: New test file.
1173 * testsuite/ifuncvar2.c: New test file.
1174 * testsuite/ifuncvar3.c: New test file.
1175 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1176 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1177 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1178 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1179 * testsuite/Makefile.in: Rebuild.
1180
33c15b45
CC
11812011-07-07 Cary Coutant <ccoutant@google.com>
1182
1183 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1184 (two_file_test_1_ndebug.o): Likewise.
1185 (two_file_test_1b_ndebug.o): Likewise.
1186 (two_file_test_2_ndebug.o): Likewise.
1187 (two_file_test_main_ndebug.o): Likewise.
1188 (incremental_test_2): Link with no-debug versions.
1189
f48b5fb7
CC
11902011-07-06 Cary Coutant <ccoutant@google.com>
1191
1192 * gold/incremental.cc
1193 (Output_section_incremental_inputs::write_info_blocks): Check for
1194 hidden and internal symbols.
1195
221597a5
CC
11962011-07-06 Cary Coutant <ccoutant@google.com>
1197
1198 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1199 Check disposition for startup file.
1200 (Incremental_inputs::report_command_line): Ignore
1201 --incremental-startup-unchanged option.
1202 * options.cc (General_options::parse_incremental_startup_unchanged):
1203 New function.
1204 (General_options::General_options): Initialize new data member.
1205 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1206 (General_options): Add --incremental-startup-unchanged option.
1207 (General_options::incremental_startup_disposition): New function.
1208 (General_options::incremental_startup_disposition_): New data member.
1209
e24719f6
CC
12102011-07-06 Cary Coutant <ccoutant@google.com>
1211
1212 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1213 input file index to Script_info ctor.
1214 (Sized_incremental_binary::do_file_has_changed): Find the
1215 command-line argument for files named in scripts.
1216 * incremental.h (Script_info::Script_info): New ctor
1217 with input file index.
1218 (Script_info::input_file_index): New function.
1219 (Script_info::input_file_index_): New data member.
1220 (Incremental_binary::get_library): Add const.
1221 (Incremental_binary::get_script_info): Add const.
1222 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1223 * testsuite/Makefile.am (incremental_test_5): New test case.
1224 (incremental_test_6): New test case.
1225 * testsuite/Makefile.in: Regenerate.
1226
8f7c81e8
CC
12272011-07-06 Cary Coutant <ccoutant@google.com>
1228
1229 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1230 debug output when command lines differ.
1231
9fbd3822
CC
12322011-07-06 Cary Coutant <ccoutant@google.com>
1233
1234 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1235 --incremental-patch option.
1236 * layout.cc (Free_list::allocate): Extend allocation beyond original
1237 end if enabled.
1238 (Layout::make_output_section): Mark sections that should get
1239 patch space.
1240 * options.cc (parse_percent): New function.
1241 * options.h (parse_percent): New function.
1242 (DEFINE_percent): New macro.
1243 (General_options): Add --incremental-patch option.
1244 * output.cc (Output_section::Output_section): Initialize new data
1245 members.
1246 (Output_section::add_input_section): Print section name when out
1247 of patch space.
1248 (Output_section::add_output_section_data): Likewise.
1249 (Output_section::set_final_data_size): Add patch space when
1250 doing --incremental-full.
1251 (Output_section::do_reset_address_and_file_offset): Remove patch
1252 space.
1253 (Output_segment::set_section_list_addresses): Print debug output
1254 only if --incremental-update.
1255 * output.h (Output_section::set_is_patch_space_allowed): New function.
1256 (Output_section::is_patch_space_allowed_): New data member.
1257 (Output_section::patch_space_): New data member.
1258 * parameters.cc (Parameters::incremental_full): New function.
1259 * parameters.h (Parameters::incremental_full): New function
1260 * testsuite/Makefile.am (incremental_test_2): Add test for
1261 --incremental-patch option.
1262 * testsuite/Makefile.in: Regenerate.
1263 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1264 (t18): Remove function body.
1265
f6cccc2c
DK
12662011-07-05 Doug Kwan <dougkwan@google.com>
1267
1268 PR gold/12771
1269 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1270 Arm_Address type for relocation result.
1271 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1272 overflow check.
1273 (Arm_relocate_functions::abs32): Use unaligned access.
1274 (Arm_relocate_functions::rel32): Ditto.
1275 (Arm_relocate_functions::prel31): Ditto.
1276 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1277 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1278 static data relocations.
1279 * testsuite/Makefile.in: Regnerate.
1280 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1281
28a13fec
ILT
12822011-07-05 Ian Lance Taylor <iant@google.com>
1283
1284 PR gold/12392
1285 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1286 symbols if necessary.
1287 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1288
24d47b34
ILT
12892011-07-05 Ian Lance Taylor <iant@google.com>
1290
1291 PR gold/12952
1292 * resolve.cc (Symbol::override_base_with_special): Simply override
1293 version with special symbol version, ignoring previous version.
1294
41f9cbbe
ILT
12952011-07-05 Ian Lance Taylor <iant@google.com>
1296
1297 * object.cc (Sized_relobj_file::include_section_group): Add
1298 information to comment about signature location.
1299
886288f1
ILT
13002011-07-02 Ian Lance Taylor <iant@google.com>
1301
1302 PR gold/12957
1303 * options.h (class General_options): Add -f and -F.
1304 * options.cc (General_options::finalize): Fatal error if -f/-F
1305 are used without -shared.
1306 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1307
ae3a6d4f
ILT
13082011-07-02 Ian Lance Taylor <iant@google.com>
1309
1310 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1311
21131061
ILT
13122011-07-01 Ian Lance Taylor <iant@google.com>
1313
1314 PR gold/12525
1315 PR gold/12952
1316 * resolve.cc (Symbol::override_base_with_special): Don't override
1317 the version if the overriding symbol has a different name.
1318 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1319 all callers. If we give an error about an undefined version,
1320 define the base version if necessary.
1321 * dynobj.h (class Versions): Update declaration.
1322 * testsuite/weak_alias_test_5.cc: New file.
1323 * testsuite/weak_alias_test.script: New file.
1324 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1325 and versioned_alias have the right value, and call t2.
1326 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1327 weak_alias_test_5.so.
1328 (weak_alias_test_LDADD): Likewise.
1329 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1330 * testsuite/Makefile.in: Rebuild.
1331
611062c0
ILT
13322011-07-01 Ian Lance Taylor <iant@google.com>
1333
1334 PR gold/12525
1335 * options.h (class General_options): Support -z notext.
1336 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1337 -Wl,-z,notext.
1338 (two_file_shared_nonpic.so): Likewise.
1339 (two_file_shared_mixed.so): Likewise.
1340 (two_file_shared_mixed_1.so): Likewise.
1341 (weak_undef_lib_nonpic.so): Likewise.
1342 (alt/weak_undef_lib_nonpic.so): Likewise.
1343 (tls_test_shared_nonpic.so): Likewise.
1344 * testsuite/Makefile.in: Rebuild.
1345
328c7c2f
ILT
13462011-07-01 Ian Lance Taylor <iant@google.com>
1347
1348 PR gold/12525
1349 * configure.ac: Test whether static linking works, setting
1350 the automake conditional HAVE_STATIC.
1351 * testsuite/Makefile.am: Disable tests using -static if
1352 HAVE_STATIC is not true.
1353 * configure, testsuite/Makefile.in: Rebuild.
1354
02d7cd44
ILT
13552011-07-01 Ian Lance Taylor <iant@google.com>
1356
1357 PR gold/12525
1358 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1359 Assert if we see DW_EH_PE_indirect.
1360 * target.h (Target::ehframe_datarel_base): New function.
1361 (Target::do_ehframe_datarel_base): New target function.
1362 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1363 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1364 function.
1365
07a60597
ILT
13662011-07-01 Ian Lance Taylor <iant@google.com>
1367
1368 PR gold/12571
1369 * options.h (class General_options): Add
1370 --ld-generated-unwind-info.
1371 * ehframe.cc (Fde::write): Add address parameter. Change all
1372 callers. If associated with PLT, fill in address and size.
1373 (Cie::set_output_offset): Only add merge mapping if there is an
1374 object.
1375 (Cie::write): Add address parameter. Change all callers.
1376 (Eh_frame::add_ehframe_for_plt): New function.
1377 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1378 input_offset_ fields into union u_, with new plt field.
1379 (Fde::Fde): Adjust for new union field.
1380 (Fde::Fde) [Output_data version]: New constructor.
1381 (Fde::add_mapping): Only add merge mapping if there is an object.
1382 (class Cie): Update declarations.
1383 (class Eh_frame): Declare add_ehframe_for_plt.
1384 * layout.cc (Layout::layout_eh_frame): Break out code into
1385 make_eh_frame_section, and call it.
1386 (Layout::make_eh_frame_section): New function.
1387 (Layout::add_eh_frame_for_plt): New function.
1388 * layout.h (class Layout): Update declarations.
1389 * merge.cc (Merge_map::add_mapping): Add assertion.
1390 * i386.cc: Include "dwarf.h".
1391 (class Output_data_plt_i386): Make first_plt_entry,
1392 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1393 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1394 and plt_eh_frame_fde.
1395 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1396 boundary. Call add_eh_frame_for_plt if appropriate.
1397 * x86_64.cc: Include "dwarf.h".
1398 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1399 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1400 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1401 and plt_eh_frame_fde.
1402 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1403 appropriate.
1404
14788a3f
ILT
14052011-06-29 Ian Lance Taylor <iant@google.com>
1406
1407 PR gold/12629
1408 * object.cc (Sized_relobj_file::layout_section): Change shdr
1409 parameter to be const.
1410 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1411 out of do_layout.
1412 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1413 appropriate. Call layout_eh_frame_section.
1414 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1415 sections.
1416 * object.h (class Sized_relobj_file): Update declarations.
1417
6c21fce1
ILT
14182011-06-29 Ian Lance Taylor <iant@google.com>
1419
37e41b03 1420 PR gold/12652
6c21fce1
ILT
1421 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1422 modifier.
1423 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1424
4d5e4e62
ILT
14252011-06-29 Ian Lance Taylor <iant@google.com>
1426
1427 PR gold/12675
1428 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1429 SHT_X86_64_UNWIND.
1430 * layout.cc (Layout::layout_eh_frame): Likewise.
1431
886f533a
ILT
14322011-06-29 Ian Lance Taylor <iant@google.com>
1433
1434 PR gold/12695
1435 * layout.cc (Layout::symtab_section_shndx): New function.
1436 * layout.h (class Layout): Declare symtab_section_shndx.
1437 * output.cc (Output_section::write_header): Call it.
1438
f3ae1b28
ILT
14392011-06-29 Ian Lance Taylor <iant@google.com>
1440
1441 PR gold/12818
1442 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1443 symbols which are not used in a relocation.
1444
aecf301f
ILT
14452011-06-28 Ian Lance Taylor <iant@google.com>
1446
1447 PR gold/12898
1448 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1449 script create indistinguishable segments.
1450 (Layout::set_segment_offsets): Use stable_sort when sorting
1451 segments. Pass this to Compare_segments constructor.
1452 * layout.h (class Layout): Make segment_precedes non-static.
1453 (class Compare_segments): Change from struct to class. Add
1454 layout_ field. Add constructor.
1455 * script-sections.cc
1456 (Script_sections::attach_sections_using_phdrs_clause): Rename
1457 local orphan to is_orphan. Don't report failure to put empty
1458 section in segment. On attachment failure, report name of
1459 section, and attach to first PT_LOAD segment.
1460
03ef7571
ILT
14612011-06-28 Ian Lance Taylor <iant@google.com>
1462
1463 PR gold/12934
1464 * target-select.cc (Target_selector::Target_selector): Add
1465 emulation parameter. Change all callers.
1466 (select_target_by_bfd_name): Rename from select_target_by_name.
1467 Change all callers.
1468 (select_target_by_emulation): New function.
1469 (supported_emulation_names): New function.
1470 * target-select.h (class Target_selector): Add emulation_ field.
1471 Update declarations.
1472 (Target_selector::recognize_by_bfd_name): Rename from
1473 recognize_by_name. Change all callers.
1474 (Target_selector::supported_bfd_names): Rename from
1475 supported_names. Change all callers.
1476 (Target_selector::recognize_by_emulation): New function.
1477 (Target_selector::supported_emulations): New function.
1478 (Target_selector::emulation): New function.
1479 (Target_selector::do_recognize_by_bfd_name): Rename from
1480 do_recognize_by_name. Change all callers.
1481 (Target_selector::do_supported_bfd_names): Rename from
1482 do_supported_names. Change all callers.
1483 (Target_selector::do_recognize_by_emulation): New function.
1484 (Target_selector::do_supported_emulations): New function.
1485 (select_target_by_bfd_name): Change name in declaration.
1486 (select_target_by_emulation): Declare.
1487 (supported_emulation_names): Declare.
1488 * parameters.cc (parameters_force_valid_target): Try to find
1489 target based on emulation from -m option.
1490 * options.h (class General_options): Change doc string for -m.
1491 * options.cc (help): Print emulations.
1492 (General_options::parse_V): Likewise.
1493 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1494 Add emulation parameter. Change all callers.
1495
200b2bb9
ILT
14962011-06-28 Ian Lance Taylor <iant@google.com>
1497
1498 * target.h (class Target): Add osabi_ field.
1499 (Target::osabi): New function.
1500 (Target::set_osabi): New function.
1501 (Target::Target): Initialize osabi_.
1502 (Target::do_adjust_elf_header): Make pure virtual.
1503 (Sized_target::do_adjust_elf_header): Declare.
1504 * target.cc (Sized_target::do_adjust_elf_header): New function.
1505 (class Sized_target): Instantiate all versions.
1506 * freebsd.h (class Target_freebsd): Remove.
1507 (Target_selector_freebsd::do_recognize): Call set_osabi on
1508 Target.
1509 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1510 (Target_selector_freebsd::set_osabi): Remove.
1511 * i386.cc (class Target_i386): Inherit from Sized_target rather
1512 than Target_freebsd.
1513 * x86_64.cc (class Target_x86_64): Likewise.
1514
b3ce541e
ILT
15152011-06-28 Ian Lance Taylor <iant@google.com>
1516
1517 * target.h (Target::can_check_for_function_pointers): Rewrite.
1518 Make non-virtual.
1519 (Target::can_icf_inline_merge_sections): Likewise.
1520 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1521 (Target::Target_info): Add can_icf_inline_merge_sections field.
1522 (Target::do_can_check_for_function_pointers): New virtual
1523 function.
1524 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1525 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1526 from can_check_for_function_pointers, move in file.
1527 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1528 section_may_have_icf_unsafe_poineters, move in file.
1529 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1530 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1531 Rename from can_check_for_function_pointers, move in file.
1532 (Target_i386::can_icf_inline_merge_sections): Remove.
1533 (Target_i386::i386_info): Initialize
1534 can_icf_inline_merge_sections.
1535 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1536 Initialize can_icf_inline_merge_sections.
1537 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1538 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1539 Rename from can_check_for_function_pointers, move in file.
1540 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1541 (Target_x86_64::x86_64_info): Initialize
1542 can_icf_inline_merge_sections.
1543 * testsuite/testfile.cc (Target_test::test_target_info):
1544 Likewise.
1545 * icf.cc (get_section_contents): Correct formatting.
1546
6d1c4efb
ILT
15472011-06-27 Ian Lance Taylor <iant@google.com>
1548
1549 * symtab.cc (Symbol::versioned_name): New function.
1550 (Symbol_table::add_to_final_symtab): Use versioned_name when
1551 appropriate.
1552 (Symbol_table::sized_write_symbol): Likewise.
1553 * symtab.h (class Symbol): Declare versioned_name.
1554 * stringpool.h (class Stringpool_template): Add variant of add
1555 which takes a std::basic_string.
1556 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1557 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1558 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1559 (ver_test_12.o): New target.
1560 * testsuite/Makefile.in: Rebuild.
1561
57eb9b50
DK
15622011-06-27 Doug Kwan <dougkwan@google.com>
1563
1564 * arm.cc (Arm_relocate_functions::thm_jump8,
1565 Arm_relocate_functions::thm_jump11): Use a wider signed
1566 type to compute offset.
1567 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1568 arm_thm_jump8.
1569 * testsuite/Makefile.in: Regenerate.
1570 * testsuite/arm_branch_in_range.sh: Check test results of
1571 arm_thm_jump11 and arm_thm_jump8.
1572 * testsuite/arm_thm_jump11.s: New test source file.
1573 * testsuite/arm_thm_jump11.t: New linker script.
1574 * testsuite/arm_thm_jump8.s: New test source file.
1575 * testsuite/arm_thm_jump8.t: New linker script.
1576
487b39df
ILT
15772011-06-24 Ian Lance Taylor <iant@google.com>
1578
1579 * layout.cc: Include "object.h".
1580 (ctors_sections_in_init_array): New static variable.
1581 (Layout::is_ctors_in_init_array): New function.
1582 (Layout::layout): Add entry to ctors_sections_in_init_array if
1583 appropriate.
1584 * layout.h (class Layout): Declare is_ctors_in_init_array.
1585 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1586 is_ctors_reverse_view is set.
1587 (Sized_relobj_file::write_sections): Add layout parameter. Change
1588 all callers. Set is_ctors_reverse_view field of View_size.
1589 (Sized_relobj_file::reverse_words): New function.
1590 * object.h (Sized_relobj_file::View_size): Add
1591 is_ctors_reverse_view field.
1592 (class Sized_relobj_file): Update declarations.
1593 * testsuite/initpri3.c: New test.
1594 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1595 initpri3b.
1596 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1597 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1598 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1599 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1600 * testsuite/Makefile.in: Rebuild.
1601
472076e4
CC
16022011-06-24 Cary Coutant <ccoutant@google.com>
1603
1604 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1605 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1606 (debug_msg_cdebug.err): New targets.
1607 * testsuite/Makefile.in: Regenerate.
1608 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1609 Fix checks for link with shared library.
1610
a60af0db
DK
16112011-06-24 Doug Kwan <dougkwan@google.com>
1612
1613 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1614 skip empty text sections.
1615 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1616
5393d741
ILT
16172011-06-22 Ian Lance Taylor <iant@google.com>
1618
1619 PR gold/12910
1620 * options.h (class General_options): Add --ctors-in-init-array.
1621 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1622 friends as SHT_PROGBITS for merging sections.
1623 (Layout::layout): Remove special handling of .init_array and
1624 friends. Don't sort if doing relocatable link. Sort for .ctors
1625 and .dtors if ctors_in_init_array.
1626 (Layout::make_output_section): Force correct section types for
1627 .init_array and friends. Don't sort if doing relocatable link,
1628 Don't sort .ctors and .dtors if ctors_in_init_array.
1629 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1630 (Layout::output_section_name): Add relobj parameter. Change all
1631 callers. Handle .ctors. and .dtors. in code rather than table.
1632 Handle .ctors and .dtors if ctors_in_init_array.
1633 (Layout::match_file_name): New function, moved from output.cc.
1634 * layout.h (class Layout): Update declarations.
1635 * output.cc: Include "layout.h".
1636 (Input_section_sort_entry::get_priority): New function.
1637 (Input_section_sort_entry::match_file_name): Just call
1638 Layout::match_file_name.
1639 (Output_section::Input_section_sort_init_fini_compare::operator()):
1640 Handle .ctors and .dtors. Sort by explicit priority rather than
1641 by name.
1642 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1643 * testsuite/initpri2.c: New test.
1644 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1645 (check_PROGRAMS): Add initpri2.
1646 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1647 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1648 * configure, testsuite/Makefile.in: Rebuild.
1649
e1f74f98
ILT
16502011-06-19 Ian Lance Taylor <iant@google.com>
1651
1652 PR gold/12880
1653 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1654 .interp section to a PT_INTERP segment even if we have seen a
1655 --dynamic-linker option. Don't do it if we have seen a PHDRS
1656 clause in a linker script.
1657 (Layout::finalize): Don't create a .interp section if we've
1658 already create a PT_INTERP segment.
1659 (Layout::create_interp): Always call choose_output_section (revert
1660 patch of 2011-06-17). Don't create PT_INTERP segment.
1661 * script-sections.cc
1662 (Script_sections::create_note_and_tls_segments): Add a .interp
1663 section to a PT_INTERP segment even if we have seen a
1664 --dynamic-linker option.
1665
766f91bb
ILT
16662011-06-18 Ian Lance Taylor <iant@google.com>
1667
1668 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1669 merely because a non-PT_LOAD segment has a dynamic reloc.
1670
0d212c3a
ILT
16712011-06-18 Ian Lance Taylor <iant@google.com>
1672
1673 * layout.cc (Layout::finish_dynamic_section): Don't create
1674 DT_FLAGS entry if not needed.
1675
911a5072
ILT
16762011-06-18 Ian Lance Taylor <iant@google.com>
1677
1678 PR gold/12745
1679 * layout.cc (Layout::layout_eh_frame): Correct handling of
1680 writable .eh_frame section.
1681
534b4e5f
ILT
16822011-06-17 Ian Lance Taylor <iant@google.com>
1683
1684 PR gold/12893
1685 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1686 symbol is redefined with the exact same object and value.
1687
10b4f102
ILT
16882011-06-17 Ian Lance Taylor <iant@google.com>
1689
1690 PR gold/12880
1691 * layout.h (class Layout): Add interp_segment_ field.
1692 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1693 (Layout::attach_allocated_section_to_segment): If making shared
1694 library, put .interp section in PT_INTERP segment.
1695 (Layout::finalize): Also call create_interp if -dynamic-linker
1696 option was used.
1697 (Layout::create_interp): Assert that there is no PT_INTERP
1698 segment. If not using a SECTIONS clause, use make_output_section.
1699 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1700 * script-sections.cc
1701 (Script_sections::create_note_and_tls_segments): If making shared
1702 library, put .interp section in PT_INTERP segment.
1703
a29b0dad
ILT
17042011-06-17 Ian Lance Taylor <iant@google.com>
1705
e588ea8d
ILT
1706 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1707 when making a shared library.
1708
17092011-06-17 Ian Lance Taylor <iant@google.com>
1710
1711 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1712 parameter. Change all callers. Don't issue warning about PC32
1713 against locally defined symbol.
a29b0dad 1714
9d3b0698
ILT
17152011-06-16 Ian Lance Taylor <iant@google.com>
1716
1717 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1718 occurs in same object.
1719
85b0f90c
AM
17202011-06-14 Alan Modra <amodra@gmail.com>
1721
1722 * po/POTFILES.in: Regenerate.
1723
a94907d9
ILT
17242011-06-09 Ian Lance Taylor <iant@google.com>
1725
1726 * script-sections.cc
1727 (Orphan_output_section::set_section_addresses): For a relocatable
1728 link set address to 0.
1729
4fb3a1c3
CC
17302011-06-09 Cary Coutant <ccoutant@google.com>
1731
1732 PR gold/12804
1733 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1734 used with --compress-debug-sections.
1735 * gold/object.cc (Sized_relobj_file::do_layout): Report
1736 uncompressed size of compressed input sections.
1737
61220854
CC
17382011-06-08 Cary Coutant <ccoutant@google.com>
1739
1740 PR gold/12804
1741 * testsuite/two_file_test_2_v1.cc: Change initialization of
1742 v2 to keep it in .data.
1743
e6455dfb
CC
17442011-06-07 Cary Coutant <ccoutant@google.com>
1745
1746 * common.cc (Symbol_table::do_allocate_commons_list): Call
1747 gold_fallback.
1748 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1749 (Errors::fallback): New function.
1750 (gold_fallback): New function.
1751 * errors.h (Errors::fallback): New function.
1752 * gold.cc (gold_exit): Change status parameter to enum; adjust
1753 all callers.
1754 (queue_initial_tasks): Call gold_fallback.
1755 * gold.h: Include cstdlib.
1756 (Exit_status): New enum type.
1757 (gold_exit): Change status parameter to enum.
1758 (gold_fallback): New function.
1759 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1760 (Layout::create_symtab_sections): Likewise.
1761 (Layout::create_shdrs): Likewise.
1762 * main.cc (main): Adjust call to gold_exit.
1763 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1764 (Output_data_got::add_got_entry_pair): Likewise.
1765 (Output_section::add_input_section): Likewise.
1766 (Output_section::add_output_section_data): Likewise.
1767 (Output_segment::set_section_list_addresses): Likewise.
1768 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1769
fb0e076f
CC
17702011-06-07 Cary Coutant <ccoutant@google.com>
1771
1772 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1773 for incremental links.
1774 * output.cc (Output_segment::set_section_list_addresses): Remove
1775 FIXME and test for TLS or BSS.
1776
a5ee4d5d
CC
17772011-06-07 Cary Coutant <ccoutant@google.com>
1778
1779 * testsuite/Makefile.am: Add incremental_copy_test,
1780 incremental_common_test_1.
1781 * testsuite/Makefile.in: Regenerate.
1782 * testsuite/common_test_1_v1.c: New source file.
1783 * testsuite/common_test_1_v2.c: New source file.
1784 * testsuite/copy_test_v1.cc: New source file.
1785
5146f448
CC
17862011-06-07 Cary Coutant <ccoutant@google.com>
1787
1788 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1789 update, allocate common from bss section's free list.
1790 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1791 linker-defined symbols.
1792 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1793 Skip GOT and PLT entries that are no longer referenced.
1794 (Output_section_incremental_inputs::write_info_blocks): Mark
1795 linker-defined symbols.
1796 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1797 * output.cc (Output_section::allocate): New function.
1798 * output.h (Output_section::allocate): New function.
1799 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1800 linker-defined symbols.
1801 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1802 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1803 (Symbol::init_base_output_data): Likewise.
1804 (Symbol::init_base_output_segment): Likewise.
1805 (Symbol::init_base_constant): Likewise.
1806 (Sized_symbol::init_output_data): Likewise.
1807 (Sized_symbol::init_output_segment): Likewise.
1808 (Sized_symbol::init_constant): Likewise.
1809 (Symbol_table::do_define_in_output_data): Likewise.
1810 (Symbol_table::do_define_in_output_segment): Likewise.
1811 (Symbol_table::do_define_as_constant): Likewise.
1812 * symtab.h (Symbol::is_predefined): New function.
1813 (Symbol::init_base_output_data): Add is_predefined parameter.
1814 (Symbol::init_base_output_segment): Likewise.
1815 (Symbol::init_base_constant): Likewise.
1816 (Symbol::is_predefined_): New data member.
1817 (Sized_symbol::init_output_data): Add is_predefined parameter.
1818 (Sized_symbol::init_output_segment): Likewise.
1819 (Sized_symbol::init_constant): Likewise.
1820 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1821
26d3c67d
CC
18222011-06-07 Cary Coutant <ccoutant@google.com>
1823
1824 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1825 instead of emit_copy_reloc.
1826 (Copy_relocs::emit_copy_reloc): Refactor.
1827 (Copy_relocs::make_copy_reloc): New function.
1828 (Copy_relocs::add_copy_reloc): Remove.
1829 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1830 section.
1831 (Copy_relocs::make_copy_reloc): New function.
1832 (Copy_relocs::add_copy_reloc): Remove.
1833 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1834 unchanged input files.
1835 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1836 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1837 Reserve BSS space for COPY relocations.
1838 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1839 (Output_section_incremental_inputs::write_info_blocks): Record
1840 whether a symbol is copied from a shared object.
1841 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1842 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1843 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1844 (Incremental_input_entry_reader::get_output_symbol_index): Add
1845 is_copy parameter.
1846 (Incremental_binary::emit_copy_relocs): New function.
1847 (Incremental_binary::do_emit_copy_relocs): New function.
1848 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1849 new data member.
1850 (Sized_incremental_binary::add_copy_reloc): New function.
1851 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1852 (Sized_incremental_binary::Copy_reloc): New struct.
1853 (Sized_incremental_binary::Copy_relocs): New typedef.
1854 (Sized_incremental_binary::copy_relocs_): New data member.
1855 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1856 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1857 * target.h (Sized_target::emit_copy_reloc): New function.
1858 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1859
7cdb37d9
CC
18602011-06-02 Cary Coutant <ccoutant@google.com>
1861
1862 PR gold/12163
1863 * gold/archive.cc (Archive::Archive): Initialize new data member.
1864 (Archive::include_all_members): Return if archive has already been
1865 included.
1866 * gold/archive.h (Archive::include_all_members_): New data member.
1867
cc643b88
NC
18682011-06-02 Nick Clifton <nickc@redhat.com>
1869
1870 * dynobj.h: Fix spelling mistake in comment.
1871 * output.cc: Likewise.
1872
f62a3ca7
DK
18732011-05-31 Doug Kwan <dougkwan@google.com>
1874 Asier Llano
1875
1876 PR gold/12826
cc643b88 1877 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1878 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1879 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1880 redundant arm_exidx_test.so.
1881 * testsuite/Makefile.in: Regenerate.
1882 (check_SCRIPTS): Add pr12826.sh
1883 (check_DATA): Add pr12826.stdout
1884 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1885 * testsuite/pr12826.sh: New file.
1886 * testsuite/pr12826_1.s: Ditto.
1887 * testsuite/pr12826_1.s: Ditto.
1888
8dbe1edc
ILT
18892011-05-30 Ian Lance Taylor <iant@google.com>
1890
1891 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1892 sections.
1893
c49875be
ILT
18942011-05-29 Ian Lance Taylor <iant@google.com>
1895
1896 PR gold/12804
1897 * testsuite/Makefile.am: Use different file name for two_file_test
1898 temporary file for each incremental test.
1899 * testsuite/Makefile.in: Rebuild.
1900
69d53f7a
ILT
19012011-05-29 Ian Lance Taylor <iant@google.com>
1902
1903 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1904 binary input file is empty.
1905
41d0ab5f
ILT
19062011-05-27 Ian Lance Taylor <iant@google.com>
1907
1908 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1909 (ver_test_9.so): Likewise.
1910 * testsuite/Makefile.in: Rebuild.
1911
89d8a36b
CC
19122011-05-26 Cary Coutant <ccoutant@google.com>
1913
1914 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1915 * incremental.cc (Incremental_inputs::report_input_section): Fix
1916 comment, indentation.
1917 (Incremental_inputs::report_comdat_group): New function.
1918 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1919 of data for incremental input file entry.
1920 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1921 group count, COMDAT group signatures.
1922 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1923 an unchanged input file.
1924 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1925 Initialize new data member.
1926 (Incremental_object_entry::add_comdat_group): New function.
1927 (Incremental_object_entry::get_comdat_group_count): New function.
1928 (Incremental_object_entry::get_comdat_signature_key): New function.
1929 (Incremental_object_entry::groups_): New data member.
1930 (Incremental_inputs::report_comdat_group): New function.
1931 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1932 data for incremental input file entry.
1933 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1934 (Incremental_input_entry_reader::get_input_section): Adjust size of
1935 data for incremental input file entry.
1936 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1937 (Incremental_input_entry_reader::get_comdat_group_signature): New
1938 function.
1939 * object.cc (Sized_relobj::include_section_group): Report kept
1940 COMDAT groups for incremental links.
1941
1706a06f
ILT
19422011-05-24 David Meyer <pdox@google.com>
1943
1944 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1945 with name parameter. Add found_name parameter.
1946 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1947 * dirsearch.h (class Dirsearch): Update declaration.
1948
a10ae760
ILT
19492011-05-24 Ian Lance Taylor <iant@google.com>
1950
1951 * archive.cc (Library_base::should_include_member): Pull in object
1952 from archive if it defines the entry symbol.
1953 * parameters.cc (Parameters::entry): New function.
1954 * parameters.h (class Parameters): Declare entry.
1955 * output.h (class Output_file_header): Remove entry_ field.
1956 * output.cc (Output_file_header::Output_file_header): Remove entry
1957 parameter. Change all callers.
1958 (Output_file_header::entry): Use parameters->entry.
1959 * gold.cc (queue_middle_tasks): Likewise.
1960 * plugin.cc (Plugin_hook::run): Likewise.
1961
aa92d6ed
CC
19622011-05-24 Cary Coutant <ccoutant@google.com>
1963
1964 * gold.cc (queue_initial_tasks): Pass incremental base filename
1965 to Output_file::open_base_file; don't print error message.
1966 * incremental-dump.cc (main): Adjust call to
1967 Output_file::open_for_modification.
1968 * incremental-dump.cc (main): Likewise.
1969 * incremental.cc (Incremental_inputs::report_command_line):
1970 Ignore --incremental-base option when comparing command lines.
1971 Ignore parameter when given as separate argument.
1972 * options.h (class General_options): Add --incremental-base.
1973 * output.cc (Output_file::Output_file):
1974 (Output_file::open_base_file): Add base_name and writable parameters;
1975 read base file into new file; print error message here.
1976 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1977 callers.
1978 * output.h (Output_file::open_for_modification): Rename to...
1979 (Output_file::open_base_file): ...this; add base_name and
1980 writable parameters; adjust all callers.
1981 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1982 callers.
1983 * testsuite/Makefile.am (incremental_test_4): Test
1984 --incremental-base.
1985 * testsuite/Makefile.in: Regenerate.
1986
2eedd706
CC
19872011-05-24 Cary Coutant <ccoutant@google.com>
1988
1989 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1990 incremental_test_4.
1991 * testsuite/Makefile.in: Regenerate.
1992 * testsuite/two_file_test_1_v1.cc: New test source file.
1993 * testsuite/two_file_test_1b_v1.cc: New test source file.
1994 * testsuite/two_file_test_2_v1.cc: New test source file.
1995
0f1c85a6
CC
19962011-05-24 Cary Coutant <ccoutant@google.com>
1997
1998 * dynobj.h (Dynobj::do_dynobj): New function.
1999 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2000 flag and soname for shared objects.
2001 * incremental.cc (Incremental_inputs::report_object): Make
2002 either Incremental_object_entry or Incremental_dynobj_entry; add
2003 soname to string table.
2004 (Incremental_inputs::report_input_section): Add assertion.
2005 (Output_section_incremental_inputs::set_final_data_size): Adjust
2006 type of input file entry for shared libraries; adjust size of
2007 shared library info entry.
2008 (Output_section_incremental_inputs::write_input_files): Write
2009 as_needed flag for shared libraries.
2010 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2011 of input file entry for shared libraries; write soname.
2012 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2013 soname from incremental info.
2014 * incremental.h (enum Incremental_input_flags): Add
2015 INCREMENTAL_INPUT_AS_NEEDED.
2016 (Incremental_input_entry::Incremental_input_entry): Initialize new
2017 data member.
2018 (Incremental_input_entry::set_as_needed): New function.
2019 (Incremental_input_entry::as_needed): New function.
2020 (Incremental_input_entry::do_dynobj_entry): New function.
2021 (Incremental_input_entry::as_needed_): New data member.
2022 (Incremental_object_entry::Incremental_object_entry): Don't check
2023 for shared library.
2024 (Incremental_object_entry::do_type): Likewise.
2025 (class Incremental_dynobj_entry): New class.
2026 (Incremental_input_entry_reader::as_needed): New function.
2027 (Incremental_input_entry_reader::get_soname): New function.
2028 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2029 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2030 size of shared library info entry.
58797674 2031 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2032 incremental link when adding DT_NEEDED entries.
2033 * object.h (Object::Object): Initialize new data member.
2034 (Object::dynobj): New function.
2035 (Object::set_as_needed): New function.
2036 (Object::as_needed): New function.
2037 (Object::do_dynobj): New function.
2038 (Object::as_needed_): New data member.
2039
6fa2a40b
CC
20402011-05-24 Cary Coutant <ccoutant@google.com>
2041
2042 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2043 info; adjust display of GOT entries.
2044 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2045 vector of input objects; remove file_status_.
2046 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2047 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2048 got_plt reader; call target hooks to reserve GOT entries.
2049 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2050 of input file info header and GOT info entry.
2051 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2052 relocation info.
2053 (Got_plt_view_info::got_descriptor): Remove.
2054 (Got_plt_view_info::sym_index): New data member.
2055 (Got_plt_view_info::input_index): New data member.
2056 (Local_got_offset_visitor::visit): Write input file index.
2057 (Global_got_offset_visitor::visit): Write 0 for input file index.
2058 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2059 with sym_index and input_index.
2060 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2061 incremental info GOT entry; replace got_descriptor with input_index.
2062 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2063 map from input file index to object.
2064 (Sized_relobj_incr::do_layout): Replace direct data member reference
2065 with accessor function.
2066 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2067 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2068 Adjust size of input file info header.
2069 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2070 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2071 (Incremental_input_entry_reader::get_input_section): Adjust size of
2072 input file info header.
2073 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2074 of incremental info GOT entry.
2075 (Incremental_got_plt_reader::get_got_desc): Remove.
2076 (Incremental_got_plt_reader::get_got_symndx): New function.
2077 (Incremental_got_plt_reader::get_got_input_index): New function.
2078 (Sized_incremental_binary::Sized_incremental_binary): Remove
2079 file_status_; add input_objects_.
2080 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2081 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2082 (Sized_incremental_binary::file_is_unchanged): Remove.
2083 (Sized_incremental_binary::set_input_object): New function.
2084 (Sized_incremental_binary::input_object): New function.
2085 (Sized_incremental_binary::file_status_): Remove.
2086 (Sized_incremental_binary::input_objects_): New data member.
2087 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2088 references.
2089 (Sized_relobj_incr::invalid_address): Move to base class.
2090 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2091 class.
2092 (Sized_relobj_incr::do_output_section_offset): Likewise.
2093 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2094 (Sized_relobj_incr::section_offsets_): Likewise.
2095 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2096 function.
2097 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2098 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2099 with accessor function.
2100 (Sized_relobj_file::do_layout): Likewise.
2101 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2102 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2103 (Sized_relobj_file::compute_final_local_value): Replace refs to
2104 section_offsets_ with accessor function.
2105 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2106 * object.h (Relobj::Relobj): Initialize new data members.
2107 (Relobj::add_dyn_reloc): New function.
2108 (Relobj::first_dyn_reloc): New function.
2109 (Relobj::dyn_reloc_count): New function.
2110 (Relobj::first_dyn_reloc_): New data member.
2111 (Relobj::dyn_reloc_count_): New data member.
2112 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2113 references.
2114 (Sized_relobj::Address): New typedef.
2115 (Sized_relobj::invalid_address): Move here from child class.
2116 (Sized_relobj::Sized_relobj): Initialize new data members.
2117 (Sized_relobj::sized_relobj): New function.
2118 (Sized_relobj::is_output_section_offset_invalid): Move here from
2119 child class.
2120 (Sized_relobj::get_output_section_offset): Likewise.
2121 (Sized_relobj::local_has_got_offset): Likewise.
2122 (Sized_relobj::local_got_offset): Likewise.
2123 (Sized_relobj::set_local_got_offset): Likewise.
2124 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2125 (Sized_relobj::clear_got_offsets): New function.
2126 (Sized_relobj::section_offsets): Move here from child class.
2127 (Sized_relobj::do_output_section_offset): Likewise.
2128 (Sized_relobj::do_set_section_offset): Likewise.
2129 (Sized_relobj::Local_got_offsets): Likewise.
2130 (Sized_relobj::local_got_offsets_): Likewise.
2131 (Sized_relobj::section_offsets_): Likewise.
2132 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2133 references.
2134 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2135 class.
2136 (Sized_relobj_file::sized_relobj): New function
2137 (Sized_relobj_file::local_has_got_offset): Move to base class.
2138 (Sized_relobj_file::local_got_offset): Likewise.
2139 (Sized_relobj_file::set_local_got_offset): Likewise.
2140 (Sized_relobj_file::get_output_section_offset): Likewise.
2141 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2142 (Sized_relobj_file::do_output_section_offset): Likewise.
2143 (Sized_relobj_file::do_set_section_offset): Likewise.
2144 (Sized_relobj_file::Local_got_offsets): Likewise.
2145 (Sized_relobj_file::local_got_offsets_): Likewise.
2146 (Sized_relobj_file::section_offsets_): Likewise.
2147 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2148 (all constructors).
2149 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2150 (Output_reloc::get_symbol_index): Likewise.
2151 (Output_reloc::local_section_offset): Likewise.
2152 (Output_reloc::get_address): Likewise.
2153 (Output_reloc::symbol_value): Likewise.
2154 (Output_data_got::reserve_slot): Move to class definition.
2155 (Output_data_got::reserve_local): New function.
2156 (Output_data_got::reserve_slot_for_global): Remove.
2157 (Output_data_got::reserve_global): New function.
2158 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2159 (all constructors, two instantiations).
2160 (Output_reloc::get_relobj): New function (two instantiations).
2161 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2162 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2163 (Output_data_reloc::add_global): Adjust type of relobj.
2164 (Output_data_reloc::add_global_relative): Likewise.
2165 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2166 (Output_data_reloc::add_local): Likewise.
2167 (Output_data_reloc::add_local_relative): Likewise.
2168 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2169 (Output_data_reloc::add_local_section): Likewise.
2170 (Output_data_reloc::add_output_section): Likewise.
2171 (Output_data_reloc::add_absolute): Likewise.
2172 (Output_data_reloc::add_target_specific): Likewise.
2173 (Output_data_got::reserve_slot): Move definition here.
2174 (Output_data_got::reserve_local): New function.
2175 (Output_data_got::reserve_global): New function.
2176 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2177 section_offsets_ with accessor function.
2178 (Sized_relobj_file::write_sections): Likewise.
2179 (Sized_relobj_file::do_relocate_sections): Likewise.
2180 * target.h (Sized_target::reserve_local_got_entry): New function.
2181 (Sized_target::reserve_global_got_entry): New function.
2182 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2183 (Target_x86_64::reserve_global_got_entry): New function.
2184 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2185
4829d394
CC
21862011-05-23 Cary Coutant <ccoutant@google.com>
2187
2188 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2189 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2190 bit when checking got_type.
2191 * incremental.cc (Sized_incremental_binary::setup_readers):
2192 Store symbol table and string table locations; initialize bit vector
2193 of file status flags.
2194 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2195 unchanged files.
2196 (Sized_incremental_binary::do_process_got_plt): New function.
2197 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2198 (Output_section_incremental_inputs::set_final_data_size): Record
2199 file index for each input file.
2200 (Output_section_incremental_inputs::write_got_plt): Store file index
2201 instead of input entry offset for each GOT entry.
2202 * incremental.h
2203 (Incremental_input_entry::Incremental_input_entry): Initialize new
2204 data member.
2205 (Incremental_input_entry::set_offset): Store file index.
2206 (Incremental_input_entry::get_file_index): New function.
2207 (Incremental_input_entry::file_index_): New data member.
2208 (Incremental_binary::process_got_plt): New function.
2209 (Incremental_binary::do_process_got_plt): New function.
2210 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2211 data members.
2212 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2213 (Sized_incremental_binary::set_file_is_unchanged): New function.
2214 (Sized_incremental_binary::file_is_unchanged): New function.
2215 (Sized_incremental_binary::do_process_got_plt): New function.
2216 (Sized_incremental_binary::file_status_): New data member.
2217 (Sized_incremental_binary::main_symtab_loc_): New data member.
2218 (Sized_incremental_binary::main_strtab_loc_): New data member.
2219 * output.cc (Output_data_got::Got_entry::write): Add case
2220 RESERVED_CODE.
2221 (Output_data_got::add_global): Call add_got_entry.
2222 (Output_data_got::add_global_plt): Likewise.
2223 (Output_data_got::add_global_with_rel): Likewise.
2224 (Output_data_got::add_global_with_rela): Likewise.
2225 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2226 (Output_data_got::add_global_pair_with_rela): Likewise.
2227 (Output_data_got::add_local): Call add_got_entry.
2228 (Output_data_got::add_local_plt): Likewise.
2229 (Output_data_got::add_local_with_rel): Likewise.
2230 (Output_data_got::add_local_with_rela): Likewise.
2231 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2232 (Output_data_got::add_local_pair_with_rela): Likewise.
2233 (Output_data_got::reserve_slot): New function.
2234 (Output_data_got::reserve_slot_for_global): New function.
2235 (Output_data_got::add_got_entry): New function.
2236 (Output_data_got::add_got_entry_pair): New function.
2237 (Output_section::add_output_section_data): Edit FIXME.
2238 * output.h
2239 (Output_section_data_build::Output_section_data_build): New
2240 constructor with size parameter.
2241 (Output_data_space::Output_data_space): Likewise.
2242 (Output_data_got::Output_data_got): Initialize new data member; new
2243 constructor with size parameter.
2244 (Output_data_got::add_constant): Call add_got_entry.
2245 (Output_data_got::reserve_slot): New function.
2246 (Output_data_got::reserve_slot_for_global): New function.
2247 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2248 (Output_data_got::add_got_entry): New function.
2249 (Output_data_got::add_got_entry_pair): New function.
2250 (Output_data_got::free_list_): New data member.
2251 * target.h (Sized_target::init_got_plt_for_update): New function.
2252 (Sized_target::register_global_plt_entry): New function.
2253 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2254 Initialize new data member; call init; add constructor with PLT count.
2255 (Output_data_plt_x86_64::init): New function.
2256 (Output_data_plt_x86_64::add_relocation): New function.
2257 (Output_data_plt_x86_64::reserve_slot): New function.
2258 (Output_data_plt_x86_64::free_list_): New data member.
2259 (Target_x86_64::init_got_plt_for_update): New function.
2260 (Target_x86_64::register_global_plt_entry): New function.
2261 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2262 incremental updates.
2263 (Output_data_plt_x86_64::add_relocation): New function.
2264 * testsuite/object_unittest.cc (Object_test): Set default options.
2265
ec69d6da
ILT
22662011-05-16 Ian Lance Taylor <iant@google.com>
2267
2268 * options.h (class General_options): Make -i a synonym for -r.
2269
732e31de
ILT
22702011-05-16 Ian Lance Taylor <iant@google.com>
2271
2272 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2273
403676b5
CC
22742011-05-10 Cary Coutant <ccoutant@google.com>
2275
2276 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2277 strip_all (-s).
2278
5b7b7d6e
ILT
22792011-05-06 Ian Lance Taylor <iant@google.com>
2280
2281 * layout.cc (Layout::layout): If the output section flags change,
2282 update the ordering.
2283
f0f9babf
CC
22842011-04-25 Cary Coutant <ccoutant@google.com>
2285
2286 * incremental-dump.cc (dump_incremental_inputs): Print local
2287 symbol info for each input file.
2288 * incremental.cc
2289 (Output_section_incremental_inputs::set_final_data_size): Add local
2290 symbol info to input file entries in incremental info.
2291 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2292 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2293 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2294 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2295 implementation.
2296 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2297 (Sized_incr_relobj::do_relocate): Write the local symbols.
2298 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2299 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2300 Adjust size of input file header.
2301 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2302 (Incremental_inputs_reader::get_local_symbol_count): New function.
2303 (Incremental_inputs_reader::get_input_section): Adjust size of input
2304 file header.
2305 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2306 (Sized_incr_relobj::This): New typedef.
2307 (Sized_incr_relobj::sym_size): New const data member.
2308 (Sized_incr_relobj::Local_symbol): New struct.
2309 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2310 (Sized_incr_relobj::do_local_symbol_offset): New function.
2311 (Sized_incr_relobj::local_symbol_count_): New data member.
2312 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2313 (Sized_incr_relobj::local_symbol_index_): New data member.
2314 (Sized_incr_relobj::local_symbol_offset_): New data member.
2315 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2316 (Sized_incr_relobj::local_symbols_): New data member.
2317 * object.h (Relobj::output_local_symbol_count): New function.
2318 (Relobj::local_symbol_offset): New function.
2319 (Relobj::do_output_local_symbol_count): New function.
2320 (Relobj::do_local_symbol_offset): New function.
2321 (Sized_relobj::do_output_local_symbol_count): New function.
2322 (Sized_relobj::do_local_symbol_offset): New function.
2323
d0a9ace3
ILT
23242011-04-22 Vladimir Simonov <sv@sw.ru>
2325
2326 * descriptors.cc (set_close_on_exec): New function.
2327 (Descriptors::open): Use set_close_on_exec.
2328 * output.cc (S_ISLNK): Define if not defined.
2329
94a3fc8b
CC
23302011-04-22 Cary Coutant <ccoutant@google.com>
2331
2332 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2333 global symbol map.
2334 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2335 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2336 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2337 relocations.
2338 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2339 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2340 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2341 * incremental.h
2342 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2343 function.
2344 (Incremental_binary::apply_incremental_relocs): New function.
2345 (Incremental_binary::do_apply_incremental_relocs): New function.
2346 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2347 data member.
2348 (Sized_incremental_binary::add_global_symbol): New function.
2349 (Sized_incremental_binary::global_symbol): New function.
2350 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2351 (Sized_incremental_binary::symbol_map_): New data member.
2352 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2353 * target.h (Sized_target::apply_relocation): New function.
2354 * target-reloc.h (apply_relocation): New function.
2355 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2356
c87e4302
DK
23572011-04-22 Doug Kwan <dougkwan@google.com>
2358
2359 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2360 flag of a SHT_ARM_EXIDX section.
2361 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2362 * testsuite/Makefile.in: Regenerate.
2363 * testsuite/arm_exidx_test.s: New file.
2364 * testsuite/arm_exidx_test.sh: Same.
2365
e7782cf6
CC
23662011-04-20 Cary Coutant <ccoutant@google.com>
2367
2368 PR gold/12689
2369 * archive.h (Incremental_archive_entry::Archive_member):
2370 Initialize arg_serial_ (second constructor).
2371
308ecdc7
ILT
23722011-04-17 Ian Lance Taylor <iant@google.com>
2373
2374 * object.cc (Relocate_info::location): Simplify location string.
2375 * errors.cc (Errors::error_at_location): Don't print program
2376 name.
2377 (Errors::warning_at_location): Likewise.
2378 (Errors::undefined_symbol): Likewise.
2379 * testsuite/debug_msg.sh: Update accordingly.
2380
bec5b579
CC
23812011-04-14 Cary Coutant <ccoutant@google.com>
2382
2383 * gold/layout.cc (Layout::symtab_section_offset): New function.
2384 * gold/layout.h (Layout::symtab_section_offset): New function.
2385 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2386
88597d34
ILT
23872011-04-12 Ian Lance Taylor <iant@google.com>
2388
2389 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2390 with MREMAP_MAYMOVE.
2391 * output.h (class Output_file): Add map_is_allocated_ field.
2392 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2393 not available, provide stubs. If mremap is not available, #define
2394 it to gold_mremap.
2395 (MREMAP_MAYMOVE): Define if not defined.
2396 (Output_file::Output_file): Initialize map_is_allocated_.
2397 (Output_file::resize): Check map_is_allocated_.
2398 (Output_file::map_anonymous): If mmap fails, use malloc.
2399 (Output_file::unmap): Don't do anything for an anonymous map.
2400 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2401 is not available, provide stubs.
2402 (File_read::View::~View): Use free rather than delete[].
2403 (File_read::make_view): Use malloc rather than new[]. If mmap
2404 fails, use malloc.
2405 (File_read::find_or_make_view): Use malloc rather than new[].
2406 * gold.h: Remove HAVE_REMAP code.
2407 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2408 exists. Rename mremap to gold_mremap. If mmap is not available
2409 don't do anything.
2410 * configure, config.in: Rebuild.
2411
11e361bc
ILT
24122011-04-11 Ian Lance Taylor <iant@google.com>
2413
2414 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2415 initialize local variable v.
2416
cdc29364
CC
24172011-04-11 Cary Coutant <ccoutant@google.com>
2418
2419 * archive.cc (Archive::include_member): Adjust call to
2420 report_object.
2421 (Add_archive_symbols::run): Track argument serial numbers.
2422 (Lib_group::include_member): Likewise.
2423 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2424 * archive.h (Incremental_archive_entry::Archive_member):
2425 Initialize arg_serial_.
2426 (Archive_member::arg_serial_): New data member.
2427 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2428 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2429 incremental link.
2430 (Sized_dynobj::do_for_all_local_got_entries): New function.
2431 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2432 function.
2433 * fileread.cc (get_mtime): New function.
2434 * fileread.h (get_mtime): New function.
2435 * gold.cc (queue_initial_tasks): Check for incremental update.
2436 (process_incremental_input): New function.
2437 (queue_middle_tasks): Don't force valid target for incremental
2438 update.
2439 * incremental-dump.cc (find_input_containing_global): Adjust
2440 size of symbol info entry.
2441 (dump_incremental_inputs): Dump argument serial number and
2442 in_system_directory flag; bias shndx by 1; print symbol names
2443 when dumping per-file symbol lists; use new symbol info readers.
2444 * incremental.cc
2445 (Output_section_incremental_inputs:update_data_size): New function.
2446 (Sized_incremental_binary::setup_readers): Setup input readers
2447 for each input file; build maps for files added from libraries
2448 and scripts.
2449 (Sized_incremental_binary::check_input_args): New function.
2450 (Sized_incremental_binary::do_check_inputs): Build map of argument
2451 serial numbers to input arguments.
2452 (Sized_incremental_binary::do_file_has_changed): Rename
2453 do_file_is_unchanged to this; compare file modification times.
2454 (Sized_incremental_binary::do_init_layout): New function.
2455 (Sized_incremental_binary::do_reserve_layout): New function.
2456 (Sized_incremental_binary::do_get_input_reader): Remove.
2457 (Sized_incremental_binary::get_symtab_view): New function.
2458 (Incremental_checker::can_incrementally_link_output_file): Remove.
2459 (Incremental_inputs::report_command_line): Exclude --debug options.
2460 (Incremental_inputs::report_archive_begin): Add parameter; track
2461 argument serial numbers; don't put input file entry for archive
2462 before archive members.
2463 (Incremental_inputs::report_archive_end): Put input file entry
2464 for archive after archive members.
2465 (Incremental_inputs::report_object): Add parameter; track argument
2466 serial numbers and in_system_directory flag.
2467 (Incremental_inputs::report_script): Add parameter; track argument
2468 serial numbers.
2469 (Output_section_incremental_inputs::set_final_data_size): Adjust
2470 size of symbol info entry; check for forwarding symbols.
2471 (Output_section_incremental_inputs::write_input_files): Write
2472 in_system_directory flag and argument serial number.
2473 (Output_section_incremental_inputs::write_info_blocks): Map section
2474 indices between incremental info and original input file; store
2475 input section index for each symbol.
2476 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2477 change operator() to visit().
2478 (class Global_got_offset_visitor): Likewise.
2479 (class Global_symbol_visitor_got_plt):
2480 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2481 classes.
2482 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2483 (Sized_incr_relobj::do_read_symbols): New function.
2484 (Sized_incr_relobj::do_layout): New function.
2485 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2486 (Sized_incr_relobj::do_add_symbols): New function.
2487 (Sized_incr_relobj::do_should_include_member): New function.
2488 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2489 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2490 (Sized_incr_relobj::do_section_size): New function.
2491 (Sized_incr_relobj::do_section_name): New function.
2492 (Sized_incr_relobj::do_section_contents): New function.
2493 (Sized_incr_relobj::do_section_flags): New function.
2494 (Sized_incr_relobj::do_section_entsize): New function.
2495 (Sized_incr_relobj::do_section_address): New function.
2496 (Sized_incr_relobj::do_section_type): New function.
2497 (Sized_incr_relobj::do_section_link): New function.
2498 (Sized_incr_relobj::do_section_info): New function.
2499 (Sized_incr_relobj::do_section_addralign): New function.
2500 (Sized_incr_relobj::do_initialize_xindex): New function.
2501 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2502 (Sized_incr_relobj::do_read_relocs): New function.
2503 (Sized_incr_relobj::do_gc_process_relocs): New function.
2504 (Sized_incr_relobj::do_scan_relocs): New function.
2505 (Sized_incr_relobj::do_count_local_symbols): New function.
2506 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2507 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2508 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2509 (Sized_incr_relobj::do_relocate): New function.
2510 (Sized_incr_relobj::do_set_section_offset): New function.
2511 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2512 (Sized_incr_dynobj::do_read_symbols): New function.
2513 (Sized_incr_dynobj::do_layout): New function.
2514 (Sized_incr_dynobj::do_add_symbols): New function.
2515 (Sized_incr_dynobj::do_should_include_member): New function.
2516 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2517 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2518 (Sized_incr_dynobj::do_section_size): New function.
2519 (Sized_incr_dynobj::do_section_name): New function.
2520 (Sized_incr_dynobj::do_section_contents): New function.
2521 (Sized_incr_dynobj::do_section_flags): New function.
2522 (Sized_incr_dynobj::do_section_entsize): New function.
2523 (Sized_incr_dynobj::do_section_address): New function.
2524 (Sized_incr_dynobj::do_section_type): New function.
2525 (Sized_incr_dynobj::do_section_link): New function.
2526 (Sized_incr_dynobj::do_section_info): New function.
2527 (Sized_incr_dynobj::do_section_addralign): New function.
2528 (Sized_incr_dynobj::do_initialize_xindex): New function.
2529 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2530 (make_sized_incremental_object): New function.
2531 (Incremental_library::copy_unused_symbols): New function.
2532 (Incremental_library::do_for_all_unused_symbols): New function.
2533 * incremental.h (enum Incremental_input_flags): New type.
2534 (class Incremental_checker): Remove.
2535 (Incremental_input_entry::Incremental_input_entry): Add argument
2536 serial number.
2537 (Incremental_input_entry::arg_serial): New function.
2538 (Incremental_input_entry::set_is_in_system_directory): New function.
2539 (Incremental_input_entry::is_in_system_directory): New function.
2540 (Incremental_input_entry::arg_serial_): New data member.
2541 (Incremental_input_entry::is_in_system_directory_): New data member.
2542 (class Script_info): Move here from script.h.
2543 (Script_info::Script_info): Add filename parameter.
2544 (Script_info::filename): New function.
2545 (Script_info::filename_): New data member.
2546 (Incremental_script_entry::Incremental_script_entry): Add argument
2547 serial number.
2548 (Incremental_object_entry::Incremental_object_entry): Likewise.
2549 (Incremental_object_entry::add_input_section): Build list of input
2550 sections with map to original shndx.
2551 (Incremental_object_entry::get_input_section_index): New function.
2552 (Incremental_object_entry::shndx_): New data member.
2553 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2554 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2555 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2556 serial number.
2557 (Incremental_inputs::report_archive_begin): Likewise.
2558 (Incremental_inputs::report_object): Likewise.
2559 (Incremental_inputs::report_script): Likewise.
2560 (class Incremental_global_symbol_reader): New class.
2561 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2562 and store flags and input file type.
2563 (Incremental_input_entry_reader::arg_serial): New function.
2564 (Incremental_input_entry_reader::type): Extract type from flags.
2565 (Incremental_input_entry_reader::is_in_system_directory): New function.
2566 (Incremental_input_entry_reader::get_input_section_count): Call
2567 accessor function for type.
2568 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2569 function for type; adjust size of global symbol entry.
2570 (Incremental_input_entry_reader::get_global_symbol_count): Call
2571 accessor function for type.
2572 (Incremental_input_entry_reader::get_object_count): Likewise.
2573 (Incremental_input_entry_reader::get_object_offset): Likewise.
2574 (Incremental_input_entry_reader::get_member_count): Likewise.
2575 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2576 (Incremental_input_entry_reader::get_member_offset): Likewise.
2577 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2578 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2579 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2580 (Incremental_input_entry_reader::get_global_symbol_reader): New
2581 function.
2582 (Incremental_input_entry_reader::get_output_symbol_index): New
2583 function.
2584 (Incremental_input_entry_reader::type_): Remove.
2585 (Incremental_input_entry_reader::flags_): New data member.
2586 (Incremental_inputs_reader::input_file_offset): New function.
2587 (Incremental_inputs_reader::input_file_index): New function.
2588 (Incremental_inputs_reader::input_file): Call input_file_offset.
2589 (Incremental_inputs_reader::input_file_at_offset): New function.
2590 (Incremental_relocs_reader::get_r_type): Reformat.
2591 (Incremental_relocs_reader::get_r_shndx): Reformat.
2592 (Incremental_relocs_reader::get_r_offset): Reformat.
2593 (Incremental_relocs_reader::data): New function.
2594 (Incremental_binary::Incremental_binary): Initialize new data members.
2595 (Incremental_binary::check_inputs): Add cmdline parameter.
2596 (Incremental_binary::file_is_unchanged): Remove.
2597 (Input_reader::arg_serial): New function.
2598 (Input_reader::get_unused_symbol_count): New function.
2599 (Input_reader::get_unused_symbol): New function.
2600 (Input_reader::do_arg_serial): New function.
2601 (Input_reader::do_get_unused_symbol_count): New function.
2602 (Input_reader::do_get_unused_symbol): New function.
2603 (Incremental_binary::input_file_count): New function.
2604 (Incremental_binary::get_input_reader): Change signature to use
2605 index instead of filename.
2606 (Incremental_binary::file_has_changed): New function.
2607 (Incremental_binary::get_input_argument): New function.
2608 (Incremental_binary::get_library): New function.
2609 (Incremental_binary::get_script_info): New function.
2610 (Incremental_binary::init_layout): New function.
2611 (Incremental_binary::reserve_layout): New function.
2612 (Incremental_binary::output_file): New function.
2613 (Incremental_binary::do_check_inputs): New function.
2614 (Incremental_binary::do_file_is_unchanged): Remove.
2615 (Incremental_binary::do_file_has_changed): New function.
2616 (Incremental_binary::do_init_layout): New function.
2617 (Incremental_binary::do_reserve_layout): New function.
2618 (Incremental_binary::do_input_file_count): New function.
2619 (Incremental_binary::do_get_input_reader): Change signature.
2620 (Incremental_binary::input_args_map_): New data member.
2621 (Incremental_binary::library_map_): New data member.
2622 (Incremental_binary::script_map_): New data member.
2623 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2624 new data members.
2625 (Sized_incremental_binary::output_section): New function.
2626 (Sized_incremental_binary::inputs_reader): Add const.
2627 (Sized_incremental_binary::symtab_reader): Add const.
2628 (Sized_incremental_binary::relocs_reader): Add const.
2629 (Sized_incremental_binary::got_plt_reader): Add const.
2630 (Sized_incremental_binary::get_symtab_view): New function.
2631 (Sized_incremental_binary::Inputs_reader): New typedef.
2632 (Sized_incremental_binary::Input_entry_reader): New typedef.
2633 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2634 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2635 (Sized_incremental_binary::do_file_has_changed): New function.
2636 (Sized_incremental_binary::do_init_layout): New function.
2637 (Sized_incremental_binary::do_reserve_layout): New function.
2638 (Sized_input_reader::Inputs_reader): Remove.
2639 (Sized_input_reader::Input_entry_reader): Remove.
2640 (Sized_input_reader::do_arg_serial): New function.
2641 (Sized_input_reader::do_get_unused_symbol_count): New function.
2642 (Sized_input_reader::do_get_unused_symbol): New function.
2643 (Sized_incremental_binary::do_input_file_count): New function.
2644 (Sized_incremental_binary::do_get_input_reader): Change signature;
2645 use index instead of filename.
2646 (Sized_incremental_binary::section_map_): New data member.
2647 (Sized_incremental_binary::input_entry_readers_): New data member.
2648 (class Sized_incr_relobj): New class.
2649 (class Sized_incr_dynobj): New class.
2650 (make_sized_incremental_object): New function.
2651 (class Incremental_library): New class.
2652 * layout.cc (Free_list::num_lists): New static data member.
2653 (Free_list::num_nodes): New static data member.
2654 (Free_list::num_removes): New static data member.
2655 (Free_list::num_remove_visits): New static data member.
2656 (Free_list::num_allocates): New static data member.
2657 (Free_list::num_allocate_visits): New static data member.
2658 (Free_list::init): New function.
2659 (Free_list::remove): New function.
2660 (Free_list::allocate): New function.
2661 (Free_list::dump): New function.
2662 (Free_list::print_stats): New function.
2663 (Layout_task_runner::run): Resize output file for incremental updates.
2664 (Layout::Layout): Initialize new data members.
2665 (Layout::set_incremental_base): New function.
2666 (Layout::init_fixed_output_section): New function.
2667 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2668 incremental updates.
2669 (Layout::create_gold_note): Do not create gold note section for
2670 incremental updates.
2671 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2672 for incremental updates.
2673 (Layout::set_section_offsets): For incremental updates, allocate space
2674 from free list.
2675 (Layout::create_symtab_sections): Layout with offsets relative to
2676 start of section; for incremental updates, allocate space from free
2677 list.
2678 (Layout::create_shdrs): For incremental updates, allocate space from
2679 free list.
2680 (Layout::finish_dynamic_section): For incremental updates, do not
2681 check --as-needed (fixed in subsequent patch).
2682 * layout.h (class Free_list): New class.
2683 (Layout::set_incremental_base): New function.
2684 (Layout::incremental_base): New function.
2685 (Layout::init_fixed_output_section): New function.
2686 (Layout::allocate): New function.
2687 (Layout::incremental_base_): New data member.
2688 (Layout::free_list_): New data member.
2689 * main.cc (main): Print Free_list statistics.
2690 * object.cc (Relobj::finalize_incremental_relocs): Add
2691 clear_counts parameter; clear counts only when clear_counts is set.
2692 (Sized_relobj::Sized_relobj): Initialize new base class.
2693 (Sized_relobj::do_layout): Don't report special sections.
2694 (Sized_relobj::do_for_all_local_got_entries): New function.
2695 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2696 symtab_off to all symbol table offsets.
2697 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2698 * object.h (class Got_offset_list): Move to top of file.
2699 (Object::Object): Allow case where input_file == NULL.
2700 (Object::~Object): Likewise.
2701 (Object::input_file): Assert that input_file != NULL.
2702 (Object::lock): Allow case where input_file == NULL.
2703 (Object::unlock): Likewise.
2704 (Object::is_locked): Likewise.
2705 (Object::token): Likewise.
2706 (Object::release): Likewise.
2707 (Object::is_incremental): New function.
2708 (Object::get_mtime): New function.
2709 (Object::for_all_local_got_entries): New function.
2710 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2711 (Object::set_is_in_system_directory): New function.
2712 (Object::is_in_system_directory): New function.
2713 (Object::do_is_incremental): New function.
2714 (Object::do_get_mtime): New function.
2715 (Object::do_for_all_local_got_entries): New function.
2716 (Object::is_in_system_directory_): New data member.
2717 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2718 (class Sized_relobj_base): New class.
2719 (class Sized_relobj): Derive from Sized_relobj_base.
2720 (class Sized_relobj::Symbols): Redeclare from base class.
2721 (class Sized_relobj::local_got_offset_list): Remove.
2722 (class Sized_relobj::Output_sections): Redeclare from base class.
2723 (class Sized_relobj::do_for_all_local_got_entries): New function.
2724 (class Sized_relobj::write_local_symbols): Add offset parameter.
2725 (class Sized_relobj::local_symbol_offset_): Update comment.
2726 (class Sized_relobj::local_dynsym_offset_): Update comment.
2727 * options.cc (Input_arguments::add_file): Remove const.
2728 * options.h (Input_file_argument::Input_file_argument):
2729 Initialize arg_serial_ (all constructors).
2730 (Input_file_argument::set_arg_serial): New function.
2731 (Input_file_argument::arg_serial): New function.
2732 (Input_file_argument::arg_serial_): New data member.
2733 (Input_arguments::Input_arguments): Initialize file_count_.
2734 (Input_arguments::add_file): Remove const.
2735 (Input_arguments::number_of_input_files): New function.
2736 (Input_arguments::file_count_): New data member.
2737 (Command_line::number_of_input_files): Call
2738 Input_arguments::number_of_input_files.
2739 * output.cc (Output_segment_headers::Output_segment_headers):
2740 Set current size.
2741 (Output_section::Input_section::current_data_size): New function.
2742 (Output_section::Output_section): Initialize new data members.
2743 (Output_section::add_input_section): Don't do merge sections for
2744 an incremental link; allocate space from free list for an
2745 incremental update.
2746 (Output_section::add_output_section_data): Allocate space from
2747 free list for an incremental update.
2748 (Output_section::update_data_size): New function.
2749 (Output_section::set_fixed_layout): New function.
2750 (Output_section::reserve): New function.
2751 (Output_segment::set_section_addresses): Remove const.
2752 (Output_segment::set_section_list_addresses): Remove const; allocate
2753 space from free list for an incremental update.
2754 (Output_segment::set_offset): Adjust size of RELRO segment for an
2755 incremental update.
2756 * output.h (Output_data::current_data_size): Move here from
2757 child classes.
2758 (Output_data::pre_finalize_data_size): New function.
2759 (Output_data::update_data_size): New function.
2760 (Output_section_headers::update_data_size): new function.
2761 (Output_section_data_build::current_data_size): Move to Output_data.
2762 (Output_data_strtab::update_data_size): New function.
2763 (Output_section::current_data_size): Move to Output_data.
2764 (Output_section::set_fixed_layout): New function.
2765 (Output_section::has_fixed_layout): New function.
2766 (Output_section::reserve): New function.
2767 (Output_section::update_data_size): New function.
2768 (Output_section::has_fixed_layout_): New data member.
2769 (Output_section::free_list_): New data member.
2770 (Output_segment::set_section_addresses): Remove const.
2771 (Output_segment::set_section_list_addresses): Remove const.
2772 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2773 New function.
2774 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2775 New function.
2776 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2777 parameter when calling Add_symbols constructor; store argument
2778 serial number for members of a lib group.
2779 (Add_symbols::locks): Allow case where token == NULL.
2780 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2781 (Read_member::~Read_member): New function.
2782 (Read_member::is_runnable): New function.
2783 (Read_member::locks): New function.
2784 (Read_member::run): New function.
2785 (Check_script::~Check_script): New function.
2786 (Check_script::is_runnable): New function.
2787 (Check_script::locks): New function.
2788 (Check_script::run): New function.
2789 (Check_library::~Check_library): New function.
2790 (Check_library::is_runnable): New function.
2791 (Check_library::locks): New function.
2792 (Check_library::run): New function.
2793 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2794 (Add_symbols::library_): New data member.
2795 (class Read_member): New class.
2796 (class Check_script): New class.
2797 (class Check_library): New class.
2798 * reloc.cc (Read_relocs::is_runnable): Allow case where
2799 token == NULL.
2800 (Read_relocs::locks): Likewise.
2801 (Scan_relocs::locks): Likewise.
2802 (Relocate_task::locks): Likewise.
2803 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2804 to clear counters.
2805 (Sized_relobj::incremental_relocs_scan): Fix comment.
2806 (Sized_relobj::do_relocate): Pass output file offset to
2807 write_local_symbols.
2808 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2809 from class declaration.
2810 * script.cc (read_input_script): Allocate Script_info; pass
2811 argument serial number to report_script.
2812 * script.h (class Script_info): Move to incremental.h.
2813 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2814 * symtab.h (Symbol_table::add_from_incrobj): New function.
2815 (Symbol_table::set_file_offset): New function.
2816
b961d0d7
CC
28172011-04-05 Cary Coutant <ccoutant@google.com>
2818
2819 * incremental-dump.cc (dump_incremental_inputs): Change signature
2820 to take a Sized_incremental_binary; change caller. Use readers
2821 in Sized_incremental_binary.
2822 * incremental.cc
2823 (Sized_incremental_binary::find_incremental_inputs_sections):
2824 Rename do_find_incremental_inputs_sections to this.
2825 (Sized_incremental_binary::setup_readers): New function.
2826 (Sized_incremental_binary::do_check_inputs): Check
2827 has_incremental_info_ flag; move setup code to setup_readers;
2828 use input readers.
2829 (Sized_incremental_binary::do_file_is_unchanged): New function.
2830 (Sized_incremental_binary::do_get_input_reader): New function.
2831 * incremental.h (class Incremental_binary): Move to end of file.
2832 (Incremental_binary::file_is_unchanged): New function.
2833 (Incremental_binary::do_file_is_unchanged): New function.
2834 (Incremental_binary::Input_reader): New class.
2835 (Incremental_binary::get_input_reader): New function.
2836 (class Sized_incremental_binary): Move to end of file.
2837 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2838 input section reader classes.
2839 (Sized_incremental_binary::has_incremental_info): New function.
2840 (Sized_incremental_binary::inputs_reader): New function.
2841 (Sized_incremental_binary::symtab_reader): New function.
2842 (Sized_incremental_binary::relocs_reader): New function.
2843 (Sized_incremental_binary::got_plt_reader): New function.
2844 (Sized_incremental_binary::do_file_is_unchanged): New function.
2845 (Sized_incremental_binary::Sized_input_reader): New class.
2846 (Sized_incremental_binary::get_input_reader): New function.
2847 (Sized_incremental_binary::find_incremental_inputs_sections):
2848 Rename do_find_incremental_inputs_sections to this.
2849 (Sized_incremental_binary::setup_readers): New function.
2850 (Sized_incremental_binary::has_incremental_info_): New data member.
2851 (Sized_incremental_binary::inputs_reader_): New data member.
2852 (Sized_incremental_binary::symtab_reader_): New data member.
2853 (Sized_incremental_binary::relocs_reader_): New data member.
2854 (Sized_incremental_binary::got_plt_reader_): New data member.
2855 (Sized_incremental_binary::current_input_file_): New data member.
2856
a869183f
PP
28572011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2858
2859 PR gold/12640
2860 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2861 violation.
2862
28632011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2864
2865 * archive.cc (Archive::include_member): Adjust call to report_object.
2866 (Add_archive_symbols::run): Add script_info to call to
2867 report_archive_begin.
2868 (Lib_group::include_member): Adjust call to report_object.
2869 (Add_lib_group_symbols::run): Adjust call to report_object.
2870 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2871 blocks. Add object count for script input files.
2872 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2873 script_info parameter; change all callers.
2874 (Incremental_inputs::report_object): Add script_info parameter;
2875 change all callers.
2876 (Incremental_inputs::report_script): Store backpointer to
2877 incremental info entry.
2878 (Output_section_incremental_inputs::set_final_data_size): Record
2879 additional information for scripts.
2880 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2881 * incremental.h (Incremental_script_entry::add_object): New function.
2882 (Incremental_script_entry::get_object_count): New function.
2883 (Incremental_script_entry::get_object): New function.
2884 (Incremental_script_entry::objects_): New data member; adjust
2885 constructor.
2886 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2887 (Incremental_inputs::report_object): Add script_info parameter.
2888 (Incremental_inputs_reader::get_object_count): New function.
2889 (Incremental_inputs_reader::get_object_offset): New function.
2890 * options.cc (Input_arguments::add_file): Return reference to
2891 new input argument.
2892 * options.h (Input_argument::set_script_info): New function.
2893 (Input_argument::script_info): New function.
2894 (Input_argument::script_info_): New data member; adjust all
2895 constructors.
2896 (Input_file_group::add_file): Return reference to new input argument.
2897 (Input_file_lib::add_file): Likewise.
2898 (Input_arguments::add_file): Likewise.
2899 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2900 * script.cc (Parser_closure::Parser_closure): Add script_info
2901 parameter; adjust all callers.
2902 (Parser_closure::script_info): New function.
2903 (Parser_closure::script_info_): New data member.
2904 (read_input_script): Report scripts earlier to incremental info.
2905 (script_add_file): Set script_info in Input_argument.
2906 (script_add_library): Likewise.
2907 * script.h (Script_options::Script_info): Rewrite class.
2908
a869183f 29092011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2910
2911 * archive.cc (Library_base::should_include_member): Move
2912 method here from class Archive.
2913 (Archive::Archive): Initialize base class.
2914 (Archive::should_include_member): Move to base class.
2915 (Archive::do_for_all_unused_symbols): New function.
2916 (Add_archive_symbols::run): Remove redundant access to
2917 incremental_inputs.
2918 (Lib_group::Lib_group): Initialize base class.
2919 (Lib_group::do_filename): New function.
2920 (Lib_group::include_member): Pass pointer to Lib_group to
2921 report_object.
2922 (Lib_group::do_for_all_unused_symbols): New function.
2923 (Add_lib_group_symbols::run): Report archive information for
2924 incremental links.
2925 * archive.h (class Library_base): New base class.
2926 (class Archive): Derive from Library_base.
2927 (Archive::filename): Move to base class.
2928 (Archive::set_incremental_info): Likewise.
2929 (Archive::incremental_info): Likewise.
2930 (Archive::Should_include): Likewise.
2931 (Archive::should_include_member): Likewise.
2932 (Archive::Armap_entry): Remove.
2933 (Archive::Unused_symbol_iterator): Remove.
2934 (Archive::unused_symbols_begin): Remove.
2935 (Archive::unused_symbols_end): Remove.
2936 (Archive::do_filename): New function.
2937 (Archive::do_get_mtime): New function.
2938 (Archive::do_for_all_unused_symbols): New function.
2939 (Archive::task_): Move to base class.
2940 (Archive::incremental_info_): Likewise.
2941 (class Lib_group): Derive from Library_base.
2942 (Lib_group::do_filename): New function.
2943 (Lib_group::do_get_mtime): New function.
2944 (Lib_group::do_for_all_unused_symbols): New function.
2945 (Lib_group::task_): Move to base class.
2946 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2947 function.
2948 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2949 function.
2950 * incremental.cc (Incremental_inputs::report_archive_begin):
2951 Use Library_base; call library's get_mtime; add incremental inputs
2952 entry before members.
2953 (class Unused_symbol_visitor): New class.
2954 (Incremental_inputs::report_archive_end): Use Library_base; use
2955 visitor class to record unused symbols; don't add incremental inputs
2956 entry after members.
2957 (Incremental_inputs::report_object): Use Library_base.
2958 * incremental.h
2959 (Incremental_archive_entry::Incremental_archive_entry): Remove
2960 unused Archive parameter.
2961 (Incremental_inputs::report_archive_begin): Use Library_base.
2962 (Incremental_inputs::report_archive_end): Likewise.
2963 (Incremental_inputs::report_object): Likewise.
2964 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2965 function.
2966 * object.h (Object::for_all_global_symbols): New function.
2967 (Object::do_for_all_global_symbols): New function.
2968 (Sized_relobj::do_for_all_global_symbols): New function.
2969 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2970 function.
2971 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2972 function.
2973
61ab3e40
ILT
29742011-03-27 Ian Lance Taylor <iant@google.com>
2975
2976 * archive.cc (Archive::interpret_header): Return -1 if something
2977 goes wrong. Change callers accordingly.
2978
30e1f9e6
CC
29792011-03-25 Cary Coutant <ccoutant@google.com>
2980
2981 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2982 * testsuite/Makefile.in: Regenerate.
2983
9370ce59 29842011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2985
2986 * plugin.cc (get_view): New.
2987 (Plugin::load): Pass get_view to the plugin.
2988 (Plugin_manager::get_view): New.
2989
9312bb0a
ILT
29902011-03-21 Ian Lance Taylor <iant@google.com>
2991
2992 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2993 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2994
7e12ba9e
ST
29952011-03-21 Sriraman Tallam <tmsriram@google.com>
2996
2997 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2998 Change == to -eq.
2999 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3000 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3001 Change == to -eq.
3002 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3003 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3004
fd7a005d
ILT
30052011-03-14 Ian Lance Taylor <iant@google.com>
3006
3007 * script-sections.cc (Sort_output_sections::script_compare):
3008 Rename from is_before, change return type.
3009 (Sort_output_sections::operator()): Adjust accordingly.
3010
ed16fd1b
ILT
30112011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3012
3013 PR gold/12572
3014 * testsuite/odr_violation2.cc: Add comment to make all error line
3015 numbers double digits.
3016 * testsuite/debug_msg.sh: Adjust expected errors.
3017
71ff8986
ILT
30182011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3019
3020 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3021 but mark earlier ones as non-canonical
3022 (offset_to_iterator): Update search target and example
3023 (do_addr2line): Return extra lines in a vector*
3024 (format_file_lineno): Extract from do_addr2line
3025 (one_addr2line): Add vector* out-param
3026 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3027 when a lineno entry appeared last for its instruction
3028 (Dwarf_line_info): Add vector* out-param
3029 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3030 * symtab.cc (Odr_violation_compare): Include the lineno in the
3031 comparison again.
3032 (linenos_from_loc): New. Combine the canonical line for an
3033 address with its other lines.
3034 (True_if_intersect): New. Helper functor to make
3035 std::set_intersection a query.
3036 (detect_odr_violations): Compare sets of lines instead of just
3037 one line for each function. This became less deterministic, but
3038 has fewer false positives.
3039 * symtab.h: Declarations.
3040 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3041 mix an optimized and non-optimized object in the same binary
3042 (odr_violation2.so): Same.
3043 * testsuite/Makefile.in: Regenerate from Makefile.am.
3044 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3045 * testsuite/debug_msg.sh: Update line numbers and add
3046 assertions.
3047 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3048 non-optimized context.
3049 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3050 isn't inlined, and use OdrDerived in an optimized context.
3051 * testsuite/odr_header1.h: Defines OdrDerived, where
3052 optimization will change the
3053 first-instruction-in-the-destructor's file and line number.
3054 * testsuite/odr_header2.h: Defines OdrBase.
3055
a19fefdc
ILT
30562011-03-09 Ian Lance Taylor <iant@google.com>
3057
3058 * fileread.cc (File_read::clear_views): Don't delete the whole
3059 file view.
3060
ecb351e9
ILT
30612011-03-08 Ian Lance Taylor <iant@google.com>
3062
3063 PR gold/12525
3064 * fileread.cc: #include <climits>.
3065 (GOLD_IOV_MAX): Define.
3066 (File_read::read_multiple): Limit number of entries by iov_max.
3067 * fileread.h (class File_read): Always set max_readv_entries to
3068 128.
3069
b821d13c
ILT
30702011-03-07 Ian Lance Taylor <iant@google.com>
3071
3072 PR gold/12525
3073 * options.h (class General_options): Add -dy and -dn.
3074
89243142
CC
30752011-03-02 Cary Coutant <ccoutant@google.com>
3076
3077 * testsuite/script_test_9.t: Add TLS segment.
3078
d0773f31
ILT
30792011-03-02 Simon Baldwin <simonb@google.com>
3080
3081 * configure.ac: Add check for gnu_indirect_function support in
3082 the toolchain building binutils.
3083 * configure: Rebuild.
3084
9370ce59 30852011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3086
3087 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3088 plugin only symbols.
3089 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3090 in plugin files as not needed in the symbol table.
3091
4cf7a849
ST
30922011-02-11 Sriraman Tallam <tmsriram@google.com>
3093
3094 * output.cc (Output_section::add_input_section): Delay fill
3095 generation for section ordering.
3096
b578bd7d
ILT
30972011-02-09 Ian Lance Taylor <iant@google.com>
3098
3099 PR gold/12316
3100 * object.h (class Sized_relobj): Remove clear_local_symbols.
3101 * reloc.cc (Sized_relobj::do_relocate): Don't call
3102 clear_local_symbols.
3103
9370ce59 31042011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3105
3106 * plugin.cc (is_visible_from_outside): Return true for symbols
3107 in the -u option.
3108
55382fb7
ILT
31092011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3110
3111 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3112 filename.
3113
4e271fff
ST
31142011-02-02 Sriraman Tallam <tmsriram@google.com>
3115
3116 * icf.h (is_section_foldable_candidate): Change type of parameter
3117 to std::string.
3118 * icf.cc (Icf::find_identical_sections): Change type of local variable
3119 section_name to be std::string.
3120 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3121
d433c3ac
ILT
31222011-01-25 Ian Lance Taylor <iant@google.com>
3123
3124 * script.cc (script_add_extern): Rewrite to use
3125 add_symbol_reference.
3126
880473a6
DK
31272011-01-25 Doug Kwan <dougkwan@google.com>
3128
d433c3ac 3129 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3130
f30f86fa
ILT
31312011-01-24 Ian Lance Taylor <iant@google.com>
3132
3133 * options.h (class General_options): Accept
3134 --no-detect-odr-violations.
3135
8e51a0b9
ILT
31362011-01-24 Ian Lance Taylor <iant@google.com>
3137
3138 * version.cc (version_string): Bump to 1.11.
3139
0f3b89d8
ILT
31402011-01-24 Ian Lance Taylor <iant@google.com>
3141
3142 * plugin.cc (class Plugin_rescan): Define new class.
3143 (Plugin_manager::claim_file): Set any_claimed_.
3144 (Plugin_manager::save_archive): New function.
3145 (Plugin_manager::save_input_group): New function.
3146 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3147 necessary.
3148 (Plugin_manager::new_undefined_symbol): New function.
3149 (Plugin_manager::rescan): New function.
3150 (Plugin_manager::rescannable_defines): New function.
3151 (Plugin_manager::add_input_file): Set any_added_.
3152 * plugin.h (class Plugin_manager): define new fields rescannable_,
3153 undefined_symbols_, any_claimed_, and any_added_. Declare
3154 Plugin_rescan as friend. Declare new functions.
3155 (Plugin_manager::Rescannable): Define type.
3156 (Plugin_manager::Rescannable_list): Define type.
3157 (Plugin_manager::Undefined_symbol_list): Define type.
3158 (Plugin_manager::Plugin_manager): Initialize new fields.
3159 * archive.cc (Archive::defines_symbol): New function.
3160 (Add_archive_symbols::run): Pass archive to plugins if any.
3161 * archive.h (class Archive): Declare defines_symbol.
3162 * readsyms.cc (Input_group::~Input_group): New function.
3163 (Finish_group::run): Pass input_group to plugins if any.
3164 * readsyms.h (class Input_group): Declare destructor.
3165 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3166 any.
3167
3bb951e5
ILT
31682011-01-10 Ian Lance Taylor <iant@google.com>
3169
3170 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3171 section as relro.
3172 (Layout::set_segment_offsets): Reset increase_relro before calling
3173 set_section_addresses a second time.
3174
0aa45fac
CC
31752011-01-04 Cary Coutant <ccoutant@google.com>
3176
3177 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3178 sections before NOBITS sections.
3179
0db46eb4
L
31802011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3181
3182 * version.cc (print_version): Update copyright to 2011.
3183
829c9745
CC
31842010-12-23 Cary Coutant <ccoutant@google.com>
3185
3186 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3187 of OS to this->add. Add OD parameter to second form of the function.
3188
7500420b
ILT
31892010-12-20 Ian Lance Taylor <iant@google.com>
3190
3191 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3192 second of two consecutive entries with same offset.
3193
f8e9a930
RW
31942010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3195
3196 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3197 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3198 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3199 to avoid unneeded links against $(LDADD).
3200 * testsuite/Makefile.in: Regenerate.
3201
2fbb4320
ILT
32022010-12-15 Ian Lance Taylor <iant@google.com>
3203
3204 PR gold/12324
3205 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3206 for R_X86_64_32 and R_X86_64_PC32.
3207 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3208 ver_matching_def_pic.o.
3209 (ver_matching_def_pic.o): New target.
3210
fedb228d
RW
32112010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3212
3213 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3214 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3215 Move definition before File_read::View member definitions.
3216 (File_read::View::~View): Initialize and hold lock before
3217 updating current_mapped_bytes.
3218
9b547ce6
RW
32192010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3220
3221 * dwarf_reader.cc: Remove outdated comment.
3222 * gold-threads.cc: Fix typo in error message.
3223 * archive.cc: Fix typos in comments.
3224 * archive.h: Likewise.
3225 * arm-reloc-property.cc: Likewise.
3226 * arm-reloc-property.h: Likewise.
3227 * arm-reloc.def: Likewise.
3228 * arm.cc: Likewise.
3229 * attributes.h: Likewise.
3230 * cref.cc: Likewise.
3231 * ehframe.cc: Likewise.
3232 * fileread.h: Likewise.
3233 * gold.h: Likewise.
3234 * i386.cc: Likewise.
3235 * icf.cc: Likewise.
3236 * incremental.h: Likewise.
3237 * int_encoding.cc: Likewise.
3238 * layout.h: Likewise.
3239 * main.cc: Likewise.
3240 * merge.h: Likewise.
3241 * object.cc: Likewise.
3242 * object.h: Likewise.
3243 * options.cc: Likewise.
3244 * readsyms.cc: Likewise.
3245 * reduced_debug_output.cc: Likewise.
3246 * reloc.cc: Likewise.
3247 * script-sections.cc: Likewise.
3248 * sparc.cc: Likewise.
3249 * symtab.h: Likewise.
3250 * target-reloc.h: Likewise.
3251 * target.cc: Likewise.
3252 * target.h: Likewise.
3253 * timer.cc: Likewise.
3254 * timer.h: Likewise.
3255 * x86_64.cc: Likewise.
3256
83e17bd5
CC
32572010-12-09 Cary Coutant <ccoutant@google.com>
3258
3259 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3260 stack.
3261 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3262 parameter; change all callers.
3263 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3264 * options.h (warn_execstack): New option.
3265
017257f8
DK
32662010-12-07 Doug Kwan <dougkwan@google.com>
3267
3268 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3269 like function call relocations.
3270
c20cbc06
ILT
32712010-12-07 Ian Lance Taylor <iant@google.com>
3272
3273 * archive.cc (Archive::get_elf_object_for_member): Permit
3274 punconfigured to be NULL.
3275 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3276 (Archive::include_member): Pass NULL to get_elf_object_for_member
3277 if we searched for the archive and this is the first included
3278 object.
3279
4dbfafcc
ILT
32802010-12-01 Ian Lance Taylor <iant@google.com>
3281
3282 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3283 track_relocs_type_ field.
3284 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3285 Set track_relocs_type_.
3286 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3287 contents when using RELA relocs.
3288 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3289 reloc_map_.
3290 * reloc.cc (Track_relocs::next_addend): New function.
3291 * reloc.h (class Track_relocs): Declare next_addend.
3292
e5e19edd
ILT
32932010-12-01 Ian Lance Taylor <iant@google.com>
3294
3295 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3296 virtual destructor.
3297
9a5ce24c
ILT
32982010-12-01 Ian Lance Taylor <iant@google.com>
3299
3300 * README: Update compilers known to work and fail.
3301
c7791212
NC
33022010-11-23 Matthias Klose <doko@ubuntu.com>
3303
3304 * configure.in: For --enable-gold, handle value `default' instead of
3305 `both*'. Always install ld as ld.bfd, install as ld if gold is
3306 not the default.
3307 * configure: Regenerate.
3308
0ad220c9
DK
33092010-11-18 Doug Kwan <dougkwan@google.com>
3310
3311 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3312 and right_alignment to be zero. Store result alignment only if it is
3313 greater than existing alignment.
3314
ab8056e0
CC
33152010-11-16 Cary Coutant <ccoutant@google.com>
3316
3317 PR gold/12220
3318 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3319 Check for ".zdebug_line".
3320
fd064a5b
CC
33212010-11-16 Doug Kwan <dougkwan@google.com>
3322 Cary Coutant <ccoutant@google.com>
3323
3324 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3325 by reference; adjust all callers.
3326 * output.cc (Output_segment::set_section_addresses): Adjust references
3327 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3328 list is empty.
3329 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3330 end at page boundary.
3331
6fc6ea19
CC
33322010-11-16 Cary Coutant <ccoutant@google.com>
3333
3334 PR gold/12220
3335 * layout.cc (Layout::choose_output_section): Transform names of
3336 compressed sections even when using a script with a SECTIONS clause.
3337 (Layout::output_section_name): Remove code to transform
3338 compressed debug section names.
3339 * output.cc (Output_section::add_input_section): Use uncompressed
3340 section size when tracking input sections.
3341
95a2c8d6
RS
33422010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3343
3344 * symtab.h (Symbol::NON_PIC_REF): Remove.
3345 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3346 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3347 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3348 (Symbol::use_plt_offset): Take a flags argument and pass it
3349 directly to needs_dynamic_reloc. Restrict check for undefined
3350 weak symbols to function calls.
3351 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3352 (Target_arm::Scan::global): Use it.
3353 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3354 (Target_arm::Relocate::relocate): Likewise.
3355 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3356 parameter with an r_type parameter. Use get_reference_flags
3357 to get the flags.
3358 (Target_arm::Relocate::relocate): Update accordingly.
3359 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3360 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3361 (Target_i386::Scan::global): Likewise.
3362 (Target_i386::Relocate::relocate): Likewise.
3363 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3364 parameter with an r_type parameter. Use get_reference_flags
3365 to get the flags.
3366 (Target_i386::Relocate::relocate): Update accordingly.
3367 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3368 (Target_powerpc::Scan::global): Use it.
3369 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3370 (Target_powerpc::Relocate::relocate): Likewise.
3371 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3372 (Target_sparc::Scan::global): Use it.
3373 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3374 (Target_sparc::Relocate::relocate): Likewise.
3375 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3376 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3377 (Target_x86_64::Scan::global): Likewise.
3378 (Target_x86_64::Relocate::relocate): Likewise.
3379
f625ae50
DK
33802010-11-08 Doug Kwan <dougkwan@google.com>
3381 Cary Coutant <ccoutant@google.com>
3382
3383 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3384 (Arm_exidx_merge_section::section_contents_): New data member.
3385 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3386 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3387 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3388 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3389 in parameters instead of calling Object::section_contents without
3390 locking.
3391 (Arm_output_section::group_section): New parameter TASK. Pass it
3392 to callees that need locking objects.
3393 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3394 to lock EXIDX input sections. Fix a formatting issue. Call
3395 Arm_exidx_merged_section::build_contents to create merged section
3396 contents.
3397 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3398 to lock object of stub table owner.
3399 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3400 TEXT_SIZE to initialize data member TEXT_SIZE_.
3401 (Arm_exidx_input_section::addralign): Fix typo in comment.
3402 (Arm_exidx_input_section::text_size): New method.
3403 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3404 that require locking objects. Lock objects before scanning for stubs
3405 and updating local symbols.
3406 (Arm_input_section<big_endian>::init): Copy contents of original
3407 input section.
3408 (Arm_input_section<big_endian>::do_write): Use saved contents of
3409 original input section instead of calling Object::section_contents
3410 without locking.
3411 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3412 size without calling Object::section_size().
3413 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3414 for size. Allocate a buffer for merged EXIDX entries.
3415 (Arm_exidx_merged_section::build_contents): New method.
3416 (Arm_exidx_merged_section::do_write): Move merge section contents
3417 building code to Arm_exidx_merged_section::build_contetns. Write
3418 out contetns in buffer instead of building it on the fly.
3419 (Arm_relobj::make_exidx_input_section): Also pass text section size
3420 to Arm_exidx_input_section constructor.
3421 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3422 (Arm_dynobj::do_read_symbols): Fix memory leak.
3423 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3424 * target.h: (class Task): Add forward declaration.
3425 (Target::relax): Add new parameter TASK and pass it to
3426 Target::do_relax().
3427 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3428
5f9bcf58
CC
34292010-11-05 Cary Coutant <ccoutant@google.com>
3430
3431 PR gold/10708
3432 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3433 object when reading from the file.
3434 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3435 second layout pass.
3436 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3437 when reading section contents.
3438 (get_section_contents): Likewise.
3439 (icf::find_identical_sections): Likewise.
3440 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3441 object when reading from the file.
3442 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3443 the object when doing deferred section layout.
3444
e597fa08
NC
34452010-11-03 Nick Clifton <nickc@redhat.com>
3446
3447 PR gold/12001
3448 * script.h (class Symbol_assignment: name): New member. Returns
3449 the name of the symbol.
3450 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3451 Returns true if the given symbol name is on the list of
3452 assignments wating to be processed.
3453 * archive.cc (should_incldue_member): If the symbol is undefined,
3454 check to see if it is on the list of symbols pending assignment.
3455
3f9a3278
ILT
34562010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3457
3458 * script-sections.cc (Script_sections::find_memory_region): Check
3459 for a NULL output section pointer.
3460
d06fb4d1
DK
34612010-10-29 Doug Kwan <dougkwan@google.com>
3462
3463 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3464 Output_section::add_relaxed_input_section.
3465 * output.cc (Output_section::add_relaxed_input_section): Add new
3466 arguments LAYOUT and NAME. Set section order index.
3467 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3468 Copy section order index.
3469 * output.h (Output_section::add_relaxed_input_section): Add new
3470 arguments LAYOUT and NAME.
3471
90e24de5
ILT
34722010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3473
3474 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3475 NATIVE_OR_CROSS_LINKER.
3476 * testsuite/Makefile.in: Regenerate.
3477
c9484ea5
DK
34782010-10-20 Doug Kwan <dougkwan@google.com>
3479
3480 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3481 without SHF_LINK_ORDER flags.
3482 * layout.cc (Layout::choose_output_section): Do not filter
3483 SHF_LINK_ORDER flag in a relocatable link.
3484
5bc2f5be
CC
34852010-10-17 Cary Coutant <ccoutant@google.com>
3486
3487 * output.h (Output_segment::set_section_addresses): Change function
3488 signature. Update all callers.
3489 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3490 sections.
3491 (Output_segment::set_section_addresses): Align after last TLS
3492 section. Add padding before last relro section instead of after.
3493
0c91cf04
DK
34942010-10-17 Doug Kwan <dougkwan@google.com>
3495
3496 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3497 GOT output section to be writable.
3498
8c21d9d3
CC
34992010-10-14 Cary Coutant <ccoutant@google.com>
3500
3501 * debug.h (DEBUG_INCREMENTAL): New flag.
3502 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3503 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3504 mode.
3505 * incremental.cc (report_command_line): Ignore all forms of
3506 --incremental.
3507 * layout.cc (Layout::Layout): Check parameters for incremental link
3508 mode.
3509 * options.cc (General_options::parse_incremental): New function.
3510 (General_options::parse_no_incremental): New function.
3511 (General_options::parse_incremental_full): New function.
3512 (General_options::parse_incremental_update): New function.
3513 (General_options::incremental_mode_): New data member.
3514 (General_options::finalize): Check incremental_mode_.
3515 * options.h (General_options): Update help text for --incremental.
3516 Add --no-incremental, --incremental-full, --incremental-update.
3517 (General_options::Incremental_mode): New enum type.
3518 (General_options::incremental_mode): New function.
3519 (General_options::incremental_mode_): New data member.
3520 * parameters.cc (Parameters::incremental_mode_): New data member.
3521 (Parameters::set_options): Set incremental_mode_.
3522 (Parameters::set_incremental_full): New function.
3523 (Parameters::incremental): New function.
3524 (Parameters::incremental_update): New function.
3525 (set_parameters_incremental_full): New function.
3526 * parameters.h (Parameters::set_incremental_full): New function.
3527 (Parameters::incremental): New function.
3528 (Parameters::incremental_update): New function.
3529 (Parameters::incremental_mode_): New data member.
3530 (set_parameters_incremental_full): New function.
3531 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3532 incremental link mode.
3533 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3534 (Sized_relobj::do_relocate_sections): Likewise.
3535 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3536 option.
3537 * testsuite/Makefile.in: Regenerate.
3538 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3539
bb32aa18 35402010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3541
3542 * script-sections.h (class Script_sections): Make
3543 Sections_elements typedef public.
3544 * script-sections.cc (class Sort_output_sections): Add elements_
3545 field. Add constructor which sets it; change all callers.
3546 (Sort_output_sections::is_before): New function.
3547 (Sort_output_sections::operator()): Call is_before.
3548 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3549 conditional.
3550 * testsuite/script_test_10.sh: New test. Test script section
3551 order.
3552 * testsuite/script_test_10.t: Likewise.
3553 * testsuite/script_test_10.s: Likewise.
3554 * testsuite/Makefile.am: Wrap the cross linker tests and the
3555 common tests into NATIVE_OR_CROSS_LINKER.
3556 (check_SCRIPTS): Add script_test_10.sh.
3557 (check_DATA): Add script_test_10.stdout.
3558 (script_test_10.o, script_test_10): New targets.
3559 (script_test_10.stdout): New target.
3560 * configure, testsuite/Makefile.in: Regenerate.
3561
3cef7179
ILT
35622010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3563
3564 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3565 error for the deprecated relocations.
3566 (Target_arm::Scan::global): Likewise.
3567 (Target_arm::Relocate::relocate): Likewise.
3568
7411e9a8
RS
35692010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3570
3571 * fileread.cc (Input_file::find_file): Initialize *found_name
3572 and *namep when using the fallback search for case 4.
3573
6a9da32a
CC
35742010-10-11 Cary Coutant <ccoutant@google.com>
3575
3576 * options.h (class General_options): Redefine -z lazy as an alias for
3577 the negation of -z now.
3578
ac897c20
ILT
35792010-10-11 Ian Lance Taylor <iant@google.com>
3580
3581 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3582 binding.
3583
ea5cae92
NC
35842010-10-06 Nick Clifton <nickc@redhat.com>
3585
3586 * script-sections.cc(class Memory_region): Remove
3587 current_lma_offset_ field. Rename current_vma_offset_ to
3588 current_offset_. Add last_section_ field.
3589 (Memory_region::get_current_vma_address): Rename to
3590 get_current_address.
3591 (Memory_region::get_current_lma_address): Delete.
3592 (Memory_region::increment_vma_offset): Rename to
3593 increment_offset.
3594 (Memory_region::increment_lma_offset): Delete.
3595 (Memory_region::attributes_compatible): New method. Returns
3596 true if the provided section is compatible with the region.
3597 (Memory_region::get_last_section): New method. Returns the last
3598 section to use the region.
3599 (Memory_region::set_last_section): New method. Stores the last
3600 section to use the region.
3601 (Script_sections::block_in_region): New method. Returns true if
3602 a block of memory is contained within a region.
3603 (Script_sections::find_memory_region): New method. Locates a
3604 memory region to be used to set a VMA or LMA address.
3605 (Output_section_definition::set_section_addresses): Add code to
3606 check for addresses set by memory regions.
3607 (Output_segment::set_section_addresses): Remove memory region
3608 walking code.
3609 (Script_sections::create_segment): Add a warning if a header
3610 segment is created outside of any region.
3611 * script-sections.h (class Script_sections): Add prototypes for
3612 find_memory_region and block_in_region methods.
3613 * testsuite/memory_test.s: Use .long instead of .word.
3614 * testsuite/memory_test.t: Add some more output sections.
3615 * testsuite/memory_test.sh: Update expected output.
3616
a9bfd952
DK
36172010-10-02 Doug Kwan <dougkwan@google.com>
3618
3619 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3620 defintion to symtab.h
3621 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3622 declaration to defintion.
3623
bacff3ab
NC
36242010-10-01 Nick Clifton <nickc@redhat.com>
3625
3626 * expression.cc (eval): Replace dummy argument with NULL.
3627 (eval_maybe_dot): Check for a NULL result section pointer.
3628 (Symbol_expression::value): Likewise.
3629 (Dot_expression::value): Likewise.
3630 (BINARY_EXPRESSION): Likewise.
3631 (Max_expression::value): Likewise.
3632 (Min_expression::value): Likewise.
3633 (Absolute_expression::value): Likewise.
3634 (Addr_expression::value_from_output_section): Likewise.
3635 (Loaddddr_expression::value_from_output_section): Likewise.
3636 (Segment_start_expression::value): Likewise.
3637 * script-sections.cc
3638 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3639 argument with NULL.
3640 (Sections_elememt_dot_assignment::set_section_addresses):
3641 Likewise.
3642 (Output_data_expression::do_write_to_buffer): Likewise.
3643 (Output_section_definition::finalize_symbols): Likewise.
3644 (Output_section_definition::set_section_addresses): Likewise.
3645
f81bc8b5
DK
36462010-09-30 Doug Kwan <dougkwan@google.com>
3647
3648 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3649
c95e9f27
ST
36502010-09-28 Sriraman Tallam <tmsriram@google.com>
3651
3652 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 3653 function.
c95e9f27
ST
3654 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3655 virtual function.
3656 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3657 virtual function.
3658 * icf.cc (get_section_contents): Inline merge sections only when
3659 target allows it.
3660
3cac54d2
RW
36612010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3662
3663 * configure: Regenerate.
3664
2904037a
ILT
36652010-09-17 Ian Lance Taylor <iant@google.com>
3666
3667 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
3668 * testsuite/Makefile.am (memory_test.o): New target.
3669 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3670 memory_test.t.
3671 * testsuite/Makefile.in: Rebuild.
2904037a 3672
bca7fb63
DK
36732010-09-17 Doug Kwan <dougkwan@google.com>
3674
3675 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3676 defintion if relocation uses GOT entries of the symbol.
3677 * testsuite/icf_safe_test.sh: Fix test.
3678 * testsuite/icf_safe_so_test.sh: Fix test.
3679
4ef28648
CC
36802010-09-16 Cary Coutant <ccoutant@google.com>
3681
3682 * script_sections.cc (class Memory_region): Remove "NULL" from
3683 vector initializations.
3684
793990de
CC
36852010-09-15 Cary Coutant <ccoutant@google.com>
3686
3687 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3688 Resolve forwarding symbols.
3689
81e015e2
DK
36902010-09-15 Doug Kwan <dougkwan@google.com>
3691
3692 * gold/testsuite/script_test_3.t: Add ARM special sections.
3693 * gold/testsuite/script_test_4.t: Same.
3694 * gold/testsuite/script_test_5.t: Same.
3695 * gold/testsuite/script_test_6.t: Same.
3696 * gold/testsuite/script_test_7.t: Same.
3697 * gold/testsuite/script_test_7.t: Same.
3698 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3699
36171d64
CC
37002010-09-14 Cary Coutant <ccoutant@google.com>
3701
3702 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3703 (Target_x86_64::Relocate::relocate_tls): Replace check for
3704 saw_tls_block_reloc_ with test for executable section.
3705
d89051bd
CC
37062010-09-12 Cary Coutant <ccoutant@google.com>
3707
3708 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3709 position-independent executables to shared libraries need dynamic
3710 relocations.
3711 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3712 position-independent executables.
3713 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3714 * testsuite/Makefile.in: Regenerate.
3715
fca41f0f
NC
37162010-09-10 Nick Clifton <nickc@redhat.com>
3717
3718 PR gold/11997
3719 * testsuite/memory_test.t: Discard any sections that are not
3720 needed.
3721
6695e4b3
L
37222010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3723
3724 PR gold/11996
3725 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3726 "This::" to work around a bug in gcc 4.2.
3727
3728 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3729
0f72bf6f
RÁE
37302010-09-09 Rafael Espindola <espindola@google.com>
3731
3732 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3733 sections with different PF_X flags in the same segment.
3734 (Layout::find_first_load_seg): Search all segments to find the first
3735 one.
3736 * options.h (rosegment): New.
3737
37382010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3739
05a79166 3740 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3741
aa98ff75
DK
37422010-09-08 Doug Kwan <dougkwan@google.com>
3743
3744 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3745 (Arm_relobj::do_relocate_sections): Add new parameter for output
3746 file to match the parent.
3747 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3748 of local symbols instead of input values. Update code to track
3749 changes in gold::relocate_section.
3750 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3751 (Sized_relobj::compute_final_local_value_internal): New methods.
3752 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3753 body into private version of Sized_relobj::compute_final_local_value.
3754 Call the inline method.
3755 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3756 merged symbol value if there is one.
3757 (Symbol_value::has_output_value): New method defintiion.
3758 (Sized_relobj::Compute_final_local_value_status): New enum type.
3759 (Sized_relobj::compute_final_local_value): New methods.
3760 (Sized_relobj::compute_final_local_value_internal): New methods.
3761 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3762 and arm_cortex_a8.sh.
3763 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3764 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3765 New tests.
3766 * Makefile.in: Regenerate.
3767 * testsuite/arm_bl_out_of_range.s: Update test.
3768 * testsuite/thumb_bl_out_of_range.s: Ditto.
3769 * testsuite/thumb_blx_out_of_range.s: Ditto.
3770 * testsuite/arm_branch_out_of_range.sh: New file.
3771 * testsuite/arm_cortex_a8.sh: Ditto.
3772 * testsuite/arm_cortex_a8_b.s: Ditto.
3773 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3774 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3775 * testsuite/arm_cortex_a8_bl.s: Ditto.
3776 * testsuite/arm_cortex_a8_blx.s: Ditto.
3777 * testsuite/arm_cortex_a8_local.s: Ditto.
3778 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3779 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3780
05a79166
L
37812010-09-08 Rafael Espindola <espindola@google.com>
3782
3783 * Makefile.am (memory_test.stdout): Run readelf with -W.
3784 * Makefile.in: Regenerate.
3785 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3786 64 bit output.
3787
33dbc701
RÁE
37882010-09-08 Rafael Espindola <espindola@google.com>
3789
3790 * script-sections.cc (Script_sections::add_memory_region): Convert
3791 field precision to int.
3792 * script.cc (script_set_section_region, script_set_section_region):
3793 Convert field precision to int.
3794
731ca54a
RÁE
37952010-09-08 Rafael Espindola <espindola@google.com>
3796
3797 * arm.cc (do_finalize_sections): Create the __exidx_start and
3798 __exdix_end symbols even when the section is missing.
3799
7f8cd844
NC
38002010-09-08 Nick Clifton <nickc@redhat.com>
3801
3802 * README: Remove claim that MEMORY is not supported.
3803 * expression.cc (script_exp_function_origin)
3804 (script_exp_function_length): Move from here to ...
3805 * script.cc: ... here.
3806 (script_set_section_region, script_add_memory)
3807 (script_parse_memory_attr, script_include_directive): New
3808 functions.
3809 * script-sections.cc
3810 (class Memory_region): New class.
3811 (class Output_section_definition): Add set_memory_region,
3812 set_section_vma, set_section_lma and get_section_name methods.
3813 (class Script_Sections): Add add_memory_region,
3814 find_memory_region, find_memory_region_origin,
3815 find_memory_region_length and set_memory_region methods.
3816 Have set_section_addresses method walk the list of set memory
3817 regions.
3818 Extend the print methos to display memory regions.
3819 * script-sections.h: Add prototypes for new methods.
3820 Add enum for MEMORY region attributes.
3821 * yyscript.y: Add support for parsing MEMORY regions.
3822 * script-c.h: Add prototypes for new functions.
3823 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3824 * testsuite/Makefile.in: Regenerate.
3825 * testsuite/memory_test.sh: New script.
3826 * testsuite/memory_test.s: New assembler source file.
3827 * testsuite/memory_test.t: New linker script.
3828
a4649286
DK
38292010-08-27 Doug Kwan <dougkwan@google.com>
3830
3831 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3832 reference override an existing dynamic weak reference.
3833 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3834 * testsuite/Makefile.in: Regenerate.
3835 * testsuite/dyn_weak_ref.sh: New file.
3836 * testsuite/dyn_weak_ref_1.c: Ditto.
3837 * testsuite/dyn_weak_ref_2.c: Ditto.
3838
b56648ad
ILT
38392010-08-27 Ian Lance Taylor <iant@google.com>
3840
3841 * incremental.h (class Incremental_input_entry): Add virtual
3842 destructor.
3843
809313cb
ILT
38442010-08-27 Ian Lance Taylor <iant@google.com>
3845
3846 * testsuite/start_lib_test_3.c: Mark t3 as used.
3847
11e32464
NC
38482010-08-27 Nick Clifton <nickc@redhat.com>
3849
3850 * options.cc (version_script): Fix small typo in previous
3851 whitespace tidyup.
3852
ca09d69a
NC
38532010-08-25 Nick Clifton <nickc@redhat.com>
3854
3855 * archive.cc: Formatting fixes: Remove whitespace between
3856 typename and following asterisk. Remove whitespace between
3857 function name and opening parenthesis.
3858 * archive.h: Likewise.
3859 * arm.cc: Likewise.
3860 * attributes.cc: Likewise.
3861 * attributes.h: Likewise.
3862 * common.cc: Likewise.
3863 * copy-relocs.cc: Likewise.
3864 * dirsearch.h: Likewise.
3865 * dynobj.cc: Likewise.
3866 * ehframe.cc: Likewise.
3867 * ehframe.h: Likewise.
3868 * expression.cc: Likewise.
3869 * fileread.cc: Likewise.
3870 * fileread.h: Likewise.
3871 * gc.h: Likewise.
3872 * gold-threads.cc: Likewise.
3873 * gold.cc: Likewise.
3874 * i386.cc: Likewise.
3875 * icf.h: Likewise.
3876 * incremental-dump.cc: Likewise.
3877 * incremental.cc: Likewise.
3878 * layout.cc: Likewise.
3879 * layout.h: Likewise.
3880 * main.cc: Likewise.
3881 * merge.cc: Likewise.
3882 * merge.h: Likewise.
3883 * object.cc: Likewise.
3884 * object.h: Likewise.
3885 * options.cc: Likewise.
3886 * options.h: Likewise.
3887 * output.cc: Likewise.
3888 * output.h: Likewise.
3889 * plugin.cc: Likewise.
3890 * plugin.h: Likewise.
3891 * powerpc.cc: Likewise.
3892 * reloc.cc: Likewise.
3893 * script-c.h: Likewise.
3894 * script-sections.cc: Likewise.
3895 * script.cc: Likewise.
3896 * stringpool.cc: Likewise.
3897 * symtab.cc: Likewise.
3898 * symtab.h: Likewise.
3899 * target.cc: Likewise.
3900 * timer.cc: Likewise.
3901 * timer.h: Likewise.
3902 * version.cc: Likewise.
3903 * x86_64.cc: Likewise.
3904
b8fa8750
NC
39052010-08-24 Nick Clifton <nickc@redhat.com>
3906
3907 PR 11899
3908 * layout.cc (segment_precedes): Sort segments by their physical
3909 addresses, if they have been set.
3910
9919d93b
CC
39112010-08-23 Cary Coutant <ccoutant@google.com>
3912
3913 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3914 symbols data.
3915 (Lib_group::include_member): Unlock object after deleting its
3916 symbols data.
3917 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3918 the bug fixed here.
3919
97b4be1c
CC
39202010-08-19 Neil Vachharajani <nvachhar@google.com>
3921 Cary Coutant <ccoutant@google.com>
3922
3923 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3924 constructor, and set_blocker.
3925 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3926 readsyms_blocker_.
3927 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3928 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3929 * testsuite/Makefile.am (start_lib_test): New test case.
3930 * testsuite/Makefile.in: Regenerate.
3931 * testsuite/start_lib_test_main.c: New file.
3932 * testsuite/start_lib_test_1.c: New file.
3933 * testsuite/start_lib_test_2.c: New file.
3934 * testsuite/start_lib_test_3.c: New file.
3935
dd0b1884
ILT
39362010-08-19 Ian Lance Taylor <iant@google.com>
3937
3938 * Makefile.in: Rebuild with automake 1.11.1.
3939 * aclocal.m4: Likewise.
3940 * testsuite/Makefile.in: Likewise.
3941
7223e9ca
ILT
39422010-08-19 Ian Lance Taylor <iant@google.com>
3943
3944 PR 10893
3945 * i386.cc (class Output_data_plt_i386): Update declarations.
3946 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3947 local_ifuncs_ fields.
3948 (Target_i386::do_plt_section_for_global): New function.
3949 (Target_i386::do_plt_section_for_local): New function.
3950 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3951 parameter; change all callers. Initialize global_ifuncs_ and
3952 local_ifuncs_. If doing a static link define __rel_iplt_start and
3953 __rel_iplt_end.
3954 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3955 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3956 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3957 symbols.
3958 (Target_i386::make_plt_section): New function, broken out of
3959 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3960 (Target_i386::make_plt_entry): Call make_plt_section.
3961 (Target_i386::make_local_ifunc_plt_entry): New function.
3962 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3963 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3964 R_386_IRELATIVE to switch.
3965 (Target_i386::Scan::global): Likewise.
3966 (Target_i386::Relocate::relocate): Likewise.
3967 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3968 switch.
3969 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3970 (Target_x86_64::do_plt_section_for_global): New function.
3971 (Target_x86_64::do_plt_section_for_local): New function.
3972 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3973 parameter; change all callers. If doing a static link define
3974 __rela_iplt_start and __rela_iplt_end.
3975 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3976 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3977 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3978 to point to .plt.
3979 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3980 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3981 switch.
3982 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3983 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3984 R_X86_64_IRELATIVE to switch.
3985 (Target_x86_64::Scan::global): Likewise.
3986 (Target_x86_64::Relocate::relocate): Likewise.
3987 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3988 switch.
3989 * target.h (class Target): Add plt_section_for_global and
3990 plt_section_for_local functions. Add do_plt_section_for_global
3991 and do_plt_section_for_local virtual functions.
3992 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3993 clarifying comments.
3994 (Symbol::use_plt_offset): Handle IFUNC symbol.
3995 * object.cc (Sized_relobj::Sized_relobj): Initialize
3996 local_plt_offsets_.
3997 (Sized_relobj::local_has_plt_offset): New function.
3998 (Sized_relobj::local_plt_offset): New function.
3999 (Sized_relobj::set_local_plt_offset): New function.
4000 (Sized_relobj::do_count): Handle IFUNC symbol.
4001 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4002 a bit away from input_shndx_ field. Add set_is_func_symbol and
4003 is_ifunc_symbol functions.
4004 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4005 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4006 local_plt_offsets_ field.
4007 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4008 * output.h (class Output_section_data): Add non-const
4009 output_section function.
4010 (class Output_data_got): Update declarations.
4011 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4012 Add use_plt_offset parameter to global and local constructors.
4013 Change all callers. Change local_sym_index_ field to 31 bits.
4014 Change GSYM_CODE and CONSTANT_CODE accordingly.
4015 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4016 doing a static link don't set sh_link field.
4017 (Output_data_got::Got_entry::write): Use PLT offset if
4018 appropriate.
4019 (Output_data_got::add_global_plt): New function.
4020 (Output_data_got::add_local_plt): New function.
4021 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4022 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4023 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4024 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4025 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4026 IFUNC conditional.
4027 * testsuite/ifunc-sel.h: New file.
4028 * testsuite/ifuncmain1.c: New file.
4029 * testsuite/ifuncmain1vis.c: New file.
4030 * testsuite/ifuncmod1.c: New file.
4031 * testsuite/ifuncdep2.c: New file.
4032 * testsuite/ifuncmain2.c: New file.
4033 * testsuite/ifuncmain3.c: New file.
4034 * testsuite/ifuncmod3.c: New file.
4035 * testsuite/ifuncmain4.c: New file.
4036 * testsuite/ifuncmain5.c: New file.
4037 * testsuite/ifuncmod5.c: New file.
4038 * testsuite/ifuncmain6pie.c: New file.
4039 * testsuite/ifuncmod6.c: New file.
4040 * testsuite/ifuncmain7.c: New file.
4041 * configure, testsuite/Makefile.in: Rebuild.
4042
56f75c03
ILT
40432010-08-18 Ian Lance Taylor <iant@google.com>
4044
4045 * incremental.cc
4046 (Output_section_incremental_inputs::write_input_files): Add cast
4047 to avoid signed/unsigned comparison warning.
4048 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4049
55455f89
CC
40502010-08-12 Cary Coutant <ccoutant@google.com>
4051
4052 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4053
e2054bcb
ILT
40542010-08-13 Ian Lance Taylor <iant@google.com>
4055
4056 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4057
74f67560
DK
40582010-08-12 Cary Coutant <ccoutant@google.com>
4059 Doug Kwan <dougkwan@google.com>
4060
4061 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4062 defintion overrides non-weak undef, remember that the original undef
4063 is not weak.
4064 * symtab.cc (Symbol_table::sized_write_global): For undef without
4065 an original weak binding, set binding to global in output.
4066 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4067 * testsuite/Makefile.in: Regenerate.
4068 * testsuite/strong_ref_weak_def.sh: New file.
4069 * testsuite/strong_ref_weak_def_1.c: Ditto.
4070 * testsuite/strong_ref_weak_def_2.c: Ditto.
4071
d1238d12
CC
40722010-08-12 Cary Coutant <ccoutant@google.com>
4073
4074 * testsuite/incremental_test.sh: Rewrite.
4075 * testsuite/incremental_test_1.c: Rewrite.
4076 * testsuite/incremental_test_2.c: Rewrite.
4077
0e70b911
CC
40782010-08-12 Cary Coutant <ccoutant@google.com>
4079
4080 * arm.cc (Target_arm::got_size): Add const.
4081 (Target_arm::got_entry_count): New function.
4082 (Target_arm::plt_entry_count): New function.
4083 (Target_arm::first_plt_entry_offset): New function.
4084 (Target_arm::plt_entry_size): New function.
4085 (Output_data_plt_arm::entry_count): New function.
4086 (Output_data_plt_arm::first_plt_entry_offset): New function.
4087 (Output_data_plt_arm::get_plt_entry_size): New function.
4088 * i386.cc (Target_i386::got_size): Add const.
4089 (Target_i386::got_entry_count): New function.
4090 (Target_i386::plt_entry_count): New function.
4091 (Target_i386::first_plt_entry_offset): New function.
4092 (Target_i386::plt_entry_size): New function.
4093 (Output_data_plt_i386::entry_count): New function.
4094 (Output_data_plt_i386::first_plt_entry_offset): New function.
4095 (Output_data_plt_i386::get_plt_entry_size): New function.
4096 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4097 find_incremental_inputs_sections. Dump incremental_got_plt section.
4098 * incremental.cc: Include target.h.
4099 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4100 parameter. Adjust all callers. Find incremental_got_plt section.
4101 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4102 section.
4103 (Output_section_incremental_inputs::set_final_data_size): Calculate
4104 size of incremental_got_plt section.
4105 (Output_section_incremental_inputs::do_write): Write the
4106 incremental_got_plt section.
4107 (Got_plt_view_info): New struct.
4108 (Local_got_offset_visitor): New class.
4109 (Global_got_offset_visitor): New class.
4110 (Global_symbol_visitor_got_plt): New class.
4111 (Output_section_incremental_inputs::write_got_plt): New function.
4112 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4113 Add parameter. Adjust all callers.
4114 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4115 (Incremental_inputs::got_plt_section): New function.
4116 (Incremental_inputs::got_plt_section_): New data member.
4117 (Incremental_got_plt_reader): New class.
4118 * layout.cc (Layout::create_incremental_info_sections): Add the
4119 incremental_got_plt section.
4120 * object.h (Got_offset_list::get_list): New function.
4121 (Got offset_list::for_all_got_offsets): New function.
4122 (Sized_relobj::local_got_offset_list): New function.
4123 * powerpc.cc (Target_powerpc::got_size): Add const.
4124 (Target_powerpc::got_entry_count): New function.
4125 (Target_powerpc::plt_entry_count): New function.
4126 (Target_powerpc::first_plt_entry_offset): New function.
4127 (Target_powerpc::plt_entry_size): New function.
4128 (Output_data_plt_powerpc::entry_count): New function.
4129 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4130 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4131 * sparc.cc (Target_sparc::got_size): Add const.
4132 (Target_sparc::got_entry_count): New function.
4133 (Target_sparc::plt_entry_count): New function.
4134 (Target_sparc::first_plt_entry_offset): New function.
4135 (Target_sparc::plt_entry_size): New function.
4136 (Output_data_plt_sparc::entry_count): New function.
4137 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4138 (Output_data_plt_sparc::get_plt_entry_size): New function.
4139 * symtab.h (Symbol::got_offset_list): New function.
4140 (Symbol_table::for_all_symbols): New function.
4141 * target.h (Sized_target::got_entry_count): New function.
4142 (Sized_target::plt_entry_count): New function.
4143 (Sized_target::plt_entry_size): New function.
4144 * x86_64.cc (Target_x86_64::got_size): Add const.
4145 (Target_x86_64::got_entry_count): New function.
4146 (Target_x86_64::plt_entry_count): New function.
4147 (Target_x86_64::first_plt_entry_offset): New function.
4148 (Target_x86_64::plt_entry_size): New function.
4149 (Output_data_plt_x86_64::entry_count): New function.
4150 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4151 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4152
09ec0418
CC
41532010-08-12 Cary Coutant <ccoutant@google.com>
4154
4155 * archive.cc: Include incremental.h.
4156 (Archive::Archive): Initialize incremental_info_.
4157 (Archive::include_member): Record archive members in incremental info.
4158 (Add_archive_symbols::run): Record begin and end of an archive in
4159 incremental info.
4160 (Lib_group::include_member): Record objects in incremental info.
4161 * archive.h (Incremental_archive_entry): Forward declaration.
4162 (Archive::set_incremental_info): New member function.
4163 (Archive::incremental_info): New member function.
4164 (Archive::Unused_symbol_iterator): New class.
4165 (Archive::unused_symbols_begin): New member function.
4166 (Archive::unused_symbols_end): New member function.
4167 (Archive::incremental_info_): New data member.
4168 * incremental-dump.cc (find_input_containing_global): New function.
4169 (dump_incremental_inputs): Dump new incremental info sections.
4170 * incremental.cc: Include symtab.h.
4171 (Output_section_incremental_inputs): New class.
4172 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4173 new incremental info sections.
4174 (Sized_incremental_binary::do_check_inputs): Likewise.
4175 (Incremental_inputs::report_archive): Remove.
4176 (Incremental_inputs::report_archive_begin): New function.
4177 (Incremental_inputs::report_archive_end): New function.
4178 (Incremental_inputs::report_object): New function.
4179 (Incremental_inputs::finalize_inputs): Remove.
4180 (Incremental_inputs::report_input_section): New function.
4181 (Incremental_inputs::report_script): Rewrite.
4182 (Incremental_inputs::finalize): Do nothing but finalize string table.
4183 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4184 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4185 (Incremental_inputs::create_data_sections): New function.
4186 (Incremental_inputs::relocs_entsize): New function.
4187 (Output_section_incremental_inputs::set_final_data_size): New function.
4188 (Output_section_incremental_inputs::do_write): New function.
4189 (Output_section_incremental_inputs::write_header): New function.
4190 (Output_section_incremental_inputs::write_input_files): New function.
4191 (Output_section_incremental_inputs::write_info_blocks): New function.
4192 (Output_section_incremental_inputs::write_symtab): New function.
4193 * incremental.h (Incremental_script_entry): Forward declaration.
4194 (Incremental_object_entry): Forward declaration.
4195 (Incremental_archive_entry): Forward declaration.
4196 (Incremental_inputs): Forward declaration.
4197 (Incremental_inputs_header_data): Remove.
4198 (Incremental_inputs_header): Remove.
4199 (Incremental_inputs_header_write): Remove.
4200 (Incremental_inputs_entry_data): Remove.
4201 (Incremental_inputs_entry): Remove.
4202 (Incremental_inputs_entry_write): Remove.
4203 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4204 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4205 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4206 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4207 Likewise.
4208 (Incremental_input_entry): New class.
4209 (Incremental_script_entry): New class.
4210 (Incremental_object_entry): New class.
4211 (Incremental_archive_entry): New class.
4212 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4213 (Incremental_inputs::report_inputs): Remove.
4214 (Incremental_inputs::report_archive): Remove.
4215 (Incremental_inputs::report_archive_begin): New function.
4216 (Incremental_inputs::report_archive_end): New function.
4217 (Incremental_inputs::report_object): Change prototype.
4218 (Incremental_inputs::report_input_section): New function.
4219 (Incremental_inputs::report_script): Change prototype.
4220 (Incremental_inputs::get_reloc_count): New function.
4221 (Incremental_inputs::set_reloc_count): New function.
4222 (Incremental_inputs::create_data_sections): New function.
4223 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4224 (Incremental_inputs::inputs_section): New function.
4225 (Incremental_inputs::symtab_section): New function.
4226 (Incremental_inputs::relocs_section): New function.
4227 (Incremental_inputs::get_stringpool): Add const.
4228 (Incremental_inputs::command_line): Add const.
4229 (Incremental_inputs::inputs): Remove.
4230 (Incremental_inputs::command_line_key): New function.
4231 (Incremental_inputs::input_file_count): New function.
4232 (Incremental_inputs::input_files): New function.
4233 (Incremental_inputs::relocs_entsize): New function.
4234 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4235 (Incremental_inputs::finalize_inputs): Remove.
4236 (Incremental_inputs::Input_info): Remove.
4237 (Incremental_inputs::lock_): Remove.
4238 (Incremental_inputs::inputs_): Change type.
4239 (Incremental_inputs::inputs_map_): Remove.
4240 (Incremental_inputs::current_object_entry_): New data member.
4241 (Incremental_inputs::inputs_section_): New data member.
4242 (Incremental_inputs::symtab_section_): New data member.
4243 (Incremental_inputs::relocs_section_): New data member.
4244 (Incremental_inputs::reloc_count_): New data member.
4245 (Incremental_inputs_reader): New class.
4246 (Incremental_symtab_reader): New class.
4247 (Incremental_relocs_reader): New class.
4248 * layout.cc (Layout::finalize): Move finalization of incremental info
4249 and creation of incremental info sections to follow finalization of
4250 symbol table. Set offsets for postprocessing sections.
4251 (Layout::create_incremental_info_sections): Call
4252 Incremental_inputs::create_data_sections. Add incremental symtab
4253 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4254 sections to layout after input sections.
4255 * layout.h (struct Timespec): Forward declaration.
4256 (Layout::incremental_inputs): Add const.
4257 (Layout::create_incremental_info_sections): Add parameter.
4258 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4259 * object.cc: Include incremental.h.
4260 (Relobj::finalize_incremental_relocs): New function.
4261 (Sized_relobj::do_layout): Record input sections in incremental info.
4262 * object.h (Object::output_section): New function.
4263 (Object::output_section_offset): Moved from Relobj.
4264 (Object::get_incremental_reloc_base): New function.
4265 (Object::get_incremental_reloc_count): New function.
4266 (Object::do_output_section): New function.
4267 (Object::do_output_section_offset): Moved from Relobj.
4268 (Object::do_get_incremental_reloc_base): New function.
4269 (Object::do_get_incremental_reloc_count): New function.
4270 (Object::Object): Initialize new data members.
4271 (Relobj::output_section): Renamed do_output_section and moved to
4272 protected.
4273 (Relobj::output_section_offset): Moved to Object.
4274 (Relobj::do_get_incremental_reloc_base): New function.
4275 (Relobj::do_get_incremental_reloc_count): New function.
4276 (Relobj::allocate_incremental_reloc_counts): New function.
4277 (Relobj::count_incremental_reloc): New function.
4278 (Relobj::finalize_incremental_relocs): New function.
4279 (Relobj::next_incremental_reloc_index): New function.
4280 (Relobj::reloc_counts_): New data member.
4281 (Relobj::reloc_bases_): New data member.
4282 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4283 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4284 (Sized_relobj::incremental_relocs_scan): New function.
4285 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4286 (Sized_relobj::incremental_relocs_write): New function.
4287 (Sized_relobj::incremental_relocs_write_reltype): New function.
4288 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4289 incremental link.
4290 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4291 archives and object files elsewhere.
4292 (Add_symbols::run): Report object files here.
4293 (Finish_group::run): Report end of archive at end of group.
4294 * reloc.cc: Include layout.h, incremental.h.
4295 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4296 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4297 (Sized_relobj::incremental_relocs_scan): New function.
4298 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4299 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4300 (Sized_relobj::incremental_relocs_write): New function.
4301 (Sized_relobj::incremental_relocs_write_reltype): New function.
4302 * script.cc (read_input_script): Rewrite test for incremental link.
4303 Change call to Incremental_inputs::report_script.
4304 * symtab.h (Symbol_table::first_global_index): New function.
4305 (Symbol_table::output_count): New function.
4306
ce0d1972
DK
43072010-08-12 Doug Kwan <dougkwan@google.com>
4308
4309 * arm.cc (Target_arm::merge_object_attributes): Check command line
4310 options --no-wchar-size-warning and --no-enum-size-warning.
4311 * options.h (General_options): Add ld-compatible options
4312 --no-enum-size-warning and --no-wchar-size-warning.
4313
6e5710ce
ILT
43142010-08-04 Ian Lance Taylor <iant@google.com>
4315
4316 * x86_64.cc (Target_x86_64::Scan::local): Use
4317 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4318 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4319 (Target_x86_64::Scan::global): Likewise.
4320 (Target_x86_64::Relocate::relocate): Likewise.
4321 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4322 Likewise.
4323
fef830db
CC
43242010-08-03 Cary Coutant <ccoutant@google.com>
4325
4326 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4327 to reserve space in merged_strings vector. Keep total input size
4328 for stats.
4329 (Output_merge_string::do_print_merge_stats): Print total input size.
4330 * merge.h (Output_merge_string): Add input_size_ field.
4331 * stringpool.cc (Stringpool_template::string_length): Move
4332 implementations out of Stringpool_template class and place in
4333 stringpool.h.
4334 * stringpool.h (string_length): Move out of Stringpool_template.
4335
1e3811b0
ILT
43362010-08-03 Ian Lance Taylor <iant@google.com>
4337
4338 PR 11712
4339 * layout.cc (relaxation_loop_body): If address of load segment is
4340 set, adjust address to include headers if possible.
4341
7af0c620
ILT
43422010-08-03 Ian Lance Taylor <iant@google.com>
4343
4344 * version.cc (version_string): Bump to 1.10.
4345
22f0da72
ILT
43462010-08-03 Ian Lance Taylor <iant@google.com>
4347
4348 PR 11805
4349 * layout.h (enum Output_section_order): Define.
4350 (class Layout): Update declarations.
4351 * layout.cc (Layout::get_output_section): Add order parameter.
4352 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4353 is_first_non_relro parameters. Change all callers.
4354 (Layout::choose_output_section): Likewise.
4355 (Layout::add_output_section_data): Likewise.
4356 (Layout::make_output_section): Likewise. Set order.
4357 (Layout::default_section_order): New function.
4358 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4359 * output.cc (Output_section::Output_section): Initialize order_.
4360 Don't initialize deleted fields.
4361 (Output_segment::Output_segment): Don't initialize deleted
4362 fields.
4363 (Output_segment::add_output_section_to_load): New function
4364 replacing add_output_section. Change all callers to call this or
4365 add_output_section_to_nonload.
4366 (Output_segment::add_output_section_to_nonload): New function.
4367 (Output_segment::remove_output_section): Rewrite.
4368 (Output_segment::add_initial_output_data): Likewise.
4369 (Output_segment::has_any_data_sections): Likewise.
4370 (Output_segment::is_first_section_relro): Likewise.
4371 (Output_segment::maximum_alignment): Likewise.
4372 (Output_segment::has_dynamic_reloc): New function replacing
4373 dynamic_reloc_count. Change all callers.
4374 (Output_segment::has_dynamic_reloc_list): New function replacing
4375 dynamic_reloc_count_list. Change all callers.
4376 (Output_segment::set_section_addresses): Rewrite.
4377 (Output_segment::set_offset): Rewrite.
4378 (Output_segment::find_first_and_last_list): Remove.
4379 (Output_segment::set_tls_offsets): Rewrite.
4380 (Output_segment::first_section_load_address): Likewise.
4381 (Output_segment::output_section_count): Likewise.
4382 (Output_segment::section_with_lowest_load_address): Likewise.
4383 (Output_segment::write_section_headers): Likewise.
4384 (Output_segment::print_sections_to_map): Likewise.
4385 * output.h (class Output_data): Remove dynamic_reloc_count_
4386 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4387 (Output_data::add_dynamic_reloc): Rewrite.
4388 (Output_data::has_dynamic_reloc): New function.
4389 (Output_data::dynamic_reloc_count): Remove.
4390 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4391 is_last_relro_, is_first_non_relro_, is_interp_,
4392 is_dynamic_linker_section_ fields. Add order and set_order
4393 functions. Remove is_relro_local, set_is_relro_local,
4394 is_last_relro, set_is_last_relro, is_first_non_relro,
4395 set_is_first_non_relro functions, is_interp, set_is_interp,
4396 is_dynamic_linker_section, and set_is_dynamic_linker_section
4397 functions.
4398 (class Output_segment): Change Output_data_list from std::list to
4399 std:;vector. Add output_lists_ field. Remove output_data_ and
4400 output_bss_ fields. Update declarations.
4401
3ff2ccb0
ILT
44022010-08-02 Ian Lance Taylor <iant@google.com>
4403
4404 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4405 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4406 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4407
88a4108b
ILT
44082010-08-02 Ian Lance Taylor <iant@google.com>
4409
4410 PR 11855
4411 * script.cc (Script_options::Script_options): Initialize
4412 symbol_definitions_ and symbol_references_.
4413 (Script_options::add_symbol_assignment): Update
4414 symbol_definitions_ and symbol_references_.
4415 (Script_options::add_symbol_reference): New function.
4416 (script_symbol): New function.
4417 * script.h (class Script_options): Add symbol_definitions_ and
4418 symbol_references_ fields.
4419 (Script_options::referenced_const_iterator): New type.
4420 (Script_options::referenced_begin): New function.
4421 (Script_options::referenced_end): New function.
4422 (Script_options::is_referenced): New function.
4423 (Script_options::any_unreferenced): New function.
4424 * script-c.h (script_symbol): Declare.
4425 * yyscript.y (exp): Call script_symbol.
4426 * symtab.cc: Include "script.h".
4427 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4428 Change all callers. Check symbols referenced by scripts.
4429 (Symbol_table::add_undefined_symbols_from_command_line): Add
4430 layout parameter. Change all callers.
4431 (Symbol_table::do_add_undefined_symbols_from_command_line):
4432 Likewise. Break out loop body. Check symbols referenced by
4433 scripts.
4434 (Symbol_table::add_undefined_symbol_from_command_line): New
4435 function broken out of
4436 do_add_undefined_symbols_from_command_line.
4437 * symtab.h (class Symbol_table): Update declarations.
4438 * archive.cc: Include "layout.h".
4439 (Archive::should_include_member): Add layout parameter. Change
4440 all callers. Check for symbol mentioned in expression.
4441 * archive.h (class Archive): Update declaration.
4442 * object.cc (Sized_relobj::do_should_include_member): Add layout
4443 parameter.
4444 * object.h (Object::should_include_member): Add layout parameter.
4445 Change all callers.
4446 (Object::do_should_include_member): Add layout parameter.
4447 (class Sized_relobj): Update declaration.
4448 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4449 parameter.
4450 * dynobj.h (class Sized_dynobj): Update declaration.
4451 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4452 layout parameter.
4453 * plugin.h (class Sized_pluginobj): Update declaration.
4454
5f1ab67a
ILT
44552010-08-02 Ian Lance Taylor <iant@google.com>
4456
4457 PR 11866
4458 * output.cc (Output_segment::set_offset): Search for the first and
4459 last sections rather than assuming that the list is in order.
4460 (Output_segment::find_first_and_last_list): New function.
4461 * output.h (class Output_segment): Update declarations.
4462 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4463 (relro_strip_test_SOURCES): New variable.
4464 (relro_strip_test_DEPENDENCIES): New variable.
4465 (relro_strip_test_LDFLAGS): New variable.
4466 (relro_strip_test_LDADD): New variable.
4467 (relro_strip_test.so): New target.
4468
a8df5856
ILT
44692010-08-02 Ian Lance Taylor <iant@google.com>
4470
4471 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4472 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4473 (Target_i386::got_tlsdesc_section): New function.
4474 (Target_i386::got_section): Create space for GOT entries for
4475 TLSDESC relocations.
4476 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4477 R_386_TLS_GOTDESC.
4478 (Target_i386::Scan::global): Likewise.
4479 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4480 using TLSDESC GOT.
4481 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4482 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4483 (Target_x86_64::got_tlsdesc_section): New function.
4484 (Target_x86_64::got_section): Create space for GOT entries for
4485 TLSDESC relocations.
4486 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4487 R_386_TLS_GOTDESC.
4488 (Target_x86_64::Scan::global): Likewise.
4489 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4490 using TLSDESC GOT.
4491
0c10a0a6
ILT
44922010-08-02 Ian Lance Taylor <iant@google.com>
4493
4494 * testsuite/final_layout.sh: Use dc to convert from hex to
4495 decimal.
4496
41cbeecc
ST
44972010-07-29 Sriraman Tallam <tmsriram@google.com>
4498
4499 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4500 paramter to the call to gold::gc_process_relocs.
4501 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4502 paramter to the call to gold::gc_process_relocs.
4503 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4504 parameter to the call to gold::gc_process_relocs.
4505 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4506 template parameter to the call to gold::gc_process_relocs.
4507 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4508 paramter to the call to gold::gc_process_relocs.
4509 * gc.h (get_embedded_addend_size): New function.
4510 (gc_process_relocs): Save the size of the reloc for use by ICF.
4511 * icf.cc (get_section_contents): Get the addend from the text section
4512 for SHT_REL relocation sections.
4513 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4514 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4515 * int_encoding.h (read_from_pointer): New overloaded function.
4516 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4517 * testsuite/icf_sht_rel_addend_test.sh: New file.
4518 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4519 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4520
6ea55b82
RW
45212010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4522
4523 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4524 * Makefile.in: Regenerate.
4525 * testsuite/Makefile.in: Regenerate.
4526
9691462b
ILT
45272010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4528
4529 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4530 * gold/testsuite/debug_msg.cc: Likewise.
4531 * gold/testsuite/odr_violation1.cc
4532 * gold/testsuite/odr_violation2.cc
4533
76897331
CC
45342010-07-21 Cary Coutant <ccoutant@google.com>
4535
4536 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4537 string, and length fields.
4538 (Output_merge_string::Merged_strings_list): New type.
4539 (Output_merge_string::Merged_strings_lists): New typedef.
4540 (Output_merge_string): Replace merged_strings_ with
4541 merged_strings_lists_.
4542 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4543 Merged_strings_list per input object and section. Don't store pointer
4544 to the string. Don't store length with each merged string entry.
4545 (Output_merge_string::finalize_merged_data): Loop over list of merged
4546 strings lists. Recompute length of each merged string.
4547
78384e8f
CC
45482010-07-15 Cary Coutant <ccoutant@google.com>
4549
4550 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4551 here.
4552
783659f9
ILT
45532010-07-14 Ian Lance Taylor <iant@google.com>
4554
4555 * descriptors.cc (Descriptors::open): Report correct name in error
4556 message.
4557
131687b4
DK
45582010-07-13 Doug Kwan <dougkwan@google.com>
4559
4560 * arm.cc (Arm_input_section::Arm_input_section): For a
4561 SHT_ARM_EXIDX section, always keeps the input sections.
4562 (Arm_input_section::set_exidx_section_link): New method.
4563 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4564 has_errors_ to false.
4565 (Arm_exidx_input_section::has_errors,
4566 Arm_exidx_input_section::set_has_errors): New methods.
4567 (Arm_exidx_input_section::has_errors_): New data member.
4568 (Arm_relobj::get_exidx_shndx_list): New method.
4569 (Arm_output_section::append_text_sections_to_list): Do not skip
4570 section without SHF_EXECINSTR.
4571 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4572 errors.
4573 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4574 section header. Make error messages more verbose. Check for
4575 a non-executable section linked to an EXIDX section.
4576 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4577 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4578 check that there is no deferred EXIDX section if we exit early.
4579 Instead of not making an EXIDX section in case of an error, make one
4580 and set the has_errors flag of it.
4581 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4582 in a relocatable link.
4583 (Target_arm::do_relax): Look for the EXIDX output section instead of
4584 assuming that it is called .ARM.exidx.
4585 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4586 section list. Do not check for SHF_EXECINSTR section flags but
4587 skip any input section with errors.
4588 * output.cc (Output_section::Output_section): Initialize
4589 always_keeps_input_sections_ to false.
4590 (Output_section::add_input_section): Check for
4591 always_keeps_input_sections_.
4592 * output.h (Output_section::always_keeps_input_sections,
4593 Output_section::set_always_keeps_input_sections): New methods.
4594 (Output_section::always_keeps_input_sections): New data member.
4595
69517287
RÁE
45962010-07-13 Rafael Espindola <espindola@google.com>
4597
4598 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4599 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4600
82742395
ILT
46012010-07-13 Philip Herron <herron.philip@googlemail.com>
4602 Ian Lance Taylor <iant@google.com>
4603
4604 * output.h (Output_section_lookup_maps::add_merge_section):
4605 Correct check of whether value was inserted.
4606 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4607 (Output_section_lookup_maps::add_relaxed_input_section):
4608 Likewise.
4609 * arm.cc (Target_arm::got_section): Remove used local os.
4610 * i386.cc (Target_i386::got_section): Likewise.
4611 * x86_64.cc (Target_x86_64::got_section): Likewise.
4612 * sparc.cc (Target_sparc::got_section): Likewise.
4613 (Target_sparc::relocate): Remove unused local have_got_offset.
4614 * powerpc.cc (Target_powerpc::relocate): Likewise.
4615
f2d707b5
ILT
46162010-07-13 Ian Lance Taylor <iant@google.com>
4617
241531d6
ILT
4618 * compressed_output.cc (zlib_decompress): Fix signature in
4619 !HAVE_ZLIB_H case.
4620
f2d707b5
ILT
4621 * archive.cc (Archive::include_member): Unlock an external member
4622 of a thin archive. Don't bother to delete an object we know is
4623 NULL.
4624
a2e47362
CC
46252010-07-12 Cary Coutant <ccoutant@google.com>
4626
4627 * compressed_output.cc (zlib_decompress): New function.
4628 (get_uncompressed_size): New function.
4629 (decompress_input_section): New function.
4630 * compressed_output.h (get_uncompressed_size): New function.
4631 (decompress_input_section): New function.
4632 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4633 Handle compressed debug sections.
4634 * layout.cc (is_compressed_debug_section): New function.
4635 (Layout::output_section_name): Map compressed section names to
4636 canonical names.
4637 * layout.h (is_compressed_debug_section): New function.
4638 (is_debug_info_section): Recognize compressed debug sections.
4639 * merge.cc: Include compressed_output.h.
4640 (Output_merge_data::do_add_input_section): Handle compressed
4641 debug sections.
4642 (Output_merge_string::do_add_input_section): Handle compressed
4643 debug sections.
4644 * object.cc: Include compressed_output.h.
4645 (Sized_relobj::Sized_relobj): Initialize new data members.
4646 (build_compressed_section_map): New function.
4647 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4648 * object.h (Object::section_is_compressed): New method.
4649 (Object::do_section_is_compressed): New method.
4650 (Sized_relobj::Compressed_section_map): New type.
4651 (Sized_relobj::do_section_is_compressed): New method.
4652 (Sized_relobj::compressed_sections_): New data member.
4653 * output.cc (Output_section::add_input_section): Handle compressed
4654 debug sections.
4655 * reloc.cc: Include compressed_output.h.
4656 (Sized_relobj::write_sections): Handle compressed debug sections.
4657
ce279a62
CC
46582010-07-08 Cary Coutant <ccoutant@google.com>
4659
4660 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4661 weak when resolving to a dynamic def.
4662 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4663 for weak undef/dynamic def cases. Adjust callers.
4664 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4665 undef_binding_weak_.
4666 (Symbol_table::sized_write_globals): Adjust symbol binding.
4667 (Symbol_table::sized_write_symbol): Add binding parameter.
4668 * symtab.h (Symbol::set_undef_binding): New method.
4669 (Symbol::is_undef_binding_weak): New method.
4670 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4671 (Symbol_table::should_override): Add new parameter.
4672 (Symbol_table::sized_write_symbol): Add new parameter.
4673
4674 * testsuite/weak_undef_file1.cc: Add new test case.
4675 * testsuite/weak_undef_file2.cc: Fix header comment.
4676 * testsuite/weak_undef_test.cc: Add new test case.
4677
b2286c10
DK
46782010-06-29 Doug Kwan <dougkwan@google.com>
4679
4680 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4681 Initialize USE_SYMBOL_.
4682 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4683 definition.
4684 (Arm_reloc_property::uses_symbol_): New data member declaration.
4685 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4686 uses symbol value and symbol is undefined but not weakly undefined.
4687
4802450a
RÁE
46882010-06-28 Rafael Espindola <espindola@google.com>
4689
4690 * plugin.cc (Plugin::load): Use dlerror.
4691
e5ca47ba
ILT
46922010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4693
4694 * symtab.cc (detect_odr_violations): When reporting an ODR
4695 violation, report an object where the symbol is defined.
4696
8a75a161
DK
46972010-06-25 Doug Kwan <dougkwan@google.com>
4698
4699 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4700 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4701 definition.
4702 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4703 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4704 target hook to detect function points.
4705 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4706 * icf.h (Icf::check_section_for_function_pointers): Change type of
4707 parameter SECTION_NAME to const reference to std::string. Use
4708 target hook to determine if section may have unsafe pointers.
4709 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4710 method definition.
4711
42218b9f
RÁE
47122010-06-21 Rafael Espindola <espindola@google.com>
4713
4714 * fileread.cc (Input_file::find_fie): New
4715 (Input_file::open): Use Input_file::find_fie.
4716 * fileread.h (Input_file::find_fie): New
4717 * plugin.cc (set_extra_library_path): New.
4718 (Plugin::load): Add set_extra_library_path to the transfer vector.
4719 (Plugin_manager::set_extra_library_path): New.
4720 (Plugin_manager::add_input_file): Use the extra search path if set.
4721 (set_extra_library_path(): New.
4722 * plugin.h (Plugin_manager): Add set_extra_library_path and
4723 extra_search_path_.
4724
a0506cca
CC
47252010-06-19 Cary Coutant <ccoutant@google.com>
4726
4727 * layout.cc (gdb_sections): Add .debug_types.
4728 (lines_only_debug_sections): Likewise.
4729
6508b958
RÁE
47302010-06-18 Rafael Espindola <espindola@google.com>
4731
4732 * plugin.cc (add_input_file,add_input_library)
4733 (Plugin_manager::add_input_file): Make filename arguments const.
4734 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4735 const.
4736
3e235302
DK
47372010-06-16 Doug Kwan <dougkwan@google.com>
4738
4739 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4740 .ARM.attributes section if we have not merged any input
4741 attributes sections.
4742
106e8a6c
DK
47432010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4744
4745 * arm.cc: Allow combining objects with no EABI version
4746 information.
4747
91ff43fe
RÁE
47482010-06-15 Rafael Espindola <espindola@google.com>
4749
4750 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4751
68ed838c
ILT
47522010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4753
4754 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4755 (struct iovec): Correct !HAVE_READV definition.
4756
f3a2388f
CC
47572010-06-10 Cary Coutant <ccoutant@google.com>
4758
4759 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4760 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4761 reloc sections.
4762 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4763
4764 PR 11683
4765 * symtab.h (Symbol::is_placeholder): New member function.
4766 * target-reloc.h (relocate_section): Check for placeholder symbols.
4767
4768 * testsuite/Makefile.am (plugin_test_8): New test.
4769 (plugin_test_9): New test.
4770 * testsuite/Makefile.in: Regenerate.
4771
e1df38aa
NC
47722010-06-09 Nick Clifton <nickc@redhat.com>
4773
4774 * yyscript.y (input_list_element): Allow strings prefixed with
4775 the '-' character. Treat these as libraries.
4776 * script.cc (script_add_library): New function. Adds a library
4777 specified by "-l<name>" found in an input script.
4778 * script-c.h: Add prototype for script_add_library.
4779
25bbe950
DK
47802010-06-07 Doug Kwan <dougkwan@google.com>
4781
4782 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4783 Restrict stub-group size to be within long conditional branch
4784 range when working around cortex-A8 erratum.
4785
0f32ea4c
ILT
47862010-06-07 Damien Diederen <dd@crosstwine.com>
4787
4788 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4789 #ifdef typo.
4790
8fe2a369
ST
47912010-06-03 Sriraman Tallam <tmsriram@google.com>
4792
4793 PR gold/11658
4794 * output.cc
4795 (Output_section::Input_section_sort_entry::compare_section_ordering):
4796 Change to return non-zero correctly.
4797 (Output_section::Input_section_sort_section_order_index_compare
4798 ::operator()): Change to fix ambiguity in comparisons.
4799
6e9ba2ca
ST
48002010-06-01 Sriraman Tallam <tmsriram@google.com>
4801
4802 * gold.h (is_wildcard_string): New function.
4803 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4804 (Layout::layout_eh_frame): Ditto.
4805 (Layout::find_section_order_index): New method.
4806 (Layout::read_layout_from_file): New method.
4807 * layout.h (Layout::find_section_order_index): New method.
4808 (Layout::read_layout_from_file): New method.
4809 (Layout::input_section_position_): New private member.
4810 (Layout::input_section_glob_): New private member.
4811 * main.cc (main): Call read_layout_from_file here.
4812 * options.h (--section-ordering-file): New option.
4813 * output.cc (Output_section::input_section_order_specified_): New
4814 member.
4815 (Output_section::Output_section): Initialize new member.
4816 (Output_section::add_input_section): Add new parameter.
4817 Keep input sections when --section-ordering-file is used.
4818 (Output_section::set_final_data_size): Sort input sections when
4819 section ordering file is specified.
4820 (Output_section::Input_section_sort_entry): Add new parameter.
4821 Check sorting type.
4822 (Output_section::Input_section_sort_entry::compare_section_ordering):
4823 New method.
4824 (Output_section::Input_section_sort_compare::operator()): Change to
4825 consider section_order_index.
4826 (Output_section::Input_section_sort_init_fini_compare::operator()):
4827 Change to consider section_order_index.
4828 (Output_section::Input_section_sort_section_order_index_compare
4829 ::operator()): New method.
4830 (Output_section::sort_attached_input_sections): Change to sort
4831 according to section order when specified.
e1df38aa
NC
4832 (Output_section::add_input_section<32, true>): Add new parameter.
4833 (Output_section::add_input_section<64, true>): Add new parameter.
4834 (Output_section::add_input_section<32, false>): Add new parameter.
4835 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4836 * output.h (Output_section::add_input_section): Add new parameter.
4837 (Output_section::input_section_order_specified): New
4838 method.
4839 (Output_section::set_input_section_order_specified): New method.
4840 (Input_section::Input_section): Initialize section_order_index_.
4841 (Input_section::section_order_index): New method.
4842 (Input_section::set_section_order_index): New method.
4843 (Input_section::section_order_index_): New member.
4844 (Input_section::Input_section_sort_section_order_index_compare): New
4845 struct.
4846 (Output_section::input_section_order_specified_): New member.
4847 * script-sections.cc (is_wildcard_string): Delete and move modified
4848 method to gold.h.
4849 (Output_section_element_input::Output_section_element_input): Modify
4850 call to is_wildcard_string.
4851 (Output_section_element_input::Input_section_pattern
4852 ::Input_section_pattern): Ditto.
4853 (Output_section_element_input::Output_section_element_input): Ditto.
4854 * testsuite/Makefile.am (final_layout): New test case.
4855 * testsuite/Makefile.in: Regenerate.
4856 * testsuite/final_layout.cc: New file.
4857 * testsuite/final_layout.sh: New file.
4858
3537c84b
RÁE
48592010-06-01 Rafael Espindola <espindola@google.com>
4860
4861 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4862
105b6afd
RÁE
48632010-06-01 Rafael Espindola <espindola@google.com>
4864
4865 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4866 visibility of symbols.
4867
29e11421
DK
48682010-05-27 Doug Kwan <dougkwan@google.com>
4869
4870 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4871 from start of output section instead of address for a local symbol
4872 in a merged or relaxed section when doing a relocatable link.
4873
5e0f337e
RÁE
48742010-05-26 Rafael Espindola <espindola@google.com>
4875
4876 PR 11604
4877 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4878 adding sections the garbage collector removed.
4879 * gold/testsuite/Makefile.am: Add test.
4880 * gold/testsuite/Makefile.in: Regenerate.
4881 * gold/testsuite/plugin_test_7.sh: New.
4882 * gold/testsuite/plugin_test_7_1.c: New.
4883 * gold/testsuite/plugin_test_7_2.c: New.
4884
f4187277
RÁE
48852010-05-26 Rafael Espindola <espindola@google.com>
4886
4887 * script-sections.cc (Output_section_definition::set_section_addresses):
4888 Check for --section-start.
4889
5c388529
DK
48902010-05-26 Doug Kwan <dougkwan@google.com>
4891
4892 * arm.cc (Arm_scan_relocatable_relocs): New class.
4893 (Target_arm::relocate_special_relocatable): New method.
4894 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4895 (Arm_relocate_functions::thumb_branch_common): Same.
4896 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4897 instead of Default_scan_relocatable_relocs.
4898 * target-reloc.h (relocate_for_relocatable): Let target handle
4899 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4900 * target.h (Sized_target::relocate_special_relocatable): New method.
4901
bca1c3ae
ILT
49022010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4903
4904 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4905
0439c796
DK
49062010-05-23 Doug Kwan <dougkwan@google.com>
4907
4908 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4909 instead of a cast.
4910 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4911 with a direct branch, not a conditional branch, to a stub.
4912 * merge.cc (Output_merge_base::record_input_section): New method
4913 defintion.
4914 (Output_merge_data::do_add_input_section): Record input section if
4915 keeps-input-sections flag is set.
4916 (Output_merge_string::do_add_input_section): Ditto.
4917 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4918 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4919 INPUT_SECTIONS_.
4920 (Output_merge_base::keeps_input_sections,
4921 Output_merge_base::set_keeps_input_sections,
4922 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4923 method definitions.
4924 (Output_merge_base::Input_sections): New type declaration.
4925 (Output_merge_base::input_sections_begin,
4926 Output_merge_base::input_sections_end,
4927 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4928 (Output_merge_base::bool keeps_input_sections_,
4929 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4930 Output_merge_base::input_sections_): New data members.
4931 (Output_merge_data::do_set_keeps_input_sections): New method
4932 defintion.
4933 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4934 * output.cc (Output_section::Input_section::relobj): Move method
4935 defintion from class declaration to here and handle merge sections.
4936 (Output_section::Input_section::shndx): Ditto.
4937 (Output_section::Output_section): Remove initializations of removed
4938 data members and initialize new data member LOOKUP_MAPS_.
4939 (Output_section::add_input_section): Set keeps-input-sections flag
4940 for a newly created merge output section as appropriate. Adjust code
4941 to use Output_section_lookup_maps class.
4942 (Output_section::add_relaxed_input_section): Adjst code for lookup
4943 maps code refactoring.
4944 (Output_section::add_merge_input_section): Add a new parameter
4945 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4946 class. If adding input section to a newly created merge output
4947 section fails, remove the new merge section.
4948 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4949 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4950 (Output_section::find_merge_section): Ditto.
4951 (Output_section::build_lookup_maps): New method defintion.
4952 (Output_section::find_relaxed_input_section): Adjust code to use
4953 Output_section_lookup_maps class.
4954 (Output_section::get_input_sections): Export merge sections. Adjust
4955 code to use Output_section_lookup_maps class.
4956 (Output_section:::add_script_input_section): Adjust code to use
4957 Output_section_lookup_maps class. Update lookup maps for merge
4958 sections also.
4959 (Output_section::discard_states): Use Output_section_lookup_maps.
4960 (Output_section::restore_states): Same.
4961 * output.h (Merge_section_properties): Move class defintion out of
4962 Output_section.
4963 (Output_section_lookup_maps): New class.
4964 (Output_section::Input_section::is_merge_section): New method
4965 defintion.
4966 (Output_section::Input_section::relobj): Move defintion out of class
4967 defintion. Declare method only.
4968 (Output_section::Input_section::shndx): Ditto.
4969 (Output_section::Input_section::output_merge_base): New method defintion.
4970 (Output_section::Input_section::u2_.pomb): New union field.
4971 (Output_section::Merge_section_by_properties_map,
4972 Output_section::Output_section_data_by_input_section_map,
4973 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4974 Remove types.
4975 (Output_section::add_merge_input_section): Add new parameter
4976 KEEPS_INPUT_SECTIONS.
4977 (Output_section::build_lookup_maps): New method declaration.
4978 (Output_section::merge_section_map_,
4979 Output_section::merge_section_by_properties_map_,
4980 Output_section::relaxed_input_section_map_,
4981 Output_section::is_relaxed_input_section_map_valid_): Remove data
4982 members.
4983 (Output_section::lookup_maps_): New data member.
4984
76295588
L
49852010-05-21 Doug Kwan <dougkwan@google.com>
4986
4987 PR gold/11619
4988 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4989 avoid a compilation error.
4990
d103a984
RÁE
49912010-05-19 Rafael Espindola <espindola@google.com>
4992
4993 * script-sections.cc (Output_section_definition::allocate_to_segment):
4994 Update the phdrs_list even when the output section is NULL.
4995 * testsuite/Makefile.am: Add test.
4996 * testsuite/Makefile.in: Regenerate.
4997 * testsuite/script_test_9.cc: New.
4998 * testsuite/script_test_9.sh: New.
4999 * testsuite/script_test_9.t: New.
5000
6625d24e
DK
50012010-05-19 Doug Kwan <dougkwan@google.com>
5002
5003 * arm.cc (Arm_input_section::original_size): New method.
5004 (Arm_input_section::do_addralign): Add a cast.
5005 (Arm_input_section::do_output_offset): Remove static cast.
5006 (Arm_input_section::original_addralign,
5007 Arm_input_section::original_size_): Change type to uint32_t.
5008 (Arm_input_section::init): Add safe casts for section alignment
5009 and size.
5010 (Arm_input_section::set_final_data_size): Do not set address and
5011 offset of stub table.
5012 (Arm_output_section::fix_exidx_coverage): Change use of of
5013 Output_section::Simple_input_section to that of
5014 Output_section::Input_section.
5015 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5016 except for the first pass.
5017 * output.cc (Output_section::get_input_sections): Change type of
5018 input_sections to std::list<Input_section>.
5019 (Output_section::add_script_input_section): Rename from
5020 Output_section::add_simple_input_section. Change type of SIS
5021 parameter from Simple_input_section to Input_section.
5022 * output.h (Output_section::Simple_input_section): Remove class.
5023 (Output_section::Input_section): Change class visibility to public.
5024 (Output_section::Input_section::addralign): Use stored alignments
5025 for special input sections if set.
5026 (Output_section::Input_section::set_addralign): New method.
5027 (Output_section::get_input_sections): Change parameter type from
5028 list of Simple_input_section to list of Input_section.
5029 (Output_section::add_script_input_section): Rename from
5030 Output_section::add_simple_input_section. Change first parameter's
5031 type from Simple_input_section to Input_section and remove the
5032 second and third parameters.
5033 * script-sections.cc (Input_section::Input_section_list): Change
5034 type to list of Output_section::Input_section/
5035 (Input_section_info::Input_section_info): Change parameter type of
5036 INPUT_SECTION to Output_section::Input_section.
5037 (Input_section_info::input_section): Change return type.
5038 (Input_section_info::input_section_): Change type to
5039 Output_section::Input_section.
5040 (Output_section_element_input::set_section_addresses): Adjust code
5041 to use Output_section::Input_section instead of
5042 Output_section::Simple_input_section. Adjust code for renaming
5043 of Output_section::add_simple_input_section.
5044 (Orphan_output_section::set_section_addresses): Ditto.
5045
e1e82ea4
RW
50462010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5047
5048 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5049 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5050
91e75c8a
RÁE
50512010-05-18 Rafael Espindola <espindola@google.com>
5052
5053 * options.cc (General_options::finalize): Handle -nostdlib.
5054 * options.h (nostdlib): New option.
5055 * script.cc (script_add_search_dir): Handle -nostdlib.
5056
da59ad79
DK
50572010-05-12 Doug Kwan <dougkwan@google.com>
5058
5059 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5060 attributes section only if there no attributes section after merging.
5061 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5062 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5063 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5064 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5065 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5066 and arm_attr_merge_7.stdout.
5067 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5068 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5069 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5070 arm_attr_merge_7b.o): New rules.
5071 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5072 arm_attr_merge_7
5073 * testsuite/Makefile.in: Regenerate.
5074 * testsuite/arm_attr_merge.sh: New file.
5075 * testsuite/arm_attr_merge_[67][ab].s: Same.
5076
3e01a7fd
NC
50772010-05-05 Nick Clifton <nickc@redhat.com>
5078
5079 * po/es.po: Updated Spanish translation.
5080
7ad2014a
L
50812010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5082
5083 * Makefile.am (install-exec-local): Properly install gold as
5084 default cross linker.
5085 * Makefile.in: Regenerated.
5086
4fda8867
NC
50872010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5088 Nick Clifton <nickc@redhat.com>
5089
5090 * configure.ac (install_as_default): Define and set to false
5091 unless --enable-gold or --enable-gold=both/gold has been
5092 specified.
5093 * configure: Regenerate.
5094
5095 * Makefile.am (install-exec-local): Install the executable as
5096 'ld.gold'. If install_as_default is true then also install it as
5097 'ld'.
5098 * Makefile.in: Regenerated.
5099
bd288ea2
ILT
51002010-04-24 Ian Lance Taylor <iant@google.com>
5101
5102 * layout.cc (Layout::layout_reloc): In relocatable link don't
5103 combine reloc sections for grouped sections.
5104
ef38fd8a
ST
51052010-04-23 Sriraman Tallam <tmsriram@google.com>
5106
5107 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5108 sections that are not ordinary to icf.
5109 * icf.cc (get_section_contents): Handle relocation pointing to section
5110 with no object or shndx information.
5111 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5112 * testsuite/Makefile.in: Regenerate.
5113 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5114 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5115
f6973bdc
ILT
51162010-04-22 Ian Lance Taylor <iant@google.com>
5117
5118 * expression.cc (Expression::Expression_eval_info): Add
5119 result_alignment_pointer field.
5120 (Expression::eval_with_dot): Add result_alignment_pointer
5121 parameter. Change all callers.
5122 (Expression::eval_maybe_dot): Likewise.
5123 (class Binary_expression): Add alignment_pointer parameter to
5124 left_value and right_value. Change all callers.
5125 (BINARY_EXPRESSION): Set result alignment.
5126 (class Trinary_expression): Add alignment_pointer parameter to
5127 arg2_value and arg3_value. Change all callers.
5128 (Trinary_cond::value): Set result alignment.
5129 (Max_expression::value, Min_expression::value): Likewise.
5130 (Align_expression::value): Likewise.
5131 * script-sections.cc (class Sections_element): Add dot_alignment
5132 parameter to set_section_addresses virtual function. Update
5133 instantiations.
5134 (class Output_section_element): Likewise.
5135 (Script_sections::create_segments): Add dot_alignment parameter.
5136 Change all callers.
5137 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5138 (Script_sections::set_phdrs_clause_addresses): Likewise.
5139 * script-sections.h: Update declarations.
5140 * script.h: Update declarations.
5141 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5142 min_p_align.
5143 * testsuite/script_test_3.t: Set large alignment.
5144 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5145 segment has expected alignment.
5146
9c9c98a5
NC
51472010-04-22 Nick Clifton <nickc@redhat.com>
5148
5149 * po/gold.pot: Updated by the Translation project.
5150 * po/vi.po: Updated Vietnamese translation.
5151
2253bfba
L
51522010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5153
5154 * testsuite/Makefile.am (check_PROGRAMS): Add
5155 icf_virtual_function_folding_test.
5156 * testsuite/Makefile.in: Regenerated.
5157
85fdf906
AH
51582010-04-15 Andrew Haley <aph@redhat.com>
5159
5160 * options.h (merge_exidx_entries): New option.
5161 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5162 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5163 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5164 (Target_arm::merge_exidx_entries): New function.
5165 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5166 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5167 to Arm_exidx_fixup constructor.
5168 Add new arg, merge_exidx_entries.
5169 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5170 Arm_output_section::fix_exidx_coverage.
5171
ce97fa81
ST
51722010-04-18 Sriraman Tallam <tmsriram@google.com>
5173
5174 * icf.cc (get_section_contents): Check for preemptible functions.
5175 Ignore addend when appropriate.
5176 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5177 section folded.
5178 (add_from_relobj): Check for section folded.
5179 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5180 * symtab.h (should_add_dynsym_entry): Add new parameter.
5181 * target-reloc.h (scan_relocs): Check for section folded.
5182 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5183 Check reloc types for function pointers in shared objects.
5184 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5185 case.
5186 (icf_preemptible_functions_test): New test case.
5187 (icf_string_merge_test): New test case.
5188 * testsuite.Makefile.in: Regenerate.
5189 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5190 bar_glob. Refactor code.
5191 * testsuite/icf_preemptible_functions_test.cc: New file.
5192 * testsuite/icf_preemptible_functions_test.sh: New file.
5193 * testsuite/icf_string_merge_test.cc: New file.
5194 * testsuite/icf_string_merge_test.sh: New file.
5195 * testsuite/icf_virtual_function_folding_test.cc: New file.
5196 * testsuite/icf_virtual_function_folding_test.sh: New file.
5197
04ceb17c
DK
51982010-04-14 Doug Kwan <dougkwan@google.com>
5199
5200 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5201 for local symbol recounting if we remove a section due to ICF.
5202 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5203 there are no regular objects in input.
5204
153e7da4
DK
52052010-04-13 Doug Kwan <dougkwan@google.com>
5206
5207 * arm.cc (Arm_input_section::set_final_data_size): Compute
5208 accurate final data size instead of using current data size.
5209
4dbd9faf
DK
52102010-04-09 Doug Kwan <dougkwan@google.com>
5211
5212 * layout.cc (Layout::choose_output_section): Handle script section
5213 types.
5214 (Layout::make_output_section_for_script): Add section type parameter.
5215 Handle script section types.
5216 * layout.h (Layout::make_output_section_for_script): Add section
5217 type parameter.
5218 * output.cc (Output_section::Output_section): Initialize data member
5219 is_noload_.
5220 (Output_section::do_reset_address_and_file_offset): Do not set address
5221 to 0 if section is a NOLOAD section.
5222 * output.h (Output_section::is_noload): New method.
5223 (Output_section::set_is_noload): Ditto.
5224 (Output_section::is_noload_): New data member.
5225 * script-c.h (Script_section_type): New enum type.
5226 (struct Parser_output_section_header): Add new file section_type.
5227 * script-sections.cc (Sections_element::output_section_name): Add
5228 parameter for returning script section type.
5229 (Output_section_definition::output_section_name): Ditto.
5230 (Output_section_definition::section_type)P; New method.
5231 (Output_section_definiton::script_section_type_name): Ditto.
5232 (Output_section_definition::script_section_type_): New data member.
5233 (Output_section_definition::Output_section_definition): Initialize
5234 data member Output_section_definition::script_section_type_.
5235 (Output_section_definition::create_sections): Pass script section type
5236 to Layout::make_output_section_for_script.
5237 (Output_section_definition::output_section_name): Return script
5238 section type to caller.
5239 (Output_section_definition::set_section_address): Do not advance
5240 dot value and load address if section type is NOLOAD. Set address
5241 of NOLOAD sections regardless of section flags.
5242 (Output_section_definition::print): Print section type if it is
5243 not SCRIPT_SECTION_TYPE_NONE.
5244 (Output_section_definition::section_type): New method.
5245 (Output_section_definition::script_section_type_name): Ditto.
5246 (Script_sections::output_section_name): Add new parameter
5247 PSECTION_TYPE for returning script section type. Pass it to
5248 section elements. Handle discard sections.
5249 (Sort_output_sections::operator()): Handle NOLOAD sections.
5250 * script-sections.h (Script_sections::Section_type): New enum type.
5251 (Script_sections::output_section_name): Add a new parameter for
5252 returning script section type.
5253 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5254 INFO and NOLOAD.
5255 * yyscript.y (union): Add new field SECTION_TYPE.
5256 (COPY, DSECT, INFO, NOLOAD): New tokens.
5257 (opt_address_and_section_type): Change type to output_section_header.
5258 (section_type): New non-terminal
5259 (section_header): Handle section type.
2253bfba 5260 (opt_address_and_section_type): Return section type value.
4dbd9faf 5261
721ea635
L
52622010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5263
5264 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5265 * testsuite/plugin_common_test_2.c (foo): Likewise.
5266
6bf924b0
DK
52672010-04-08 Doug Kwan <dougkwan@google.com>
5268
5269 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5270 Output_merge_data.
5271 * output.cc (Output_section::add_merge_input_section): Simplify
5272 code and return status of Output_merge_base::add_input_section.
e1df38aa 5273 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5274 returns true.
5275
24af6f92
DK
52762010-04-07 Doug Kwan <dougkwan@google.com>
5277
5278 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5279 if section is marked as containing instructions but has no mapping
5280 symbols.
5281 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5282 correct section index.
5283 (Arm_relobj::find_linked_text_section): Ditto.
5284
00698fc5
CC
52852010-04-07 Cary Coutant <ccoutant@google.com>
5286
5287 * archive.cc (include_member): Destroy Read_symbols_data object before
5288 releasing file.
5289 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5290 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5291 (Read_symbols_data::~Read_symbols_data) New destructor.
5292 (Section_relocs::Section_relocs) New constructor.
5293 (Section_relocs::~Section_relocs) New destructor.
5294 (Read_relocs_data::Read_relocs_data) New constructor.
5295 (Read_relocs_data::~Read_relocs_data) New destructor.
5296 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5297 pointers to NULL after deleting.
5298
7296d933
DK
52992010-04-07 Doug Kwan <dougkwan@google.com>
5300
5301 * arm.cc: Replace "endianity" with "endianness" in comments.
5302 (Arm_exidx_cantunwind): Ditto.
5303 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5304 (Arm_relobj::merge_flags_and_attributes): New method.
5305 (Arm_relobj::merge_flags_and_attributes_): New data member.
5306 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5307 (Arm_relobj::scan_sections_for_stubs): Ditto.
5308 (Arm_relobj::do_read_symbols): Check to see if we really want to
5309 merge processor-specific flags and attributes. Exit early if
5310 an object is empty except for section names and the undefined symbol.
5311 (Target_arm::do_finalize_sections): Move check for ELF format to
5312 Arm_relobj::do_read_symbols. Merge processor specific flags and
5313 attributes from a regular object only when we have determined that
5314 it is aapropriate. Do not create an .ARM.attributes section in
5315 output if there is no regular input object.
5316 (Target_arm::merge_processor_specific_flags): Check
5317 --warn-mismatch before printing any error.
5318 (Target_arm::merge_object_attributes): Ditto.
5319 * gold.cc (queue_middle_tasks): Handle the case in which there is
5320 no regular object in input.
5321 * options.cc (General_options::parse_EB): New method.
5322 (General_options::parse_EL): Same.
5323 (General_options::General_options): Initialize endianness_.
5324 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5325 New options.
5326 (General_options::Endianness): New enum.
5327 (General_options::endianness): New method.
5328 (General_options::endianness_): New data member.
5329 * parameters.cc (Parameters::set_options): Check target endianness.
5330 (Parameters::set_target_once): Ditto.
5331 (Parameters::check_target_endianness): New method.
5332 (parameters_force_valid_target): If either -EL or -EB is specified,
5333 use it to define endianness of default target.
5334 * parameters.h (Parameters::check_target_endianness): New method
5335 declaration.
5336 * target.h (class Target): Change "endianity" to "endianness"
5337 in comments.
5338
efc8d4f2
RW
53392010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5340
5341 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5342 * configure: Regenerate.
5343 * Makefile.in: Regenerate.
5344 * testsuite/Makefile.in: Regenerate.
5345
be234d88
CC
53462010-04-06 Cary Coutant <ccoutant@google.com>
5347
5348 gcc PR lto/42757
5349 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5350 prevailing definitions of common symbols.
5351 * testsuite/plugin_test_6.sh: New test case.
5352 * testsuite/plugin_common_test_1.c: New test case.
5353 * testsuite/plugin_common_test_2.c: New test case.
5354 * testsuite/Makefile.am (plugin_test_6): New test case.
5355 * testsuite/Makefile.in: Regenerate.
5356
bd32c6bd
NC
53572010-04-06 Nick Clifton <nickc@redhat.com>
5358
5359 * po/vi.po: New Vietnamese translation.
5360
323c532f
DK
53612010-03-30 Doug Kwan <dougkwan@google.com>
5362
5363 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5364
4fcd97eb
DK
53652010-03-25 Doug Kwan <dougkwan@google.com>
5366
5367 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5368 to avoid a conversion warning on a 32-bit host.
5369
4ebf39db
ILT
53702010-03-24 Ian Lance Taylor <iant@google.com>
5371
5372 * testsuite/script_test_3.t: Add a TLS segment.
5373 * testsuite/Makefile.am (check_PROGRAMS): Add
5374 tls_phdrs_script_test.
5375 (tls_phdrs_script_test_SOURCES): Define.
5376 (tls_phdrs_script_test_DEPENDENCIES): Define.
5377 (tls_phdrs_script_test_LDFLAGS): Define.
5378 (tls_phdrs_script_test_LDADD): Define.
5379 * testsuite/Makefile.in: Rebuild.
5380
4a599bdd
CC
53812010-03-23 Cary Coutant <ccoutant@google.com>
5382
5383 * fileread.cc (find_or_make_view): Fix comment.
5384
6c93b22c
ILT
53852010-03-23 Ian Lance Taylor <iant@google.com>
5386
5387 * script-sections.cc (class Orphan_section_placement): Define
5388 PLACE_TLS and PLACE_TLS_BSS.
5389 (Orphan_section_placement::Orphan_section_placement): Initialize
5390 new places.
5391 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5392 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5393 (tls_script_test_SOURCES): Define.
5394 (tls_script_test_DEPENDENCIES): Define.
5395 (tls_script_test_LDFLAGS): Define.
5396 (tls_script_test_LDADD): Define.
5397 * testsuite/Makefile.in: Rebuild.
5398
a2c7281b
DK
53992010-03-22 Doug Kwan <dougkwan@google.com>
5400
5401 * arm.cc (Arm_relocate_functions::abs8,
5402 Arm_relocate_functions::abs16): Use correct check for overflow
5403 specified in the ARM ELF specs.
5404 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5405 target of a BLX instruction specially.
5406 (Reloc_stub::stub_type_for_reloc): Ditto.
5407 (Relocate::relocate): Use symbolic names instead of numeric relocation
5408 codes to report error.
5409 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5410 workaround.
5411 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5412 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5413 thumb2_blx_out_of_range.stdout
5414 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5415 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5416 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5417 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5418 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5419 thumb2_blx_in_range, thumb2_blx_in_range.o,
5420 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5421 thumb2_blx_out_of_range.o): New rules.
5422 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5423 thumb2_blx_in_range and thumb2_blx_out_of_range.
5424 * testsuite/Makefile.in: Regenerate.
5425 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5426 * testsuite/thumb_blx_in_range.s: New file.
5427 * testsuite/thumb_blx_out_of_range.s: New file.
5428
b0193076
RÁE
54292010-03-22 Rafael Espindola <espindola@google.com>
5430
5431 * archive.cc (Should_include): Move to archive.h.
5432 (should_include_member): Make it a member of Archive.
5433 (Lib_group): New.
5434 (Add_lib_group_symbols): New.
5435 * archive.h: Include options.h.
5436 (Archive_member): Moved from Archive.
5437 (Should_include): Moved from archive.cc.
5438 (Lib_group): New.
5439 (Add_lib_group_symbols): New.
5440 * dynobj.cc (do_should_include_member): New.
5441 * dynobj.h (do_should_include_member): New.
5442 * gold.cc (queue_initial_tasks): Update call to queue.
5443 * main.cc (main): Print lib group stats.
5444 * object.cc (do_should_include_member): New.
5445 * object.h: Include archive.h.
5446 (Object::should_include_member): New.
5447 (Object::do_should_include_member): New.
5448 (Sized_relobj::do_should_include_member): New.
5449 * options.cc (General_options::parse_start_lib): New.
5450 (General_options::parse_end_lib): New.
5451 (Input_arguments::add_file): Handle lib groups.
5452 (Input_arguments::start_group): Check we are not in a lib.
5453 (Input_arguments::start_lib): New.
5454 (Input_arguments::end_lib): New.
5455 * options.h (General_options): Add start_lib and end_lib.
5456 (Input_argument::lib_): New.
5457 (Input_argument::lib): New.
5458 (Input_argument::is_lib): New.
5459 (Input_file_lib): New.
5460 (Input_arguments::in_lib_): New.
5461 (Input_arguments::in_lib): New.
5462 (Input_arguments::start_lib): New.
5463 (Input_arguments::end_lib_): New.
5464 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5465 in unused members as preempted.
5466 (Sized_pluginobj::do_should_include_member): New.
5467 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5468 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5469 return the blocker.
5470 (Read_symbols::do_whole_lib_group): New.
5471 (Read_symbols::do_lib_group): New.
5472 (Read_symbols::do_read_symbols): Handle lib groups.
5473 (Read_symbols::get_name): Handle lib groups.
5474 * readsyms.h (Read_symbols): Add an archive member pointer.
5475 (Read_symbols::do_whole_lib_group): New.
5476 (Read_symbols::do_lib_group): New.
5477 (Read_symbols::member_): New.
5478 * script.cc (read_input_script): Update call to queue_soon.
5479
d099120c
DK
54802010-03-19 Doug Kwan <dougkwan@google.com>
5481
5482 * arm.cc (Stub_table::Stub_table): Initialize new data members
5483 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5484 (Stub_table::add_reloc_stub): Assign stub offset and update
5485 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5486 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5487 New data members.
5488 (Stub_table::update_data_size_and_addralign): Use
5489 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5490 instead of going over all reloc stubs.
5491 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5492 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5493 Stringpool_template::offset_ to size of Stringpool_char.
5494 (Stringpool_template::new_key_offset): Remove code to initialize
5495 Stringpool_template::offset_.
5496 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5497 Stringpool_template::offset_ to zero.
5498
1aa37384
DK
54992010-03-15 Doug Kwan <dougkwan@google.com>
5500
5501 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5502 offset_.
5503 (Stringpool_template::new_key_offset): New method.
5504 (Stringpool_template::add_string): Assign offsets when adding new
5505 strings.
5506 (Stringpool_template::set_string_offsets): Do not set string offsets
5507 when not optimizing.
5508 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5509 member size_.
5510 (Chunked_vector::clear): Clear size_.
5511 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5512 (Chunked_vector::size): Return size_.
5513 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5514 (Chunked_vector::size_): New data member.
1aa37384
DK
5515 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5516 (Stringpool_template::new_key_offset): New method declaration.
5517 (Stringpool_template::offset_): New data member.
5518
b672b057
RÁE
55192010-03-15 Rafael Espindola <espindola@google.com>
5520
5521 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5522 Add_symbols' constructor.
5523 * readsyms.h (Add_symbols): Remove the input_group member.
5524
b6848d3c
ILT
55252010-03-10 Ian Lance Taylor <iant@google.com>
5526
5527 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5528 target to ask whether a reference to a symbol requires a stack
5529 split.
5530 * target.h (Target::is_call_to_non_split): New function.
5531 (Target::do_is_call_to_non_split): Declare virtual function.
5532 * target.cc: Include "symtab.h".
5533 (Target::do_is_call_to_non_split): New function.
5534 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5535
a2a5469e
CC
55362010-03-10 Cary Coutant <ccoutant@google.com>
5537
5538 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5539 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5540 (File_read::open[2]): Add whole_file_view_ to list of views.
5541 (File_read::make_view): Remove test of whole_file_view_.
5542 (File_read::find_or_make_view): Create whole_file_view_ if
5543 necessary.
5544 (File_read::clear_views): Replace bool parameter with enum;
5545 adjust all callers. Don't delete views with permanent data;
5546 do delete cached views and views from archives if
5547 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5548 if clearing the corresponding view.
5549 * fileread.h (File_read::Clear_views_mode): New enum.
5550 (File_read::View::is_permanent_view): New method.
5551 (File_read::clear_views): Replace bool parameter
5552 with enum; adjust all callers.
5553 * options.h (General_options): Change keep_files_mapped option;
5554 add map_whole_files.
5555 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5556 releasing the file.
5557 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5558 the file.
5559
8861f32b
DM
55602010-03-10 David S. Miller <davem@davemloft.net>
5561
5562 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5563
d62d0f5f
ST
55642010-03-09 Sriraman Tallam <tmsriram@google.com>
5565
5566 * icf.cc (get_section_contents): Add '@' marker after processing the
5567 merge reloc.
5568
9177756d
DK
55692010-03-08 Doug Kwan <dougkwan@google.com>
5570
5571 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5572 due to a conversion warning.
5573 (Arm_relobj::update_output_local_symbol_count): Check for local
5574 symbol with unset output index.
5575
9e9e071b
ILT
55762010-03-05 Ian Lance Taylor <iant@google.com>
5577
5578 * options.h (class General_options): Add --spare-dynamic-tags.
5579 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5580 --spare-dynamic-tags.
5581
a81ee015
ILT
55822010-03-05 Ian Lance Taylor <iant@google.com>
5583
5584 * incremental.cc: Include "libiberty.h".
5585
44ec90b9
RO
55862010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5587
5588 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5589 function, is_info_ member.
5590 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5591 (Versions::Versions): Update caller.
5592 (Versions::define_base_version): Likewise.
5593 (Versions::add_def): Likewise.
5594
0897ed3b
ST
55952010-03-03 Sriraman Tallam <tmsriram@google.com>
5596
5597 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5598 (Scan::possible_function_pointer_reloc): New function.
5599 (Scan::local_reloc_may_be_function_pointer): Change to call
5600 possible_function_pointer_reloc.
5601 (Scan::global_reloc_may_be_function_pointer): Ditto.
5602 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5603 relocations in ".data.rel.ro._ZTV" section.
5604 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5605 * testsuite/icf_safe_so_test.cc: Ditto.
5606 * testsuite/icf_safe_test.cc: Ditto.
5607 * testsuite/icf_safe_test.sh: Ditto.
5608
d3bbad62
ILT
56092010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5610 Ian Lance Taylor <iant@google.com>
5611
5612 * target-reloc.h (relocate_section): Check the symbol table index
5613 for -1U before setting the local symbol index.
5614 (scan_relocatable_relocs): If copying the relocation, record that
5615 the local symbol is required.
5616 * object.h (Symbol_value::is_output_symtab_index_set): New
5617 function.
5618 (Symbol_value::may_be_discarded_from_output_symtab): New
5619 function.
5620 (Symbol_value::has_output_symtab_entry): New function.
5621 (Symbol_value::needs_output_symtab_entry): Remove.
5622 (Symbol_value::output_symtab_index): Make sure the symbol index is
5623 set.
5624 (Symbol_value::set_output_symtab_index): Make sure the symbol
5625 index is not set. Make sure the new index is valid.
5626 (Symbol_value::set_must_have_output_symtab_entry): New function.
5627 (Symbol_value::has_output_dynsym_entry): New function.
5628 (Symbol_value::set_output_dynsym_index): Make sure the new index
5629 is valid.
5630 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5631 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5632 local symbol if permitted.
5633 (Sized_relobj::do_finalize_local_symbols): Call
5634 is_output_symtab_index_set rather than needs_output_symtab_entry.
5635 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5636 rather than needs_output_symtab_entry. Call
5637 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5638 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5639 is_output_symtab_index_set rather than needs_output_symtab_entry.
5640 * testsuite/discard_locals_relocatable_test.c: New file.
5641 * testsuite/discard_locals_test.sh: Test -r.
5642 * testsuite/Makefile.am (check_DATA): Add
5643 discard_locals_relocatable_test1.syms,
5644 discard_local_relocatable_test2.syms.
5645 (MOSTLYCLEANFILES): Likewise. Also add
5646 discard_locals_relocatable_test1.lout and
5647 discard_locals_relocatable_test2.out.
5648 (discard_locals_relocatable_test1.syms): New target.
5649 (discard_locals_relocatable_test.o): New target.
5650 (discard_locals_relocatable_test1.out): New target.
5651 (discard_locals_relocatable_test2.syms): New target.
5652 (discard_locals_relocatable_test2.out): New target.
5653 (various): Add missing ../ld-new dependencies.
5654 * testsuite/Makefile.in: Rebuild.
5655
7e8ccf26
NC
56562010-03-03 Nick Clifton <nickc@redhat.com>
5657
5658 * po/fi.po: New Finnish translation.
5659
2a0ff005
DK
56602010-03-01 Doug Kwan <dougkwan@google.com>
5661
5662 * layout.cc (Layout::Layout): Force section types of .init_array*,
5663 .preinit_array* and .fini_array* sections.
5664 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5665 Fix check of return value of std::string::find.().
5666 (Output_section::Input_section_sort_compare::operator()): Remove
5667 comment about .init_array.
5668 (Output_section::Input_section_sort_init_fini_compare::operator()):
5669 New method.
5670 (Output_section::sort_attached_input_sections): Handle .init_array
5671 and .fini_array specially.
5672 * output.h (Output_section::Inut_section_sort_compare): Update
5673 comment.
5674 (Output_section::Input_section_sort_init_fini_compare): New struct.
5675
c3e4ae29
DK
56762010-02-26 Doug Kwan <dougkwan@google.com>
5677
5678 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5679 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5680 * testsuite/debug_msg.sh: Avoid matching source line number for
5681 use of global variable undef_int.
5682
2fd9ae7a
DK
56832010-02-26 Doug Kwan <dougkwan@google.com>
5684
5685 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5686 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5687 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5688 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5689 * options.cc (General_options::General_options): Initialize member
5690 fix_v4bx_.
5691 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5692 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5693 and rm_no_fix_v4bx.stdout
5694 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5695 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5696 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5697 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5698 and arm_no_fix_v4bx.
5699 * Makefile.in: Regenerate.
5700 * testsuite/arm_fix_v4bx.s: New file.
5701 * testsuite/arm_fix_v4bx.sh: Ditto.
5702
67ec7d0b
DK
57032010-02-24 Doug Kwan <dougkwan@google.com>
5704
5705 * arm.cc (Target_arm::got_section): Make the .got section the first
5706 non RELRO section in the data segment.
5707 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5708 suffixes of section names.
5709
10165461
DK
57102010-02-24 Doug Kwan <dougkwan@google.com>
5711
5712 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5713 flags and attributes merging if an input file is a binary file.
5714 * fileread.cc (Input_file::open): Record format of original file.
5715 * fileread.h (Input_file::Format): New enum type.
5716 (Input_file::Input_file): Initialize data member format_.
5717 (Input_file::format): New method definition.
5718 (Input_file::format_):: New data member.
5719
4a54abbb
DK
57202010-02-24 Doug Kwan <dougkwan@google.com>
5721
5722 * arm.cc (Arm_output_data_got): New class.
5723 (ARM_TCB_SIZE): New constant
5724 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5725 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5726 If user uses a script with a SECTIONS clause, issue only a warning
5727 for a misplaced EXIDX input section. Otherwise, issue an error.
5728 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5729 garbage collection.
5730 (Target_arm::got_mode_index_entry): Handle static linking.
5731 (Target_arm::Scan::local): Ditto.
5732 (Target_arm::Scan::global): Ditto.
5733 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5734 all incorrectly implemented relocations.
e1df38aa 5735 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5736 Arm_output_section::fix_exidx_coverage.
5737 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5738 from ".ARM.exidx." and ".ARM.extab.".
5739
ca419a6f
ILT
57402010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5741
5742 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5743 section if it does not already exist.
5744 * attributes.cc (Attributes_section_data::Attributes_section_data):
5745 Don't crash if size is zero.
5746
135b9c78
ILT
57472010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5748 Ian Lance Taylor <iant@google.com>
5749
5750 * gold.cc (queue_middle_tasks): If no input files were opened,
5751 exit.
5752 * workqueue.h (Task_function::Task_function): Assert that there is
5753 a blocker.
5754
bb0bfe4f
DK
57552010-02-22 Doug Kwan <dougkwan@google.com>
5756
5757 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5758 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5759 types to avoid warnings due to different uint64_t implementations
5760 on different hosts.
5761
2a2b6d42
DK
57622010-02-21 Doug Kwan <dougkwan@google.com>
5763
5764 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5765 handling of the maximum backward branch offset.
5766 (Arm_relocate_functions::thumb_branch_common): Ditto.
5767 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5768 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5769 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5770 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5771 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5772 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5773 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5774 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5775 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5776 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5777 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5778 thumb2_bl_out_of_range.o): New rules.
5779 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5780 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5781 thumb2_bl_out_of_range
5782 * testsuite/Makefile.in: Regenerate.
5783 * testsuite/arm_bl_in_range.s: New file.
5784 * testsuite/arm_bl_out_of_range.s: Ditto.
5785 * testsuite/arm_branch_in_range.sh: Ditto.
5786 * testsuite/arm_branch_range.t: Ditto.
5787 * testsuite/thumb2_branch_range.t: Ditto.
5788 * testsuite/thumb_bl_in_range.s: Ditto.
5789 * testsuite/thumb_bl_out_of_range.s: Ditto.
5790 * testsuite/thumb_branch_range.t: Ditto.
5791
b487ad64
ST
57922010-02-20 Sriraman Tallam <tmsriram@google.com>
5793
5794 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5795 Add reloc offset information.
5796 * icf.cc (get_section_contents): Change iterators to point to the new
5797 vectors. Add reloc offset information to the contents.
5798 * icf.h (Icf::Sections_reachable_info): New typedef.
5799 (Icf::Sections_reachable_list): New typedef.
5800 (Icf::Offset_info): New typedef.
5801 (Icf::Reloc_info): New struct typedef.
5802 (Icf::Reloc_info_list): New typedef.
5803 (Icf::symbol_reloc_list): Delete method.
5804 (Icf::addend_reloc_list): Delete method.
5805 (Icf::section_reloc_list): Delete method.
5806 (Icf::reloc_info_list): New method.
5807 (Icf::reloc_info_list_): New member.
5808
f96accdf
DK
58092010-02-19 Doug Kwan <dougkwan@google.com>
5810
5811 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5812 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5813 * arm.cc (Arm_relocation_functions): New forward declaration.
5814 (Target_arm::Target_arm): Initialize new data members
5815 got_mod_index_offset_ and tls_base_symbol_defined_.
5816 (Target_arm::Relocate::relocate_tls): New method.
5817 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5818 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5819 New methods.
5820 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5821 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5822 (Target_arm::got_mod_index_offset_,
5823 Target_arm::tls_base_symbol_defined_): New data members.
5824 (Target_arm::Scan::local, Target::Scan::global,
5825 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5826 relocations.
5827
c8761b9a
DK
58282010-02-18 Doug Kwan <dougkwan@google.com>
5829
5830 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5831 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5832 text section as a parameter becuase some broken tools may not set
5833 the link in section header.
5834 (Target_arm::has_got_section): New method.
5835 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5836 without any mapping symbol as data only. Remove warning.
5837 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5838 link in its section header, try to discover the link by inspecting the
5839 REL31 relocation at the beginning of the section.
5840 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5841 in error message.
5842 (Target_arm::Scan::global): Treat any reference to the symbol
5843 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5844
21bb3914
ST
58452010-02-12 Sriraman Tallam <tmsriram@google.com>
5846
5847 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5848 (Scan::global_reloc_may_be_function_pointer): New function.
5849 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5850 (Scan::global_reloc_may_be_function_pointer): New function.
5851 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5852 (Scan::global_reloc_may_be_function_pointer): New function.
5853 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5854 (Scan::global_reloc_may_be_function_pointer): New function.
5855 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5856 (Scan::global_reloc_may_be_function_pointer): New function.
5857 (Scan::possible_function_pointer_reloc): New function.
5858 (Target_x86_64::can_check_for_function_pointers): New function.
5859 * gc.h (gc_process_relocs): Scan relocation types to determine if
5860 function pointers were taken for targets that support it.
5861 * icf.cc (Icf::find_identical_sections): Include functions for
5862 folding in safe ICF whose pointer is not taken.
5863 * icf.h (Secn_fptr_taken_set): New typedef.
5864 (fptr_section_id_): New member.
5865 (section_has_function_pointers): New function.
5866 (set_section_has_function_pointers): New function.
5867 (check_section_for_function_pointers): New function.
5868 * options.h: Fix comment for safe ICF option.
5869 * target.h (can_check_for_function_pointers): New function.
5870 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5871 Modify icf_safe_test for X86-64.
5872 * testsuite/Makefile.in: Regenerate.
5873 * testsuite/icf_safe_so_test.cc: New file.
5874 * testsuite/icf_safe_so_test.sh: New file.
5875 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5876 (main): Change to take pointer to function kept_func_3.
5877 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5878 folding is done correctly for X86-64.
5879
0da6fa6c
DM
58802010-02-12 David S. Miller <davem@davemloft.net>
5881
5882 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5883 is_symbolless parameter.
5884 (Output_reloc<SHT_REL>::is_symbolless): New.
5885 (Output_reloc<SHT_REL>::is_symbolless_): New.
5886 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5887 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5888 (Output_reloc<SHT_RELA>::is_symbolless): New.
5889 (Output_data_reloc::add_global): Handle is_symbolless.
5890 (Output_data_reloc::add_global_relative): Likewise.
5891 (Output_data_reloc::add_local): Likewise.
5892 (Output_data_reloc::add_local_relative): Likewise.
5893 (Output_data_reloc::add_symbolless_global_addend): New.
5894 (Output_data_reloc::add_symbolless_local_addend): New.
5895 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5896 is_symbolless.
5897 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5898 instead of ->is_relative_
5899 (Output_reloc::write): Likewise.
5900 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5901 (Output_reloc::write_rel): Simplify.
5902
5903 * sparc.cc (Target_sparc::Scan::local): Use
5904 ->add_symbolless_local_addend as needed.
5905 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5906 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5907 based upon relocation offset.
5908
e4782e83
DK
59092010-02-11 Doug Kwan <dougkwan@google.com>
5910
5911 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5912 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5913 beginning of function.
5914 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5915 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5916 parameter is_32bit in calls to should_apply_static_reloc.
5917 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5918 (check_DATA): Add arm_abs_global.stdout.
5919 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5920 arm_abs_global.stdout): New rules.
5921 (MOSTLLYCLEANFILES): Add arm_abs_global
5922 * Makefile.in: Regenerate.
5923 * testsuite/arm_abs_global.s: New file.
5924 * testsuite/arm_abs_global.sh: Ditto.
5925 * testsuite/arm_abs_lib.s: Ditto.
5926
93ceb764
ILT
59272010-02-11 Ian Lance Taylor <iant@google.com>
5928
5929 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5930 Read_relocs task.
5931 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5932 Allocate_commons_task first.
5933 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5934 task, rather than symtab_lock_.
5935 (Gc_process_relocs::~Gc_process_relocs): New function.
5936 (Gc_process_relocs::is_runnable): Check this_blocker_.
5937 (Gc_process_relocs::locks): Use next_blocker_ rather than
5938 blocker_.
5939 (Scan_relocs::~Scan_relocs): New function.
5940 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5941 symtab_lock_.
5942 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5943 next_blocker_.
5944 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5945 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5946 constructor accordingly.
5947 (class Gc_process_relocs): Likewise.
5948 (class Scan_relocs): Likewise.
5949 * common.h (class Allocate_commons_task): Remove symtab_lock_
5950 field, and corresponding constructor parameter.
5951 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5952 symtab_lock_.
5953 (Allocate_commons_task::locks): Likewise.
5954
114dfbe1
ILT
59552010-02-11 Ian Lance Taylor <iant@google.com>
5956
5957 * gold-threads.h (class Once): Define.
5958 (class Initialize_lock): Rewrite as child of Once.
5959 * gold-threads.cc (class Once_initialize): Define.
5960 (once_pointer_control): New static variable.
5961 (once_pointer, once_arg): New static variables.
5962 (c_run_once): New static function.
5963 (Once::Once, Once::run_once, Once::internal_run): New functions.
5964 (class Initialize_lock_once): Remove.
5965 (initialize_lock_control): Remove.
5966 (initialize_lock_pointer): Remove.
5967 (initialize_lock_once): Remove.
5968 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5969 (Initialize_lock::initialize): Rewrite.
5970 (Initialize_lock::do_run_once): New function.
5971 * archive.cc (Archive::interpret_header): Only clear name if it is
5972 not already empty.
5973 * fileread.cc: Include "gold-threads.h"
5974 (file_counts_lock): New static variable.
5975 (file_counts_initialize_lock): Likewise.
5976 (File_read::release): Only increment counts when using --stats.
5977 Use a lock around the increment.
5978 * parameters.cc (class Set_parameters_target_once): Define.
5979 (set_parameters_target_once): New static variable.
5980 (Parameters::Parameters): Move here from parameters.h.
5981 (Parameters::set_target): Rewrite.
5982 (Parameters::set_target_once): New function.
5983 (Parameters::clear_target): Move here and rewrite.
5984 * parameters.h (class Parameters): Update declarations. Add
5985 set_parameters_target_once_ field.
5986 (Parameters::Parameters): Move to parameters.cc.
5987 (Parameters::clear_target): Likewise.
5988 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5989 task.
5990 (Start_group::~Start_group): New function.
5991 (Start_group::is_runnable): New function.
5992 (Start_group::locks, Start_group::run): New functions.
5993 (Finish_group::run): Change saw_undefined to size_t.
5994 * readsyms.h (class Start_group): Define.
5995 (class Finish_group): Change saw_undefined_ field to size_t.
5996 (Finish_group::Finish_group): Remove saw_undefined and
5997 this_blocker parameters. Change all callers.
5998 (Finish_group::set_saw_undefined): New function.
5999 (Finish_group::set_blocker): New function.
6000 * symtab.h (class Symbol_table): Change saw_undefined to return
6001 size_t. Change saw_undefined_ field to size_t.
6002 * target-select.cc (Set_target_once::do_run_once): New function.
6003 (Target_selector::Target_selector): Initialize set_target_once_
6004 field. Don't initialize lock_ and initialize_lock_ fields.
6005 (Target_selector::instantiate_target): Rewrite.
6006 (Target_selector::set_target): New function.
6007 * target-select.h (class Set_target_once): Define.
6008 (class Target_selector): Update declarations. Make
6009 Set_target_once a friend. Remove lock_ and initialize_lock_
6010 fields. Add set_target_once_ field.
6011
fa17a3f4
ILT
60122010-02-10 Ian Lance Taylor <iant@google.com>
6013
6014 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6015 queueing any tasks.
6016 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6017 (queue_middle_tasks): Add all blockers before queueing any tasks.
6018 (queue_final_tasks): Likewise.
6019 * token.h (Task_token::add_blockers): New function.
6020 * object.h (Input_objects::number_of_relobjs): New function.
6021
c7177d31
ILT
60222010-02-10 Ian Lance Taylor <iant@google.com>
6023
5de0e392
ILT
6024 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6025 shared, not if not position independent.
6026 * x86_64.cc (Relocate::relocate_tls): Likewise.
6027 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6028 (tls_pie_pic_test): New target.
6029 * testsuite/Makefile.in: Rebuild.
6030
c7177d31
ILT
6031 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6032 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6033 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6034 * testsuite/Makefile.in: Rebuild.
6035
684b268a
DM
60362010-02-09 David S. Miller <davem@davemloft.net>
6037
6038 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6039 R_SPARC_RELATIVE using ->add_local_relative().
6040 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6041
612a8d3d
DM
6042 * output.h (Output_data_dynamic::add_section_size): New method
6043 that takes two Output_data objects.
6044 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6045 entry param. Handle it in initializers.
6046 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6047 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6048 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6049 arg.
6050 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6051 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6052 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6053 for dynrel_includes_plt.
6054 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6055 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6056 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6057 before .rela.plt
6058 (Target_sparc::do_finalize_sections): Update to pass true for
6059 dynrel_includes_plt.
6060 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6061 output before .rela.plt
6062 (Target_powerpc::do_finalize_sections): Update to pass true for
6063 dynrel_includes_plt when 32-bit.
6064
cb1be87e
DK
60652010-02-08 Doug Kwan <dougkwan@google.com>
6066
6067 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6068 method.
6069 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6070 Arm_relobj::scan_section_for_cortex_a8_stubs,
6071 Arm_relobj::do_relocation_section): Instead of calling
6072 Output_section::output_address, use faster
6073 Arm_relobj::simple_input_section_output_address.
6074
705b5121
DM
60752010-02-08 David S. Miller <davem@davemloft.net>
6076
6077 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6078 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6079 relocation helper function.
6080
024c4466
DM
6081 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6082 just like R_SPARC_GOT{10,13,22}.
6083 (Target_sparc::Scan::local): Likewise.
6084 (Target_sparc::Relocate:relocate): Likewise.
6085
9109c078
ILT
60862010-02-06 Ian Lance Taylor <iant@google.com>
6087
6088 * configure.ac: Rewrite targetobjs duplicate removal code to use
6089 only shell constructs.
6090 * configure: Rebuild.
6091
cf846138
DK
60922010-02-05 Doug Kwan <dougkwan@google.com>
6093
6094 PR 11247
6095 * arm.cc (Arm_relobj::section_is_scannable): New method.
6096 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6097 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6098
6cfaf60b
DK
60992010-02-04 Doug Kwan <dougkwan@google.com>
6100
6101 PR 11247
6102 * arm-reloc-property.cc (cstdio): Include.
6103 * configure.ac (targetobjs): Remove duplicates.
6104 * configure: Regenerate.
6105 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6106 big and little endian version for a given address size.
6107
5c57f1be
DK
61082010-02-03 Doug Kwan <dougkwan@google.com>
6109
6110 * arm-reloc-property.cc
6111 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6112 definition.
6113 * arm-reloc-property.h
6114 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6115 New method definition.
6116 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6117 declaration.
6118 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6119 overflow to N.
6120 (GOT_PREL): Change implemented to Y.
6121 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6122 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6123 (Arm_relocate_functions::movw_abs_nc): Remove method.
6124 (Arm_relocate_functions::movt_abs): Ditto.
6125 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6126 (Arm_relocate_functions::thm_movt_abs): Ditto.
6127 (Arm_relocate_functions::movw_rel_nc): Ditto.
6128 (Arm_relocate_functions::movw_rel): Ditto.
6129 (Arm_relocate_functions::movt_rel): Ditto.
6130 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6131 (Arm_relocate_functions:thm_movw_rel): Ditto.
6132 (Arm_relocate_functions:thm_movt_rel): Ditto.
6133 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6134 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6135 New method definitions.
6136 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6137 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6138 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6139 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6140 (Target_arm::Relocate::relocate): Check for non-static or
6141 unimplemented relocation code and exit early. Change calls to
6142 Target_arm::reloc_uses_thumb_bit and
6143 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6144 instead. Refactor code to handle similar relocations to increase
6145 code sharing. Remove check for unsupported relocation code in switch
6146 statement.
6147 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6148 relocation property table to find out size. Change error message to
6149 print out the name of a relocation code instead of the numeric value.
6150 (Target_arm::scan_reloc_for_stub): Use relocation property table
6151 instead of calling Target_arm::reloc_uses_thumb_bit().
6152
218c5831
DK
61532010-02-02 Doug Kwan <dougkwan@google.com>
6154
6155 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6156 types of relaxed input section.
6157
0d31c79d
DK
61582010-02-02 Doug Kwan <dougkwan@google.com>
6159
6160 * Makefile.am (HFILES): Add arm-reloc-property.h.
6161 (DEFFILES): New.
6162 (TARGETSOURCES): Add arm-reloc-property.cc
6163 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6164 (libgold_a_SOURCES): $(DEFFILES)
6165 * Makefile.in: Regenerate.
6166 * arm-reloc-property.cc: New file.
6167 * arm-reloc-property.h: New file.
6168 * arm-reloc.def: New file.
6169 * arm.cc: Update comments.
6170 (arm-reloc-property.h): New included header.
6171 (arm_reloc_property_table): New global variable.
6172 (Target_arm::do_select_as_default_target): New method definition.
6173 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6174 arm-reloc-property to targ_extra_obj.
6175 * parameters.cc (set_parameters_target): Call
6176 Target::select_as_default_target().
6177 * target.h (Target::select_as_default_target): New method definition.
6178 (Target::do_select_as_default_target): Same.
6179
546c7457
DK
61802010-02-01 Doug Kwan <dougkwan@google.com>
6181
6182 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6183 first_output_text_section_.
6184 (Arm_exidx_fixup::first_output_text_section): New method definition.
6185 (Arm_exidx_fixup::first_output_text_section_): New data member.
6186 (Arm_exidx_fixup::process_exidx_section): Record the first text
6187 output section seen.
6188 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6189 and entsize in output section header.
6190
11b861d5
DK
61912010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6192
6193 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6194 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6195 (Arm_relocate_functions::thm_alu11): New Method.
6196 (Arm_relocate_functions::thm_pc8): New Method.
6197 (Arm_relocate_functions::thm_pc12): New Method.
6198 (Target_arm::Scan::local): Handle the relocations.
6199 (Target_arm::Scan::global): Likewise.
6200 (Target_arm::Relocate::relocate): Likewise.
6201 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6202
c9a2c125
DK
62032010-01-29 Doug Kwan <dougkwan@google.com>
6204
6205 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6206 of relocation types as ld.
6207
1521477a
DK
62082010-01-29 Doug Kwan <dougkwan@google.com>
6209
6210 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6211 to public.
6212 (Arm_relocate_functions::thumb_branch_common): Ditto.
6213 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6214 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6215 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6216 Arm_relocate_functions::jump24): Remove.
6217 (Target_arm::Relocate::relocate): Adjust code to call
6218 Arm_relocation_functions::arm_branch_common and
6219 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6220 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6221
e7eca48c
DK
62222010-01-29 Doug Kwan <dougkwan@google.com>
6223
6224 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6225 output_local_symbol_count_needs_update_.
6226 (Arm_relobj::output_local_symbol_count_needs_update,
6227 Arm_relobj::set_output_local_symbol_count_needs_update,
6228 Arm_relobj::update_output_local_symbol_count): New methods.
6229 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6230 member.
6231 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6232 of pointed function as in a R_ARM_PREL31 relocation.
6233 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6234 for output local symbol count updating.
6235 (Target_arm::do_relax): Update output local symbol counts in objects
6236 if necessary.
6237 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6238
02961d7e
ILT
62392010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6240
6241 * arm.cc: Added support for the ARM relocations:
6242 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6243 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6244 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6245 movw_prel_nc).
6246 (Arm_relocate_functions::movw_rel): New method.
6247 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6248 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6249 thm_movw_prel_nc).
6250 (Arm_relocate_functions::thm_movw_rel): New method.
6251 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6252 thm_movt_prel).
6253 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6254 relocations.
6255 (Target_arm::Scan::global): Likewise.
6256 (Target_arm::Relocate::relocate): Likewise.
6257 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6258 Likewise.
6259
b10d2873
ILT
62602010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6261
6262 * arm.cc: Added support for ARM group relocations.
6263 (Target_arm::reloc_needs_sym_origin): New method.
6264 (Arm_relocate_functions::calc_grp_kn): New method.
6265 (Arm_relocate_functions::calc_grp_residual): New method.
6266 (Arm_relocate_functions::calc_grp_gn): New method.
6267 (Arm_relocate_functions::arm_grp_alu): New Method.
6268 (Arm_relocate_functions::arm_grp_ldr): New Method.
6269 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6270 (Arm_relocate_functions::arm_grp_ldc): New Method.
6271 (Target_arm::Scan::local): Handle the ARM group relocations.
6272 (Target_arm::Scan::global): Likewise.
6273 (Target_arm::Relocate::relocate): Likewise.
6274 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6275 Likewise.
6276
2b328d4e
DK
62772010-01-26 Doug Kwan <dougkwan@google.com>
6278
6279 * arm.cc (set): Include.
6280 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6281 pointer type.
6282 (Arm_output_section::Text_section_list): New type.
6283 (Arm_output_section::append_text_sections_to_list): New method.
6284 (Arm_output_section::fix_exidx_coverage): Ditto.
6285 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6286 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6287 Relobj::set_section_offset() instead of
6288 Sized_relobj::invalidate_section_offset().
6289 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6290 parameter for section headers. Ignore relocation sections for
6291 unallocated sections and EXIDX sections.
6292 (Target_arm::fix_exidx_coverage): New method.
6293 (Target_arm::output_section_address_less_than): New type.
6294 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6295 linked text section instead of the EXIDX section.
6296 (Arm_output_section::create_stub_group): Add an assertion to check
6297 that this is not an EXIDX output section.
6298 (Arm_output_section::append_text_sections_to_list): New method.
6299 (Arm_output_section::fix_exidx_coverage): Ditto.
6300 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6301 Arm_relobj::section_needs_reloc_stub_scanning.
6302 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6303 first pass.
6304 (Target_arm::fix_exidx_coverage): New method.
6305 * object.h (Relobj::set_output_section): New method.
6306 (Sized_relobj::invalidate_section_offset): Remove method.
6307 (Sized_relobj::do_invalidate_section_offset): Remove method.
6308 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6309
c7f3c371
DK
63102010-01-25 Doug Kwan <dougkwan@google.com>
6311
6312 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6313 Fix warning due to signed and unsigned comparison on a 32-bit host.
6314
8923b24c
DK
63152010-01-22 Doug Kwan <dougkwan@google.com>
6316
6317 * arm.cc (Target_arm::do_relax): Record an output section for section
6318 offset adjustment it contains any stub table that has changed.
6319 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6320 offsets in an output section if necessary.
6321 * output.cc (Output_section::Output_section): Initialize
6322 section_offsets_need_adjustments_.
6323 (Output_section::add_input_section_for_script): Renamed to
6324 Output_section::add_simple_input_section.
6325 (Output_section::save_states): Add a comment.
6326 (Output_section::discard_states): New method defintion.
6327 (Output_section::adjust_section_offsets): Same.
6328 * output.h (Output_section::add_input_section_for_script): Renamed to
6329 Output_section::add_simple_input_section.
6330 (Output_section::discard_states): New method declaration.
6331 (Output_section::adjust_section_offsets): Same.
6332 (Output_section::section_offsets_need_adjustment,
6333 Output_section::set_section_offsets_need_adjustment): New method
6334 definitions.
6335 (Output_section::section_offsets_need_adjustment_): New data member.
6336 * script-sections.cc
6337 (Output_section_element_input::set_section_address): Adjust code for
6338 renaming of Output_section::add_input_section_for_script.
6339 (Orphan_output_section::set_section_address): Same.
6340
9b2fd367
DK
63412010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6342
6343 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6344 Fix_v4bx enum values .
6345 * gold/options.h (General_options): New option definitions.
6346 (General_options::fix_v4bx): New method.
6347 (General_options::Fix_v4bx): New enum.
6348 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6349 (General_options::parse_fix_v4bx_interworking): New method.
6350
80d0d023
DK
63512010-01-22 Doug Kwan <dougkwan@google.com>
6352
6353 * arm.cc (Arm_exidx_fixup): New class.
6354
af2cdeae
DK
63552010-01-21 Doug Kwan <dougkwan@google.com>
6356
6357 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6358 classes.
6359 (Arm_exidx_section_offset_map): New type.
6360
993d07c1
DK
63612010-01-21 Doug Kwan <dougkwan@google.com>
6362
6363 * arm.cc (Arm_exidx_input_section): New class.
6364 (Arm_relobj::exidx_input_section_by_link,
6365 Arm_relobj::exidx_input_section_by_shndx,
6366 Arm_relobj::make_exidx_input_section): New methods.
6367 (read_arm_attributes_section): Remove.
6368 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6369 information about them.
6370 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6371 to here.
6372
5ac169d4
DK
63732010-01-20 Doug Kwan <dougkwan@google.com>
6374
6375 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6376 Input_section_specifier to Section_id.
6377 (Target_arm::new_arm_input_section: Adjust code for change of key
6378 type.
6379 (Target_arm::find_arm_input_section): Ditto.
6380 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6381 (Section_id): Remove.
6382 (Garbage_collection::Section_id_hash): Remove.
6383 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6384 (Section_id): Remove.
6385 (Icf::Section_id_hash): Remove.
6386 * object.h (Section_id, Const_section_id, Section_id_hash,
6387 Const_section_id_hash): New type definitions.
6388 * output.cc (Output_section::add_relaxed_input_section): Change to
6389 use Const_section_id instead of Input_section_specifier as key type.
6390 (Output_section::add_merge_input_section): Ditto.
6391 (Output_section::build_relaxation_map): Change to use Section_id
6392 instead of Input_section_specifier as key type.
6393 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6394 Ditto.
6395 (Output_section::convert_input_sections_to_relaxed_sections): Change
6396 to use Const_section_id instead of Input_section_specifier as key type.
6397 (Output_section::find_merge_section): Ditto.
6398 (Output_section::find_relaxed_input_section): Ditto.
6399 * output.h (Input_section_specifier): Remove class.
6400 (Output_section::Output_section_data_by_input_section_map): Change
6401 key type to Const_section_id.
6402 (Output_section::Output_relaxed_input_section_by_input_section_map):
6403 Ditto.
6404 (Output_section::Relaxation_map): Change key type to Section_id.
6405
a2162063
ILT
64062010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6407
6408 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6409 (class Arm_v4bx_stub): New class.
6410 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6411 (Stub_factory::make_arm_v4bx_stub): New method.
6412 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6413 (Stub_table::empty): Handle v4bx stubs.
6414 (Stub_table::add_arm_v4bx_stub): New method.
6415 (Stub_table::find_arm_v4bx_stub): New method.
6416 (Arm_relocate_functions::v4bx): New method.
6417 (Target_arm::fix_v4bx): New method.
6418 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6419 (Stub_table::relocate_stubs): Likewise.
6420 (Stub_table::do_write): Likewise.
6421 (Stub_table::update_data_size_and_addralign): Likewise.
6422 (Stub_table::finalize_stubs): Likewise.
6423 (Target_arm::Scan::local): Likewise.
6424 (Target_arm::Scan::global): Likewise.
6425 (Target_arm::do_finalize_sections): Likewise.
6426 (Target_arm::Relocate::relocate): Likewise.
6427 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6428 Likewise.
6429 (Target_arm::scan_reloc_for_stub): Likewise.
6430 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6431
5696ab0b
ILT
64322010-01-19 Ian Lance Taylor <iant@google.com>
6433
6434 * output.cc (Output_section_headers::do_sized_write): Write large
6435 segment count to sh_info field.
6436 (Output_file_header::do_sized_write): For large segment count,
6437 write PN_XNUM to e_phnum field.
6438
800d0f56
ILT
64392010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6440
6441 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6442 (Arm_relocate_functions::thm_jump8): New function.
6443 (Arm_relocate_functions::thm_jump11): New function.
6444 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6445 R_ARM_THM_JUMP11.
6446 (Target_arm::Scan::global): Likewise.
6447 (Target_arm::Relocate::relocate): Likewise.
6448 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6449 Likewise.
6450
41263c05
DK
64512010-01-14 Doug Kwan <dougkwan@google.com>
6452
6453 * arm.cc (map, utility): Include headers.
6454 (Target_arm::apply_cortex_a8_workaround): New method.
6455 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6456 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6457 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6458 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6459 the --[no-]fix-cortex-a8 command line options.
6460 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6461 (Target_arm::relocate_stub): Use addend in instruction template.
6462 * options.h (DEFINE_bool): Set the user-set flag.
6463 (General_options): Add --[no-]-fix-cortex options.
6464 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6465 : Update fast look-up map after conversion.
41263c05 6466
459e9b03
ST
64672010-01-14 Sriraman Tallam <tmsriram@google.com>
6468
6469 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6470 in the first pass of do_layout.
6471
b521dfe4
DK
64722010-01-13 Doug Kwan <dougkwan@google.com>
6473
6474 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6475 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6476 apparent compiler problem of not folding static constant integral
6477 data members of elfcpp::Elf_sizes<32>.
6478
44272192
DK
64792010-01-13 Doug Kwan <dougkwan@google.com>
6480
6481 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6482 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6483 Arm_relobj::scan_section_for_cortex_a8_erratum,
6484 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6485 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6486 sections to scan for relocation stubs into a new method
6487 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6488 relocation and Cortex-A8 stub scanning.
6489 (Target_arm::do_relax): Force stubs to be after stubbed sections
6490 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6491 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6492 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6493
44b71ece
ILT
64942010-01-12 Ian Lance Taylor <iant@google.com>
6495
6496 * target-reloc.h (visibility_error): New inline function.
6497 (relocate_section): Call visibility_error.
6498 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6499 (MOSTLYCLEANFILES): Likewise.
6500 (protected_4_pic.o, protected_3.err): New targets.
6501 * testsuite/protected_4.cc: New file.
6502
a120bc7f
DK
65032010-01-12 Doug Kwan <dougkwan@google.com>
6504
6505 * arm.cc (Cortex_a8_reloc): New class.
6506 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6507 and cortex_a8_relocs_info_.
6508 (Target_arm::fix_cortex_a8): New method definition.
6509 (Target_arm::Cortex_a8_relocs_info): New type.
6510 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6511 New data member declarations.
6512 (Target_arm::scan_reloc_for_stub): Record information about
6513 relocations for THUMB branches that might be exempted from the
6514 Cortex-A8 workaround.
6515 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6516 at the beginning of a relaxation pass.
6517
20138696
DK
65182010-01-12 Doug Kwan <dougkwan@google.com>
6519
6520 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6521 (Arm_relobj::Mapping_symbol_position,
6522 Arm_reloj::Mapping_symbol_position_less,
6523 Arm_relobj::Mapping_symbols_info): New types.
6524 (Target_arm::is_mapping_symbol_name): New method definition.
6525 (Arm_relobj::do_count_local_symbols): Save information about mapping
6526 symbols.
6527
089d69dc
DK
65282010-01-11 Doug Kwan <dougkwan@google.com>
6529
6530 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6531 Arm_relocate_functions::thumb32_branch_upper,
6532 Arm_relocate_functions::thumb32_branch_lower,
6533 Arm_relocate_functions::thumb32_cond_branch_offset,
6534 Arm_relocate_functions::thumb32_cond_branch_upper,
6535 Arm_relocate_functions::thumb32_cond_branch_lower,
6536 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6537 branch offset encoding.
6538 (Arm_relocate_functions::thumb_branch_common): Use new branch
6539 offset encoding methods to avoid code duplication.
6540 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6541 (Stub_addend_reader::operator()): Use new branch encoding method
6542 to avoid code duplication.
6543
99e5bff2
DK
65442010-01-11 Doug Kwan <dougkwan@google.com>
6545
6546 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6547 (Target_arm::do_finalize_sections): Define special EXIDX section
6548 symbols only if referenced.
6549 * gc.h (Garbage_collection::add_reference): New method.
6550 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6551 code duplication.
6552
98e090bd
ILT
65532010-01-11 Ian Lance Taylor <iant@google.com>
6554
d0a91bd8
ILT
6555 * script.cc (Version_script_info::build_expression_list_lookup):
6556 Change complaing about duplicate wildcard match from error to
6557 warning.
6558
98e090bd
ILT
6559 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6560 of 2009-12-30.
6561 (Version_script_info::Version_script_info): Initialize globs_,
6562 default_version_, default_is_global_, and exact_. Don't
6563 initialize globals_ or locals_.
6564 (Version_script_info::build_lookup_tables): Build local symbols
6565 first.
6566 (Version_script_info::unquote): New function.
6567 (Version_script_info::add_exact_match): New function.
6568 (Version_script_info::build_expression_list_lookup): Remove lookup
6569 parameter. Add is_global parameter. Change all callers. Handle
6570 wildcard pattern specially. Unquote pattern. Call
6571 add_exact_match.
6572 (Version_script_info::get_name_to_match): New function.
6573 (Version_script_info::get_symbol_version): New function.
6574 (Version_script_info::get_symbol_version_helper): Remove.
6575 (Version_script_info::check_unmatched_names): Call unquote.
6576 * script.h (class Version_script_info): Change get_symbol_version
6577 to be non-inline and add is_global parameter; change all callers.
6578 Rewrite symbol_is_local. Update declarations. Define struct
6579 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6580 Remove globals_ and locals_ members. Add exact_, globs_,
6581 default_version_, is_global_.
6582 (Version_script_info::Glob): Remove pattern, add expression and
6583 is_global. Update constructor. Change all callers.
6584 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6585 default version.
6586 (Versions::symbol_section_contents): If a symbol is undefined, or
6587 defined in a dynamic object, set the version index to
6588 VER_NDX_LOCAL.
6589 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6590 symbol_is_local.
6591 (Symbol_table::add_from_pluginobj): Likewise.
6592 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6593
d56962d3
DK
65942010-01-11 Doug Kwan <dougkwan@google.com>
6595
6596 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6597 (incremental_dump_LDADD): Add linking option for libintl.
6598 * Makefile.in: Regenerate.
6599
94e6ee91
L
66002010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6601
6602 PR gold/11144
6603 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6604 instead of -Ds.
6605 * testsuite/Makefile.in: Regenerated.
6606
e96c574b
DK
66072010-01-10 Doug Kwan <dougkwan@google.com>
6608
6609 * options.h (DEFINE_var): Use parentheses around argument varname__
6610 in macro body to avoid any unintended subsequent substitutions.
6611
7198066b
ILT
66122010-01-10 Ian Lance Taylor <iant@google.com>
6613
ba4d53bf
ILT
6614 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6615 candidates before doing symbol resolution.
6616
7198066b
ILT
6617 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6618 ODR candidates if only one is weak.
6619
a2beed37
ILT
66202010-01-08 Ian Lance Taylor <iant@google.com>
6621
6622 * script.cc (Version_script_info::build_expression_list_lookup):
6623 Don't warn about ambiguous version, just record the ambiguity.
6624 (Version_script_info::get_symbol_version_helper): Give error if
6625 version is ambiguous.
6626
2fb7225c
DK
66272010-01-08 Doug Kwan <dougkwan@google.com>
6628
6629 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6630 prev_data_size_ and prev_addralign_. Remove initializer for
6631 deleted data member has_been_changed_.
6632 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6633 to determine if the table is empty.
6634 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6635 Remove.
6636 (Stub_table::add_reloc_stub): Define method in class definition
6637 instead of just declaring it there.
6638 (Stub_table::add_cortex_a8_stub): New method definition.
6639 (Stub_table::update_data_size_and_addralign): Ditto.
6640 (Stub_table::finalize_stubs): Ditto.
6641 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6642 (Stub_table::do_addralign_): Return address alignment in the
6643 (Stub_table::do_reset_address_and_file_offset): Define method in
6644 class definition instead of declaring it there. Set current data
6645 size to be the data size of the previous pass.
6646 (Stub_table::set_final_data_size): Use current data size as the
6647 final data size.
6648 (Stub_table::relocate_stub): Change parameter type of stub from
6649 Reloc_stub pointer to Stub pointer.
6650 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6651 (Stub_table::Cortex_a8_stub_list): New typedef.
6652 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6653 Stub_table::prev_addralign_): New data member.
6654 (Arm_relobj::Arm_relobj): Initialize data member
6655 section_has_cortex_a8_workaround_.
6656 (Arm_relobj::section_has_cortex_a8_workaround,
6657 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6658 definitions.
6659 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6660 declarations.
6661 (Target_arm::relocate_stub): Change parameter type of stub from
6662 Reloc_stub pointer to Stub pointer.
6663 (Insn_template::size, Insn_template::alignment): Handle
6664 THUMB16_SPECIAL_TYPE.
6665 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6666 Stub_table::update_data_size_and_addralign,
6667 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6668 definitions.
6669 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6670 (Stub_table::do_write): Ditto.
6671 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6672
880cd20d
ILT
66732010-01-08 Ian Lance Taylor <iant@google.com>
6674
6675 PR 11108
6676 * symtab.h (class Symbol): Remove fields is_target_special_ and
6677 has_plt_offset_. Add field is_defined_in_discarded_section_.
6678 (Symbol::is_defined_in_discarded_section): New function.
6679 (Symbol::set_is_defined_in_discarded_section): New function.
6680 (Symbol::has_plt_offset): Rewrite.
6681 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6682 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6683 Don't initialize is_target_special_ or has_plt_offset_.
6684 Initialize is_defined_in_discarded_section_.
6685 (Symbol_table::add_from_relobj): If appropriate, set
6686 is_defined_in_discarded_section.
6687 * resolve.cc (Symbol::override_base_with_special): Don't test
6688 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6689 * target-reloc.h (relocate_section): Do special handling for
6690 symbols defined in discarded sections for global symbols as well
6691 as local symbols.
6692
2703e3eb
ILT
66932010-01-08 Ian Lance Taylor <iant@google.com>
6694
6695 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6696 the SHT_SYMTAB case.
6697
339d40a3
ILT
66982010-01-08 Ian Lance Taylor <iant@google.com>
6699
6700 * object.cc (Sized_relobj::do_layout): Don't get confused if
6701 layout_eh_frame returns NULL.
6702
abecea76
ILT
67032010-01-08 Ian Lance Taylor <iant@google.com>
6704
6705 PR 11084
6706 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6707 dynamic symbol table, use the normal symbol table.
6708 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6709 symbol table.
6710
6b7dd3f3
ILT
67112010-01-08 Ian Lance Taylor <iant@google.com>
6712
6713 PR 11072
6714 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6715 sections.
6716
36c50e63
L
67172010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6718
6719 * version.cc (print_version): Change to "Copyright 2010".
6720
e291e7b9
ILT
67212010-01-08 Ian Lance Taylor <iant@google.com>
6722
6723 PR 10287
6724 PR 11063
6725 * i386.cc (class Target_i386): Change return type of plt_section
6726 to be non-const.
6727 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6728 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6729 tls_desc_rel_ field.
6730 (Output_data_plt_i386::rel_tls_desc): New function.
6731 (Target_i386::rel_tls_desc_section): New function.
6732 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6733 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6734 R_386_TLS_DESC reloc in rel_tls_desc_section.
6735 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6736 Define struct Tlsdesc_info.
6737 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6738 (Target_x86_64::do_reloc_symbol_index): New function.
6739 (Target_x86_64::add_tlsdesc_info): New function.
6740 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6741 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6742 tlsdesc_rel_ field.
6743 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6744 all callers.
6745 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6746 (Target_x86_64::rela_tlsdesc_section): New function.
6747 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6748 handling.
6749 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6750 (Target_x86_64::do_reloc_addend): New function.
6751 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6752 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6753 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6754 (Output_reloc::type): New function.
6755 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6756 (Output_reloc::is_target_specific): New function.
6757 (Output_reloc::target_arg): New function.
6758 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6759 absolute relocs and target specific relocs.
6760 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6761 add_target_specific.
6762 (class Output_data_reloc) [SHT_RELA]: Likewise.
6763 * output.cc (Output_reloc::Output_reloc): Add four new versions
6764 for absolute relocs and target specific relocs.
6765 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6766 (Output_reloc::get_symbol_index): Likewise.
6767 (Output_reloc::local_section_offset): Check that local_sym_index_
6768 is not TARGET_CODE or 0.
6769 (Output_reloc::symbol_value): Likewise.
6770 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6771 reloc.
6772 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6773 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6774 functions.
6775 * layout.cc (add_target_dynamic_tags): Use output section for
6776 DT_PLTRELSZ and DT_JMPREL.
6777
3a44184e
ILT
67782010-01-07 Ian Lance Taylor <iant@google.com>
6779
6780 PR 11061
6781 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6782 function.
6783 (class Output_data_reloc_generic): Define.
6784 (class Output_data_reloc_base): Change base class to
6785 Output_data_reloc_generic. Change add() method to call
6786 bump_relative_reloc_count for a relative reloc. Remove
6787 sort_relocs_ field.
6788 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6789 to sort_relocs().
6790 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6791 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6792 appropriate.
6793 * layout.h (class Layout): Update declaration.
6794
ea715a34
ILT
67952010-01-07 Ian Lance Taylor <iant@google.com>
6796
6797 * output.h (class Output_data): Add const version of
6798 output_section and do_output_section.
6799 (class Output_section_data): Add const version of
6800 do_output_section.
6801 (class Output_section): Likewise.
6802 * layout.cc (Layout::add_target_dynamic_tags): New function.
6803 * layout.h (class Layout): Update declarations.
6804 * arm.cc (Target_arm::do_finalize_sections): Use
6805 add_target_dynamic_tags.
6806 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6807 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6808 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6809 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6810
659948a4
ILT
68112010-01-07 Ian Lance Taylor <iant@google.com>
6812
6813 PR 11042
6814 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6815 object as needed.
6816
9d3b86f6
ILT
68172010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6818 Ian Lance Taylor <iant@google.com>
6819
6820 PR 11019
6821 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6822 Xindex::read_symtab_xindex.
6823
bb0d3eb0
DK
68242010-01-07 Doug Kwan <dougkwan@google.com>
6825
6826 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6827 (Insn_template::thumb16_bcond_insn): New method declaration.
6828 (Insn_template): Fix spelling.
6829 (Stub::thumb16_special): New method declaration.
6830 (Stub::do_write): Define virtual method which was previously pure
6831 virtual.
6832 (Stub::do_thumb16_special): New method declaration.
6833 (Stub::do_fixed_endian_write): New template member.
6834 (Reloc_stub::do_write): Remove.
6835 (Reloc_stub::do_fixed_endian_write): Remove.
6836 (Cortex_a8_stub): New class definition.
6837 (Stub_factory::make_cortex_a8_stub): New method definition.
6838 (Stub_factory::Stub_factory): Add missing static storage class
6839 qualifier for elf32_arm_stub_a8_veneer_blx.
6840
ffeef7df
ILT
68412010-01-07 Ian Lance Taylor <iant@google.com>
6842
dc3f80fe
ILT
6843 PR 10980
6844 * options.h (class General_options): Add --warn-unresolved-symbols
6845 and --error-unresolved-symbols.
6846 * errors.cc (Errors::undefined_symbol): Implement
6847 --warn-unresolved-symbols.
6848
ffeef7df
ILT
6849 * options.h (class General_options): Add -z text and -z textoff.
6850 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6851
f1ec9ded
ST
68522010-01-06 Sriraman Tallam <tmsriram@google.com>
6853
6854 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6855 (Garbage_collection::cident_sections): New function.
6856 (Garbage_collection::add_cident_section): New function.
6857 (Garbage_collection::cident_sections_): New member.
6858 (gc_process_relocs): Add references to sections whose names are C
6859 identifiers.
6860 * gold.h (cident_section_start_prefix): New constant.
6861 (cident_section_stop_prefix): New constant.
6862 (is_cident): New function.
6863 * layout.cc (Layout::define_section_symbols): Replace string constants
6864 with the newly defined constants.
6865 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6866 C identifiers.
6867 * testsuite/Makefile.am: Add gc_orphan_section_test.
6868 * testsuite/Makefile.in: Regenerate.
6869 * testsuite/gc_orphan_section_test.cc: New file.
6870 * testsuite/gc_orphan_section_test.sh: New file.
6871
6eda8c29
ILT
68722010-01-06 Ian Lance Taylor <iant@google.com>
6873
b9674e17
ILT
6874 PR 10980
6875 * options.h (class General_options): Add --warn-shared-textrel.
6876 * layout.cc (Layout::finish_dynamic_section): Implement
6877 --warn-shared-textrel.
6878
6eda8c29
ILT
6879 PR 10980
6880 * options.h (class General_options): Add --warn-multiple-gp.
6881
32dcd44e
ILT
68822010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6883
6884 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6885 $(THREADSLIB) and $(LIBDL).
6886 * Makefile.in: Rebuild.
6887
a192ba05
ILT
68882010-01-06 Ian Lance Taylor <iant@google.com>
6889
6890 PR 10980
6891 * options.cc (General_options::parse_section_start): New function.
6892 (General_options::section_start): New function.
6893 (General_options::General_options): Initialize all members.
6894 * options.h: Include <map>
6895 (class General_options): Add --section-start. Add section_starts_
6896 member.
6897 * layout.cc (Layout::attach_allocated_section_to_segment): If
6898 --section-start was used, set the address of the segment. Remove
6899 local sort_sections.
6900 (Layout::relaxation_loop_body): If the address of the load segment
6901 has been set by --section-start, don't use it.
6902 * output.h (Output_segment::update_flags_for_output_section): New
6903 function.
6904 * output.cc (Output_segment::add_output_section): Call
6905 update_flags_for_output_section.
6906
dde3f402
ILT
69072010-01-05 Ian Lance Taylor <iant@google.com>
6908
62dfdd4d
ILT
6909 PR 10980
6910 * options.h (class General_options): Add --undefined-version.
6911 * script.cc (struct Version_expression): Add was_matched_by_symbol
6912 field.
6913 (Version_script_info::matched_symbol): New function.
6914 (Version_script_info::get_symbol_version_helper): Call
6915 matched_symbol.
6916 (Version_script_info::check_unmatched_names): New function.
6917 * script.h (class Version_script_info): Update declarations.
6918 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6919
9c4ae156
ILT
6920 * options.h (class General_options): Use DEFINE_bool_alias for
6921 allow_multiple_definition.
6922 * resolve.cc (Symbol_table::should_override): Don't test
6923 allow_multiple_definition.
6924
dde3f402
ILT
6925 PR 10980
6926 * options.h (class General_options): Add --cref.
6927 * main.cc (main): Print cref table if --cref. Don't close mapfile
6928 until after printing cref table.
6929 * cref.cc: Include "symtab.h".
6930 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6931 (Cref_table_compare::operator()): New function.
6932 (Cref_inputs::gather_cref): New function.
6933 (filecol): New static const.
6934 (Cref_inputs::print_cref): New function.
6935 (Cref::print_cref): New function.
6936 * cref.h: Include <cstdio>.
6937 (class Cref): Update declarations.
6938 * mapfile.h (Mapfile::file): New function.
6939 * object.h (class Object): Define Symbols. Declare virtual
6940 do_get_global_symbols.
6941 (Object::get_global_symbols): New function.
6942 * object.cc (Input_objects::add_object): Pass object to cref_ if
6943 --cref.
6944 (Input_objects::archive_start): Likewise.
6945 (Input_objects::archive_stop): Likewise.
6946 (Input_objects::print_cref): New function.
6947 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6948 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6949 --cref.
6950 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6951 function.
6952 * plugin.h (class Sized_pluginobj): Update declarations.
6953
8781f709
ILT
69542010-01-05 Ian Lance Taylor <iant@google.com>
6955
6956 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6957 to is_default_version. Rename insdef to insdefault.
6958 (Symbol_table::add_from_relobj): Rename def to is_default_version
6959 and local to is_forced_local.
6960 (Symbol_table::add_from_pluginobj): Likewise.
6961 (Symbol_table::add_from_dynobj): Likewise.
6962 (Symbol_table::define_special_symbol): Rename insdef to
6963 insdefault.
6964
fe35d28d
ILT
69652010-01-04 Ian Lance Taylor <iant@google.com>
6966
30bc8c46
ILT
6967 PR 10980
6968 * options.h (class General_options): Add
6969 --allow-multiple-definition and -z muldefs.
6970 * resolve.cc (Symbol_table::should_override): Don't warn about a
6971 multiple symbol definition if --allow-multiple-definition or -z
6972 muldefs.
6973
7eaea549
ILT
6974 PR 10980
6975 * options.h (class General_options): Add --add-needed and
6976 --copy-dt-needed-entries. Tweak --as-needed help entry.
6977 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6978 error if --copy-dt-needed-entries aka --add-needed is used and
6979 would cause a change in behaviour.
6980
fe35d28d
ILT
6981 PR 10980
6982 * options.h (class General_options): Add -G as a short version of
6983 --shared. Add no-op options -assert, -g, and -i.
6984
55a2bb35
ST
69852010-01-04 Sriraman Tallam <tmsriram@google.com>
6986
6987 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6988 check for .text or .gnu.linkonce.t sections.
6989 * icf.cc (Icf::find_identical_sections): Ditto.
6990 Change the detection for mangled function name within the section
6991 name.
6992 * icf.h (is_section_foldable_candidate): New function.
6993
719328e1
ILT
69942009-12-30 Ian Lance Taylor <iant@google.com>
6995
6996 PR 10980
6997 * options.h (class General_options): Permit two dashes with
6998 --retain-symbols-file.
6999
d7bb5745
ILT
70002009-12-30 Ian Lance Taylor <iant@google.com>
7001
403a15dd
ILT
7002 PR 10979
7003 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7004 don't put the file header and segment headers in the text
7005 segment.
7006
eda294df
ILT
7007 PR 10979
7008 * common.cc (Sort_commons::operator()): Stabilize sort when both
7009 entries are NULL.
7010 (Symbol_table::do_allocate_commons_list): When allocating common
7011 symbols, skip a symbol which is no longer common.
7012 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7013 an object before checking its type.
7014 * testsuite/common_test_2.c: New file.
7015 * testsuite/common_test_3.c: New file.
7016 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7017 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7018 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7019 (common_test_2_pic.o, common_test_2.so): New targets.
7020 (common_test_3_pic.o, common_test_3.so): New targets.
7021 * testsuite/Makefile.in: Rebuild.
7022
d7bb5745
ILT
7023 PR 10979
7024 * script.cc (read_input_script): If we see a new SECTIONS clause,
7025 and we have added an input section, give an error.
7026 * layout.h (class Layout): Add have_added_input_section function.
7027 Add have_added_input_section_ field.
7028 * layout.cc (Layout::Layout): Initialize
7029 have_added_input_section_.
7030 (Layout::layout): Set have_added_input_section_.
7031 (Layout::layout_eh_frame): Likewise.
7032
fc59c572
ILT
70332009-12-30 Ian Lance Taylor <iant@google.com>
7034
7035 PR 10931
7036 * options.h (class General_options): Add --sort-common option.
7037 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7038 * common.cc (Sort_common): Add sort_order parameter to
7039 constructor. Add sort_order_ field.
7040 (Sort_commons::operator): Check sort_order_.
7041 (Symbol_table::allocate_commons): Determine the sort order.
7042 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7043 Change all callers.
7044 (Symbol_table::do_allocate_commons_list): Likewise.
7045
1c74fab0
ILT
70462009-12-30 Ian Lance Taylor <iant@google.com>
7047
7048 PR 10916
7049 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7050 symbols from this object, don't change the visibility of an
7051 undefined symbol.
7052 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7053
6affe781
ILT
70542009-12-30 Ian Lance Taylor <iant@google.com>
7055
7056 PR 10861
7057 * script.h (class Version_script_info): Define Language enum.
7058 Update declarations. Define Glob, Exact, and Lookup types. Add
7059 new fields globals_, locals_, and is_finalized_.
7060 * script.cc: Various formatting fixes.
7061 (class Parser_closure): Change language_stack_ from a vector of
7062 std::string to one of Version_script_info::Language. Adjust all
7063 uses accordingly.
7064 (class Lazy_demangler): Remove.
7065 (struct Version_expression): Change language from std::string to
7066 Version_script_info::Language.
7067 (Version_script_info::Version_script_info): New function.
7068 (Version_script_info::~Version_script_info): Don't call clear.
7069 (Version_script_info::finalize): New function.
7070 (Version_script_info::build_lookup_tables): New function.
7071 (Version_script_info::build_expression_list_lookup): New
7072 function.
7073 (Version_script_info::get_symbol_version_helper): Rewrite to use
7074 lookup tables.
7075 (Version_script_info::print_expression_list): Adjust to use
7076 Version_script_info::Language.
7077 (script_push_lex_into_version_mode): Check that the version script
7078 has not been finalized.
7079 (version_script_push_lang): Change language string to
7080 Version_script_info::Language.
7081 * options.cc (Command_line::version_script): New function.
7082 * options.h (class General_options): Add finalize_dynamic_list
7083 function. Change version_script from declaration to definition.
7084 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7085 * testsuite/version_script.map: Remove duplicate def of foo.
7086 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7087 version_script.map.
7088 * testsuite/Makefile.in: Rebuild.
7089
818bf354
ILT
70902009-12-30 Ian Lance Taylor <iant@google.com>
7091
7092 PR 10843
7093 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7094 if the input symbol index is 0, make the output symbol index 0.
7095
ebcc8304
ILT
70962009-12-30 Ian Lance Taylor <iant@google.com>
7097
7098 PR 10670
7099 * options.h (class General_options): Add -x/--discard-all.
7100 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7101 --discard-all. If the local symbol needs a dynamic entry, check
7102 that before handling --discard-locals.
7103
176fe33f
ILT
71042009-12-30 Ian Lance Taylor <iant@google.com>
7105
bb321bb1
ILT
7106 PR 10450
7107 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7108 flags to PF_R.
7109 (Output_segment::add_output_section): Don't change the flags if
7110 the type is PT_TLS.
7111
176fe33f
ILT
7112 PR 10450
7113 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7114 GNU hash table if they need a dynamic value. Otherwise, don't add
7115 them if they are defined in a dynamic object or are forced local.
7116
e8cd95c7
ILT
71172009-12-29 Ian Lance Taylor <iant@google.com>
7118
1b81fb71
ILT
7119 PR 10450
7120 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7121 .gnu.hash table for a 32-bit target.
7122
8d6d383d
ILT
7123 PR 10450
7124 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7125 regular and a dynamic object only needs a dynamic symbol table
7126 entry if it is externally visible.
7127
e785ec03
ILT
7128 PR 10450
7129 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7130 constructor. Add global_offset_table_ field.
7131 (Target_i386::got_section): Set global_offset_table_.
7132 (Target_i386::do_finalize_sections): Set global_offset_table_
7133 size.
7134 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7135 in constructor. Add global_offset_table_ field.
7136 (Target_x86_64::got_section): Set global_offset_table_.
7137 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7138 size.
7139
1a2dff53
ILT
7140 * layout.cc (Layout::Layout): Initialize increase_relro_.
7141 (Layout::get_output_section): Add is_relro, is_last_relro, and
7142 is_first_non_relro parameters. Change all callers.
7143 (Layout::choose_output_section): Likewise.
7144 (Layout::add_output_section_data): Likewise.
7145 (Layout::make_output_section): Likewise.
7146 (Layout::set_segment_offsets): Clear increase_relro when using a
7147 linker script.
7148 * layout.h (class Layout): Add increase_relro method. Add
7149 increase_relro_ field. Update declarations.
7150 * output.cc (Output_section::Output_section): Initialize
7151 is_last_relro_ and is_first_non_relro_.
7152 (Output_segment::add_output_section): Group relro sections is
7153 do_sort is true. Handle is_last_relro and is_first_non_relro.
7154 (Output_segment::maximum_alignment): Remove relro handling.
7155 (Output_segment::set_section_addresses): Add increase_relro
7156 parameter. Change all callers. Add initial alignment to align
7157 relro sections on separate page. Remove old relro handling.
7158 (Output_segment::set_section_list_addresses): Remove in_relro
7159 parameter. Change all callers.
7160 (Output_segment::set_offset): Add increase parameter. Change all
7161 callers. Remove old relro handling.
7162 * output.h (class Output_section): Add new methods: is_last_relro,
7163 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7164 Add is_last_relro_ and is_first_non_relro_ fields.
7165 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7166 Create separate .got.plt section. Call increase_relro.
7167 * x86_64.cc (Target_x86_64::got_section): Likewise.
7168 * testsuite/relro_script_test.t: Add .got.plt.
7169
f0ba79e2
ILT
7170 PR 10450
7171 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7172 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7173 (Layout::finalize): Call set_dynamic_symbol_size.
7174 (Layout::set_dynamic_symbol_size): New function.
7175 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7176 set_dynamic_symbol_size.
7177
e8cd95c7
ILT
7178 PR 10450
7179 * output.h (class Output_section): Add is_entsize_zero_ field.
7180 * output.cc (Output_section::Output_section): Initialize
7181 is_entsize_zero_.
7182 (Output_section::set_entsize): If two different entsizes are
7183 requested, force it to zero.
7184 (Output_section::add_input_section): Set flags for .debug_str
7185 before updating section flags. Set entsize.
7186 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7187 and SHF_STRING if all input sections have those flags.
7188
3e1b9a8a
RÁE
71892009-12-29 Rafael Espindola <espindola@google.com>
7190
7191 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7192 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7193 reporting.
3e1b9a8a 7194
3dcad376
ST
71952009-12-29 Sriraman Tallam <tmsriram@google.com>
7196
7197 * options.cc (General_options::parse_version): Allow -v to exit
7198 without an error if there is nothing to link.
7199
084e2665
ILT
72002009-12-29 Ian Lance Taylor <iant@google.com>
7201
7202 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7203 using a version of gcc before 4.1.
7204 * configure: Rebuild.
7205
250acde3
CD
72062009-12-28 Chris Demetriou <cgd@google.com>
7207
7208 * attributes.cc (Output_attributes_section_data::do_write): Use
7209 std::vector::front rather than std::vector::data.
7210
99fff23b
ILT
72112009-12-28 Ian Lance Taylor <iant@google.com>
7212
7213 * symtab.h (class Symbol_table): Add enum Defined.
7214 * resolve.cc (Symbol_table::should_override): Add defined
7215 parameter. Change all callers. Test whether object is NULL
7216 before calling a method on it.
7217 (Symbol_table::report_resolve_problem): Add defined parameter.
7218 Change all callers.
7219 (Symbol_table::should_override_with_special): Likewise.
7220 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7221 parameter. Change all callers.
7222 (Symbol_table::do_define_in_output_data): Likewise.
7223 (Symbol_table::define_in_output_segment): Likewise.
7224 (Symbol_table::do_define_in_output_segment): Likewise.
7225 (Symbol_table::define_as_constant): Likewise.
7226 (Symbol_table::do_define_as_constant): Likewise.
7227 * script.h (class Symbol_assignment): Add is_defsym parameter to
7228 constructor; change all callers.
7229 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7230 parameter. Change all callers. Add is_defsym_ field.
7231 (class Parser_closure): Add parsing_defsym parameter to
7232 constructor; change all callers. Add parsing_defsym accessor
7233 function. Add parsing_defsym_ field.
7234
556bd683
ILT
72352009-12-28 Ian Lance Taylor <iant@google.com>
7236
7237 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7238 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7239
1782c879
ILT
72402009-12-23 Ian Lance Taylor <iant@google.com>
7241
7242 * i386.cc (Target_i386::do_calls_non_split): Recognize
7243 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7244 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7245 -fsplit-stack prologue when using %r11.
1782c879 7246
329ca2b1
ST
72472009-12-21 Sriraman Tallam <tmsriram@google.com>
7248
7249 * options.cc (General_options::parse_version): Make -v continue and do
7250 the link like GNU ld does.
7251
d675ff46
RÁE
72522009-12-17 Rafael Avila de Espindola <espindola@google.com>
7253
7254 * Makefile.am (CCFILES): Add timer.cc.
7255 (HFILES): Add timer.h.
7256 * configure.ac: Check for sysconf and times.
7257 * main.cc: include timer.h.
7258 (main): Use Timer instead of get_run_time.
7259 * timer.cc: New.
7260 * timer.h: New.
7261 * workqueue.cc: include timer.h.
7262 (Workqueue::find_and_run_task):
7263 Report user, sys and wall time.
7264 * Makefile.in: Regenerate.
7265 * config.in: Regenerate.
7266 * configure: Regenerate.
7267
d6344fb5
DK
72682009-12-16 Doug Kwan <dougkwan@google.com>
7269
7270 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7271 sections.
7272 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7273 relaxed input sections.
7274 * output.cc (Output_section::find_relaxed_input_section): Change
7275 return type to Output_relaxed_input_section pointer. Adjust code
7276 for new type of relaxed_input_section_map_.
7277 * output.h (Output_section::find_relaxed_input_section): Change
7278 return type to Output_relaxed_input_section pointer.
7279 (Output_section::Output_relaxed_input_section_by_input_section_map):
7280 New type.
7281 (Output_section::relaxed_input_section_map_): Change type to
7282 Output_section::Output_relaxed_input_section_by_input_section_map.
7283 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7284 input section.
7285
0e0d5469
ILT
72862009-12-15 Ian Lance Taylor <iant@google.com>
7287
7288 * layout.cc (Layout::create_shstrtab): Only write out after input
7289 sections if we are compressing debug sections.
7290
0649a889
ILT
72912009-12-15 Ian Lance Taylor <iant@google.com>
7292
7293 * archive.cc (Archive::add_symbols): Only look up a symbol without
7294 a version if there is, in fact, a version.
7295
2ea97941
ILT
72962009-12-14 Ian Lance Taylor <iant@google.com>
7297
7298 Revert -Wshadow changes, all changes from:
7299 2009-12-11 Doug Kwan <dougkwan@google.com>
7300 2009-12-11 Nick Clifton <nickc@redhat.com>
7301 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7302
b0eec2cc
DK
73032009-12-11 Doug Kwan <dougkwan@google.com>
7304
7305 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7306 due to -Wshadow.
7307 * attributes.cc (Object_attribute::size): Ditto.
7308 (Attributes_section_data::size): Ditto.
7309 (Attributes_section_data::Attributes_section_data): Ditto.
7310 (Output_attributes_section_data::do_write): Ditto.
7311 * attributes.h (Object_attribute::set_type): Ditto.
7312 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7313
91d6fa6a
NC
73142009-12-11 Nick Clifton <nickc@redhat.com>
7315
7316 * archive.cc: Fix shadowed variable warnings.
7317 * arm.cc: Likewise.
7318 * compressed_output.cc: Likewise.
7319 * compressed_output.h: Likewise.
7320 * configure: Likewise.
7321 * dwarf_reader.cc: Likewise.
7322 * dynobj.cc: Likewise.
7323 * dynobj.h: Likewise.
7324 * ehframe.cc: Likewise.
7325 * ehframe.h: Likewise.
7326 * errors.cc: Likewise.
7327 * expression.cc: Likewise.
7328 * fileread.cc: Likewise.
7329 * fileread.h: Likewise.
7330 * freebsd.h: Likewise.
7331 * i386.cc: Likewise.
7332 * icf.cc: Likewise.
7333 * incremental.h: Likewise.
7334 * layout.cc: Likewise.
7335 * layout.h: Likewise.
7336 * mapfile.cc: Likewise.
7337 * merge.cc: Likewise.
7338 * merge.h: Likewise.
7339 * object.cc: Likewise.
7340 * object.h: Likewise.
7341 * options.h: Likewise.
7342 * output.cc: Likewise.
7343 * output.h: Likewise.
7344 * parameters.cc: Likewise.
7345 * plugin.cc: Likewise.
7346 * powerpc.cc: Likewise.
7347 * reduced_debug_output.cc: Likewise.
7348 * reduced_debug_output.h: Likewise.
7349 * reloc.cc: Likewise.
7350 * reloc.h: Likewise.
7351 * resolve.cc: Likewise.
7352 * script-sections.cc: Likewise.
7353 * script.cc: Likewise.
7354 * script.h: Likewise.
7355 * sparc.cc: Likewise.
7356 * symtab.cc: Likewise.
7357 * symtab.h: Likewise.
7358 * target-select.cc: Likewise.
7359 * target-select.h: Likewise.
7360 * token.h: Likewise.
7361 * workqueue.cc: Likewise.
7362 * workqueue.h: Likewise.
7363 * x86_64.cc: Likewise.
7364
a0351a69
DK
73652009-12-10 Doug Kwan <dougkwan@google.com>
7366
7367 * arm.cc (attributes.h): New include.
7368 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7369 (Arm_relobj::~Arm_relobj): Delete object pointed by
7370 attributes_section_data_.
7371 (Arm_relobj::attributes_section_data): New method definition.
7372 (Arm_relobj::attributes_section_data_): New data member declaration.
7373 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7374 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7375 attributes_section_data_.
7376 (Arm_dynobj::attributes_section_data): New method definition.
7377 (Arm_dynobj::attributes_section_data_): New data member declaration.
7378 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7379 initialization value of may_use_blx_ to false.
7380 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7381 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7382 object attributes to compute results instead of hard-coding.
7383 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7384 Target_arm::get_secondary_compatible_arch,
7385 Target_arm::set_secondary_compatible_arch
7386 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7387 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7388 New method declarations.
7389 (Target_arm::get_aeabi_object_attribute): New method definition.
7390 (Target_arm::attributes_section_data_): New data member declaration.
7391 (read_arm_attributes_section): New template definition.
7392 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7393 (Arm_dynobj::do_read_symbols): Ditto.
7394 (Target_arm::do_finalize_sections): Merge attributes sections from
7395 input. Check for BLX use after attributes section merging.
7396 Fix __exidx_start and __exidx_end visibility. Create an
7397 .ARM.attributes section if necessary.
7398 (Target_arm::get_secondary_compatible_arch,
7399 Target_arm::set_secondary_compatible_arch,
7400 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7401 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7402 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7403 New method definitions.
7404
b59befec
ILT
74052009-12-09 Ian Lance Taylor <iant@google.com>
7406
7407 * plugin.cc (Plugin::load): Don't cast from void* to a function
7408 pointer.
7409
1276bc89
ILT
74102009-12-09 Ian Lance Taylor <iant@google.com>
7411
7412 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7413 information fields.
7414
2f2de248
L
74152009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7416
7417 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7418 Replace two_file_shared_1.so with two_file_shared_2.so.
7419 * testsuite/Makefile.in: Regenerated.
7420
4f787271
DK
74212009-12-08 Doug Kwan <dougkwan@google.com>
7422
7423 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7424 (HFILES): Add attributes.h and int_encoding.h.
7425 * Makefile.in: Regenerate.
7426 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7427 function definitions to int_encoding.cc
7428 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7429 prototypes to int_encoding.h
7430 * reduced_debug_output.cc (int_encoding.h): New include.
7431 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7432 function definitions to int_encoding.cc
7433 (insert_into_vector, read_from_pointer): Move template definitions to
7434 int_encoding.h
7435 * attributes.cc: New file.
7436 * attributes.h: New file.
7437 * int_encoding.cc: New file.
7438 * int_encoding.h: New file.
7439
20b52f1a
RÁE
74402009-12-07 Rafael Avila de Espindola <espindola@google.com>
7441
7442 PR gold/11055
7443 * incremental-dump.cc (dump_incremental_inputs): New.
7444 (main): Use dump_incremental_inputs.
7445
53d7974c
L
74462009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7447
7448 PR gold/10893
7449 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7450 checking elfcpp::STT_FUNC.
7451 (Target_i386::Relocate::relocate): Likewise.
7452 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7453
7454 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7455 symbols from shared libraries into normal FUNC symbols.
7456
7457 * symtab.h (Symbol): Add is_func and use it.
7458
05a352e6
DK
74592009-12-05 Doug Kwan <dougkwan@google.com>
7460
7461 * arm.cc (Target_arm::arm_info): Initialize new fields
7462 attributes_section and attributes_vendor.
7463 * i386.cc (Target_i386::i386_info): Same.
7464 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7465 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7466 fields attributes_section and attributes_vendor.
53d7974c 7467 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7468 * target.h (Target::attributes_section, Target::attributes_vendor,
7469 Target::is_attributes_section, Target::attribute_arg_type,
7470 Target::attributes_order): New method definitions.
7471 (Target::Target_info::attributes_section,
7472 Target::Target_info::attributes_vendor): New fields.
7473 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7474 virtual method definitions.
7475 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7476 attributes_section and attributes_vendor.
7477 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7478
f4e5969c
DK
74792009-12-05 Doug Kwan <dougkwan@google.com>
7480
7481 * arm.cc: Update comments about interworking and stub generation.
7482 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7483 considered as non-PIC.
7484 (Arm_relocate_functions::base_abs): Fix formatting.
7485 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7486 of function to use GOT entry address instead of offset.
7487 (Target_arm::Scan::global): Issue an error if a symbol would need a
7488 PLT does not get one because it is untyped. Remove code to create
7489 dynamic symbols for relative branches.
7490 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7491 takes unsigned integer instead of boolean.
7492
1abce4a6
L
74932009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7494
7495 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7496 (two_file_test_LDADD): Likewise.
7497 (common_test_1_LDADD): Likewise.
7498 (exception_test_LDADD) Likewise.
7499 (weak_test_LDADD): Likewise.
7500 (many_sections_test_LDADD): Likewise.
7501 (initpri1_LDADD): Likewise.
7502 (script_test_1_LDADD): Likewise.
7503 (script_test_2_LDADD): Likewise.
7504 (justsyms_LDADD): Likewise.
7505 (binary_test_LDADD): Likewise.
7506 (large_LDADD): Likewise.
7507 * testsuite/Makefile.in: Regenerated.
7508
adcf2816 75092009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7510
adcf2816
L
7511 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7512 (Symbol_table::override_with_special): Likewise.
7513 (Symbol_table::add_from_object): Likewise.
7514
28e67f5d
RÁE
75152009-12-04 Rafael Avila de Espindola <espindola@google.com>
7516
7517 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7518 Don't set the data_offset twice.
7519
ae10a101
RÁE
75202009-12-04 Rafael Avila de Espindola <espindola@google.com>
7521
7522 * testsuite/Makefile.in: Regenerate.
7523
f59f41f3
DK
75242009-12-03 Doug Kwan <dougkwan@google.com>
7525
7526 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7527 (Target_arm::do_finalize_sections): Add parameter for symbol table
7528 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7529 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7530 parameter for symbol table pointer.
7531 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7532 an additional parameter for a pointer to symbol table.
7533 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7534 parameter for a symbol table pointer.
7535 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7536 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7537 Ditto.
7538 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7539 parameter for a symbol table pointer.
7540
ca55d848
RÁE
75412009-12-03 Rafael Avila de Espindola <espindola@google.com>
7542
7543 * incremental.cc (Incremental_inputs_header)
7544 (Incremental_inputs_header_write, Incremental_inputs_entry)
7545 (Incremental_inputs_entry_write): Move ...
7546 * incremental.h (Incremental_inputs_header)
7547 (Incremental_inputs_header_write, Incremental_inputs_entry)
7548 (Incremental_inputs_entry_write): here.
7549
3aec4f9c
RÁE
75502009-12-02 Rafael Avila de Espindola <espindola@google.com>
7551
7552 * incremental.cc (make_sized_incremental_binary): Set the target.
7553 Error if it is incompatible.
7554 * output.h (Output_file): Add filename method.
7555
9c0ae74d
RÁE
75562009-12-02 Rafael Avila de Espindola <espindola@google.com>
7557
7558 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7559 from the get_* methods.
7560
a45500ae
RÁE
75612009-12-02 Rafael Avila de Espindola <espindola@google.com>
7562
7563 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7564 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7565 Write 0 for the data_offset of scripts.
7566
325e6408
RÁE
75672009-12-02 Rafael Avila de Espindola <espindola@google.com>
7568
7569 * testsuite/Makefile.am: Add the incremental_test.sh test.
7570 * testsuite/incremental_test.sh: New.
7571 * testsuite/incremental_test_1.c: New.
7572 * testsuite/incremental_test_2.c: New.
7573
954c3e2e
RÁE
75742009-12-01 Rafael Avila de Espindola <espindola@google.com>
7575
7576 * incremental-dump.cc (main): Fix typos.
7577
f8086623
RÁE
75782009-11-27 Rafael Avila de Espindola <espindola@google.com>
7579
7580 PR gold/11025
7581 * incremental-dump.cc (main): Use llu to print 64 bit values.
7582
3b0dd6ac
L
75832009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7584 H.J. Lu <hongjiu.lu@intel.com>
7585
7586 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7587 $(LIBDL).
7588 (incremental_dump_LDADD): Likewise.
7589 * Makefile.in: Regenerated.
7590
a6d1ef57 75912009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7592
a6d1ef57
DK
7593 Revert:
7594
7595 2009-11-25 Doug Kwan <dougkwan@google.com>
7596
7597 * arm.cc (Target_arm::Target_arm): Move method definition
7598 outside of class definition. Add code to handle
7599 --target1-rel, --target1-abs and --target2= options.
7600 (Target_arm::get_reloc_reloc_type): Change method to be
7601 non-static and const.
7602 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7603 New data member declaration.
7604 (Target_arm::Scan::local, Target_arm::Scan::global,
7605 Target_arm::Relocate::relocate,
7606 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7607 Adjust call to Target_arm::get_real_reloc_type.
7608 (Target_arm::get_real_reloc_type): Use command line options
7609 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7610 * options.h (--target1-rel, --target1-abs, --target2): New
7611 ARM-only options.
7612
50aeb7d4
DK
76132009-11-25 Doug Kwan <dougkwan@google.com>
7614
7615 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7616 class definition. Add code to handle --target1-rel, --target1-abs
7617 and --target2= options.
7618 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7619 and const.
7620 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7621 member declaration.
7622 (Target_arm::Scan::local, Target_arm::Scan::global,
7623 Target_arm::Relocate::relocate,
7624 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7625 call to Target_arm::get_real_reloc_type.
7626 (Target_arm::get_real_reloc_type): Use command line options to
7627 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7628 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7629 options.
7630
51938283
DK
76312009-11-25 Doug Kwan <dougkwan@google.com>
7632
7633 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7634 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7635 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7636 formatting.
7637 (Arm_relocate_functions::thm_call): Replace body with a call to
7638 Arm_relocate_functions::thumb_branch_common.
7639 (Arm_relocate_functions::thm_jump24,
7640 Arm_relocate_functions::thm_xpc22): New method definitions.
7641 (Arm_relocate_functions::thumb_branch_common): New method definition.
7642 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7643 operator.
7644 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7645 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7646
e2b8f3c4
RÁE
76472009-11-24 Rafael Avila de Espindola <espindola@google.com>
7648
7649 * Makefile.am: Build incremental-dump
7650 * Makefile.in: Regenerate.
7651 * incremental-dump.cc: New.
7652 * incremental.cc (Incremental_inputs_header_data,
7653 Incremental_inputs_entry_data): Move to incremental.h
7654 * incremental.h: (Incremental_inputs_header_data,
7655 Incremental_inputs_entry_data): Move from incremental.cc
7656
bcba9aec
RÁE
76572009-11-24 Rafael Avila de Espindola <espindola@google.com>
7658
7659 * incremental.cc (Incremental_inputs_header,
7660 Incremental_inputs_header_write, Incremental_inputs_entry,
7661 Incremental_inputs_entry_write): Add a typedef with the data type.
7662
7c3afe08
RÁE
76632009-11-24 Rafael Avila de Espindola <espindola@google.com>
7664
7665 * incremental.cc (Incremental_inputs_header,
7666 Incremental_inputs_header_write, Incremental_inputs_entry,
7667 Incremental_inputs_entry_write): Update comment about which
7668 type has the filed descriptions.
7669
d204b6e9
DK
76702009-11-15 Doug Kwan <dougkwan@google.com>
7671
7672 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7673 (Arm_relocate_functions::arm_branch_common): Change method defintion
7674 in class definition to a method declaration and update list of formal
7675 parameters.
7676 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7677 Arm_relocation_functions::jump24): Adjust call to
7678 Arm_relocate_functions::arm_branch_common. Update list of formal
7679 parameters.
7680 (Arm_relocate_functions::xpc25): New method definition.
7681 (Arm_relocate_functions::arm_branch_common): Move method defintion
7682 out from class definition. Use stubs for mode-switching and extending
7683 branch ranges.
7684 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7685 specially. Change code to enable use of stubs in ARM branches.
7686
43d12afe
DK
76872009-11-10 Doug Kwan <dougkwan@google.com>
7688
7689 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7690 in method declaration.
7691 (Target_arm::relocate_stub): New method declaration.
7692 (Target_arm::default_target): Change to return a pointer instead of
7693 a const reference.
7694 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7695 Target_arm::default_target.
7696 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7697 method definition.
7698 (Target_arm::relocate_section): Adjust view.
7699 (Target_arm::relocate_stub): New method definition.
7700
ac33a407
DK
77012009-11-10 Doug Kwan <dougkwan@google.com>
7702
7703 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7704 a format warning.
7705 * incremental.cc (open_incremental_binary): Initialized local
7706 variables to avoid warnings.
7707 * object.cc (make_elf_object): Ditto.
7708 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7709 a format warning.
e1df38aa 7710
88ee28e9
L
7711009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7712
7713 PR gold/10930
7714 * testsuite/plugin_test.c: Include "config.h".
7715
2daedcd6
DK
77162009-11-09 Doug Kwan <dougkwan@google.com>
7717
7718 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7719 (arm_symbol_value): Remove.
7720 (Arm_relocate_functions::arm_branch_common,
7721 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7722 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7723 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7724 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7725 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7726 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7727 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7728 Arm_relocate_functions::thm_mobw_abs_nc,
7729 Arm_relocate_functions::thm_mov_abs,
7730 Arm_relocate_functions::movw_prel_nc,
7731 Arm_relocate_functions::thm_movt_abs,
7732 Arm_relocate_functions::movt_prel,
7733 Arm_relocate_functions::thm_movw_prel_nc,
7734 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7735 (Target_arm::Relocate::relocate): Only decompose address into two
7736 parts if relocation type uses the thumb-bit and pass the actual
7737 bit instead of a flag indicating that the thumb-bit is used. Adjust
7738 calls to methods in Arm_relocate_functions for this change.
7739
1276bc89 77402009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7741
7742 PR 10925
7743 * reloc.cc: Instantiate
7744 Sized_relobj::initialize_input_to_output_maps and
7745 Sized_relobj:free_input_to_output_maps.
7746
e53ad1b5
ILT
77472009-11-06 Ian Lance Taylor <iant@google.com>
7748
7749 PR 10876
7750 * defstd.cc (in_segment): Set only_if_ref true for "end".
7751
eb44217c
DK
77522009-11-06 Doug Kwan <dougkwan@google.com>
7753
7754 * arm.cc (class Reloc_stub): Correct a comment.
7755 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7756 (Target_arm::scan_section_for_stubs): New method declaration.
7757 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7758 Change methods from private to protected.
7759 (Target_arm::do_may_relax): New method definition.
7760 (Target_arm::do_relax, Target_arm::group_sections,
7761 Target_arm::scan_reloc_for_stub,
7762 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7763 (Target_arm::arm_input_section_map_): New data member declaration.
7764 (Target_arm::scan_reloc_for_stub,
7765 Target_arm::scan_reloc_section_for_stubs,
7766 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7767 Target_arm::do_relax): New method definitions.
7768
5d329b7d
ILT
77692009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7770
7771 * configure.ac: Check for (struct stat)::st_mtim
7772 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7773 * config.in: Regenerate.
7774 * configure: Regenerate.
7775
96a0d71b
ILT
77762009-11-05 Ian Lance Taylor <iant@google.com>
7777
7778 PR 10910
7779 * output.cc (Output_segment::add_output_section): Add missing
7780 return statement.
7781
594c8e5e
ILT
77822009-11-04 Ian Lance Taylor <iant@google.com>
7783
7784 PR 10880
7785 * object.h (class Object): Add is_needed and set_is_needed
7786 methods. Add is_needed_ field. Make bool fields into bitfields.
7787 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7788 defined in a dynamic object and referenced by a regular object,
7789 set is_needed for the dynamic object.
7790 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7791 if the file is marked with as_needed and it is not needed.
7792
22b127cc
ILT
77932009-11-04 Ian Lance Taylor <iant@google.com>
7794
7795 PR 10887
7796 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7797 tags if data is discarded by linker script.
7798 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7799 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7800 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7801 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7802
f5c870d2
ILT
78032009-11-04 Ian Lance Taylor <iant@google.com>
7804
7805 * layout.cc (Layout::get_output_section): Add is_interp and
7806 is_dynamic_linker_section parameters. Change all callers.
7807 (Layout::choose_output_section): Likewise.
7808 (Layout::make_output_section): Likewise.
7809 (Layout::add_output_section_data): Add is_dynamic_linker_section
7810 parameter. Change all callers.
7811 * layout.h (class Layout): Update declarations.
7812 * output.h (class Output_section): Add is_interp, set_is_interp,
7813 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7814 Add is_interp_, is_dynamic_linker_section_ fields. Change
7815 generate_code_fills_at_write_ to a bitfield.
7816 * output.cc (Output_section::Output_sections): Initialize new
7817 fields.
7818 (Output_segment::add_output_section): Add do_sort parameter.
7819 Change all callers.
7820
1ae4d23b
ILT
78212009-11-03 Ian Lance Taylor <iant@google.com>
7822
7823 PR 10860
7824 * options.h (class General_options): Add --warn-common.
7825 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7826 merging two common symbols.
7827 (Symbol_table::should_override): Handle --warn-common when merging
7828 a common symbol with a defined symbol. Use report_resolve_problem
7829 for multiple definitions.
7830 (Symbol_table::report_resolve_problem): New function.
7831 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7832
55da9579
DK
78332009-11-03 Doug Kwan <dougkwan@google.com>
7834
7835 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7836 stub_factory_.
7837 (Target_arm::stub_factory): New method definition.
7838 (Target_arm::new_arm_input_section,
7839 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7840 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7841 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7842 New type definitions.
7843 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7844 member declarations.
7845 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7846 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7847 New method definitions.
7848
37a9ac43
ILT
78492009-11-03 Ian Lance Taylor <iant@google.com>
7850
7851 * options.h (class General_options): Add --warn_constructors.
7852
b3d6a3d4
ILT
78532009-11-03 Ian Lance Taylor <iant@google.com>
7854
7855 PR 10893
7856 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7857 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7858
934b01dd
ILT
78592009-11-03 Ian Lance Taylor <iant@google.com>
7860
7861 PR 10895
7862 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7863 --msgid-bugs-address.
7864 (install-pdf): New target.
7865 (install-data_yes): Look up one directory to find mkinstalldirs.
7866
03c1939b
L
78672009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7868
7869 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7870 tree.
7871
ebd95253
DK
78722009-10-30 Doug Kwan <dougkwan@google.com>
7873
7874 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7875
e9bbb538
DK
78762009-10-30 Doug Kwan <dougkwan@google.com>
7877
7878 * arm.cc (Stub_addend_reader): New struct template definition
7879 and partial specializations.
7880 (Stub_addend_reader::operator()): New method definition for a
7881 partially specialized template.
7882
d5b40221
DK
78832009-10-30 Doug Kwan <dougkwan@google.com>
7884
7885 * arm.cc (Arm_relobj::processor_specific_flags): New method
7886 definition.
7887 (Arm_relobj::do_read_symbols): New method declaration.
7888 (Arm_relobj::processor_specific_flags_): New data member declaration.
7889 (Arm_dynobj): New class definition.
7890 (Target_arm::do_finalize_sections): Add input_objects parameter.
7891 (Target_arm::do_adjust_elf_header): New method declaration.
7892 (Target_arm::are_eabi_versions_compatible,
7893 (Target_arm::merge_processor_specific_flags): New method declaration.
7894 (Target_arm::do_make_elf_object): New overloaded method definitions
7895 and declaration.
7896 (Arm_relobj::do_read_symbols): New method definition.
7897 (Arm_dynobj::do_read_symbols): Ditto.
7898 (Target_arm::do_finalize_sections): Add input_objects parameters.
7899 Merge processor-specific flags from all input objects.
7900 (Target_arm::are_eabi_versions_compatible,
7901 Target_arm::merge_processor_specific_flags,
7902 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7903 New method definitions.
7904 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7905 Input_objects pointer type parameter.
7906 * layout.cc (Layout::finalize): Pass input objects to target's.
7907 finalize_sections function.
7908 * output.cc (Output_file_header::do_sized_write): Set ELF file
7909 header's processor-specific flags.
7910 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7911 Input_objects pointer type parameter.
7912 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7913 * target.h (Input_objects): New forward class declaration.
7914 (Target::processor_specific_flags,
7915 Target::are_processor_specific_flags_sect): New method definitions.
7916 (Target::finalize_sections): Add input_objects parameter.
7917 (Target::Target): Initialize processor_specific_flags_ and
7918 are_processor_specific_flags_set_.
7919 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7920 parameter.
7921 (Target::set_processor_specific_flags): New method definition.
7922 (Target::processor_specific_flags_,
7923 Target::are_processor_specific_flags_set_): New data member
7924 declarations.
7925 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7926 Input_objects pointer type parameter.
7927
ebabffbd
DK
79282009-10-30 Doug Kwan <dougkwan@google.com>
7929
7930 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7931
ad0f2072
ILT
79322009-10-28 Ian Lance Taylor <iant@google.com>
7933
7934 * object.h (class Relobj): Drop options parameter from
7935 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7936 do_scan_relocs, do_relocate. Change all callers.
7937 (class Sized_relobj): Drop options parameters from
7938 do_gc_process_relocs, do_scan_relocs, do_relocate,
7939 do_relocate_sections, relocate_sections, emit_relocs_scan,
7940 emit_relocs_scan_reltype. Change all callers.
7941 (struct Relocate_info): Remove options field and all references to
7942 it.
7943 * reloc.h (class Read_relocs): Remove options constructor
7944 parameter and options_ field. Change all callers.
7945 (class Gc_process_relocs, class Scan_relocs): Likewise.
7946 (class Relocate_task): Likewise.
7947 * target-reloc.h (scan_relocs): Remove options parameter. Change
7948 all callers.
7949 (scan_relocatable_relocs): Likewise.
7950 * target.h (class Sized_target): Remove options parameter from
7951 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7952 all callers.
7953 * gc.h (gc_process_relocs): Remove options parameter. Change all
7954 callers.
7955 * arm.cc: Update functions to remove options parameters.
7956 * i386.cc: Likewise.
7957 * powerpc.cc: Likewise.
7958 * sparc.cc: Likewise.
7959 * x86_64.cc: Likewise.
7960 * testsuite/testfile.cc: Likewise.
7961
8ffa3667
DK
79622009-10-28 Doug Kwan <dougkwan@google.com>
7963
7964 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7965 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7966 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7967 New method definitions.
7968
40f36857
CC
79692009-10-28 Cary Coutant <ccoutant@google.com>
7970
7971 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7972 (Plugin::cleanup_done_): New member.
7973 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7974 (Plugin_manager::cleanup_done_): Remove.
7975 (Plugin_manager::add_input_file): Edit error message.
7976 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7977 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7978
2c849493
ILT
79792009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7980
7981 * fileread.cc: (File_read::View::~View): Use the new
7982 data_ownership_ filed.
7983 (File_read::~File_read): Dispose the new whole_file_view_.
7984 (File_read::open): Mmap the whole file if needed.
7985 (File_read::open): Use whole_file_view_ instead of contents_.
7986 (File_read::find_view): Use whole_file_view_ if applicable.
7987 (File_read::do_read): Use whole_file_view_ instead of contents_.
7988 (File_read::make_view): Use whole_file_view_ instead of contents_,
7989 update File_read::View::View call.
7990 (File_read::find_or_make_view): Update File_read::View::View
7991 call.
7992 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7993 remove contents_
7994 (File_read::View::Data_ownership): New enum.
7995 (File_read::View::View): Replace bool mapped_ with Data_ownership
7996 argument.
7997 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7998 (File_read::View::data_ownership_): New field.
7999 (File_read::contents_): Remove (replaced by whole_file_view_).
8000 (File_read::whole_file_view_): New field.
8001 * options.h (class General_options): Add --keep-files-mapped.
8002
24998053
CC
80032009-10-27 Cary Coutant <ccoutant@google.com>
8004
8005 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8006 * testsuite/Makefile.am (plugin_test_5): New test case.
8007 * testsuite/Makefile.in: Regenerate.
8008
72adc4fa
DK
80092009-10-25 Doug Kwan <dougkwan@google.com>
8010
8011 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8012 from private to protected to allow access by child class.
8013 (Sized_relobj::do_relocate_sections): New method declaration.
8014 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8015 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8016 Sized_relobj::relocate_sections. Instantiate template explicitly
8017 for different target sizes and endianity.
8018
07f508a2
DK
80192009-10-24 Doug Kwan <dougkwan@google.com>
8020
8021 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8022 (Arm_input_section::as_arm_input_section): New method.
8023 (Arm_output_section): New class definition.
8024 (Arm_output_section::create_stub_group,
8025 Arm_output_section::group_sections): New method definitions.
8026
10ad9fe5
DK
80272009-10-22 Doug Kwan <dougkwan@google.com>
8028
8029 * arm.cc (Arm_input_section): New class definition.
8030 (Arm_input_section::init, Arm_input_section:do_write,
8031 Arm_input_section::set_final_data_size,
8032 Arm_input_section::do_reset_address_and_file_offset): New method
8033 definitions.
8034
56ee5e00
DK
80352009-10-21 Doug Kwan <dougkwan@google.com>
8036
8037 * arm.cc (Stub_table, Arm_input_section): New forward class
8038 declarations.
8039 (Stub_table): New class defintion.
8040 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8041 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8042 New method definition.
8043
b569affa
DK
80442009-10-21 Doug Kwan <dougkwan@google.com>
8045
8046 * arm.cc: Update copyright comments.
8047 (Target_arm): New forward class template declaration.
8048 (Arm_address): New type.
8049 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8050 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8051 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8052 constants.
8053 (Insn_template): Same.
8054 (DEF_STUBS): New macro.
8055 (Stub_type): New enum type.
8056 (Stub_template): New class definition.
8057 (Stub): Same.
8058 (Reloc_stub): Same.
8059 (Stub_factory): Same.
8060 (Target_arm::Target_arm): Initialize may_use_blx_ and
8061 should_force_pic_veneer_.
8062 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8063 Target_arm::should_force_pic_veneer,
8064 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8065 Target_arm::using_thumb_only, Target_arm:;default_target): New
8066 method defintions.
8067 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8068 New data member declarations.
8069 (Insn_template::size, Insn_template::alignment): New method defintions.
8070 (Stub_template::Stub_template): New method definition.
8071 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8072 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8073 (Stub_factory::Stub_factory): New method definition.
8074 * gold.h (string_hash): New template.
8075 * output.h (Input_section_specifier::hash_value): Use
8076 gold::string_hash.
8077 (Input_section_specifier::string_hash): Remove.
8078 * stringpool.cc (Stringpool_template::string_hash): Use
8079 gold::string_hash.
8080
6c172549
DK
80812009-10-20 Doug Kwan <dougkwan@google.com>
8082
8083 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8084 symbols of relaxed input sections.
8085 * output.h (Output_section::find_relaxed_input_section): Make
8086 method public.
8087
c5617f2f
DK
80882009-10-16 Doug Kwan <dougkwan@google.com>
8089
8090 * dynobj.cc (Versions::Versions): Initialize version_script_.
8091 Only insert base version symbol definition for a shared object
8092 if version script defines any version versions.
8093 (Versions::define_base_version): New method definition.
8094 (Versions::add_def): Check that base version is not needed.
8095 (Versions::add_need): Define base version lazily.
8096 * dynobj.h (Versions::define_base_version): New method declaration.
8097 (Versions::needs_base_version_): New data member declaration.
8098 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8099 (check_DATA): Add no_version_test.stdout.
8100 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8101 New make rules.
8102 * testsuite/Makefile.in: Regenerate.
8103 * testsuite/no_version_test.c: New file.
8104 * testsuite/no_version_test.sh: Ditto.
8105
3c12dcdb
DK
81062009-10-16 Doug Kwan <dougkwan@google.com>
8107
8108 * expression.cc (class Segment_start_expression): New class definition.
8109 (Segment_start_expression::value): New method definition.
8110 (script_exp_function_segment_start): Return a new
8111 Segment_start_expression.
8112 * gold/script-c.h (script_saw_segment_start_expression): New function
8113 prototype.
8114 * script-sections.cc (Script_sections::Script_sections): Initialize
8115 SAW_SEGMENT_START_EXPRESSION_ to false.
8116 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8117 and -Tbbs options to specify section addresses if given in
8118 command line and no SEGMENT_START expression is seen in a script.
8119 * script-sections.h (Script_sections::saw_segment_start_expression,
8120 Script_sections::set_saw_segment_start_expression): New method
8121 definition.
8122 (Script_sections::saw_segment_start_expression_): New data member
8123 declaration.
8124 * script.cc (script_saw_segment_start_expression): New function.
8125 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8126 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8127 script_test_7.sh and script_test_8.sh.
8128 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8129 script_test_8.stdout.
8130 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8131 (script_test_6, script_test_6.stdout, script_test_7,
8132 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8133 * Makefile.in: Regenerate.
8134 * testsuite/script_test_6.sh: New file.
8135 * testsuite/script_test_6.t: Same.
8136 * testsuite/script_test_7.sh: Same.
8137 * testsuite/script_test_7.t: Same.
8138 * testsuite/script_test_8.sh: Same.
8139
64b1ae37
DK
81402009-10-16 Doug Kwan <dougkwan@google.com>
8141
8142 * output.cc (Output_segment::set_section_list_address): Cast
8143 expressions to unsigned long long type to avoid format warnings.
8144
661be1e2
ILT
81452009-10-15 Ian Lance Taylor <iant@google.com>
8146
12edd763 8147 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8148 dot assignment to script_sections_.
12edd763
ILT
8149 * script-sections.cc (Script_sections::add_dot_assignment):
8150 Initialize if necessary.
8151
68b6574b
ILT
8152 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8153 program headers with no load segment if there is a linker script.
8154
661be1e2
ILT
8155 * layout.cc (Layout::set_segment_offsets): Align the file offset
8156 to the segment aligment for -N or -n with no load segment.
8157 * output.cc (Output_segment::add_output_section): Don't crash if
8158 the first section is a TLS section.
8159 (Output_segment::set_section_list_addresses): Print an error
8160 message if the address moves backward in a linker script.
8161 * script-sections.cc
8162 (Output_section_element_input::set_section_addresses): Don't
8163 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8164 (Orphan_output_section::set_section_addresses): Likewise.
8165
f15f61a7
DK
81662009-10-15 Doug Kwan <dougkwan@google.com>
8167
8168 * layout.cc (Layout::finish_dynamic_section): Generate tags
8169 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8170 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8171 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8172
82bb573a
ILT
81732009-10-14 Ian Lance Taylor <iant@google.com>
8174
8175 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8176 fields.
8177 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8178 data_shdr fields of relinfo.
8179 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8180 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8181 R_386_TLS_LDO_32, adjust based on section flags.
8182 (Target_i386::Relocate::fix_up_ldo): Remove.
8183
374ad285
ILT
81842009-10-13 Ian Lance Taylor <iant@google.com>
8185
8186 Add support for -pie.
8187 * options.h (class General_options): Add -pie and
8188 --pic-executable.
8189 (General_options::output_is_position_independent): Test -pie.
8190 (General_options::output_is_executable): Return true if not shared
8191 and not relocatable.
8192 (General_options::output_is_pie): Remove.
8193 * options.cc (General_options::finalize): Reject incompatible uses
8194 of -pie.
8195 * gold.cc (queue_middle_tasks): A -pie link is not static.
8196 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8197 * symtab.cc (Symbol::final_value_is_known): Return false if
8198 output_is_position_independent.
8199 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8200 output_is_position_independent.
8201 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8202 output_is_position_independent.
8203 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8204 output_is_position_independent.
8205 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8206 two_file_pie_test.
8207 (basic_pie_test.o, basic_pie_test): New targets.
8208 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8209 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8210 (two_file_pie_test): New target.
8211 * testsuite/Makefile.in: Rebuild.
8212 * README: Remove note saying that -pie is not supported.
8213
c6585162
ILT
82142009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8215
8216 * options.h (class General_options): Add -init and -fini.
8217 * layout.cc (Layout::finish_dynamic_section): Emit
8218 given init and fini functions.
8219
032ce4e9
ST
82202009-10-13 Sriraman Tallam <tmsriram@google.com>
8221
8222 * gc.h (gc_process_relocs): Check if icf is enabled using new
8223 function.
8224 * gold.cc (queue_initial_tasks): Likewise.
8225 (queue_middle_tasks): Likewise.
8226 * object.cc (do_layout): Likewise.
8227 * symtab.cc (is_section_folded): Likewise.
8228 * main.cc (main): Likewise.
8229 * reloc.cc (Read_relocs::run): Likewise.
8230 (Sized_relobj::do_scan_relocs): Likewise.
8231 * icf.cc (is_function_ctor_or_dtor): New function.
8232 (Icf::find_identical_sections): Check if function is ctor or dtor when
8233 safe icf is chosen.
8234 * options.h (General_options::icf): Change option to be an enum.
8235 (Icf_status): New enum.
8236 (icf_enabled): New method.
8237 (icf_safe_folding): New method.
8238 (set_icf_status): New method.
8239 (icf_status_): New variable.
8240 * (options.cc) (General_options::finalize): Set icf_status_.
8241 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8242 icf_test and icf_keep_unique_test to use the --icf enum flag.
8243 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8244 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8245
f345227a
ST
82462009-10-12 Sriraman Tallam <tmsriram@google.com>
8247
8248 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8249 includes to gc.h and icf.h.
8250 * arm.cc: Include gc.h.
8251 * gold.cc: Likewise.
8252 * i386.cc: Likewise.
8253 * powerpc.cc: Likewise.
8254 * sparc.cc: Likewise.
8255 * x86_64.cc: Likewise.
8256 * gc.h: Include icf.h.
8257
1c7814ed
ILT
82582009-10-11 Ian Lance Taylor <iant@google.com>
8259
8260 * plugin.cc: Include "gold.h" before other header files.
8261
ae3b5189
CD
82622009-10-10 Chris Demetriou <cgd@google.com>
8263
8264 * options.h (Input_file_argument::Input_file_type): New enum.
8265 (Input_file_argument::is_lib_): Replace with...
8266 (Input_file_argument::type_): New member.
8267 (Input_file_argument::Input_file_argument): Take Input_file_type
8268 'type' rather than boolean 'is_lib' as second argument.
8269 (Input_file_argument::is_lib): Use type_.
8270 (Input_file_argument::is_searched_file): New function.
8271 (Input_file_argument::may_need_search): Handle is_searched_file.
8272 * options.cc (General_options::parse_library): Support -l:filename.
8273 (General_options::parse_just_symbols): Update for Input_file_argument
8274 changes.
8275 (Command_line::process): Likewise.
8276 * archive.cc (Archive::get_file_and_offset): Likewise.
8277 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8278 * script.cc (read_script_file, script_add_file): Likewise.
8279 * fileread.cc (Input_file::Input_file): Likewise.
8280 (Input_file::will_search_for): Handle is_searched_file.
8281 (Input_file::open): Likewise.
8282 * readsyms.cc (Read_symbols::get_name): Likewise.
8283 * testsuite/Makefile.am (searched_file_test): New test.
8284 * testsuite/Makefile.in: Regenerate.
8285 * testsuite/searched_file_test.cc: New file.
8286 * testsuite/searched_file_test_lib.cc: New file.
8287
f3048a1d
ILT
82882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8289 Ian Lance Taylor <iant@google.com>
8290
8291 * descriptor.cc: Include <cstdio> and "binary-io.h".
8292 (Descriptors::open): Open the files in binary mode always.
8293 * script.cc (Lex::get_token): Treat \r as whitespace.
8294
d4780e57
ILT
82952009-10-09 Ian Lance Taylor <iant@google.com>
8296
8297 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8298
d9a893b8
ILT
82992009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8300 Ian Lance Taylor <iant@google.com>
8301
8302 * configure.ac: Check for readv function also.
8303 * fileread.cc (readv): Define if not HAVE_READV.
8304 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8305 does not exist.
8306 * config.in: Regenerate.
8307 * configure: Regenerate.
8308
c0a62865
DK
83092009-10-09 Doug Kwan <dougkwan@google.com>
8310
8311 * layout.cc (Layout::make_output_section): Call target hook to make
8312 ordinary output section.
8313 (Layout::finalize): Adjust parameter list of call the
8314 Target::may_relax().
8315 * layout.h (class Layout::section_list): New method.
8316 * merge.h (Output_merge_base::entsize): Change visibility to public.
8317 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8318 New methods.
8319 (Output_merge_string::do_is_string): New method.
8320 * object.cc (Sized_relobj::do_setup): renamed from
8321 Sized_relobj::set_up.
8322 * object.h (Sized_relobj::adjust_shndx,
8323 Sized_relobj::initializ_input_to_output_maps,
8324 Sized_relobj::free_input_to_output_maps): Change visibilities to
8325 protected.
8326 (Sized_relobj::setup): Virtualize.
8327 (Sized_relobj::do_setup): New method declaration.
8328 (Sized_relobj::invalidate_section_offset,
8329 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8330 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8331 * options.cc (parse_int): New function.
8332 * options.h (parse_int): New declaration.
8333 (DEFINE_int): New macro.
8334 (stub_group_size): New option.
8335 * output.cc (Output_section::Output_section): Initialize memebers
8336 merge_section_map_, merge_section_by_properties_map_,
8337 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8338 (Output_section::add_input_section): Handled deferred code-fill
8339 generation and remove an old comment.
8340 (Output_section::add_relaxed_input_section): New method definition.
8341 (Output_section::add_merge_input_section): Use merge section by
8342 properties map to speed to search. Update merge section maps
8343 as appropriate.
8344 (Output_section::build_relaxation_map): New method definition.
8345 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8346 Same.
8347 (Output_section::relax_input_section): Renamed to
8348 Output_section::convert_input_sections_to_relaxed_sections and change
8349 interface to take a vector of pointers to relaxed sections.
8350 (Output_section::find_merge_section,
8351 Output_section::find_relaxed_input_section): New method definitions.
8352 (Output_section::is_input_address_mapped,
8353 Output_section::output_offset, Output_section::output_address):
8354 Use output section data maps to speed up searching.
8355 (Output_section::find_starting_output_address): Add comments.
8356 (Output_section::do_write,
8357 Output_section::write_to_postprocessing_buffer): Do code-fill
8358 generation as appropriate.
8359 (Output_section::get_input_sections): Invalidate relaxed input section
8360 map.
8361 (Output_section::restore_states): Adjust type of checkpoint .
8362 Invalidate relaxed input section map.
8363 * output.h (Output_merge_base): New class declaration.
8364 (Input_section_specifier): New class defintion.
8365 (class Output_relaxed_input_section) Change base class to
8366 Output_section_data_build.
8367 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8368 base class initializer.
8369 (Output_section::add_relaxed_input_section): New method declaration.
8370 (Output_section::Input_section): Change visibility to protected.
8371 (Output_section::Input_section::relobj,
8372 Output_section::Input_section::shndx): Handle relaxed input sections.
8373 Output_section::input_sections) Change visibility to protected. Also
8374 define overload to return a non-const pointer.
8375 (Output_section::Merge_section_properties): New class defintion.
8376 (Output_section::Merge_section_by_properties_map,
8377 Output_section::Output_section_data_by_input_section_map,
8378 Output_section::Relaxation_map): New types.
8379 (Output_section::relax_input_section): Rename method to
8380 Output_section::convert_input_sections_to_relaxed_sections and change
8381 interface to take a vector of relaxed section pointers.
8382 (Output_section::find_merge_section,
8383 Output_section::find_relaxed_input_section,
8384 Output_section::build_relaxation_map,
8385 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8386 New method declarations.
8387 (Output_section::merge_section_map_
8388 Output_section::merge_section_by_properties_map_,
8389 Output_section::relaxed_input_section_map_,
8390 Output_section::is_relaxed_input_section_map_valid_,
8391 Output_section::generate_code_fills_at_write_): New data members.
8392 * script-sections.cc
8393 (Output_section_element_input::set_section_addresses): Call
8394 current_data_size and addralign methods of relaxed input sections.
8395 (Orphan_output_section::set_section_addresses): Call current_data_size
8396 and addralign methods of relaxed input sections.
8397 * symtab.cc (Symbol_table::compute_final_value): Extract template
8398 from the body of Symbol_table::sized_finalize_symbol.
8399 (Symbol_table::sized_finalized_symbol): Call
8400 Symbol_table::compute_final_value.
8401 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8402 (Symbol_table::compute_final_value): New templated method declaration.
8403 * target.cc (Target::do_make_output_section): New method defintion.
8404 * target.h (Target::make_output_section): New method declaration.
8405 (Target::relax): Add more parameters for input objects, symbol table
8406 and layout. Adjust call to do_relax.
8407 (Target::do_make_output_section): New method declaration.
8408 (Target::do_relax): Add parameters for input objects, symbol table
8409 and layout.
8410
d446d6c4
ILT
84112009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8412
8413 * pread.c: Include stdio.h.
8414
bc06c745
ILT
84152009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8416
8417 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8418 defined.
8419
75aea3d0
ILT
84202009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8421
8422 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8423 Change read_shndx type to unsigned int.
8424 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8425 int.
8426 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8427 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8428 Change read_shndx type to unsigned int.
8429 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8430 int.
8431 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8432 * layout.cc (Layout::create_symtab_sections): Cast the result of
8433 local_symcount * symsize to off_t in the gold_assert.
8434
be8fcb75
ILT
84352009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8436
8437 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8438 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8439 R_ARM_BASE_ABS.
8440 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8441 (Arm_relocate_functions::thm_abs5): New function.
8442 (Arm_relocate_functions::abs12): New function.
8443 (Arm_relocate_functions::abs16): New function.
8444 (Arm_relocate_functions::base_abs): New function.
8445 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8446 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8447 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8448 R_ARM_BASE_ABS.
8449 (Scan::global): Likewise.
8450 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8451 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8452 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8453 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8454 R_ARM_BASE_ABS.
8455
c2a122b6
ILT
84562009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8457
8458 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8459 (Arm_relocate_functions::movt_prel): New function.
8460 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8461 (Arm_relocate_functions::thm_movt_prel): New function.
8462 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8463 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8464 (Scan::global, Relocate::relocate): Likewise.
8465 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8466
c4aa1e2d
ILT
84672009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8468
8469 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8470 Incremental_checker.
8471 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8472 unsigned int.
8473 (class Incremental_inputs_header): New class.
8474 (Incremental_inputs_header_writer): Edit comment.
8475 (Incremental_inputs_entry): New class.
8476 (Incremental_inputs_entry_writer): Edit comment.
8477 (Sized_incremental_binary::do_find_incremental_inputs_section):
8478 Add *strtab_shndx parameter, fill it.
8479 (Sized_incremental_binary::do_check_inputs): New method.
8480 (Incremental_checker::can_incrementally_link_output_file): Use
8481 Sized_incremental_binary::check_inputs.
8482 (Incremental_inputs::report_command_line): Save command line in
8483 command_line_.
8484 * incremental.h:
8485 (Incremental_binary::find_incremental_inputs_section): New
8486 method.
8487 (Incremental_binary::do_find_incremental_inputs_section): Add
8488 strtab_shndx parameter.
8489 (Incremental_binary::do_check_inputs): New pure virtual method.
8490 (Sized_incremental_binary::do_check_inputs): Declare.
8491 (Incremental_checker::Incremental_checker): Add incremental_inputs
8492 parameter, use it to initialize incremental_inputs_.
8493 (Incremental_checker::incremental_inputs_): New field.
8494 (Incremental_checker::command_line): New method.
8495 (Incremental_checker::inputs): New method.
8496 (Incremental_checker::command_line_): New field.
8497
c549a694
ILT
84982009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8499
8500 * incremental.cc: Include <cstdarg> and "target-select.h".
8501 (vexplain_no_incremental): New function.
8502 (explain_no_incremental): New function.
8503 (Incremental_binary::error): New method.
8504 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8505 method.
8506 (make_sized_incremental_binary): New function.
8507 (open_incremental_binary): New function.
8508 (can_incrementally_link_file): Add checks if output is ELF and has
8509 inputs section.
8510 * incremental.h: Include "elfcpp_file.h" and "output.h".
8511 (Incremental_binary): New class.
8512 (Sized_incremental_binary): New class.
8513 (open_incremental_binary): Declare.
8514 * object.cc (is_elf_object): Use
8515 elfcpp::Elf_recognizer::is_elf_file.
8516 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8517 * output.h (Output_file::filesize): New method.
8518
fd3c5f0b
ILT
85192009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8520
8521 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8522 New function.
8523 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8524 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8525 function.
8526 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8527 function.
8528 (Arm_relocate_functions::movw_abs_nc): New function.
8529 (Arm_relocate_functions::movt_abs): New function.
8530 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8531 (Arm_relocate_functions::thm_movt_abs): New function.
8532 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8533 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8534 (Scan::global): Likewise.
8535 (Relocate::relocate): Likewise.
8536 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8537
7f5309a5
ILT
85382009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8539
8540 * arm.cc (Arm_relocate_functions::got_prel) New function.
8541 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8542 (Relocate::relocate): Likewise.
8543 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8544
364c7fa5
ILT
85452009-10-06 Ian Lance Taylor <iant@google.com>
8546
8547 * options.h (class General_options): Define
8548 split_stack_adjust_size parameter.
8549 * object.h (class Object): Add uses_split_stack_ and
8550 has_no_split_stack_ fields. Add uses_split_stack and
8551 has_no_split_stack accessor functions. Declare
8552 handle_split_stack_section.
8553 (class Reloc_symbol_changes): Define.
8554 (class Sized_relobj): Define Function_offsets. Declare
8555 split_stack_adjust, split_stack_adjust_reltype, and
8556 find_functions.
8557 * object.cc (Object::handle_split_stack_section): New function.
8558 (Sized_relobj::do_layout): Call handle_split_stack_section.
8559 * dynobj.cc (Sized_dynobj::do_layout): Call
8560 handle_split_stack_section.
8561 * reloc.cc (Sized_relobj::relocate_sections): Call
8562 split_stack_adjust for executable sections in split_stack
8563 objects. Pass reloc_map to relocate_section.
8564 (Sized_relobj::split_stack_adjust): New function.
8565 (Sized_relobj::split_stack_adjust_reltype): New function.
8566 (Sized_relobj::find_functions): New function.
8567 * target-reloc.h: Include "object.h".
8568 (relocate_section): Add reloc_symbol_changes parameter. Change
8569 all callers.
8570 * target.h (class Target): Add calls_non_split method. Declare
8571 do_calls_non_split virtual method. Declare match_view and
8572 set_view_to_nop.
8573 * target.cc: Include "elfcpp.h".
8574 (Target::do_calls_non_split): New function.
8575 (Target::match_view): New function.
8576 (Target::set_view_to_nop): New function.
8577 * gold.cc (queue_middle_tasks): Give an error if mixing
8578 split-stack and non-split-stack objects with -r.
8579 * i386.cc (Target_i386::relocate_section): Add
8580 reloc_symbol_changes parameter.
8581 (Target_i386::do_calls_non_split): New function.
8582 * x86_64.cc (Target_x86_64::relocate_section): Add
8583 reloc_symbol_changes parameter.
8584 (Target_x86_64::do_calls_non_split): New function.
8585 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8586 parameter.
8587 * powerpc.cc (Target_powerpc::relocate_section): Add
8588 reloc_symbol_changes parameter.
8589 * sparc.cc (Target_sparc::relocate_section): Add
8590 reloc_symbol_changes parameter.
8591 * configure.ac: Call AM_CONDITIONAL for the default target.
8592 * configure: Rebuild.
8593 * testsuite/Makefile.am (TEST_AS): New variable.
8594 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8595 (check_DATA): Add split_i386 and split_x86_64 files.
8596 (SPLIT_DEFSYMS): Define.
8597 (split_i386_[1234n].o): New targets.
8598 (split_i386_[124]): New targets.
8599 (split_i386_[1234r].stdout): New targets.
8600 (split_x86_64_[1234n].o): New targets.
8601 (split_x86_64_[124]): New targets.
8602 (split_x86_64_[1234r].stdout): New targets.
8603 (MOSTLYCLEANFILES): Add new executables.
8604 * testsuite/split_i386.sh: New file.
8605 * testsuite/split_x86_64.sh: New file.
8606 * testsuite/split_i386_1.s: New file.
8607 * testsuite/split_i386_2.s: New file.
8608 * testsuite/split_i386_3.s: New file.
8609 * testsuite/split_i386_4.s: New file.
8610 * testsuite/split_i386_n.s: New file.
8611 * testsuite/split_x86_64_1.s: New file.
8612 * testsuite/split_x86_64_2.s: New file.
8613 * testsuite/split_x86_64_3.s: New file.
8614 * testsuite/split_x86_64_4.s: New file.
8615 * testsuite/split_x86_64_n.s: New file.
8616 * testsuite/testfile.cc (Target_test): Update relocation_section
8617 function.
8618 * testsuite/Makefile.in: Rebuild.
8619
e8a9fcda
ILT
86202009-10-06 Ian Lance Taylor <iant@google.com>
8621
8622 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8623 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8624 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8625 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8626 the address on ldo_addrs_.
8627 (Target_i386::Relocate::fix_up_ldo): New function.
8628
e99daf92
ILT
86292009-10-06 Rafael Espindola <espindola@google.com>
8630
8631 * plugin.cc (add_input_library): New.
8632 (Plugin::load): Add add_input_library to tv.
8633 (Plugin_manager::add_input_file): Add the is_lib argument.
8634 (add_input_file): Update call to Plugin_manager::add_input_file.
8635 (add_input_library): New.
8636 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8637
966d4097
DK
86382009-09-30 Doug Kwan <dougkwan@google.com>
8639
8640 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8641 symbol and call Symbol::may_need_copy_reloc to determine if
8642 a copy reloc is needed.
8643 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8644 nocopyreloc is given in command line.
8645 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8646 given in command line.
8647 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8648 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8649 of the removed Target_i386::may_need_copy_reloc.
8650 * options.h (copyreloc): New option with default value false.
8651 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8652 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8653 instead of the removed Target_powerpc::may_need_copy_reloc.
8654 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8655 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8656 instead of the removed Target_sparc::may_need_copy_reloc.
8657 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8658 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8659 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8660 instead of the removed Target_x86_64::may_need_copy_reloc.
8661
029ba973
ILT
86622009-09-30 Ian Lance Taylor <iant@google.com>
8663
8664 * object.h (class Object): Remove target_ field, and target,
8665 sized_target, and set_target methods.
8666 (Object::sized_target): Remove.
8667 (class Sized_relobj): Update declarations. Remove sized_target.
8668 * object.cc (Sized_relobj::setup): Remove target parameter.
8669 Change all callers.
8670 (Input_objects::add_object): Don't do anything with the target.
8671 (make_elf_sized_object): Add punconfigured parameter. Change all
8672 callers. Set or test parameter target.
8673 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8674 Change all callers.
8675 * parameters.cc (Parameters::set_target): Change parameter type to
8676 be non-const.
8677 (Parameters::default_target): Remove.
8678 (set_parameters_target): Change parameter type to be non-const.
8679 (parameters_force_valid_target): New function.
8680 (parameters_clear_target): New function.
8681 * parameters.h (class Parameters): Update declarations. Remove
8682 default_target method. Add sized_target and clear_target
8683 methods. Change target_ to be non-const.
8684 (set_parameters_target): Update declaration.
8685 (parameters_force_valid_target): Declare.
8686 (parameters_clear_target): Declare.
8687 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8688 as NULL if we aren't searching.
8689 (Add_symbols::run): Don't check for compatible target.
8690 * fileread.cc (Input_file::open_binary): Call
8691 parameters_force_valid_target.
8692 * gold.cc (queue_middle_tasks): Likewise.
8693 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8694 set_target on object.
8695 * dynobj.h (class Sized_dynobj): Update declarations.
8696 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8697 make_elf_object returns NULL.
8698 (Archive::include_member): Don't check whether object target is
8699 compatible.
8700 * output.cc (Output_section::add_input_section): Get target from
8701 parameters.
8702 (Output_section::relax_input_section): Likewise.
8703 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8704 parameters.
8705 (Sized_relobj::do_scan_relocs): Likewise.
8706 (Sized_relobj::relocate_sections): Likewise.
8707 * resolve.cc (Symbol_table::resolve): Likewise.
8708 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8709 parameter. Change all callers.
8710 (Symbol_table::add_from_object): Get target from parameters.
8711 (Symbol_table::add_from_relobj): Don't check object target.
8712 (Symbol_table::add_from_dynobj): Likewise.
8713 (Symbol_table::define_special_symbol): Get target from
8714 parameters.
8715 * symtab.h (class Symbol_table): Update declaration.
8716 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8717 parameter. Change all callers. Clear parameter target.
8718 (Binary_test): Test target here.
8719 * testsuite/object_unittest.cc (gold_testsuite): Remove
8720 target_test_pointer parameter. Change all callers.
8721 (Object_test): Test target here.
8722
a6a22b83
ILT
87232009-09-26 Ian Lance Taylor <iant@google.com>
8724
8725 * testsuite/initpri1.c: Don't try to use constructor priorities if
8726 compiling with gcc before 4.3.
8727
6a8f49fe
ILT
87282009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8729
8730 * testsuite/retain_symbols_file_test.sh (check_present): Change
8731 output file name to retain_symbols_file_test.stdout.
8732 (check_absent): Likewise.
8733
8c604651
CS
87342009-09-18 Craig Silverstein <csilvers@google.com>
8735
8736 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8737 * options.cc: Include <cerrno> and <fstream>.
8738 (General_options::finalize): Parse -retain-symbols-file tag.
8739 * options.h: New flag.
8740 (General_options): New method should_retain_symbol, new
8741 variable symbols_to_retain.
8742 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8743 should_retain_symbol map.
8744 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8745 * testsuite/Makefile.in: Regenerate.
8746 * testsuite/retain_symbols_file_test.sh: New file.
8747
ca58b19f
NC
87482009-09-18 Nick Clifton <nickc@redhat.com>
8749
8750 * po/es.po: Updated Spanish translation.
8751
20e6d0d6
DK
87522009-09-17 Doug Kwan <dougkwan@google.com>
8753
8754 * debug.h (DEBUG_RELAXATION): New constant.
8755 (DEBUG_ALL): Add DEBUG_RELAXATION.
8756 (debug_string_to_enum): Add relaxation debug option.
8757 * layout.cc
8758 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8759 Layout::Relaxation_debug_check::read_sections,
8760 Layout::Relaxation_debug_check::read_sections): New method definitions.
8761 (Layout::Layout): Initialize data members
8762 record_output_section_data_from_scrips_,
8763 script_output_section_data_list_ and relaxation_debug_check_.
8764 (Layout::save_segments, Layout::restore_segments,
8765 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8766 Layout::relaxation_loop_body): New method definitions.
8767 (Layout::finalize): Support relaxation. Move section layout code to
8768 Layout::relaxation_loop_body.
8769 (Layout::set_asection_address_from_script): Move code for orphan
8770 section placement out.
8771 (Layout::place_orphan_sections_in_script): New method definition.
8772 * layout.h (Output_segment_headers, Output_file_header):
8773 New forward class declarations.
8774 (Layout::~Layout): Define.
8775 (Layout::new_output_section_data_from_script): New method definition.
8776 (Layout::place_orphan_sections_in_script): New method declaration.
8777 (Layout::Segment_states): New type declaration.
8778 (Layout::save_segments, Layout::restore_segments,
8779 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8780 Layout::relaxation_loop_body): New method declarations.
8781 (Layout::Output_section_data_list): New type declaration.
8782 (Layout::Relaxation_debug_check): New class definition.
8783 (Layout::record_output_section_data_from_script_,
8784 Layout::script_output_section_data_list_, Layout::segment_states_,
8785 Layout::relaxation_debug_check_): New data members.
8786 * output.cc: (Output_section_headers::do_size): New method definition.
8787 (Output_section_headers::Output_section_headers): Move size
8788 computation to Output_section_headers::do_size.
8789 (Output_segment_headers::do_size): New method definition.
e1df38aa 8790 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8791 Output_file_header::do_size and call it.
8792 (Output_file_header::do_size): New method definition.
8793 (Output_data_group::Output_data_group): Adjust call to
8794 Output_section_data.
8795 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8796 (Output_symtab_xindex::do_write): Add array bound check.
8797 (Output_section::Input_section::print_to_mapfile): Handle
8798 RELAXED_INPUT_SECTION_CODE.
8799 (Output_section::Output_section): Initialize data member checkpoint_.
8800 (Output_section::~Output_section): Delete checkpoint object pointed
8801 by checkpoint_.
8802 (Output_section::add_input_section): Always add an Input_section if
8803 relaxing.
8804 (Output_section::add_merge_input_section): Add assert.
8805 (Output_section::relax_input_section): New method definition.
8806 (Output_section::set_final_data_size): Set load address to zero for
8807 an unallocated section.
8808 (Output_section::do_address_and_file_offset_have_reset_values):
8809 New method definition.
8810 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8811 Handle relaxed input section.
8812 (Output_section::sort_attached_input_sections): Checkpoint input
8813 section list lazily.
8814 (Output_section::get_input_sections): Change type of input_sections to
8815 list of Simple_input_section pointers. Checkpoint input section list
8816 lazily. Also handle relaxed input sections.
8817 (Output_section::add_input_section_for_script): Take a reference to
8818 a Simple_input_section object instead of Relobj pointer and section
8819 index as parameter. Handle relaxed input sections.
8820 (Output_section::save_states, Output_section::restore_states): New
8821 method definitions.
8822 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8823 (Output_data::is_data_size_fixed): New method definition.
8824 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8825 if it is fixed.
8826 (Output_data::address_and_file_offset_have_reset_values): New method
8827 definition.
8828 (Output_data::do_address_and_file_offset_have_reset_values): New method
8829 definition.
8830 (Output_data::set_data_size): Check that data size is not fixed.
8831 (Output_data::fix_data_size): New method definition.
8832 (Output_data::is_data_size_fixed_): New data member.
8833 (Output_section_headers::set_final_data_size): New method definition.
8834 (Output_section_headers::do_size): New method declaration.
8835 (Output_segment_headers::set_final_data_size): New method definition.
8836 (Output_segment_headers::do_size): New method declaration.
8837 (Output_file_header::set_final_data_size)::New method definition.
8838 (Output_file_header::do_size)::New method declaration.
8839 (Output_section_data::Output_section_data): Add new parameter
8840 is_data_size_fixed and use it to fix data size.
8841 (Output_data_const::Output_data_const): Adjust call to base class
8842 constructor and fix data size.
8843 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8844 base class constructor and fix data size.
8845 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8846 base class constructor and fix data size.
8847 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8848 class constructor and fix data size.
8849 (Output_data_group::set_final_data_size): New method definition.
8850 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8851 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8852 class constructor and fix data size.
8853 (Output_relaxed_input_section): New class definition.
8854 (Output_section::Simple_input_section): New class definition.
8855 (Output_section::get_input_sections): Adjust parameter list.
8856 (Output_section::add_input_section_for_script): Same.
8857 (Output_section::save_states, Output_section::restore_states,
8858 Output_section::do_address_and_file_offset_have_reset_values,
8859 (Output_section::Input_section::Input_section): Handle
8860 RELAXED_INPUT_SECTION_CODE. Add new overload for
8861 Output_relaxed_input_section.
8862 (Output_section::Input_section::is_input_section,
8863 Output_section::Input_section::set_output_section): Handle relaxed
8864 input section.
8865 (Output_section::Input_section::is_relaxed_input_section,
8866 Output_section::Input_section::output_section_data,
8867 Output_section::Input_section::relaxed_input_section): New method
8868 definitions.
8869 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8870 value.
8871 (Output_section::Input_section::u1_): Update comments.
8872 (Output_section::Input_section::u2_): Add new union member poris.
8873 (Output_section::Checkpoint_output_section): New classs definition.
8874 (Output_section::relax_input_section): New method declaration.
8875 (Output_section::checkpoint_): New data member.
8876 (Output_segment): Update comments.
8877 (Output_segment::Output_segment): Un-privatize copy constructor.
8878 (Output_segment::operator=): Un-privatize.
8879 * script-sections.cc (Output_section_element::Input_section_list):
8880 Change element type to Output_section::Simple_input_section.
8881 (Output_section_element_dot_assignment::set_section_addresses):
8882 Register output section data for relaxation clean up.
8883 (Output_data_exression::Output_data_expression): Adjust call to base
8884 constructor to fix data size.
8885 (Output_section_element_data::set_section_addresses): Register
8886 Output_data_expression object for relaxation clean up.
8887 (struct Input_section_info): Replace Relobj pointer and section index
8888 pair with Output_section::Simple_input_section and Convert struct to a
8889 class.
8890 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8891 Input_section_info data member to use accessors.
20e6d0d6
DK
8892 (Output_section_element_input::set_section_addresses): Use layout
8893 parameter. Adjust code to use Output_section::Simple_input_section
8894 and Input_secction_info classes. Register filler for relaxation
8895 clean up.
8896 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8897 and section index pair with Output_section::Simple_input_section
8898 class. Adjust code accordingly.
8899 (Phdrs_element::release_segment): New method definition.
8900 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8901 segment list.
8902 (Script_sections::release_segments): New method definition.
8903 * gold/script-sections.h (Script_sections::release_segments): New
8904 method declaration.
8905 * gold/target.h (Target::may_relax, Target::relax,
8906 Target::do_may_relax, Target::do_relax): New method definitions.
8907
5e445df6
ILT
89082009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8909
8910 * arm.cc (has_signed_unsigned_overflow): New function.
8911 (Arm_relocate_functions::abs8): New function.
8912 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8913 (Target_arm::Scan::global): Likewise.
8914 (Target_arm::relocate::relocate): Likewise.
8915 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8916 Likewise.
8917
8c604651 89182009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8919
8920 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8921 * testsuite/Makefile.in: Regenerate.
8922
1e9cc1c2
NC
89232009-09-11 Nick Clifton <nickc@redhat.com>
8924
8925 * po/gold.pot: Updated by the Translation project.
8926
6a89f575
CC
89272009-09-08 Cary Coutant <ccoutant@google.com>
8928
8929 * output.cc (Output_file::open): Add execute permission to empty file.
8930 * testsuite/Makefile.am (permission_test): New test.
8931 * testsuite/Makefile.in: Regenerate.
8932
fdcac5af
ILT
89332009-09-02 Ian Lance Taylor <iant@google.com>
8934
8935 * output.cc (Output_file::resize): Call map_no_anonymous rather
8936 than map.
8937
44453f85
ILT
89382009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8939
8940 * gold.cc: Include "incremental.h".
8941 (queue_initial_tasks): Call Incremental_checker methods.
8942 * incremental.cc: Include "output.h".
8943 (Incremental_checker::can_incrementally_link_output_file): New
8944 method.
8945 * incremental.h (Incremental_checker): New class.
8946
8947 * output.cc (Output_file::open_for_modification): New method.
8948 (Output_file::map_anonymous): Changed return type to bool. Record
8949 map in base_ field.
8950 (Output_file::map_no_anonymous): New method, broken out of map.
8951 (Output_file::map): Use map_no_anonymous and map_anonymous.
8952 * output.h (class Output_file): Update declarations.
8953
293c1386
CC
89542009-08-24 Cary Coutant <ccoutant@google.com>
8955
8956 * options.h (Command_line::Pre_options): New class.
8957 (Command_line::pre_options): New member.
8958 * options.cc (gold::options::ready_to_register): New variable.
8959 (One_option::register_option): Do nothing if not registering options.
8960 Assert if same short option registered twice.
8961 (General_options::General_options): Turn off option registration when
8962 done constructing.
8963 (Command_line::Pre_options::Pre_options): New constructor.
8964
f773f3d2
CC
89652009-08-24 Cary Coutant <ccoutant@google.com>
8966
06a73cfe
CC
8967 * options.h (General_options::no_keep_memory): Remove incorrect
8968 short option.
f773f3d2 8969
a15af8e2
RW
89702009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8971
8972 * Makefile.am (am__skiplex, am__skipyacc): New.
8973 * Makefile.in: Regenerate.
8974
c462b41b
RW
89752009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8976
14ec8efd
RW
8977 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8978 (INCLUDES): ... this.
8979 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8980 (AM_CPPFLAGS): Renamed from ...
8981 (INCLUDE): ... this.
8982 * Makefile.in, testsuite/Makefile.in: Regenerate.
8983
81ecdfbb
RW
8984 * Makefile.in: Regenerate.
8985 * aclocal.m4: Likewise.
8986 * config.in: Likewise.
8987 * configure: Likewise.
8988 * testsuite/Makefile.in: Likewise.
8989
c462b41b
RW
8990 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8991 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8992 * Makefile.in: Regenerate.
8993 * testsuite/Makefile.in: Regenerate.
8994
2da73f13
CC
89952009-08-19 Cary Coutant <ccoutant@google.com>
8996
8997 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8998 symbols in shared libraries overridden by hidden or internal symbols
8999 in the main program.
9000
2db70501
CD
90012009-08-19 Chris Demetriou <cgd@google.com>
9002
9003 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9004 checking source file names in error messages.
9005
f733487b
DK
90062009-08-18 Doug Kwan <dougkwan@google.com>
9007
9008 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9009 an elcpp::Ehdr as parameter. Adjust call to set_target.
9010 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9011 an elfcpp::Ehdr as parameter.
9012 * object.cc (Object::set_target): Remove the version that looks up
9013 a target and sets it.
9014 (Sized_relobj::setup): Take a Target object instead of
9015 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9016 (make_elf_sized_object): Find target and ask target to
9017 make an ELF object.
9018 * object.h: (Object::set_target): Remove the version that looks up
9019 a target and sets it.
9020 (Sized_relobj::setup): Take a Target object instead of
9021 an elfcpp:Ehdr as parameter.
9022 * target.cc: Include dynobj.h.
9023 (Target::do_make_elf_object_implementation): New.
9024 (Target::do_make_elf_object): New.
9025 * target.h (Target::make_elf_object): New template declaration.
9026 (Target::do_make_elf_object): New method declarations.
9027 (Target::do_make_elf_object_implementation): New template declaration.
9028
cc70f101
ILT
90292009-08-14 Ian Lance Taylor <iant@google.com>
9030
9031 * gold.h (FUNCTION_NAME): Define.
9032 (gold_unreachable): Use FUNCTION_NAME.
9033
ef5e0cb1
ST
90342009-08-12 Sriraman Tallam <tmsriram@google.com>
9035
9036 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9037 symbol in the --keep-unique list is not found.
9038
48c187ce
ST
90392009-08-12 Sriraman Tallam <tmsriram@google.com>
9040
9041 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9042 been maked as --keep-unique.
9043 (Icf::unfold_section): New function.
9044 * icf.h (Icf::unfold_section): New function.
9045 * options.h (General_options::keep_unique): New option.
9046 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9047 * testsuite/Makefile.in: Regenerate.
9048 * testsuite/icf_keep_unique_test.sh: New file.
9049 * testsuite/icf_keep_unique_test.cc: New file.
9050
645afe0c
CC
90512009-08-12 Cary Coutant <ccoutant@google.com>
9052
9053 PR 10471
9054 * resolve.cc (Symbol_table::resolve): Check for references from
9055 dynamic objects to hidden and internal symbols.
9056 * testsuite/Makefile.am (hidden_test.sh): New test.
9057 * testsuite/Makefile.in: Regenerate.
9058 * testsuite/hidden_test.sh: New script.
9059 * testsuite/hidden_test_1.c: New test source.
9060 * testsuite/hidden_test_main.c: New test source.
9061
11af873f
DK
90622009-08-11 Doug Kwan <dougkwan@google.com>
9063
9064 * arm.cc: Update comments.
9065 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9066 segment to locate the .ARM.exidx section if present.
9067
b9f7d72d
DK
90682009-08-09 Doug Kwan <dougkwan@google.com>
9069
9070 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9071 patch.
9072
ddd3c53c
ST
90732009-08-07 Sriraman Tallam <tmsriram@google.com>
9074 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9075 compiler warnings.
9076
27721062
ST
90772009-08-06 Sriraman Tallam <tmsriram@google.com>
9078
9079 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9080 valid tls_segment only for non-debug-section relocations.
9081 * testsuite/Makefile.am: Add gc_tls_test.
9082 * testsuite/Makefile.in: Regenerate.
9083 * testsuite/gc_tls_test.cc: New file.
9084 * testsuite/gc_tls_test.sh: New file.
9085
ef15dade 90862009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9087
ef15dade
ST
9088 * icf.cc: New file.
9089 * icf.h: New file.
9090 * Makefile.am (CCFILES): Add icf.cc.
9091 (HFILES): Add icf.h
9092 * Makefile.in: Regenerate.
9093 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9094 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9095 section, symbol and addend information for the relocs.
9096 * gold.cc (queue_middle_tasks): Call identical code folding.
9097 * gold.h: Add defines for multimap.
9098 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9099 to the call of finalize_local_symbols.
9100 * main.cc (main): Create object of class Icf.
9101 * object.cc (Sized_relobj::do_layout): Allow this function to be
9102 called twice during icf.
9103 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9104 to sections marked as identical by icf.
9105 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9106 when available.
9107 (Sized_relobj::do_section_entsize): New function.
9108 * object.h (Object::section_entsize): New function.
9109 (Object::do_section_entsize): New pure virtual function.
9110 (Relobj::finalize_local_symbols): Add new parameter.
9111 (Relobj::do_section_entsize): New function.
9112 * options.h (General_options::icf): New option.
9113 (General_options::icf_iterations): New option.
9114 (General_options::print_icf_sections): New option.
9115 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9116 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9117 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9118 icf.
9119 * symtab.cc (Symbol_table::is_section_folded): New function.
9120 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9121 to sections marked as identical by icf.
9122 * symtab.h (Symbol_table::set_icf): New function.
9123 (Symbol_table::icf): New function.
9124 (Symbol_table::is_section_folded): New function.
9125 (Symbol_table::icf_): New data member.
9126 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9127 * testsuite/Makefile.am: Add commands to build icf_test.
9128 * testsuite/Makefile.in: Regenerate.
9129 * testsuite/icf_test.sh: New file.
9130 * testsuite/icf_test.cc: New file.
9131
c3b65ac4
CD
91322009-07-24 Chris Demetriou <cgd@google.com>
9133
9134 * layout.cc (is_compressible_debug_section): Fix incorrect
9135 comment about compressed section names.
9136
1caf2c51
ILT
91372009-07-20 Ian Lance Taylor <ian@airs.com>
9138
9139 PR 10419
9140 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9141
1ef4d87f
ILT
91422009-07-16 Ian Lance Taylor <iant@google.com>
9143
9144 PR 10400
9145 * layout.h: #include <map>.
9146 (class Kept_section): Change from struct to class. Add accessors
9147 and setters. Add section size to Comdat_group mapping. Change
9148 Comdat_group to std::map. Add is_comdat_ field. Add
9149 linkonce_size field in union.
9150 (class Layout): Update declaration of find_or_add_kept_section.
9151 Don't declare find_kept_object.
9152 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9153 parameter. Add object, shndx, is_comdat, and is_group_name
9154 parameters. Change all callers. Adjust for new Kept_section.
9155 (Layout::find_kept_object): Remove.
9156 * object.cc (Sized_relobj::include_section_group): Update use of
9157 Kept_section. Rename secnum to shndx. Only record
9158 Kept_comdat_section if sections are the same size.
9159 (Sized_relobj::include_linkonce_section): Update use of
9160 Kept_section. Only record Kept_comdat_section if sections are the
9161 same size. Set size of linkonce section.
9162 (Sized_relobj::map_to_kept_section): Update call to
9163 get_kept_comdat_section.
9164 * object.h (class Sized_relobj): Rename fields in
9165 Kept_comdat_section to drop trailing underscores; change object
9166 field to Relobj*. Change Kept_comdat_section_table to store
9167 struct rather than pointer.
9168 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9169 Add kept_object and kept_shndx parameters. Change all callers.
9170 (Sized_relobj::get_kept_comdat_section): Change return type to
9171 bool. Add kept_object and kept_shndx parameters. Change all
9172 callers.
9173 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9174 Layout::find_or_add_kept_section.
9175
37c3b7b0
ILT
91762009-07-09 Ian Lance Taylor <iant@google.com>
9177
9178 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9179 Reserve space in the hash table.
9180
98fa85cb
ILT
91812009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9182
9183 * fileread.cc (File_read::get_mtime): New method.
9184 * fileread.h (Timespec): New structure.
9185 (File_read::get_mtime): New method.
9186 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9187 Renamed from timestamp_nsec.
9188 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9189 Elf_Xword.
e1df38aa 9190 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9191 timestamp_nsec.
e1df38aa 9192 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9193 (Incremental_inputs::report_obejct): Save mtime; style fix.
9194 (Incremental_inputs::report_script): Save mtime; style fix.
9195 (Incremental_inputs::finalize_inputs): Style fix.
9196 (Incremental_inputs::finalize): Style fix.
9197 (Incremental_inputs::create_input_section_data): Store inputs
9198 mtime.
9199 * incremental.h (Incremental_inputs::report_script): Add mtime
9200 argument.
9201 (Incremental_inputs::Input_info::Input_info): Intialize only one
9202 union member.
9203 (Incremental_inputs::Input_info::archive): Move to nameless
9204 union.
9205 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9206 (Incremental_inputs::Input_info::script): Move to nameless union.
9207 (Incremental_inputs::mtime): New field.
9208 * script.cc (read_input_script): Pass file mtime to
9209 Incremental_input.
9210 * script.h (Script_info::inputs): Style fix.
9211
c9d70757
ILT
92122009-07-01 Ian Lance Taylor <ian@airs.com>
9213
9214 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9215 instead of 32.
9216
9c547ec3
ILT
92172009-06-24 Ian Lance Taylor <iant@google.com>
9218
9219 PR 10156
9220 * layout.cc (Layout::choose_output_section): If we find an
9221 existing section, update the flags.
9222 (Layout::create_notes): New function, broken out of
9223 Layout::finalize.
9224 (Layout::finalize): Don't create note sections.
9225 (Layout::create_note): Don't crash if linker script discards
9226 section.
9227 (Layout::create_gold_note): Likewise.
9228 (Layout::create_build_id): Likewise. Don't set
9229 after_input_sections on the section.
9230 (Layout::create_executable_stack_info): Remove target parameter.
9231 Change caller.
9232 * layout.h (class Layout): Declare create_notes. Update
9233 declaration of create_executable_stack_info.
9234 * gold.cc (queue_middle_tasks): Call create_notes.
9235 * output.cc (Output_section::update_flags_for_input_section): Move
9236 here from output.h. If SHF_ALLOC flag is newly set, mark address
9237 invalid.
9238 * output.h (Output_data::mark_address_invalid): New function.
9239 (class Output_section): Only declare, not define,
9240 update_flags_for_input_section. Remove set_flags.
9241
55458500
ILT
92422009-06-24 Ian Lance Taylor <iant@google.com>
9243
9244 * script-sections.cc (Output_section_definition::
9245 set_section_addresses): Rename shadowing local load_address to
9246 laddr.
9247
1307d6cd
ILT
92482009-06-24 Ian Lance Taylor <iant@google.com>
9249
9250 PR 10244
9251 * reloc.cc (relocate_sections): Skip empty relocation sections.
9252
ec3f783e
ILT
92532009-06-23 Ian Lance Taylor <iant@google.com>
9254
9255 PR 10156
9256 * layout.cc (Layout::create_note): Use choose_output_section
9257 rather than make_output_section.
9258
459c9f1c
ILT
92592009-06-23 Ian Lance Taylor <iant@google.com>
9260
9261 PR 10237
9262 * options.cc (General_options::parse_V): Set printed_version_.
9263 (General_options::General_options): Initialize printed_version_.
9264 * options.h (class General_options): Add printed_version_ field.
9265 * gold.cc (queue_initial_tasks): If there are no input files,
9266 don't give a fatal error if we printed the version information.
9267 (queue_middle_tasks): If using -r with a shared object, give a
9268 fatal error rather than an ordinary error.
9269
1518dc8f
ILT
92702009-06-23 Ian Lance Taylor <iant@google.com>
9271
9272 PR 10219
9273 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9274 (Layout::make_output_section): Set have_stabstr_section_ if we see
9275 a .stab*str section.
9276 (Layout::finalize): Call link_stabs_sections.
9277 (Layout::link_stabs_sections): New file.
9278 * layout.h (class Layout): Add have_stabstr_section_ field.
9279 Declare link_stabs_sections.
9280
3d857b98
DK
92812009-06-23 Doug Kwan <dougkwan@google.com>
9282
9283 * Makefile.am (libgold_a_LIBADD): New.
9284 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9285 * Makefile.in: Regenerate.
9286 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9287 * configure: Regenerate.
9288 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9289 * fileread.cc: Include sys/state.h
9290 * gold.h: Declare memmem and strndup if found missing.
9291 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9292
0639a6f6
ILT
92932009-06-23 Ian Lance Taylor <iant@google.com>
9294
9295 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9296 * configure: Rebuild.
9297
8d63875c
ILT
92982009-06-23 Ian Lance Taylor <iant@google.com>
9299
9300 PR 10147
9301 * object.cc (Object::section_contents): Don't try to get a view if
9302 the section has length zero.
9303 (Object::handle_gnu_warning_section): If the section is empty, use
9304 the name of the section as the warning.
9305
f7c8a183
ILT
93062009-06-23 Ian Lance Taylor <iant@google.com>
9307
9308 PR 10133
9309 * stringpool.h (class Stringpool_template): Add optimize_ field.
9310 (Stringpool_template::set_optimize): New function.
9311 * stringpool.cc (Stringpool_template::Stringpool_template):
9312 Initialize optimize_ field.
9313 (Stringpool_template::set_string_offsets): Test local optimize
9314 fild rather than parameter.
9315 * layout.cc (Layout::Layout): Call set_optimize on the section
9316 name stringpool.
9317
e6a307ba
ILT
93182009-06-22 Ian Lance Taylor <iant@google.com>
9319
9320 PR 10030
9321 * yyscript.y: Parse TARGET.
9322 * script.cc (script_set_target): New function.
9323 * script-c.h (script_set_target): Declare.
9324 * options.cc (General_options::string_to_object_format): Rename
9325 from string_to_object_format in anonymous namespace. Change
9326 callers.
9327 * options.h (class General_options): Declare
9328 string_to_object_format.
9329
3ee173de
ILT
93302009-06-22 Ian Lance Taylor <iant@google.com>
9331
9332 * script-sections.cc (Script_sections::create_segments): Don't put
9333 program headers in a PT_LOAD segment if -n or -N.
9334
93352009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9336
9337 PR 10141
9338 * options.h (class General_options): Add -z lazy and -z now. Sort
9339 -z options into alphabetical order.
9340 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9341
cd6739a1 93422009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9343
9344 * layout.cc (Layout::make_output_section): Call
9345 Target::new_output_section.
9346 (Layout::attach_allocated_section_to_segment): Put large section
9347 sections in a separate load segment with the large segment flag
9348 set.
9349 (Layout::segment_precedes): Sort large data segments after other
9350 load segments.
9351 (align_file_offset): New static function.
9352 (Layout::set_segment_offsets): Use align_file_offset.
9353 * output.h (class Output_section): Add is_small_section_ and
9354 is_large_section_ fields.
9355 (Output_section::is_small_section): New function.
9356 (Output_section::set_is_small_section): New function.
9357 (Output_section::is_large_section): New function.
9358 (Output_section::set_is_large_section): New function.
9359 (Output_section::is_large_data_section): New function.
9360 (class Output_segment): Add is_large_data_segment_ field.
9361 (Output_segment::is_large_data_segment): New function.
9362 (Output_segment::set_is_large_data_segment): New function.
9363 * output.cc (Output_section::Output_section): Initialize new
9364 fields.
9365 (Output_segment::Output_segment): Likewise.
9366 (Output_segment::add_output_section): Add assertion that large
9367 data sections always go in large data segments. Force small data
9368 sections to the end of the list of data sections. Force small BSS
9369 sections to the start of the list of BSS sections. For large BSS
9370 sections to the end of the list of BSS sections.
9371 * symtab.h (class Symbol): Declare is_common_shndx.
9372 (Symbol::is_defined): Check Symbol::is_common_shndx.
9373 (Symbol::is_common): Likewise.
9374 (class Symbol_table): Define enum Commons_section_type. Update
9375 declarations. Add small_commons_ and large_commons_ fields.
9376 * symtab.cc (Symbol::is_common_shndx): New function.
9377 (Symbol_table::Symbol_table): Initialize new fields.
9378 (Symbol_table::add_from_object): Put small and large common
9379 symbols in the right list.
9380 (Symbol_table::sized_finalized_symbol): Check
9381 Symbol::is_common_shndx.
9382 (Symbol_table::sized_write_globals): Likewise.
9383 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9384 common symbol lists. Don't call do_allocate_commons_list if the
9385 list is empty.
9386 (Symbol_table::do_allocate_commons_list): Remove is_tls
9387 parameter. Add comons_section_type parameter. Change all
9388 callers. Handle small and large common symbols.
9389 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9390 Symbol::is_common_shndx.
9391 * resolve.cc (symbol_to_bits): Likewise.
9392 * target.h (Target::small_common_shndx): New function.
9393 (Target::small_common_section_flags): New function.
9394 (Target::large_common_shndx): New function.
9395 (Target::large_common_section_flags): New function.
9396 (Target::new_output_section): New function.
9397 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9398 small_common_section_flags, and large_common_section_flags
9399 fields.
9400 (Target::do_new_output_section): New virtual function.
9401 * arm.cc (Target_arm::arm_info): Initialize new fields.
9402 * i386.cc (Target_i386::i386_info): Likewise.
9403 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9404 Likewise.
9405 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9406 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9407 (Target_x86_64::do_new_output_section): New function.
9408 * configure.ac: Define conditional MCMODEL_MEDIUM.
9409 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9410 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9411 (large_LDFLAGS): Define.
9412 * testsuite/large.c: New file.
9413 * testsuite/testfile.cc (Target_test::test_target_info):
9414 Initialize new fields.
9415 * configure, testsuite/Makefile.in: Rebuild.
9416
bb04269c
DK
94172009-06-05 Doug Kwan <dougkwan@google.com>
9418
9419 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9420 * Makefile.in: Regenerate.
bb04269c
DK
9421 * i386.cc (class Target_i386): Define new virtual method to
9422 override do_is_local_label_name in parent.
9423 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9424 local symbols if --discard-locals or -X is given.
9425 * options.h (class General_options): Declare new options
9426 '--discard-locals' and '-X' for discarding locals.
9427 * target.h (class Target): Define new methods is_local_label_name.
9428 Declare new virtual method do_is_local_label_name.
9429 * target.cc: New file.
9430 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9431 (check_SCRIPTS): Add discard_locals_test.sh.
9432 (check_DATA): Add discard_local_tests.syms.
9433 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9434 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9435 * testsuite/Makefile.in: Regenerate.
9436 * testsuite/discard_locals_test.c: New file.
9437 * testsuite/discard_locals_test.sh: Same.
9438
805bb01c
DK
94392009-06-05 Doug Kwan <dougkwan@google.com>
9440
9441 * object.cc (Sized_relobj::Sized_relobj): Initialize
9442 discarded_eh_frame_shndx_ to -1U.
9443 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9444 section.
9445 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9446 a discarded .eh_frame section.
9447 (Sized_relobj::do_finalize_local_symbols): Ditto.
9448 * object.h (class Sized_relobj): Declare new member
9449 discarded_eh_frame_shndx_.
9450 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9451 (local_labels_test.o, local_labels_test): New rules.
9452 * testsuite/Makefile.in: Regenerate.
9453
1dcd334d
DK
94542009-06-04 Doug Kwan <dougkwan@google.com>
9455
9456 * layout.cc (Layout::section_name_mapping): Add mapping for
9457 special ARM sections.
9458
96d49306
DK
94592009-06-03 Doug Kwan <dougkwan@google.com>
9460
9461 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9462 (utils::has_overflow): Same.
9463
dff16297
ILT
94642009-06-03 Ian Lance Taylor <iant@google.com>
9465
9466 * layout.cc (Layout::section_name_mapping): New array, replacing
9467 Layout::linkonce_mapping.
9468 (Layout::section_name_mapping_count): New variable, replacing
9469 Layout::linkonce_mapping_count.
9470 (Layout::linkonce_output_name): Remove.
9471 (Layout::output_section_name): Rewrite.
9472 * layout.h (class Layout): Rename Linkonce_mapping to
9473 Section_name_mapping, linkonce_mapping to section_name_mapping,
9474 linkonce_mapping_count to section_name_mapping_count. Don't
9475 declare linkonce_output_name.
9476
c121c671
DK
94772009-06-03 Doug Kwan <dougkwan@google.com>
9478
9479 * gold/arm.cc (namespace utils): New.
9480 (Target_arm::reloc_is_non_pic): Define new method.
9481 (class Arm_relocate_functions): New.
9482 (Target_arm::Relocate::relocate): Handle relocation types used by
9483 Android.
9484
07800fab
ILT
94852009-06-03 Ian Lance Taylor <iant@google.com>
9486
9487 * arm.cc (Target_arm::scan::global): Use || instead of |.
9488
c121c671
DK
94892009-06-02 Doug Kwan <dougkwan@google.com>
9490
9491 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9492 issued_non_pic_error_.
9493 (class Target_arm::Scan): Declare new method check_non_pic.
9494 Define new method symbol_needs_plt_entry.
9495 Declare new data member issued_non_pic_error_.
9496 (class Target_arm::Relocate): Declare new method
9497 should_apply_static_reloc.
9498 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9499 (Target_arm::Scan::check_non_pic): Define new method.
9500 (Target_arm::Scan::local): Handle a small subset of reloc types used
9501 by Android.
9502 (Target_arm::Scan::local): Same.
9503 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9504
b19b0c6d
ILT
95052009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9506
9507 * incremental.cc (Incremental_inputs::report_command_line): Filter
9508 out --incremental-* options.
9509
94cdfcff
DK
95102009-05-29 Doug Kwan <dougkwan@google.com>
9511
9512 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9513 template class.
9514 (class Target_arm): Update comment.
9515 (Target_arm::Target_arm): Initialize new data members GOT_,
9516 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9517 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9518 and Target_arm::rel_dyn_section.
9519 Declare new_enum Target_arm::Got_type.
9520 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9521 and DYNBSS_.
9522 Update commments for member do_dynsym_value.
9523 (Target_arm::got_size, Target_arm::plt_section,
9524 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9525 new methods inside class defintion.
9526 (Target_arm::got_section): Define new method.
9527 (Target_arm::rel_dyn_section): Same.
9528 (Output_data_plt_arm): New template class.
9529 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9530 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9531 (Output_data_plt_arm::add_entry): Same.
9532 (Output_data_plt_arm::first_plt_entry): Define new
9533 static data member for PLT instruction template.
9534 (Output_data_plt_arm::plt_entry): Same.
9535 (Output_data_plt_arm::do_write): Define new method.
9536 (Target_arm::make_plt_entry): Same.
9537 (Target_arm::do_finalize_sections): Same.
9538 (Target_arm::do_dynsym_value): Same.
9539
4a657b0d
DK
95402009-05-28 Doug Kwan <dougkwan@google.com>
9541
9542 * Makefile.am (TARGETSOURCES): Add arm.cc.
9543 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9544 * Makefile.in: Regenerate.
9545 * arm.cc: New file.
9546 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9547
e7ae8c36
DK
95482009-05-26 Doug Kwan <dougkwan@google.com>
9549
9550 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9551 (General_options::check_excluded_libs): Strip off directories in
9552 archive name before matching like GNU ld does.
9553 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9554 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9555 (exclude_libs_test_LDFLAGS): Add linker option
9556 -Wl,--exclude-libs,libexclude_libs_test_3
9557 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9558 an explicit archive without using -l.
9559 (alt/libexclude_libs_test_3.a): New make rule.
9560 * testsuite/Makefile.in: Regenerate.
9561 * testsuite/exclude_libs_test.c : Declare lib3_default().
9562 (main): Call it.
9563 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9564 * exclude_libs_test_3.c: New file.
9565
f12e7348
NC
95662009-05-26 Nick Clifton <nickc@redhat.com>
9567
9568 * po/id.po: New Indonesian translation.
9569 * po/gold.pot: Updated template file.
9570
4daadc0d
ST
95712009-05-22 Sriraman Tallam <tmsriram@google.com>
9572
e1df38aa 9573 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9574 gc_comdat_test files. Add -Wl,--gc-sections to build
9575 gc_comdat_test.
9576 * testsuite/Makefile.in: Regenerate.
9577 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9578
531813ad
ST
95792009-05-21 Sriraman Tallam <tmsriram@google.com>
9580
9581 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9582 kept comdat section was garbage collected.
9583 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9584 * testsuite/Makefile.in: Regenerate.
9585 * testsuite/gc_comdat_test.sh: New file.
9586 * testsuite/gc_comdat_test_1.cc: New file.
9587 * testsuite/gc_comdat_test_2.cc: New file.
9588
65514900
CC
95892009-05-19 Doug Kwan <dougkwan@google.com>
9590
9591 * archive.cc (Archive::Archive): Move constructor from archive.h
9592 to here. Initialize no_export_.
9593 (Archive::get_elf_object_for_member): Set no_export flag of object.
9594 * archive.h (Archive::Archive): Move constructor body to
9595 archive.cc.
9596 (Archive::no_export): New method.
9597 (Archive::no_export_): New field.
9598 * object.h (Object::Object): Initialize no_export_ to false.
9599 (Object::no_export, Object::set_no_export): New methods.
9600 (Object::no_export_): New field.
9601 * options.cc (General_options::parse_exclude_libs): New method.
9602 (General_options::check_excluded_libs) Same.
9603 * options.h (exclude_libs): New option.
9604 (General_options::check_excluded_libs): New method declaration.
9605 (General_options::excluded_libs_): New field.
9606 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9607 default or protected visibility if an object has no-export flag set.
9608 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9609 (check_SCRIPTS): Add exclude_libs_test.sh.
9610 (check_DATA): Add exclude_libs_test.syms.
9611 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9612 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9613 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9614 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9615 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9616 libexclude_libs_test_2.a): New rules.
9617 * testsuite/Makefile.in: Regenerate.
9618 * testsuite/exclude_libs_test.c: New file.
9619 * testsuite/exclude_libs_test.sh: Ditto.
9620 * testsuite/exclude_libs_test_1.c: Ditto.
9621 * testsuite/exclude_libs_test_2.c: Ditto.
9622
1b77ea50
ILT
96232009-05-15 Ian Lance Taylor <iant@google.com>
9624
9625 * configure.ac: Check for declarations for cases where libiberty.h
9626 checks HAVE_DECL_xxx.
9627 * configure, config.in: Rebuild.
9628
072fe7ce
ILT
96292009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9630
9631 * gold.h (Incremental_argument_list): Remove (invalid) forward
9632 declaration.
9633 * incremental.cc (Incremental_inputs::report_achive): New method.
9634 (Incremental_inputs::report_object): New method.
9635 (Incremental_inputs::report_script): New method.
9636 (Incremental_inputs::finalize_inputs): New method.
9637 (Incremental_inputs::finalize): Call finalize_inputs().
9638 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9639 Create inputs entries.
9640 * incremental.h (Incremental_input_type): New enum.
9641 (Incremental_inputs::Incremental_input): Initialize new fields.
9642 (Incremental_inputs::report_inputs): New method.
9643 (Incremental_inputs::report_achive): New method.
9644 (Incremental_inputs::report_object): New method.
9645 (Incremental_inputs::report_script): New method.
9646 (Incremental_inputs::finalize_inputs): New method.
9647 (Incremental_inputs::Input_info): New struct.
9648 (Incremental_inputs::Input_info_map): New typedef.
9649 (Incremental_inputs::lock_): New field.
9650 (Incremental_inputs::Inputs_): New field.
9651 (Incremental_inputs::Inputs_map): New field.
9652 * main.cc (main): Call Incremental_input::report_inputs.
9653 * options.h (Input_argument_list): Typedef moved from
9654 Input_arguments.
9655 (Input_file_group::Files): Remove, use ::Input_argument_list.
9656 (Input_file_group::Input_argument_list): Remove, use
9657 ::Input_argument_list.
9658 * plugin.cc (Plugin_manager::add_input_file): Add error in
9659 incremental build.
9660 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9661 functions.
9662 * script.cc (read_input_script): Call
9663 Incremental_input::report_script.
9664 * script.h (Script_info): New class.
9665
b0481b0b
ILT
96662009-04-27 Ian Lance Taylor <iant@google.com>
9667
9668 * x86_64.cc (do_adjust_output_section): Set entsize to
9669 plt_entry_size.
9670
b22a5a41 96712009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
9672
9673 * output.cc (Output_file::close): After short writes, continue
9674 writing from the correct offset in the buffer being written.
9675
40fde488
CD
96762009-04-23 Chris Demetriou <cgd@google.com>
9677
9678 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9679 * configure: Regenerate.
9680 * config.in: Regenerate.
9681 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9682 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9683
3ce2c28e
ILT
96842009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9685
9686 * incremental.cc (Incremental_inputs_header_data): Renamed from
9687 Incremental_input_header_data.
9688 (Incremental_inputs_header_data::data_size): New field.
9689 (Incremental_inputs_header_data::put_input_file_count): Renamed
9690 from input_file_count.
9691 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9692 from command_line_offset.
9693 (Incremental_inputs_header_data::put_reserved): Renamed from
9694 put_reserved.
9695 (Incremental_inputs_entry_data): Renamed from
9696 Incremental_input_entry_data.
9697 (Incremental_inputs_entry_data::data_size): New field.
9698 (Incremental_inputs::report_command_line): New method.
9699 (Incremental_inputs::finalize): New method.
9700 (Incremental_inputs::create_incremental_inputs_data): New method.
9701 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9702 * incremental.h: New file.
9703 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9704 (Layout::finalize): Create incremental inputs section in
9705 incremental builds.
9706 (Layout::create_incremental_info_sections): New method.
9707 * layout.h (Layout::incremental_inputs): New method.
9708 (Layout::create_incremental_info_sections): New method.
9709 (Layout::incremental_inputs_): New field.
9710 * main.cc (main): Notify Incremental_input of the command line.
9711
e55bde5e
ILT
97122009-04-01 Ian Lance Taylor <iant@google.com>
9713 Mikolaj Zalewski <mikolajz@google.com>
9714
9715 * gold.h (reserve_unordered_map): Define, three versions, one for
9716 each version of Unordered_map.
9717 * layout.cc (Layout::Layout): Remove options parameter. Add
9718 number_of_input_files parameter. Don't initialize options_.
9719 Initialize number_of_input_files_ and resized_signatures_. Move
9720 sections_are_attached_.
9721 (Layout::layout_group): Reserve space for group_signatures_.
9722 (Layout::find_or_add_kept_section): Change name parameter to be a
9723 reference. Resize signatures_ map when it gets large enough.
9724 (Layout::layout_eh_frame): Use parameters->options() instead of
9725 this->options_.
9726 (Layout::make_output_section): Likewise.
9727 (Layout::attach_allocated_section_to_segment): Likewise.
9728 (Layout::finalize, Layout::create_executable_stack): Likewise.
9729 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9730 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9731 * layout.h (class Layout): Update declarations. Remove options_
9732 field. Add number_of_input_files_ and resized_signatures_
9733 fields. Move sections_are_attached_ field.
9734 * main.cc (main): Pass number of input files to Layout
9735 constructor. Don't pass options.
9736
154b857c
ILT
97372009-03-30 Ian Lance Taylor <iant@google.com>
9738
9739 * ffsll.c (ffsll): Correct implementation.
9740
2f35ab9b
ILT
97412009-03-27 Ian Lance Taylor <iant@google.com>
9742
fd03461a
ILT
9743 * ffsll.c: New file.
9744 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9745 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9746 * ftruncate.c (ftruncate): Declare before definition.
9747 * mremap.c (mremap): Likewise.
9748 * pread.c (pread): Likewise.
9749 * configure, Makefile.in, config.in: Rebuild.
9750
2f35ab9b
ILT
9751 * mremap.c: New file.
9752 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9753 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9754 (mremap): Declare if HAVE_MREMAP is not defined.
9755 * configure, Makefile.in, config.in: Rebuild.
9756
33aea2fd
CC
97572009-03-27 Cary Coutant <ccoutant@google.com>
9758
9759 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9760 position independent.
9761 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9762 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9763
6d479619
CC
97642009-03-24 Cary Coutant <ccoutant@google.com>
9765
9766 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9767 an executable.
9768 (needs_dynamic_reloc): Likewise.
9769
afc06bb8
ILT
97702009-03-24 Ian Lance Taylor <iant@google.com>
9771
9772 * yyscript.y (file_cmd): Recognize EXTERN.
9773 (extern_name_list, extern_name_list_body): New nonterminals.
9774 * script.cc (script_add_extern): Define.
9775 * script-c.h (script_add_extern): Declare.
9776
f6060a4d
ILT
97772009-03-24 Rafael Avila de Espindola <espindola@google.com>
9778
9779 * object.cc (is_elf_object): Define.
9780 * object.h (is_elf_object): Declare.
9781 * archive.cc (Archive::get_elf_object_for_member): Call
9782 is_elf_object.
33aea2fd 9783 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9784
26736d8e
ILT
97852009-03-24 Elliott Hughes <enh@google.com>
9786
9787 * output.cc (Output_file::map_anonymous): Define.
9788 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9789 try an anonymous one. Report the size if the mmap fails.
9790 * output.h (class Output_file): Declare map_anonymous.
9791
22fd9730
ILT
97922009-03-24 Ian Lance Taylor <iant@google.com>
9793
9794 * target-select.cc (instantiate_target): Don't acquire the lock if
9795 the instantiated_target_ field has already been set.
9796
cb010894
ILT
97972009-03-23 Ian Lance Taylor <iant@google.com>
9798
7f055c20
ILT
9799 * gold-threads.h (class Initialize_lock): Define.
9800 * gold-threads.cc (class Initialize_lock_once): Define.
9801 (initialize_lock_control): New static variable.
9802 (initialize_lock_pointer): New static variable.
9803 (initialize_lock_once): New static function.
9804 (Initialize_lock::Initialize_lock): Define.
9805 (Initialize_lock::initialize): Define.
9806 * target-select.h: Include "gold-threads.h".
9807 (class Target_selector): Add lock_ and initialize_lock_ fields.
9808 Don't define instantiate_target, just declare it.
9809 * target-select.cc (Target_selector::Target_selector): Initialize
9810 new fields.
9811 (Target_selector::instantiate_target): Define.
9812 * descriptors.h: Include "gold-threads.h".
9813 (class Descriptors): Add initialize_lock_ field.
9814 * descriptors.cc (Descriptors::Descriptors): Initialize new
9815 field.
9816 (Descriptors::open): Use initialize_lock_ field
9817 * errors.h (class Errors): Add initialize_lock_ field.
9818 * errors.cc (Errors::Errors): Initialize new field.
9819 (Errors::initialize_lock): Use initialize_lock_ field.
9820 * powerpc.cc (class Target_selector_powerpc): Remove
9821 instantiated_target_ field. In do_recognize call
9822 instantiate_target rather than do_instantiate_target. In
9823 do_instantiate_target just allocate a new target.
9824 * sparc.cc (class Target_selector_sparc): Likewise.
9825
36959681
ILT
9826 * freebsd.h: New file.
9827 * i386.cc: Include "freebsd.h".
9828 (Target_i386): Derive from Target_freebsd rather than
9829 Sized_target.
9830 (Target_selector_i386): Derive from Target_selector_freebsd rather
9831 than Target_selector.
9832 * x86_64.cc: Include "freebsd.h".
9833 (Target_x86_64): Derive from Target_freebsd rather than
9834 Sized_target.
9835 (Target_selector_x86_64): Derive from Target_selector_freebsd
9836 rather than Target_selector.
9837 * target.h (class Target): Add adjust_elf_header and
9838 do_adjust_elf_header.
9839 * output.cc (Output_file_header:: do_sized_write): Call target
9840 adjust_elf_header routine.
9841 * configure.tgt: Set targ_osabi.
9842 * configure.ac: Define GOLD_DEFAULT_OSABI.
9843 * parameters.cc (Parameters::default_target): Pass
9844 GOLD_DEFAULT_OSABI to select_target.
9845 * target-select.h (class Target_selector): Make instantiate_target
9846 protected rather than private.
9847 * Makefile.am (HFILES): Add freebsd.h.
9848 * configure, Makefile.in, config.in: Rebuild.
9849
cb010894
ILT
9850 * merge.cc (do_add_input_section): Correct pend value. Change
9851 message about last entry not being null terminated from error to
9852 warning.
9853
0e879927
ILT
98542009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9855
9856 * incremental.cc: New file.
9857 * Makefile.am (CCFILES): Add incremental.cc.
9858 * Makefile.in: Rebuild.
9859
41105937
PP
98602009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9861
9862 * layout.cc (Layout::output_section_name): Preserve names
9863 of '.note.' sections.
e1df38aa 9864
60439920
ILT
98652009-03-19 Ian Lance Taylor <iant@google.com>
9866
9867 * descriptors.cc (Descriptors::open): Check that the options are
9868 valid before using them.
9869
0d371ad3
ILT
98702009-03-18 Ian Lance Taylor <iant@google.com>
9871
9872 * script-sections.h: Include <list>.
9873 (class Script_sections): Change Sections_elements from std::vector
9874 to std::list. Typedef public Elements_iterator. Add
9875 orphan_section_placement_, data_segment_align_start_, and
9876 saw_data_segment_align_ fields. Remove data_segment_align_index_
9877 field.
9878 * script-sections.cc (class Orphan_section_placement): New class.
9879 (class Sections_element): Add virtual functions is_relro and
9880 orphan_section_init. Remove virtual function place_orphan_here.
9881 (class Output_section_definition): Add is_relro and
9882 orphan_section_init. Remove place_orphan_here.
9883 (class Orphan_output_section): Likewise.
9884 (Script_sections::Script_sections): Update for field changes.
9885 (Script_sections::data_segment_align): Set saw_data_segment_align_
9886 and data_segment_align_start_, not data_segment_align_index.
9887 (Script_sections::data_segment_relro_end): Check
9888 saw_data_segment_align_. Use data_segment_align_start_ rather
9889 than data_segment_align_index_.
9890 (Script_sections::place_orphan): Rewrite to use
9891 Orphan_section_placement.
9892
9201d894
ILT
98932009-03-17 Ian Lance Taylor <iant@google.com>
9894
9c5b8369
ILT
9895 * archive.cc (Archive::add_symbols): Check for a version attached
9896 to the symbol name in the archive map.
9897 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9898 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9899 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9900 (ver_test_11.a): New target.
9901 * testsuite/Makefile.in: Rebuild.
9902
9201d894
ILT
9903 * configure.ac: Check for chsize and posix_fallocate. Replace
9904 ftruncate.
9905 * ftruncate.c: New file, from gnulib.
9906 * output.cc (posix_fallocate): Define dummy version if not
9907 HAVE_POSIX_FALLOCATE.
9908 (Output_file::map): Call posix_fallocate rather than lseek and
9909 write.
9910 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9911 * configure, Makefile.in, config.in: Rebuild.
9912
ef4ab7a8 99132009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9914
ef4ab7a8
PP
9915 * layout.h (Layout::create_note): Add section_name parameter.
9916 * layout.cc (Layout::create_note): Likewise.
9917 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9918
8c500701
ILT
99192009-03-17 Ian Lance Taylor <iant@google.com>
9920
e85b18e1
ILT
9921 * descriptors.cc: Include "options.h".
9922 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9923 (Descriptors::open): Always use O_CLOEXEC when opening a new
9924 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9925 then set FD_CLOEXEC.
9926
9efe6174
ILT
9927 * sparc.cc (class Target_sparc): Add has_got_section.
9928 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9929 make sure we have a GOT section.
9930
9931 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9932 (Target_sparc::Scan::local): Likewise.
9933 (Target_sparc::Scan::global): Likewise.
9934 (Target_sparc::Relocate::relocate): Likewise.
9935 (Target_sparc::Relocate::relocate_tls): Likewise.
9936
8c500701
ILT
9937 * symtab.cc (Symbol_table::define_default_version): New function,
9938 broken out of add_from_object.
9939 (Symbol_table::add_from_object): Call define_default_version.
9940 (Symbol_table::define_special_symbol): Add resolve_oldsym
9941 parameter. Change all callers. If the version for a symbol comes
9942 from a version script, resolve it with the symbol with the same
9943 name with no version. Also add the symbol without a version if
9944 appropriate.
9945 (do_define_in_output_data): If resolving with oldsym, don't delete
9946 sym.
9947 (do_define_in_output_segment): Likewise.
9948 (do_define_as_constant): Likewise.
9949 * symtab.h (class Symbol_table): Update declarations.
9950
f1ed28fb
ILT
99512009-03-13 Ian Lance Taylor <iant@google.com>
9952
15f8229b
ILT
9953 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9954 (Read_symbols::requeue): New function.
9955 (Read_symbols::do_read_symbols): If make_elf_object fails because
9956 the target type is not configured, and the file was searched for,
9957 issue a warning and retry with the next directory.
9958 (Add_symbols::run): If the file has an incompatible format, and
9959 it was searched for, requeue the Read_symbols task. On error,
9960 release the object.
9961 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9962 dirindex parameter to constructor. Change all callers. Declare
9963 incompatible_warning and requeue.
9964 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9965 input_argument_ and input_group_ fields. Add them to
9966 constructor. Change all callers.
9967 (class Read_script): Add dirindex_ field. Add it to constructor.
9968 Change all callers.
9969 * archive.cc (Archive::setup): Remove input_objects parameter.
9970 Change all callers.
9971 (Archive::get_file_and_offset): Likewise.
9972 (Archive::read_all_symbols): Likewise.
9973 (Archive::read_symbols): Likewise.
9974 (Archive::get_elf_object_for_member): Remove input_objects
9975 parameter. Add punconfigured parameter. Change all callers.
9976 (Archive::add_symbols): Change return type to bool. Check return
9977 value of include_member.
9978 (Archive::include_all_members): Likewise.
9979 (Archive::include_member): Change return type to bool. Return
9980 false if first included object has incompatible target. Set
9981 included_member_ field.
9982 (Add_archive_symbols::run): If add_symbols returns false, requeue
9983 Read_symbols task.
9984 * archive.h (class Archive): Add included_member_ field.
9985 Initialize it in constructor. Add input_file and searched_for
9986 methods. Update declarations.
9987 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9988 input_argument_ fields. Add them to constructor. Change all
9989 callers.
9990 * script.cc: Include "target-select.h".
9991 (class Parser_closure): Add skip_on_incompatible_target_ and
9992 found_incompatible_target_ fields. Add
9993 skip_on_incompatible_target parameter to constructor. Change all
9994 callers. Add methods skip_on_incompatible_target,
9995 clear_skip_on_incompatible_target, found_incompatible_target, and
9996 set_found_incompatible_target.
9997 (read_input_script): Add dirindex parameter. Change all callers.
9998 If parser finds an incompatible target, requeue Read_symbols
9999 task.
10000 (script_set_symbol): Clear skip_on_incompatible_target in
10001 closure.
10002 (script_add_assertion, script_parse_option): Likewise.
10003 (script_start_sections, script_add_phdr): Likewise.
10004 (script_check_output_format): New function.
10005 * script.h (read_input_script): Update declaration.
10006 * script-c.h (script_check_output_format): Declare.
10007 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10008 (ignore_cmd): Remove OUTPUT_FORMAT.
10009 * fileread.cc (Input_file::Input_file): Add explicit this.
10010 (Input_file::will_search_for): New function.
10011 (Input_file::open): Add pindex parameter. Change all callers.
10012 * fileread.h (class Input_file): Add input_file_argument method.
10013 Declare will_search_for. Update declarations.
10014 * object.cc (make_elf_object): Add punconfigured parameter.
10015 Change all callers.
10016 * object.h (class Object): Make input_file public. Add
10017 searched_for method.
10018 (make_elf_object): Update declaration.
10019 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10020 restart search.
10021 * dirsearch.h (class Dirsearch): Update declaration.
10022 * options.h (class General_options): Add --warn-search-mismatch.
10023 * parameters.cc (Parameters::is_compatible_target): New function.
10024 * parameters.h (class Parameters): Declare is_compatible_target.
10025 * workqueue.cc (Workqueue::add_blocker): New function.
10026 * workqueue.h (class Workqueue): Declare add_blocker.
10027
f1ed28fb
ILT
10028 * fileread.cc (Input_file::open): Remove options parameter.
10029 Change all callers.
10030 (Input_file::open_binary): Likewise.
10031 * script.cc (read_input_script): Likewise.
10032 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10033 options parameter from constructor. Change all callers.
10034 (class Read_script): Likewise.
10035 * fileread.h (class Input_file): Update declarations.
10036 * script.h (read_input_script): Update declaration.
10037
34dd024a
NC
100382009-03-10 Nick Clifton <nickc@redhat.com>
10039
10040 * po/es.po: New Spanish translation.
10041
6d71b17c
CC
100422009-03-06 Cary Coutant <ccoutant@google.com>
10043
10044 * options.cc (parse_short_option): Keep dash_z from registering itself.
10045
031cdbed
ILT
100462009-03-03 Ian Lance Taylor <iant@google.com>
10047
10048 PR 9918
10049 * target-reloc.h (relocate_section): Pass output_section to
10050 relocate.
10051 * i386.cc (Target_i386::should_apply_static_reloc): Add
10052 output_section parameter. Change all callers.
10053 (Target_i386::Relocate::relocate): Add output_section parameter.
10054 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10055 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10056 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10057 * testsuite/two_file_shared.sh: New script.
10058 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10059 (check_DATA): Add two_file_shared.dbg.
10060 (two_file_shared.dbg): New target.
10061 * testsuite/Makefile.in: Rebuild.
10062
15d5fa16
ILT
100632009-03-01 Ian Lance Taylor <iant@google.com>
10064
10065 * configure.ac: Check for byteswap.h.
10066 * configure: Rebuild.
10067 * config.in: Rebuild.
10068
8a4c0b0d
ILT
100692009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10070
10071 * layout.cc (Layout::find_or_add_kept_section): New function.
10072 (Layout::add_comdat): Removed.
10073 * layout.h (struct Kept_section): Move out of class Layout.
10074 Remove trailing underscores from field names. Add group_sections
10075 field. Rename group_ field to is_group. Change all uses.
10076 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10077 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10078 comdat_groups_ field.
10079 (Sized_relobj::include_section_group): Use
10080 find_or_add_kept_section and Kept_section::group_sections.
10081 (Sized_relobj::include_linkonce_section): Likewise.
10082 * object.cc (class Sized_relobj): Don't define Comdat_group or
10083 Comdat_group_table. Remove find_comdat_group and
10084 add_comdat_group. Remove comdat_groups_ field.
10085 * plugin.cc (include_comdat_group): Use
10086 Layout::find_or_add_kept_section.
10087
b4ecf66b
ILT
100882009-02-28 Ian Lance Taylor <iant@google.com>
10089
14359ca0
ILT
10090 * README: --gc-sections and map files are now supported. Document
10091 some build requirements.
10092
b4ecf66b
ILT
10093 PR 6992
10094 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10095 relocatable link set the value of the section symbol to zero.
10096 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10097 relocatable link don't include the section address in the local
10098 symbol value.
10099
0602e05a
ILT
101002009-02-27 Ian Lance Taylor <iant@google.com>
10101
fd9d194f
ILT
10102 PR 6811
10103 * options.h (class Search_directory): Add is_system_directory.
10104 (class General_options): Declare is_in_system_directory.
10105 * options.cc (get_relative_sysroot): Make static.
10106 (get_default_sysroot): Make static.
10107 (General_optoins::is_in_system_directory): New function.
10108 * fileread.cc (Input_file::is_in_system_directory): New function.
10109 * fileread.h (class Input_file): Declare is_in_system_directory.
10110 * object.h (class Object): Add is_in_system_directory.
10111 (class Input_objects): Remove system_library_directory_ field.
10112 * object.cc (Input_objects::add_object): Don't set
10113 system_library_directory_.
10114 (input_objects::found_in_system_library_directory): Remove.
10115 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10116 parameter. Change all callers.
10117 (Symbol_table::sized_write_globals): Likewise.
10118 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10119 Call Object::is_in_system_directory.
10120 * symtab.h (class Symbol_table): Update declarations.
10121
61edd21f
ILT
10122 PR 5990
10123 * descriptors.h (Open_descriptor): Add is_on_stack field.
10124 * descriptors.cc (Descriptors::open): If the descriptor is on the
10125 top of the stack, remove it. Initialize is_on_stack field.
10126 (Descriptors::release): Only add pod to stack if it is not on the
10127 stack already.
10128 (Descriptors::close_some_descriptor): Clear stack_next and
10129 is_on_stack fields.
10130
e29e076a
ILT
10131 PR 7091
10132 * output.cc (Output_section::find_starting_output_address): Rename
10133 from starting_output_address; add PADDR parameter; change return
10134 type.
10135 * output.h (class Output_section): Declare
10136 find_starting_output_address instead of starting_output_address.
10137 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10138 section symbol for which we can't find a merge section.
10139
0602e05a
ILT
10140 PR 9836
10141 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10142 hidden or internal, force the symbol to be local.
10143 * resolve.cc (Symbol::override_visibility): Define.
10144 (Symbol::override_base): Use override_visibility.
10145 (Symbol_table::resolve): Likewise.
10146 (Symbol::override_base_with_special): Likewise.
10147 (Symbol_table::override_with_special): If the visibility is hidden
10148 or internal, force the symbol to be local.
10149 * symtab.h (class Symbol): Add set_visibility and
10150 override_visibility.
10151 * testsuite/ver_test_1.sh: New file.
10152 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10153 (check_DATA): Add ver_test_1.syms.
10154 (ver_test_1.syms): New target.
10155 * testsuite/Makefile.in: Rebuild.
10156
401a9a73
CC
101572009-02-25 Cary Coutant <ccoutant@google.com>
10158
10159 * layout.cc (Layout::choose_output_section): Don't rename sections
10160 when using a linker script that has a SECTIONS clause.
10161 * Makefile.in: Regenerate.
10162
10163 * testsuite/Makefile.am (script_test_5.sh): New test case.
10164 * testsuite/Makefile.in: Regenerate.
10165 * testsuite/script_test_5.cc: New file.
10166 * testsuite/script_test_5.sh: New file.
10167 * testsuite/script_test_5.t: New file.
10168
f488e4b0
CC
101692009-02-13 Rafael Avila de Espindola <espindola@google.com>
10170
10171 * archive.cc (Archive::include_member): Update calls to add_symbols.
10172 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10173 the Layout argument.
10174 * dynobj.h (do_add_symbols): Add the Layout argument.
10175 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10176 Layout argument.
10177 * object.h (Object::add_symbols): Add the Layout argument.
10178 (Object::do_add_symbols): Add the Layout argument.
10179 (Sized_relobj::do_add_symbols): Add the Layout argument.
10180 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10181 Unify the two versions.
10182 (Add_plugin_symbols): Remove.
10183 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10184 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10185 (Add_plugin_symbols): Remove.
10186 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10187 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10188 (Add_symbols::run): Make it work with Pulginobj.
10189
89dd1680
ILT
101902009-02-06 Ian Lance Taylor <iant@google.com>
10191
10192 * object.cc (Sized_relobj::do_layout): Make info message start
10193 with lower case letter.
10194
266d0a74
ILT
101952009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10196
602b464e
ILT
10197 * binary.cc: Fix file comment.
10198
266d0a74
ILT
10199 * options.h (enum Incremental_disposition): Define.
10200 (class General_options): Add new options: --incremental,
10201 --incremental_changed, --incremental_unchanged,
10202 --incremental_unknown. Add incremental_disposition_ and
10203 implicit_incremental_ fields.
10204 (General_options::incremental_disposition): New function.
10205 (class Position_dependent_options): Add incremental_disposition
10206 option.
10207 (Position_dependent_options::copy_from_options): Set incremental
10208 dispositions.
10209 * options.cc (General_options::parse_incremental_changed): New
10210 function.
10211 (General_options::parse_incremental_unchanged): New function.
10212 (General_options::parse_incremental_unknown): New function.
10213 (General_options::General_options): Initialize new fields
10214 incremental_disposition_ and implicit_incremental_.
10215 (General_options::finalize): Check for uasge of --incremental-*
10216 without --incremental.
10217
f073bbf7
CD
102182009-02-06 Chris Demetriou <cgd@google.com>
10219
10220 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10221 pointer and to report location as the file name associated with
10222 the symbol.
10223 (gold_undefined_symbol_at_location): New function to replace the
10224 old gold_undefined_symbol functionality.
10225 * target-reloc.h (relocate_section): Update to use
10226 gold_undefined_symbol_at_location.
10227 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10228 Call gold_undefined_symbol function rather than gold_error.
10229 * errors.h (Errors::undefined_symbol): Take location as a
10230 string, rather than calculating it from a relocation.
10231 * errors.cc (Errors::fatal): Print "fatal error:" before the
10232 formatted message.
10233 (Errors::error, Errors::error_at_location): Print "error: "
10234 before the formatted message.
10235 (Errors::undefined_symbol): Take location as a string, rather
10236 than calculating it from a relocation.
10237 (gold_undefined_symbol_at_location): New function akin to
10238 old gold_undefined_symbol, calculates location from relocation.
10239 (gold_undefined_symbol): Change to take only a Symbol pointer
10240 and to report location as the file name associated with the symbol.
10241 * testsuite/debug_msg.sh: Update for changed error messages.
10242 * testsuite/undef_symbol.sh: Likewise.
10243
8e94a90c
ILT
102442009-02-04 Duncan Sands <baldrick@free.fr>
10245
10246 PR 9812
10247 * reduced_debug_output.h
10248 (Output_reduced_debug_abbrev_section::failed): Use format for
10249 gold_warning.
10250 (Output_reduced_debug_info_section::faild): Likewise.
10251
88a0e15b
ILT
102522009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10253
10254 * script.cc (Lazy_demangler): New class.
10255 (Version_script_info::get_symbol_version_helper): Demangle a
10256 symbol only once.
10257
5efc7cd2
CC
102582009-01-29 Cary Coutant <ccoutant@google.com>
10259
10260 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10261 to __tls_get_addr.
10262 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10263
e0ebcf42
ILT
102642009-01-28 Ian Lance Taylor <iant@google.com>
10265
5efc7cd2 10266 * version.cc (version_string): Bump to 1.9.
75fe7426 10267
e0ebcf42
ILT
10268 * gold.h: Include <cstring> and <stdint.h>.
10269 * version.cc: Include <cstdio>.
10270 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10271 warning.
10272 * reduced_debug_output.cc (insert_into_vector): Rename from
10273 Insert_into_vector; change all callers. Use Swap_unaligned to
10274 avoid aliasing issue; remove union since it is unnecessary.
10275
8e2813be 102762009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10277
10278 * Makefile.am (CCFILES): Add gc.cc.
10279 (HFILES): Add gc.h.
10280 * Makefile.in: Regenerate.
10281 * gold.cc (Gc_runner): New class.
10282 (queue_initial_tasks): Call garbage collection related tasks
10283 when corresponding options are invoked.
10284 (queue_middle_gc_tasks): New function.
10285 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10286 processed early before laying out sections during garbage collection.
10287 * gold.h (queue_middle_gc_tasks): New function.
10288 (is_prefix_of): Move from "layout.cc".
10289 * i386.cc (Target_i386::gc_process_relocs): New function.
10290 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10291 * main.cc (main): Create object of class "Garbage_collection".
10292 * object.cc (Relobj::copy_symbols_data): New function.
10293 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10294 (Sized_relobj::do_layout): Allow this function to be called twice
10295 during garbage collection and defer layout of section during the
6d03d481
ST
10296 first call.
10297 * object.h (Relobj::get_symbols_data): New function.
10298 (Relobj::is_section_name_included): New function.
10299 (Relobj::copy_symbols_data): New function.
10300 (Relobj::set_symbols_data): New function.
10301 (Relobj::get_relocs_data): New function.
10302 (Relobj::set_relocs_data): New function.
10303 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10304 (Relobj::gc_process_relocs): New function.
10305 (Relobj::do_gc_process_relocs): New pure virtual function.
10306 (Relobj::sd_): New data member.
10307 (Sized_relobj::is_output_section_offset_invalid): New function.
10308 (Sized_relobj::do_gc_process_relocs): New function.
10309 * options.h (General_options::gc_sections): Modify to not be a no-op.
10310 (General_options::print_gc_sections): New option.
10311 * plugin.cc (Plugin_finish::run): Remove function call to
10312 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10313 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10314 * reloc.cc (Read_relocs::run): Add task to process relocs and
10315 determine unreferenced sections when doing garbage collection.
10316 (Gc_process_relocs): New class.
10317 (Sized_relobj::do_gc_process_relocs): New function.
10318 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10319 sections that are garbage collected.
10320 * reloc.h (Gc_process_relocs): New class.
10321 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10322 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10323 symbols whose corresponding sections are garbage collected.
10324 (Symbol_table::Symbol_table): Add new parameter for the garbage
10325 collection object.
10326 (Symbol_table::gc_mark_undef_symbols): New function.
10327 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10328 (Symbol_table::gc_mark_dyn_syms): New function.
10329 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10330 as garbage.
10331 (Symbol_table::add_from_object): Likewise.
10332 (Symbol_table::add_from_relobj): When building shared objects, do not
10333 treat externally visible symbols as garbage.
10334 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10335 table information for static and relocatable links.
10336 * symtab.h (Symbol_table::set_gc): New function.
10337 (Symbol_table::gc): New function.
10338 (Symbol_table::gc_mark_undef_symbols): New function.
10339 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10340 (Symbol_table::gc_mark_dyn_syms): New function.
10341 (Symbol_table::gc_): New data member.
e1df38aa 10342 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10343 function.
10344 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10345 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10346
3b293544
CF
103472009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10348
10349 * options.h (General_options::gc_sections): Define as a no-op for now.
10350 (General_options::no_keep_memory): Ditto.
10351 (General_options::Bshareable): Define.
10352 * options.cc (General_options::finalize): Honor -Bshareable.
10353
83d22aa8
AS
103542009-01-20 Andreas Schwab <schwab@suse.de>
10355
10356 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10357 read the value in the contents, since we don't use it. Use the
10358 template endianness when writing.
10359 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10360
cd536b21
AS
103612009-01-19 Andreas Schwab <schwab@suse.de>
10362
10363 * configure.tgt (powerpc64-*): Fix targ_obj.
10364
99e9a495
ILT
103652009-01-15 Ian Lance Taylor <iant@google.com>
10366
10367 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10368 local symbols when stripping all symbols.
10369
bbbfea06
CC
103702009-01-14 Cary Coutant <ccoutant@google.com>
10371
99e9a495 10372 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10373
0f7c0701
CC
103742009-01-14 Cary Coutant <ccoutant@google.com>
10375
10376 * archive.cc (Archive::get_elf_object_for_member): Remove call
10377 to File_read::claim_for_plugin.
10378 * descriptors.cc (Descriptors::open): Remove reference to
10379 is_claimed.
10380 (Descriptors::claim_for_plugin): Remove.
10381 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10382 (Descriptors::is_claimed): Remove.
10383 (claim_descriptor_for_plugin): Remove.
10384 * fileread.cc (File_read::claim_for_plugin): Remove.
10385 * fileread.h (File_read::claim_for_plugin): Remove.
10386 (File_read::descriptor): Reopen descriptor if necessary.
10387 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10388 (Plugin_manager::all_symbols_read): Add task parameter. Change
10389 all callers.
10390 (Plugin_manager::get_input_file): New function.
10391 (Plugin_manager::release_input_file): New function.
10392 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10393 corresponding data member.
10394 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10395 and pass to base constructor. Change all callers.
10396 (get_input_file, release_input_file): New functions.
10397 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10398 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10399 (Plugin_manager::all_symbols_read): Add task parameter.
10400 (Plugin_manager::get_input_file): New function.
10401 (Plugin_manager::release_input_file): New function.
10402 (Plugin_manager::task_): New data member.
10403 (Pluginobj::Pluginobj): Add filesize parameter.
10404 (Pluginobj::filename): New function.
10405 (Pluginobj::descriptor): New function.
10406 (Pluginobj::filesize): New function.
10407 (Pluginobj::filesize_): New data member.
10408 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10409 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10410 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10411
10412 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10413 with archive libraries.
10414 * testsuite/Makefile.in: Regenerate.
10415 * testsuite/plugin_test.c (struct sym_info): New type.
10416 (get_input_file, release_input_file): New static variables.
10417 (onload): Capture new transfer vector entries.
10418 (claim_file_hook): Stop reading at end of file according to filesize.
10419 Factor out parsing of readelf output into separate function.
10420 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10421 APIs and get the source file name from the symbol table. Convert
10422 source file name to corresponding object file name. Print info
10423 message when adding new input files.
10424 (parse_readelf_line): New function.
10425 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10426 * testsuite/plugin_test_2.sh: Likewise.
10427 * testsuite/plugin_test_3.sh: Likewise.
10428 * testsuite/plugin_test_4.sh: New test case.
10429
62a6d109
ILT
104302009-01-07 Ian Lance Taylor <iant@google.com>
10431
10432 * version.cc (version_string): Bump to 1.8.
10433
483620e8
CC
104342008-12-23 Cary Coutant <ccoutant@google.com>
10435
10436 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10437 * plugin.cc (Plugin_manager::finish): Rename as
10438 layout_deferred_objects. Move cleanup to separate function.
10439 (Plugin_manager::cleanup): New function.
10440 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10441 separately.
10442 * plugin.h (Plugin_manager::finish): Rename as
10443 layout_deferred_objects.
10444 (Plugin_manager::cleanup): New function.
10445 (Plugin_manager::cleanup_done): New field.
10446
d66a9eb3
CC
104472008-12-23 Cary Coutant <ccoutant@google.com>
10448
10449 * plugin.cc (is_visible_from_outside): New function.
10450 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10451 so we don't return "IR only" status for exported symbols or -r links.
10452
10453 * testsuite/Makefile.am (plugin_test_3): New test case.
10454 * testsuite/Makefile.in: Regenerate.
10455 * testsuite/plugin_test_3.sh: New file.
10456
5995b570
CC
104572008-12-22 Cary Coutant <ccoutant@google.com>
10458
10459 * object.cc (Sized_relobj::layout_section): New function.
10460 (Sized_relobj::do_layout): Defer layout of input sections until after
10461 plugin has provided replacement files.
10462 (Sized_relobj::do_layout_deferred_sections): New function.
10463 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10464 (Relobj::layout_deferred_sections): New function.
10465 (Relobj::do_layout_deferred_sections): New function.
10466 (Sized_relobj::do_layout_deferred_sections): New function.
10467 (Sized_relobj::layout_section): New function.
10468 (Sized_relobj::Deferred_layout): New structure.
10469 (Sized_relobj::deferred_layout_): New field.
10470 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10471 Change all callers. Layout deferred sections.
10472 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10473 references.
10474 (Plugin_hook::run): Move code from do_plugin_hook inline.
10475 (Plugin_hook::do_plugin_hook): Remove.
10476 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10477 (Plugin_manager::finish): Renamed, was cleanup.
10478 (Plugin_manager::should_defer_layout): New function.
10479 (Plugin_manager::add_deferred_layout_object): New function.
10480 (Plugin_manager::Deferred_layout_list): New type.
10481 (Plugin_manager::deferred_layout_objects_): New field.
10482 (Plugin_hook::do_plugin_hook): Remove.
10483
ee769c88
ILT
104842008-12-17 Ian Lance Taylor <iant@google.com>
10485
10486 * options.h (class General_options): Add --no case for
10487 --export-dynamic.
10488
abc8dcba
CC
104892008-12-16 Cary Coutant <ccoutant@google.com>
10490
10491 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10492 vector.
10493 (Plugin_manager::claim_file): Create plugin object even if
10494 plugin did not call the add_symbols callback.
10495 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10496 asking for more symbols than were added.
10497 * testsuite/Makefile.am (plugin_test_1): Add test case with
10498 no global symbols.
10499 (empty.syms): New target.
10500 * testsuite/Makefile.in: Regenerate.
10501 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10502 message. Don't call add_symbols if no globals.
10503 (all_symbols_read_hook): Don't provide replacement for empty
10504 claimed file.
10505
b0074644
ILT
105062008-12-12 Ian Lance Taylor <iant@google.com>
10507
68943102
ILT
10508 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10509 r_type == 0 for a local symbol with r_sym == 0.
10510 (scan_relocatable_relocs): Pass r_sym to
10511 local_non_section_strategy.
10512 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10513 r_sym parameter.
10514
b0074644
ILT
10515 * configure.ac: Update test for TLS descriptors: they are
10516 supported as of glibc 2.9.
10517 * configure: Rebuild.
10518
c2508178
ILT
105192008-12-11 Ian Lance Taylor <iant@google.com>
10520
10521 PR 7091
10522 * target-reloc.h (Default_scan_relocatable_relocs): For each
10523 function, map r_type == 0 to RELOC_DISCARD.
10524
2756a258
CC
105252008-12-10 Cary Coutant <ccoutant@google.com>
10526
10527 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10528 object to override a kept COMDAT group from a plugin object.
10529
bb6f53d3
ILT
105302008-12-09 Ian Lance Taylor <iant@google.com>
10531
fbc558e1
ILT
10532 PR 7088
10533 * yyscript.y (file_cmd): Handle INPUT.
10534
bb6f53d3
ILT
10535 * testsuite/initpri1.c: Change all declarations to be full
10536 prototypes by adding void, to avoid compiler warnings.
10537
4674ecfc
CC
105382008-12-05 Rafael Avila de Espindola <espindola@google.com>
10539
10540 * options.cc (General_options::parse_plugin_opt): New.
10541 (General_options::add_plugin): The argument now is just the filename.
10542 (General_options::add_plugin_option): New.
10543 * options.h (plugin_opt): New.
10544 (add_plugin): Change argument name.
10545 (add_plugin_option): New.
10546 * plugin.cc (Plugin::load): Don't parse the plugin option.
10547 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10548 (Plugin::add_option): New.
10549 (Plugin::args_): Change type.
10550 (Plugin::filename_): New.
10551 (Plugin_manager::add_plugin_option): New.
10552 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10553 * testsuite/Makefile.in: Regenerate.
10554
fd06b4aa
CC
105552008-12-05 Cary Coutant <ccoutant@google.com>
10556
10557 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10558 Handle --strip-lto-sections option.
10559 * options.h (strip_lto_sections): New option.
10560
6c52134c
CC
105612008-12-01 Cary Coutant <ccoutant@google.com>
10562
10563 * plugin.cc (ld_plugin_message): Change format parameter to const.
10564 Fix mismatch between new[] and delete.
10565
a45248e0
CC
105662008-11-14 Cary Coutant <ccoutant@google.com>
10567
10568 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10569 instead of -1U.
10570
c82fbeee
CS
105712008-11-05 Craig Silverstein <csilvers@google.com>
10572
10573 * options.cc (General_options::parse_dynamic_list): New function.
10574 * options.h (General_options): New flags dynamic_list,
10575 dynamic_list_data, dynamic_list_cpp_new, and
10576 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10577 (General_options::in_dynamic_list): New function.
10578 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10579 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10580 (Lex::can_continue_name): Likewise.
10581 (yylex): Likewise.
10582 (read_script_file): New parameter script_options.
10583 (read_dynamic_list): New function.
10584 (Script_options::define_dynamic_list): New function.
10585 (dynamic_list_keyword_parsecodes): New variable.
10586 (dynamic_list_keywords): New variable.
10587 * script.h (Script_options::define_dynamic_list): New function
10588 prototype.
10589 (read_dynamic_list): New function prototype.
10590 * symtab.cc (strprefix): New macro.
10591 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10592 dynamic_list_data, dynamic_list_cpp_new, and
10593 dynamic_list_cpp_typeinfo.
10594 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10595 (dynamic_list_expr): New rule.
10596 (dynamic_list_nodes): Likewise.
10597 (dynamic_list_node): Likewise.
10598 * testsuite/Makefile.am (dynamic_list): New test.
10599 * testsuite/Makefile.in: Regenerated.
10600 * testsuite/dynamic_list.t: New file.
10601 * testsuite/dynamic_list.sh: New file.
10602
e0bb29a5
CS
106032008-11-05 Craig Silverstein <csilvers@google.com>
10604
10605 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10606 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10607 (t11_last): Likewise.
10608 * testsuite/ver_test_6.c (main): Likewise.
10609
4e1e25e0
CC
106102008-10-07 Cary Coutant <ccoutant@google.com>
10611
10612 * options.c (General_options::finalize): Add check for -static and
10613 -shared.
10614 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10615 is not empty.
10616
92f03fcb
CC
106172008-10-02 Cary Coutant <ccoutant@google.com>
10618
10619 * plugin.cc (make_sized_plugin_object): Fix conditional
10620 compilation to work when not all targets are enabled.
10621
fbd8a257
CC
106222008-09-29 Cary Coutant <ccoutant@google.com>
10623
10624 * archive.cc (Archive::get_file_and_offset): Use filename instead
10625 of name to get library path.
10626 (Archive::include_member): Unlock external member of a thin archive.
10627
10628 * testsuite/Makefile.am (TEST_AR): New variable.
10629 (thin_archive_test_1): New test.
10630 (thin_archive_test_2): New test.
81636b3f
CC
10631 * testsuite/Makefile.in: Regenerate.
10632 * testsuite/thin_archive_main.cc: New file.
10633 * testsuite/thin_archive_test_1.cc: New file.
10634 * testsuite/thin_archive_test_2.cc: New file.
10635 * testsuite/thin_archive_test_3.cc: New file.
10636 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 10637
eff45813
CC
106382008-09-29 Cary Coutant <ccoutant@google.com>
10639
10640 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10641 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10642 instead of -1U.
10643 (Sized_relobj::do_finalize_local_symbols): Likewise.
10644 (Sized_relobj::map_to_kept_section): Likewise.
10645 * object.h (Sized_relobj::invalid_address): New constant.
10646 (Sized_relobj::do_output_section_offset): Check for invalid_address
10647 and return -1ULL.
10648 * output.cc (Output_reloc::local_section_offset): Use constant
10649 invalid_address instead of -1U.
10650 (Output_reloc::get_address): Likewise.
10651 (Output_section::output_address): Change -1U to -1ULL.
10652 * output.h (Output_reloc::invalid_address): New constant.
10653 * reloc.cc (Sized_relobj::write_sections): Use constant
10654 invalid_address instead of -1U.
10655 (Sized_relobj::relocate_sections): Likewise.
10656 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10657 values for merge sections.
10658 * target-reloc.h (relocate_for_relocatable): Use constant
10659 invalid_address instead of -1U.
10660
89fc3421
CC
106612008-09-19 Cary Coutant <ccoutant@google.com>
10662
10663 Add plugin functionality for link-time optimization (LTO).
10664 * configure.ac (plugins): Add --enable-plugins option.
10665 * configure: Regenerate.
10666 * config.in: Regenerate.
10667 * Makefile.am (LIBDL): New variable.
10668 (CCFILES): Add plugin.cc.
10669 (HFILES): Add plugin.h.
10670 (ldadd_var): Add LIBDL.
10671 * Makefile.in: Regenerate.
10672
10673 * archive.cc: Include "plugin.h".
10674 (Archive::setup): Don't preread archive symbols when using a plugin.
10675 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10676 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10677 files.
10678 (Archive::include_member): Add symbols from plugin objects.
10679 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10680 * descriptors.cc (Descriptors::open): Check for file descriptors
10681 abandoned by plugins.
10682 (Descriptors::claim_for_plugin): New function.
10683 * descriptors.h (Descriptors::claim_for_plugin): New function.
10684 (Open_descriptor::is_claimed): New field.
10685 (claim_descriptor_for_plugin): New function.
10686 * fileread.cc (File_read::claim_for_plugin): New function.
10687 * fileread.h (File_read::claim_for_plugin): New function.
10688 (File_read::descriptor): New function.
10689 * gold.cc: Include "plugin.h".
10690 (queue_initial_tasks): Add task to call plugin hooks for generating
10691 new object files.
10692 * main.cc: Include "plugin.h".
10693 (main): Load plugin libraries.
10694 * object.h (Pluginobj): Declare.
10695 (Object::pluginobj): New function.
10696 (Object::do_pluginobj): New function.
10697 (Object::set_target): New function.
10698 * options.cc: Include "plugin.h".
10699 (General_options::parse_plugin): New function.
10700 (General_options::General_options): Initialize plugins_ field.
10701 (General_options::add_plugin): New function.
10702 * options.h (Plugin_manager): Declare.
10703 (General_options): Add --plugin option.
10704 (General_options::has_plugins): New function.
10705 (General_options::plugins): New function.
10706 (General_options::add_plugin): New function.
10707 (General_options::plugins_): New field.
10708 * plugin.cc: New file.
10709 * plugin.h: New file.
10710 * readsyms.cc: Include "plugin.h".
10711 (Read_symbols::do_read_symbols): Check for archive before checking
10712 for ELF file. Call plugin hooks to claim files.
10713 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10714 from a real object file; force override when processing replacement
10715 files.
10716 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10717 (Symbol::init_base_object): Likewise.
10718 (Symbol::init_base_output_data): Likewise.
10719 (Symbol::init_base_output_segment): Likewise.
10720 (Symbol::init_base_constant): Likewise.
10721 (Symbol::init_base_undefined): Likewise.
10722 (Symbol::output_section): Assert that object is not a plugin.
10723 (Symbol_table::add_from_pluginobj): New function.
10724 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10725 undefined.
10726 (Symbol_table::sized_write_globals): Likewise.
10727 (Symbol_table::add_from_pluginobj): Instantiate template.
10728 * symtab.h (Sized_pluginobj): Declare.
10729 (Symbol::in_real_elf): New function.
10730 (Symbol::set_in_real_elf): New function.
10731 (Symbol::in_real_elf_): New field.
10732 (Symbol_table::add_from_pluginobj): New function.
10733
10734 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10735 (LIBDL): New variable.
10736 (LDADD): Add LIBDL.
10737 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10738 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10739 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10740 (MOSTLYCLEANFILES): Likewise.
10741 * testsuite/Makefile.in: Regenerate.
10742 * testsuite/plugin_test.c: New file.
10743 * testsuite/plugin_test_1.sh: New file.
10744 * testsuite/plugin_test_2.sh: New file.
10745
de31bda5
ILT
107462008-09-16 Ian Lance Taylor <iant@google.com>
10747
9c2d0ef9
ILT
10748 * target-reloc.h (relocate_section): Check whether a symbol is
10749 defined by the ABI before reporting an undefined symbol error.
10750 * target.h (Target::is_defined_by_abi): Make parameter const.
10751 (Target::do_is_defined_by_abi): Likewise.
10752 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10753 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10754 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10755 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10756 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10757 * testsuite/Makefile.in: Rebuild.
10758
de31bda5
ILT
10759 * fileread.cc (make_view): Add casts to avoid warning.
10760
9fa33bee
AO
107612008-09-16 Alexandre Oliva <aoliva@redhat.com>
10762
10763 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10764 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10765
183fd0e3
AO
107662008-09-16 Alexandre Oliva <aoliva@redhat.com>
10767
10768 * options.h (General_options::output_is_executable): New.
10769 (General_options::output_is_pie): New.
10770 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10771 for shared libraries.
10772 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10773
7be8330a
CD
107742008-09-11 Chris Demetriou <cgd@google.com>
10775
10776 * options.h (origin): New -z option.
10777 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10778 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10779 in DT_FLAGS_1.
10780
a9caad02
CC
107812008-09-05 Cary Coutant <ccoutant@google.com>
10782
10783 * fileread.cc (File_read::make_view): Add check for attempt to map
10784 beyond end of file.
10785
ae6dce4d
CC
107862008-09-05 Cary Coutant <ccoutant@google.com>
10787
10788 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10789 explicit instantiations.
10790
d7ab2a47
KVH
107912008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10792
10793 PR gold/6858
10794 * options.cc (General_options::finalize): Allow undefined symbols
10795 in shlibs if linking -shared.
10796
10797 PR gold/6859
10798 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10799 symbols as not needing a dynsym entry.
10800
1e52a9c1
CS
108012008-08-20 Craig Silverstein <csilvers@google.com>
10802
10803 * fileread.cc (File_read::open): Do not lock the file unless it
10804 was successfully opened.
10805
d85c80a3
CC
108062008-08-14 Cary Coutant <ccoutant@google.com>
10807
10808 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10809 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10810 * testsuite/tls_test.cc (struct int128): 128-bit struct
10811 for testing TLS relocs with non-zero addend.
10812 (v12): New TLS variable.
10813 (t12): New test.
10814 (t_last): Add check for v12.
10815 * testsuite/tls_test.h (t12): New function.
10816 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10817
2d924fd9
ILT
108182008-08-13 Ian Lance Taylor <iant@google.com>
10819
10820 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10821 set tls_segment_ or relro_segment_.
10822 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10823 when appropriate.
10824 * output.h (Output_section::clear_is_relro): New function.
10825 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10826 sections specially even when output_data_ is empty.
10827 (Output_segment::maximum_alignment): When first section is relro,
10828 only force alignment for PT_LOAD segments.
10829 * script.cc (script_data_segment_align): New function.
10830 (script_data_segment_relro_end): New function.
10831 * script-c.h (script_data_segment_align): Declare.
10832 (script_data_segment_relro_end): Declare.
10833 * script-sections.h (class Script_sections): Declare
10834 data_segment_align and data_segment_relro_end. Add fields
10835 segment_align_index_ and saw_relro_end_.
10836 * script-sections.cc (class Sections_element): Add set_is_relro
10837 virtual function. Add new bool* parameter to place_orphan_here.
10838 Add get_output_section virtual function.
10839 (class Output_section_definition): Add set_is_relro. Add new
10840 bool* parameter to place_orphan_here. Add get_output_section.
10841 Add is_relro_ field.
10842 (Output_section_definition::Output_section_definition): Initialize
10843 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10844 and is_relro_ fields.
10845 (Output_section_definition::place_orphan_here): Add is_relro
10846 parameter.
10847 (Output_section_definition::set_section_addresses): Set relro for
10848 output section.
10849 (Output_section_definition::alternate_constraint): Likewise.
10850 (class Orphan_output_section): Add new bool* parameter to
10851 place_orphan_here. Add get_output_section.
10852 (Orphan_output_section::place_orphan_here): Add is_relro
10853 parameter.
10854 (Script_sections::Script_sections): Initialize
10855 data_segment_align_index_ and saw_relro_end_.
10856 (Script_sections::data_segment_align): New function.
10857 (Script_sections::data_segment_relro_end): New function.
10858 (Script_sections::place_orphan): Set or clear is_relro.
10859 (Script_sections::set_section_addresses): Force alignment of first
10860 TLS section.
10861 * yyscript.y (exp): Call script_data_segment_align and
10862 script_data_segment_relro_end.
10863 * testsuite/relro_script_test.t: New file.
10864 * testsuite/relro_test.cc (using_script): Declare.
10865 (t1, t2): Test using_script.
10866 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10867 (relro_script_test_SOURCES): Define.
10868 (relro_script_test_DEPENDENCIES): Define.
10869 (relro_script_test_LDFLAGS): Define.
10870 (relro_script_test_LDADD): Define.
10871 (relro_script_test.so): New target.
10872 * testsuite/Makefile.in: Rebuild.
10873
f827c9a9
CC
108742008-08-06 Cary Coutant <ccoutant@google.com>
10875
10876 * archive.cc (Archive::total_archives, Archive::total_members)
10877 (Archive::total_members_loaded): New variables.
10878 (Archive::setup): Add parameter. Add option to preread
10879 archive symbols.
10880 (Archive::read_armap): Add counter.
10881 (Archive::get_file_and_offset): New function.
10882 (Archive::get_elf_object_for_member): New function.
10883 (Archive::read_all_symbols): New function.
10884 (Archive::read_symbols): New function.
10885 (Archive::add_symbols): Add counters.
10886 (Archive::include_all_members): Use armap to find members if it's
10887 already built.
10888 (Archive::include_member): Skip reading symbols if already read.
10889 Factored code into Archive::get_file_and_offset and
10890 Archive::get_elf_object_for_member. Changed call to
10891 Mapfile::report_include_archive_member.
10892 (Archive::print_stats): New function.
10893 * archive.h: Declare Object and Read_symbols_data classes.
10894 (Archive::Archive): Add initializers for new members.
10895 (Archive::setup): Add parameter.
10896 (Archive::print_stats): New function.
10897 (Archive::total_archives, Archive::total_members)
10898 (Archive::total_members_loaded): New variables.
10899 (Archive::get_file_and_offset): New function.
10900 (Archive::get_elf_object_for_member): New function.
10901 (Archive::read_all_symbols): New function.
10902 (Archive::read_symbols): New function.
10903 (Archive::Archive_member): New class.
10904 (Archive::members_): New member.
10905 (Archive::num_members_): New member.
10906 * main.cc: Include archive.h.
10907 (main): Call Archive::print_stats.
10908 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10909 archive parameter; member_name is now the fully-decorated name.
10910 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10911 * options.h: (General_options): Add --preread-archive-symbols option.
10912 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10913 Archive::setup.
10914
de4c45bd
ILT
109152008-08-04 Ian Lance Taylor <iant@google.com>
10916
10917 * symtab.h (Symbol::use_plt_offset): New function.
10918 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10919 * powerpc.cc (Relocate::relocate): Likewise.
10920 * sparc.cc (Relocate::relocate): Likewise.
10921 * x86_64.cc (Relocate::relocate): Likewise.
10922 * testsuite/weak_plt.sh: New test.
10923 * testsuite/weak_plt_main.cc: New test.
10924 * testsuite/weak_plt_shared.cc: New test.
10925 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10926 (check_PROGRAMS): Add weak_plt.
10927 (check_DATA): Add weak_plt_shared.so.
10928 (weak_plt_main_pic.o, weak_plt): New targets.
10929 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10930 * testsuite/Makefile.in: Rebuild.
10931
10932 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10933 gcctestdir/ld.
10934 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10935 * testsuite/Makefile.in: Rebuild.
10936
323ee3f4
AM
109372008-08-04 Alan Modra <amodra@bigpond.net.au>
10938
10939 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10940 * Makefile.in: Regenerate.
10941 * po/POTFILES.in: Regenerate.
10942
7c07ecec
ILT
109432008-07-29 Ian Lance Taylor <iant@google.com>
10944
10945 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10946 symbols before other symbols.
10947 * testsuite/script_test_2.cc (test_addr): Declare.
10948 (test_addr_alias): Declare.
10949 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10950 values.
7c07ecec
ILT
10951 * testsuite/script_test_2.t: Define test_addr_alias and
10952 test_addr.
10953
5778530e
ILT
109542008-07-24 Ian Lance Taylor <iant@google.com>
10955
2a00e4fb
ILT
10956 PR 5990
10957 * descriptors.cc: New file.
10958 * descriptors.h: New file.
10959 * gold-threads.h (class Hold_optional_lock): New class.
10960 * fileread.cc: Include "descriptors.h".
10961 (File_read::~File_read): Release descriptor rather than closing
10962 it.
10963 (File_read::open) [file]: Call open_descriptor rather than open.
10964 Set is_descriptor_opened_.
10965 (File_read::open) [memory]: Assert that descriptor is not open.
10966 (File_read::reopen_descriptor): New function.
10967 (File_read::release): Release descriptor.
10968 (File_read::do_read): Make non-const. Reopen descriptor.
10969 (File_read::read): Make non-const.
10970 (File_read::make_view): Reopen descriptor.
10971 (File_read::do_readv): Likewise.
10972 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10973 Update declarations.
10974 * layout.cc: Include "descriptors.h".
10975 (Layout::create_build_id): Use open_descriptor rather than open.
10976 * output.cc: Include "descriptors.h".
10977 (Output_file::open): Use open_descriptor rather than open.
10978 * archive.cc (Archive::const_iterator): Change Archive to be
10979 non-const.
10980 (Archive::begin, Archive::end): Make non-const.
10981 (Archive::count_members): Likewise.
10982 * archive.h (class Archive): Update declarations.
10983 * object.h (Object::read): Make non-const.
10984 * Makefile.am (CCFILES): Add descriptors.cc.
10985 (HFILES): Add descriptors.h.
10986 * Makefile.in: Rebuild.
10987
801647d1
ILT
10988 PR 6716
10989 * gold.h: Always include <clocale>. Add Solaris workarounds
10990 following code in binutils/sysdep.h.
10991
5edd166e
ILT
10992 PR 6048
10993 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10994 this->eh_frame_hdr_ is NULL before using it.
10995
c89ad728
ILT
10996 * dynobj.cc (Versions::Versions): Update comment.
10997
aa86f06b
ILT
10998 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10999 the base version name.
11000
5778530e
ILT
11001 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11002 array size plus one.
11003 (Stringpool_template::set_string_offsets): Subtract one from key
11004 before using it as an array index.
11005 (Stringpool_template::get_offset_with_length): Likewise.
11006 (Stringpool_template::write_to_buffer): Likewise.
11007 * stringpool.h (Stringpool_template::get_offset_from_key):
11008 Likewise.
11009
057ead22
ILT
110102008-07-23 Ian Lance Taylor <iant@google.com>
11011
7f649c59
ILT
11012 PR 6658
11013 * object.h (Merged_symbol_value::value): Do our best to handle a
11014 negative addend.
11015
057ead22
ILT
11016 PR 6647
11017 * script.cc (Version_script_info::get_versions): Don't add empty
11018 version tag to return value.
11019 (Version_script_info::get_symbol_version_helper): Change return
11020 type to bool. Add pversion parameter. Change all callers.
11021 (script_register_vers_node): Don't require a non-NULL tag.
11022 * script.h (class Version_script_info): Update declarations.
11023 (Version_script_info::get_symbol_version): Change return type to
11024 bool. Add version parameter. Change all callers.
11025 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11026 handling. Handle an empty version from a version script.
11027 (Symbol_table::define_special_symbol): Likewise.
11028 * testsuite/ver_test_10.script: New file.
11029 * testsuite/ver_test_10.sh: New file.
11030 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11031 (check_DATA): Add ver_test_10.syms.
11032 (ver_test_10.syms, ver_test_10.so): New target.
11033 * testsuite/Makefile.in: Rebuild.
11034
58e54ac2
CD
110352008-07-23 Simon Baldwin <simonb@google.com>
11036
11037 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11038 to zero for undefined symbols from dynamic libraries.
11039
95d14cd3
ILT
110402008-07-23 Ian Lance Taylor <iant@google.com>
11041
11042 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11043 Change all callers.
11044 * symtab.h (class Symbol_table): Update declaration.
11045 * testsuite/ver_test_9.cc: New file.
11046 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11047 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11048 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11049 (ver_test_9.so, ver_test_9.o): New targets.
11050 * testsuite/Makefile.in: Rebuild.
11051
92de84a6
ILT
110522008-07-22 Ian Lance Taylor <iant@google.com>
11053
34810851
ILT
11054 * options.h (class General_options): Define --check-sections.
11055 * layout.cc (Layout::set_segment_offsets): Handle
11056 --check-sections.
11057
af6156ef
ILT
11058 * options.h (class General_options): Define -n/--nmagic and
11059 -N/--omagic.
11060 * options.cc (General_options::finalize): For -n/--nmagic or
11061 -N/--omagic, set -static.
11062 * layout.cc (Layout::attach_allocated_section_to_segment): If
11063 -N/--omagic, don't put read-only and read-write sections in
11064 different segments.
11065 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11066 finding a read-only segment.
11067 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11068 don't set the minimum segment alignment to the common page size,
11069 and don't set the file offset to the address modulo the page size.
11070 * script-sections.cc (Script_sections::create_segments): If
11071 -n/--omagic, don't put read-only and read-write sections in
11072 different segments.
11073
92de84a6
ILT
11074 * cref.cc: New file.
11075 * cref.h: New file.
11076 * options.h (class General_options): Add --print-symbol-counts.
11077 * main.cc (main): Issue defined symbol report if requested.
11078 * archive.cc (Archive::interpret_header): Make into a const member
11079 function.
11080 (Archive::add_symbols): Call Input_objects::archive_start and
11081 archive_stop.
11082 (Archive::const_iterator): Define new class.
11083 (Archive::begin, Archive::end): New functions.
11084 (Archive::include_all_members): Rewrite to use iterator.
11085 (Archive::count_members): New function.
11086 * archive.h (class Archive): Update declarations.
11087 (Archive::filename): New function.
11088 * object.cc: Include "cref.h".
11089 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11090 (Sized_relobj::do_get_global_symbol_counts): New function.
11091 (Input_objects::add_object): Add object to cross-referencer.
11092 (Input_objects::archive_start): New function.
11093 (Input_objects::archive_stop): New function.
11094 (Input_objects::print_symbol_counts): New function.
11095 * object.h: Declare Cref and Archive.
11096 (Object::get_global_symbol_counts): New function.
11097 (Object::do_get_global_symbol_counts): New pure virtual function.
11098 (class Sized_relobj): Add defined_count_ field. Update
11099 declarations.
11100 (class Input_objects): Add cref_ field. Update constructor.
11101 Update declarations.
11102 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11103 defined_count_.
11104 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11105 symbol counts.
11106 (Sized_dynobj::do_get_global_symbol_counts): New function.
11107 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11108 defined_count_. Update declarations. Define Symbols typedef.
11109 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11110 parameter. Change all callers.
11111 (Symbol_table::add_from_dynobj): Add sympointers and defined
11112 parameters. Change all callers.
11113 * symtab.h (class Symbol_table): Update declarations.
11114 * Makefile.am (CCFILES): Add cref.cc.
11115 (HFILES): Add cref.h.
11116 * Makefile.in: Rebuild.
11117
3f7c5e1d
CD
111182008-07-22 Simon Baldwin <simonb@google.com>
11119
11120 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11121 to zero when writing undefined symbols.
11122
e0b64032
ILT
111232008-07-22 Ian Lance Taylor <iant@google.com>
11124
11125 * output.cc (Output_section::add_input_section): Don't try to
11126 merge empty merge sections.
11127
096b02cf
CS
111282008-07-21 Craig Silverstein <csilvers@google.com>
11129
11130 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11131 Include symbol version in error message.
cd536b21 11132
1d1f116d
CD
111332008-07-20 Chris Demetriou <cgd@google.com>
11134
cd536b21 11135 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11136 (RANDOM_SEED_CFLAGS): New substituted variable.
11137 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11138 * configure: Rebuild.
11139 * Makefile.in: Likewise.
11140 * testsuite/Makefile.in: Likewise.
11141
a18f591e
ILT
111422008-07-18 Ian Lance Taylor <iant@google.com>
11143
11144 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11145 where we see NAME/NULL and NAME/VERSION as separate symbols.
11146 * testsuite/ver_test_main.cc (main): Call t4.
11147 (t4, t4_2a): Define.
11148 * testsuite/ver_test_2.cc (t4_2): Define.
11149 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11150 * testsuite/ver_test_4.cc (t4_2a): Define.
11151 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11152 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11153
c6e3f6ed
ILT
111542008-07-17 Ian Lance Taylor <iant@google.com>
11155
11156 * dynobj.cc (Versions::add_def): If we give an error about a
11157 missing version, go ahead and create the version anyhow.
11158
ef9beddf
ILT
111592008-07-10 Ian Lance Taylor <iant@google.com>
11160
11161 Handle output sections with more than 0x7fffffff bytes.
11162 * object.h (class Relobj): Change map_to_output_ to
11163 output_sections_, and just keep a section pointer. Change all
11164 uses. Move comdat group support to Sized_relobj.
11165 (Relobj::is_section_specially_mapped): Remove.
11166 (Relobj::output_section): Remove poff parameter. Change all
11167 callers.
11168 (Relobj::output_section_offset): New function.
11169 (Relobj::set_section_offset): Rewrite.
11170 (Relobj::map_to_output): Remove.
11171 (Relobj::output_sections): New function.
11172 (Relobj::do_output_section_offset): New pure virtual function.
11173 (Relobj::do_set_section_offset): Likewise.
11174 (class Sized_relobj): Add section_offsets_ field. Add comdat
11175 group support from Relobj. Update declarations.
11176 (Sized_relobj::get_output_section_offset): New function.
11177 (Sized_relobj::do_output_section_offset): New function.
11178 (Sized_relobj::do_set_section_offset): New function.
11179 * object.cc (Relobj::output_section_address): Remove.
11180 (Sized_relobj::Sized_relobj): Initialize new fields.
11181 (Sized_relobj::include_section_group): Cast find_kept_object to
11182 Sized_relobj.
11183 (Sized_relobj::include_linkonce_section): Likewise.
11184 (Sized_relobj::do_layout): Use separate arrays for output section
11185 and output offset.
11186 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11187 output_sections.
11188 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11189 output_sections and section_offsets.
11190 (Sized_relobj::write_local_symbols): Likewise.
11191 (map_to_kept_section): Compute output address directly.
11192 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11193 output_sections and section_offsets.
11194 (Sized_relobj::write_sections): Likewise.
11195 (Sized_relobj::relocate_sections): Likewise.
11196 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11197 * output.h (class Output_reloc): Update declarations. Change
11198 u2_.relobj to Sized_relobj*.
11199 (class Output_data_reloc): Change add functions to use
11200 Sized_relobj*.
11201 * output.cc (Output_reloc::Output_reloc): Change relobj to
11202 Sized_relobj*.
11203 (Output_reloc::local_section_offset): Change return type to
11204 Elf_Addr. Use get_output_section_offset.
11205 (Output_reloc::get_address): Likewise.
11206 (Output_section::is_input_address_mapped): Don't call
11207 is_section_specially_mapped.
11208 (Output_section::output_offset): Likewise.
11209 (Output_section::output_address): Likewise.
11210 (Output_section::starting_output_address): Likewise.
11211 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11212 parameter to Sized_relobj*.
11213 (Copy_relocs::need_copy_reloc): Likewise.
11214 (Copy_relocs::save): Likewise.
11215 * copy-relocs.h (class Copy_relocs): Update declarations.
11216 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11217 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11218 * target-reloc.h (relocate_for_relocatable): Change
11219 offset_in_output_section type to Elf_Addr. Change code that uses
11220 it as well.
11221 * layout.cc (Layout::layout): Always set *off.
11222 * mapfile.cc (Mapfile::print_input_section): Use
11223 output_section_offset.
11224 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11225 Sized_relobj*.
11226 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11227 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11228 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11229
5cb66f97
ILT
112302008-07-03 Ian Lance Taylor <iant@google.com>
11231
11232 * layout.cc (Layout::include_section): Do not discard unrecognized
11233 SHT_STRTAB sections.
11234
afe47622
CS
112352008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11236
11237 * script.cc (Lex::can_continue_name): Make '?' allowable in
11238 version-script names.
11239 * testsuite/version_script.map: Change glob pattern to use '?'
11240
5adf9721
ILT
112412008-06-30 Manish Singh <yosh@gimp.org>
11242
11243 PR 6585
11244 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11245 Correct typo.
11246
e6fde208
ILT
112472008-06-30 Ian Lance Taylor <iant@google.com>
11248
11249 PR 6660
11250 PR 6682
11251 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11252 versions]: Don't try to read the value in the contents, since we
11253 don't use it. Use the template endianness when writing.
11254
3f2e6a2d
CC
112552008-06-25 Cary Coutant <ccoutant@google.com>
11256
11257 * fileread.cc (File_read::make_view): Assert on zero-length view.
11258 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11259 symbol table when there are no symbols to read.
11260
c43d3a48
CS
112612008-06-23 Craig Silverstein <csilvers@google.com>
11262
11263 * version.cc (version_string): Bump to 1.7
11264
5f494ea0
CS
112652008-06-18 Craig Silverstein <csilvers@google.com>
11266
11267 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11268 constant 0xFFFF to type Valtype.
11269 (Powerpc_relocate_functions::rel16_ha): Likewise.
11270
c42e122e
ILT
112712008-06-17 Ian Lance Taylor <iant@google.com>
11272
f34787f8
ILT
11273 * output.h (Output_section::Input_section): Initialize p2align_ to
11274 zero for Output_section_data constructors.
11275 (Output_section::Input_section::addralign): If not an input
11276 section, return the alignment of the Output_section_data.
11277 * testsuite/copy_test.cc: New file.
11278 * testsuite/copy_test_1.cc: New file.
11279 * testsuite/copy_test_2.cc: New file.
11280 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11281 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11282 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11283 (copy_test_1_pic.o, copy_test_1.so): New targets.
11284 (copy_test_2_pic.o, copy_test_2.so): New targets.
11285 * testsuite/Makefile.in: Rebuild.
11286
c42e122e
ILT
11287 * script-sections.cc (Script_sections::place_orphan): Initialize
11288 local variable exact.
11289
ce3ac18a
DE
112902008-06-13 David Edelsohn <edelsohn@gnu.org>
11291
11292 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11293
42cacb20
DE
112942008-06-12 David Edelsohn <edelsohn@gnu.org>
11295 David S. Miller <davem@davemloft.net>
11296
11297 * powerpc.cc: New file.
11298 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11299 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11300 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11301 * Makefile.in: Rebuild.
11302
7b308235
ILT
113032008-06-09 Ian Lance Taylor <iant@google.com>
11304
11305 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11306 <exception>.
11307 (throwing, orig_terminate): New static variables.
11308 (terminate_handler): New static function.
11309 (t2): Set terminate handler.
11310
f0b886e3
ILT
113112008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11312
11313 PR 6584
cd536b21 11314 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11315 alignment.
11316
3e90f135
CC
113172008-05-30 Cary Coutant <ccoutant@google.com>
11318
11319 * archive.cc (Archive::include_all_members) Correct to step
11320 over symbol table and extended name table in thin archives.
11321
e09ad04a
ILT
113222008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11323
11324 PR 6407
11325 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11326 calculation.
11327
62b01cb5
ILT
113282008-05-28 Caleb Howe <cshowe@google.com>
11329
11330 * reduced_debug_output.cc: New file.
11331 * reduced_debug_output.h: New file.
92de84a6 11332 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11333 * options.cc (General_options::finalize): Add strip_debug_non_line
11334 to the strip heirarchy.
11335 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11336 fields.
11337 * layout.cc: Include "reduced_debug_output.h".
11338 (Layout::Layout): Initialize new fields.
11339 (line_only_debug_sections): New static array.
11340 (is_lines_only_debug_sections): New static inline function.
11341 (Layout::include_section): Handle --strip-debug-non-line.
11342 (Layout::make_output_section): If --strip-debug-non-line, build
11343 new output sections for .debug_abbrev and .debug_info.
11344 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11345 gold. Warn about possible overflow.
11346 (read_signed_LEB_128): Likewise.
11347 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11348 (read_signed_LEB_128): Declare.
11349 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11350 (HFILES): Add reduced_debug_output.h.
11351 * Makefile.in: Rebuild.
11352
7d9e3d98
ILT
113532008-05-21 Ian Lance Taylor <iant@google.com>
11354
11355 * mapfile.cc: New file.
11356 * mapfile.h: New file.
11357 * options.h (class General_options): Add -M/--print-map and -Map.
11358 * options.cc (General_options::finalize): Make -M equivalent to
11359 -Map -.
11360 * main.cc: Include <cstdio> and "mapfile.h".
11361 (main): Open mapfile if requested.
11362 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11363 constructor. Change caller.
11364 (queue_initial_tasks): Add mapfile parameter. Change caller.
11365 (queue_middle_tasks): Likewise.
11366 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11367 declarations.
11368 * archive.cc: Include "mapfile.h".
11369 (Archive::add_symbols): Add mapfile parameter. Change all
11370 callers. Pass mapfile, symbol, and reason to include_member.
11371 (Archive::include_all_members): Add mapfile parameter. Change all
11372 callers.
11373 (Archive::include_member): Add mapfile, sym, and why parameters.
11374 Change all callers. Report inclusion to map file.
11375 * archive.h: Include "fileread.h".
11376 (class Archive): Update declarations.
11377 (Archive::file): New const method.
11378 (class Add_archive_symbols): Add mapfile_ field. Update
11379 constructor. Change all callers.
11380 * readsyms.h (class Read_symbols): Likewise.
11381 (class Finish_group): Likewise.
11382 (class Read_script): Likewise.
11383 * common.cc: Include "mapfile.h".
11384 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11385 all callers.
11386 (Symbol_table::do_allocate_commons): Likewise.
11387 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11388 symbol allocation to mapfile.
11389 * common.h (class Allocate_commons_task): Add mapfile_ field.
11390 Update constructor. Change all callers.
11391 * symtab.h (class Symbol_table): Update declarations.
11392 * layout.cc: Include "mapfile.h".
11393 (Layout_task_runner::run): Print information to mapfile.
11394 (Layout::create_gold_note): Change Output_data_fixed_space to
11395 Output_data_zero_fill.
11396 (Layout::create_build_id): Likewise.
11397 (Layout::print_to_mapfile): New function.
11398 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11399 constructor. Change caller.
11400 (class Layout): Declare print_to_mapfile.
11401 * output.cc (Output_section::Input_section::print_to_mapfile): New
11402 function.
11403 (Output_section::add_input_section): If producing a map, always
11404 add to input_sections_ list.
11405 (Output_section::do_print_to_mapfile): New function.
11406 (Output_segment::print_sections_to_mapfile): New function.
11407 (Output_segment::print_section_list_to_mapfile): New function.
11408 * output.h: Include "mapfile.h".
11409 (Output_data::print_to_mapfile): New function.
11410 (Output_data::do_print_to_mapfile): New virtual function.
11411 (Output_segment_headers::do_print_to_mapfile): New function.
11412 (Output_file_header::do_print_to_mapfile): New function.
11413 (Output_data_const::do_print_to_mapfile): New function.
11414 (class Output_data_const_buffer): Add map_name_ field. Update
11415 constructor. Change all callers. Add do_print_to_mapfile
11416 function.
11417 (class Output_data_fixed_space): Likewise.
11418 (class Output_data_space): Likewise.
11419 (class Output_data_zero_fill): New class.
11420 (Output_data_strtab::do_print_to_mapfile): New function.
11421 (Output_data_reloc_base::do_print_to_mapfile): New function.
11422 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11423 (Output_data_group::do_print_to_mapfile): New function.
11424 (Output_data_got::do_print_to_mapfile): New function.
11425 (Output_data_dynamic::do_print_to_mapfile): New function.
11426 (Output_symtab_xindex::do_print_to_mapfile): New function.
11427 (class Output_section): Declare do_print_to_mapflie. Declare
11428 print_to_mapfile in Input_section.
11429 (class Output_segment): Declare new functions.
11430 * object.h (Sized_relobj::symbol_count): New function.
11431 * script-sections.cc
11432 (Output_section_element_dot_assignment::set_section_addresses):
11433 Change Output_data_fixed_space to Output_data_zero_fill.
11434 (Output_data_expression::do_print_to_mapfile): New function.
11435 * script.cc (read_input_script): Add mapfile parameter. Change
11436 all callers.
11437 * script.h (read_input_script): Update declaration.
11438 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11439 (Eh_frame::do_print_to_mapfile): New function.
11440 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11441 (Output_merge_string::do_print_to_mapfile): New function.
11442 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11443 function.
11444 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11445 function.
11446 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11447 function.
11448 * Makefile.am (CCFILES): Add mapfile.cc.
11449 (HFILES): Add mapfile.h.
11450 * Makefile.in: Rebuild.
11451
9f1d377b
ILT
114522008-05-19 Ian Lance Taylor <iant@google.com>
11453
11454 * options.h (class General_options): Add -z relro.
11455 * layout.cc (Layout::Layout): Initialize relro_segment_.
11456 (Layout::add_output_section_data): Return the output section.
11457 (Layout::make_output_section): Rcognize relro sections and mark
11458 them appropriately.
11459 (Layout::attach_allocated_section_to_segment): Put relro sections
11460 in a PT_GNU_RELRO segment.
11461 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11462 section as relro.
11463 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11464 PT_TLS segments.
11465 (Layout::linkonce_mapping): Map d.rel.ro.local to
11466 .data.rel.ro.local.
11467 (Layout::output_section_name): Us .data.rel.ro.local for any
11468 section which begins with that.
11469 * layout.h (class Layout): Update add_output_section_data
11470 declaration. Add relro_segment_ field.
11471 * output.cc (Output_section::Output_section): Initialize is_relro_
11472 and is_relro_local_ fields.
11473 (Output_segment::add_output_section): Group relro sections.
11474 (Output_segment::is_first_section_relro): New function.
11475 (Output_segment::maximum_alignment): If there is a relro section,
11476 align the segment to the common page size.
11477 (Output_segment::set_section_addresses): Track whether we are
11478 looking at relro sections. If the last section is a relro
11479 section, align to the common page size.
11480 (Output_segment::set_section_list_addresses): Add in_relro
11481 parameter. Change all callers. Align to the page size when
11482 moving from relro to non-relro section.
11483 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11484 segment.
11485 * output.h (class Output_section): Add is_relro_ and
11486 is_relro_local_ fields.
11487 (Output_section::is_relro): New function.
11488 (Output_section::set_is_relro): New function.
11489 (Output_section::is_relro_local): New function.
11490 (Output_section::set_is_relro_local): New function.
11491 (class Output_segment): Update declarations.
11492 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11493 * sparc.cc (Target_sparc::got_section): Likewise.
11494 * x86_64.cc (Target_x86_64::got_section): Likewise.
11495 * testsuite/relro_test_main.cc: New file.
11496 * testsuite/relro_test.cc: New file.
11497 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11498 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11499 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11500 (relro_test.so, relro_test_pic.o): New targets.
11501 * testsuite/Makefile.in: Rebuild.
11502
a984ee1d
ILT
115032008-05-16 Ian Lance Taylor <iant@google.com>
11504
01676dcd
ILT
11505 * output.cc (Output_segment::add_output_section): Remove front
11506 parameter.
11507 * output.h (class Output_segment): Remove
11508 add_initial_output_section and overloaded add_output_section.
11509 Update declaration of remaining add_output_section.
11510 * layout.cc (Layout::create_interp): Call add_output_section
11511 rather than add_initial_output_section.
11512 (Layout::finish_dynamic_section): Likewise.
11513
497897f9
ILT
11514 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11515 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11516 know the dynamic type.
11517 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11518 field. Initialize it in constructor.
11519 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11520 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11521 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11522 reloc.
11523
a984ee1d
ILT
11524 * output.cc (Output_reloc::get_address): Change return type to
11525 Elf_Addr.
11526 * output.h (class Output_reloc): Update get_address declaration.
11527 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11528 for section addresses.
11529
55ba0940
ILT
115302008-05-09 Ian Lance Taylor <iant@google.com>
11531
11532 PR 6493
11533 * gold.cc (gold_nomem): Use return value of write.
11534
75517b77
ILT
115352008-05-08 Ian Lance Taylor <iant@google.com>
11536
11537 * symtab.c (Symbol::init_base_output_data): Add version
11538 parameter. Change all callers.
11539 (Symbol::init_base_output_segment): Likewise.
11540 (Symbol::init_base_constant): Likewise.
11541 (Symbol::init_base_undefined): Likewise.
11542 (Sized_symbol::init_output_data): Likewise.
11543 (Sized_symbol::init_output_segment): Likewise.
11544 (Sized_symbol::init_constant): Likewise.
11545 (Sized_symbol::init_undefined): Likewise.
11546 (Symbol_table::do_define_in_output_data): If the new symbol has a
11547 version, mark it as the default.
11548 (Symbol_table::do_define_in_output_segment): Likewise.
11549 (Symbol_table::do_define_as_constant): Likewise.
11550 * symtab.h (class Symbol): Update declarations.
11551 (class Sized_symbol): Likewise.
11552 * resolve.cc (Symbol::override_version): New function.
c42e122e 11553 (Symbol::override_base): Call override_version.
75517b77
ILT
11554 (Symbol::override_base_with_special): Likewise.
11555 * testsuite/ver_script_8.script: New file.
11556 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11557 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11558 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11559 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11560
f1f70eae
ILT
115612008-05-06 Ian Lance Taylor <iant@google.com>
11562
f3e9c5c5
ILT
11563 PR 6049
11564 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11565 functions.
11566 (class General_options): Remove existing --undefined, and add
11567 --no-undefined instead. Add new --undefined as synonym for -u.
11568 * archive.cc (Archive::add_symbols): Check whether symbol was
11569 named with -u.
11570 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11571 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11572 all uses. Add IS_UNDEFINED. Update declarations to split
11573 different versions of init_base. Declare init_base_undefined.
11574 (Symbol::is_defined): Handle IS_UNDEFINED.
11575 (Symbol::is_undefined): Likewise.
11576 (Symbol::is_weak_undefined): Call is_undefined.
11577 (Symbol::is_absolute): Handle IS_CONSTANT.
11578 (class Sized_symbol): Update declarations to split different
11579 versions of init. Declare init_undefined.
11580 (class Symbol_table): Declare new functions.
11581 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11582 Change all callers.
11583 (Symbol::init_base_output_data): Likewise.
11584 (Symbol::init_base_output_segment): Likewise.
11585 (Symbol::init_base_constant): Likewise.
11586 (Symbol::init_base_undefined): New function.
11587 (Sized_symbol::init_object): Rename from init. Change all
11588 callers.
11589 (Sized_symbol::init_output_data): Likewise.
11590 (Sized_symbol::init_output_segment): Likewise.
11591 (Sized_symbol::init_constant): Likewise.
11592 (Sized_symbol::init_undefined): New function.
11593 (Symbol_table::add_undefined_symbols_from_command_line): New
11594 function.
11595 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11596 function.
11597 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11598 (Symbol::output_section): Likewise.
11599 (Symbol::set_output_section): Likewise.
11600 (Symbol_table::sized_finalize_symbol): Likewise.
11601 (Symbol_table::sized_write_globals): Likewise.
11602 * resolve.cc (Symbol_table::should_override): Likewise.
11603 (Symbol::override_base_with_special): Likewise.
11604
8bdcdf2c
ILT
11605 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11606 symbol, change it to have default visibility.
11607 * testsuite/protected_1.cc: New file.
11608 * testsuite/protected_2.cc: New file.
11609 * testsuite/protected_3.cc: New file.
11610 * testsuite/protected_main_1.cc: New file.
11611 * testsuite/protected_main_2.cc: New file.
11612 * testsuite/protected_main_3.cc: New file.
11613 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11614 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11615 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11616 (protected_1.so): New target.
11617 (protected_1_pic.o, protected_2_pic.o): New targets.
11618 (protected_3_pic.o): New target.
11619 (check_PROGRAMS): Add protected_2.
11620 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11621 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11622 * testsuite/Makefile.in: Rebuild.
11623
2b706932
ILT
11624 * options.h (DEFINE_var): Add set_user_set_##varname__.
11625 (DEFINE_bool_alias): New macro.
11626 (class General_options): Define -Bstatic using DEFINE_bool_alias
11627 rather than DEFINE_special. Add --undefined as an alias for -z
11628 defs.
11629 * options.cc (General_options::parse_Bstatic): Remove.
11630
d82a5bcc
ILT
11631 * options.h (class General_options): Add --fatal-warnings.
11632 * main.cc (main): Implement --fatal-warnings.
11633 * errors.h (Errors::warning_count): New function.
11634
f1f70eae
ILT
11635 * options.h (class General_options): Add -Bsymbolic-functions.
11636 * symtab.h (Symbol::is_preemptible): Check for
11637 -Bsymbolic-functions.
11638
8825ac63
ILT
116392008-05-05 Ian Lance Taylor <iant@google.com>
11640
d98bc257
ILT
11641 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11642 as noVARNAME rather than no-VARNAME.
11643 (class General_options): Add option -z combreloc.
11644 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11645 get_address.
11646 (Output_reloc::sort_before) [SHT_REL]: New function.
11647 (Output_reloc::sort_before) [SHT_RELA]: New function.
11648 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11649 Sort_relocs_comparison.
11650 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11651 parameter. Change all callers.
11652 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11653 sort_relocs parameter. Change all callers.
11654 * output.cc (Output_reloc::get_address): New function, broken out
11655 of write_rel.
11656 (Output_reloc::write_rel): Call it.
11657 (Output_reloc::compare): New function.
11658 (Output_data_reloc_base::do_write): Optionally sort relocs.
11659
60b2b4e7
ILT
11660 * configure.ac: If targ_extra_obj is set, link it in.
11661 * configure.tgt: Initialize all variables.
11662 (x86_64*): Set targ_extra_obj and targ_extra_size.
11663 * configure: Rebuild.
11664
8825ac63
ILT
11665 * object.cc (Sized_relobj::include_section_group): Adjust section
11666 indexes read from group data. Build vector to pass to
11667 layout_group.
11668 * layout.cc (Layout::layout_group): Add flags and shndxes
11669 parameters. Remove contents parameter. Change caller. Update
11670 explicit instantiations.
11671 * layout.h (class Layout): Update layout_group declaration.
11672 * output.cc (Output_data_group::Output_data_group): Add flags and
11673 input_shndxes parameters. Remove contents parameter. Change
11674 caller.
11675 (Output_data_group::do_write): Change input_sections_ to
11676 input_shndxes_.
11677 * output.h (class Output_data_group): Update constructor
11678 declaration. Rename input_sections_ to input_shndxes_.
11679 * testsuite/many_sections_test.cc: Add template.
11680
e94cf127
CC
116812008-04-30 Cary Coutant <ccoutant@google.com>
11682
4418b2d5
CC
11683 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11684
e94cf127
CC
11685 * layout.cc (Layout::include_section): Refactored check for debug
11686 info section.
11687 (Layout::add_comdat): Add new parameters. Change type
11688 of signature parameter. Add object and shndx to signatures table.
11689 (Layout::find_kept_object): New function.
11690 * layout.h: Include <cstring>.
11691 (Layout::is_debug_info_section): New function.
11692 (Layout::add_comdat): Add new parameters.
11693 (Layout::find_kept_object): New function.
11694 (Layout::Kept_section): New struct.
11695 (Layout::Signatures): Change type of map range.
11696 * object.cc (Relobj::output_section_address): New function.
11697 (Sized_relobj::include_section_group): Add new parameters. Change
11698 calls to Layout::add_comdat. Change to build table of kept comdat
11699 groups and table mapping discarded sections to kept sections.
11700 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11701 (Sized_relobj::do_layout): Change calls to include_section_group and
11702 include_linkonce_section.
11703 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11704 value to zero when section is discarded.
11705 (Sized_relobj::map_to_kept_section): New function.
11706 * object.h (Relobj::output_section_address): New function.
11707 (Relobj::Comdat_group): New type.
11708 (Relobj::find_comdat_group): New function.
11709 (Relobj::Comdat_group_table): New type.
11710 (Relobj::Kept_comdat_section): New type.
11711 (Relobj::Kept_comdat_section_table): New type.
11712 (Relobj::add_comdat_group): New function.
11713 (Relobj::set_kept_comdat_section): New function.
11714 (Relobj::get_kept_comdat_section): New function.
11715 (Relobj::comdat_groups_): New field.
11716 (Relobj::kept_comdat_sections_): New field.
11717 (Symbol_value::input_value): Update comment.
11718 (Sized_relobj::map_to_kept_section) New function.
11719 (Sized_relobj::include_linkonce_section): Add new parameter.
11720 * target-reloc.h (Comdat_behavior): New type.
11721 (get_comdat_behavior): New function.
11722 (relocate_section): Add code to map a discarded section to the
11723 corresponding kept section when applying a relocation.
11724
e4e5049b
CS
117252008-04-30 Craig Silverstein <csilvers@google.com>
11726
11727 * dwarf_reader.cc (next_generation_count): New static var.
11728 (Addr2line_cache_entry): New struct.
11729 (addr2line_cache): New static var.
11730 (Dwarf_line_info::one_addr2line): Added caching.
11731 (Dwarf_line_info::clear_addr2line_cache): New function.
11732 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11733 cache-size parameter.
11734 (Dwarf_line_info::one_addr2line_cache): New function.
11735 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11736 new cache-size argument to one_addr2line(), and clear cache.
11737
d09e9154
CC
117382008-04-28 Cary Coutant <ccoutant@google.com>
11739
11740 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11741 R_386_PC8 relocations.
11742
7ef73768
ILT
117432008-04-23 Ian Lance Taylor <iant@google.com>
11744
55438702
ILT
11745 * object.cc (Sized_relobj::include_section_group): Check for
11746 invalid section group.
11747
c165fb93
ILT
11748 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11749 header size.
11750
7ef73768
ILT
11751 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11752 than read for file header.
11753 * archive.cc (Archive::include_member): Likewise.
11754
6194aaab
L
117552008-04-23 Paolo Bonzini <bonzini@gnu.org>
11756
11757 * aclocal.m4: Regenerate.
11758 * configure: Regenerate.
11759
d491d34e
ILT
117602008-04-19 Ian Lance Taylor <iant@google.com>
11761
5ea2bac6
ILT
11762 * version.cc (version_string): Bump to 1.6.
11763
7bc3e21a
ILT
11764 * testsuite/Makefile.am (many_sections_r_test): New target.
11765 (many_sections_r_test_SOURCES): Remove.
11766 (many_sections_r_test_DEPENDENCIES): Remove.
11767 (many_sections_r_test_LDFLAGS): Remove.
11768 (many_sections_r_test_LDADD): Remove.
11769
7fcd3aa9
ILT
11770 * object.cc (Sized_relobj::do_add_symbols): Always pass
11771 local_symbol_count_ to add_from_relobj.
11772
4c94d6ae
ILT
11773 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11774 every thousand variables.
11775 * testsuite/Makefile.in: Rebuild.
11776
d491d34e
ILT
11777 * object.cc (Xindex::initialize_symtab_xindex): New function.
11778 (Xindex::read_symtab_xindex): New function.
11779 (Xindex::sym_xindex_to_shndx): New function.
11780 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11781 available.
11782 (Sized_relobj::do_initialize_xindex): New function.
11783 (Sized_relobj::do_read_symbols): Adjust section links.
11784 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11785 parameter. Change all callers.
11786 (Sized_relobj::include_section_group): Adjust section links and
11787 symbol section indexes.
11788 (Sized_relobj::do_layout): Adjust section links.
11789 (Sized_relobj::do_count_local_symbols): Adjust section links and
11790 symbol section indexes.
11791 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11792 ordinary and special symbols.
11793 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11794 dynsym_xindex parameters. Change all callers. Adjust section
11795 links. Use SHN_XINDEX when needed.
11796 (Sized_relobj::get_symbol_location_info): Adjust section links.
11797 Don't get fooled by special symbols.
11798 * object.h (class Xindex): Define.
11799 (class Object): Add xindex_ parameter. Declare virtual functoin
11800 do_initialize_xindex.
11801 (Object::adjust_sym_shndx): New function.
11802 (Object::set_xindex): New protected function.
11803 (class Symbol_value): Add is_ordinary_shndx_ field.
11804 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11805 (Symbol_value::value): Assert ordinary section.
11806 (Symbol_value::initialize_input_to_output_map): Likewise.
11807 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11808 Change all callers.
11809 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11810 all callers.
11811 (class Sized_relobj): Update declarations.
11812 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11813 parameter. Change all callers.
11814 (Sized_relobj::adjust_shndx): New function.
11815 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11816 field.
11817 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11818 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11819 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11820 (Sized_dynobj::read_dynsym_section): Adjust section links.
11821 (Sized_dynobj::read_dynamic): Likewise.
11822 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11823 section links.
11824 (Sized_dynobj::do_initialize_xindex): New function.
11825 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11826 do_initialize_xindex.
11827 (Sized_dynobj::adjust_shndx): New function.
11828 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11829 dynsym_xindex_ fields.
11830 (Layout::finalize): Add a call to set_section_indexes before
11831 creating the symtab sections.
11832 (Layout::set_section_indexes): Don't do anything if the section
11833 already has a section index.
11834 (Layout::create_symtab_sections): Add shnum parameter. Change
11835 caller. Create .symtab_shndx section if needed.
11836 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11837 caller.
11838 (Layout::allocated_output_section_count): New function.
11839 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11840 needed.
11841 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11842 fields. Update declarations.
11843 (Layout::symtab_xindex): New function.
11844 (Layout::dynsym_xindex): New function.
11845 (class Write_symbols_task): Add layout_ field.
11846 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11847 Change caller.
11848 * output.cc (Output_section_headers::Output_section_headers): Add
11849 shstrtab_section parameter. Change all callers.
11850 (Output_section_headers::do_sized_write): Store overflow values
11851 for section count and section string table section index in
11852 section header zero.
11853 (Output_file_header::do_sized_write): Check for overflow of
11854 section count and section string table section index.
11855 (Output_symtab_xindex::do_write): New function.
11856 (Output_symtab_xindex::endian_do_write): New function.
11857 * output.h (class Output_section_headers): Add shstrtab_section_.
11858 Update declarations.
11859 (class Output_symtab_xindex): Define.
11860 (Output_section::has_out_shndx): New function.
11861 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11862 field.
11863 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11864 Change all callers.
11865 (Sized_symbol::init): Likewise.
11866 (Symbol::output_section): Check for ordinary symbol.
11867 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11868 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11869 callers.
11870 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11871 Change all callers. Simplify handling of symbols from sections
11872 not included in the link.
11873 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11874 distinction.
11875 (Weak_alias_sorter::operator()): Assert that symbols are
11876 ordinary.
11877 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11878 distinction.
11879 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11880 parameters. Change all callers.
11881 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11882 symbol distinction. Use SHN_XINDEX when needed.
11883 (Symbol_table::write_section_symbol): Add symtab_xindex
11884 parameter. Change all callers.
11885 (Symbol_table::sized_write_section_symbol): Likewise. Use
11886 SHN_XINDEX when needed.
11887 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11888 declarations.
11889 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11890 (Symbol::is_defined): Check is_ordinary.
11891 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11892 (Symbol::is_absolute, Symbol::is_common): Likewise.
11893 (class Sized_symbol): Update declarations.
11894 (class Symbol_table): Update declarations.
11895 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11896 parameters. Change all callers.
11897 (Sized_symbol::override): Likewise.
11898 (Symbol_table::override): Likewise.
11899 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11900 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11901 is_ordinary, and orig_st_shndx parameters. Change all callers.
11902 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11903 to be in an ordinary section.
11904 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11905 object and is_ordinary parameters. Change all callers.
11906 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11907 Change all callers. Don't add undefined or non-ordinary symbols
11908 to reloc_map_.
11909 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11910 Change all callers.
11911 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11912 declarations.
11913 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11914 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11915 (Sized_relobj::relocate_sections): Likewise.
11916 * target-reloc.h (scan_relocs): Adjust section symbol index.
11917 (scan_relocatable_relocs): Likewise.
11918 * i386.cc (Scan::local): Check for ordinary symbols.
11919 * sparc.cc (Scan::local): Likewise.
11920 * x86_64.cc (Scan::local): Likewise.
11921 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11922 to symbol_section_and_value.
11923 * testsuite/many_sections_test.cc: New file.
11924 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11925 (check_PROGRAMS): Add many_sections_test.
11926 (many_sections_test_SOURCES): Define.
11927 (many_sections_test_DEPENDENCIES): Define.
11928 (many_sections_test_LDFLAGS): Define.
11929 (BUILT_SOURCES): Add many_sections_define.h.
11930 (many_sections_define.h): New target.
11931 (BUILT_SOURCES): Add many_sections_check.h.
11932 (many_sections_check.h): New target.
11933 (check_PROGRAMS): Add many_sections_r_test.
11934 (many_sections_r_test_SOURCES): Define.
11935 (many_sections_r_test_DEPENDENCIES): Define.
11936 (many_sections_r_test_LDFLAGS): Define.
11937 (many_sections_r_test_LDADD): Define.
11938 (many_sections_r_test.o): New target.
11939 * testsuite/Makefile.in: Rebuild.
11940
c5818ff1
CC
119412008-04-17 Cary Coutant <ccoutant@google.com>
11942
11943 * errors.cc (Errors::info): New function.
11944 (gold_info): New function.
11945 * errors.h (Errors::info): New function.
11946 * gold.h (gold_info): New function.
11947 * object.cc (Input_objects::add_object): Print trace output.
11948 * options.cc (options::parse_set): New function.
11949 (General_options::parse_wrap): Deleted.
11950 (General_options::General_options): Deleted initializer.
11951 * options.h (options::String_set): New typedef.
11952 (options::parse_set): New function.
11953 (DEFINE_set): New macro.
11954 (General_options::wrap): Changed to use DEFINE_set. Changed
11955 callers of any_wrap_symbols and is_wrap_symbol.
11956 (General_options::trace, General_options::trace_symbol):
11957 New options.
11958 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11959 (General_options::wrap_symbols_): Deleted.
11960 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11961
b5be4a7c
DM
119622008-04-17 David S. Miller <davem@davemloft.net>
11963
11964 * options.cc (General_options::parse_V): New function.
11965 * options.h: Add entries for -V and -Qy.
11966
155a0dd7
ILT
119672008-04-17 Ian Lance Taylor <iant@google.com>
11968
11969 * common.cc (Symbol_table::allocate_commons): Remove options
11970 parameter. Change caller.
11971 (Symbol_table::do_allocate_commons): Remove options parameter.
11972 Change caller. Just call do_allocate_commons_list twice.
11973 (Symbol_table::do_allocate_commons_list): New function, broken out
11974 of do_allocate_commons.
11975 * common.h (class Allocate_commons_task): Remove options_ field.
11976 Update constructor.
11977 * symtab.cc (Symbol_table::Symbol_table): Initialize
11978 tls_commons_.
11979 (Symbol_table::add_from_object): Put TLS common symbols on
11980 tls_commons_ list.
11981 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11982 which are IN_OUTPUT_DATA.
11983 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11984 allocate_commons and do_allocate_commons declarations. Declare
11985 do_allocate_commons_list.
11986 * gold.cc (queue_middle_tasks): Update creation of
11987 Allocate_commons_task to not pass options.
11988 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11989 (TLS_TEST_C_FLAGS): New variable.
11990 (tls_test_c_pic.o): New target.
11991 (tls_test_shared.so): Link in tls_test_c_pic.o.
11992 (tls_test_c_pic_ie.o): New target.
11993 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11994 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11995 (tls_test_c.o): New target.
11996 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11997 (tls_pic_test_LDADD): Likewise.
11998 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11999 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12000 (tls_test_c_gnu2.o): New target.
12001 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12002 tls_test_c_gnu2.o.
12003 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12004 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12005 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12006 * testsuite/tls_test.cc: Include "config.h".
12007 (t_last): Call t11_last.
12008 * testsuite/tls_test.h (t11, t11_last): Declare.
12009 * testsuite/tls_test_c.c: New file.
12010 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12011 * configure.ac: Check for OpenMP support.
12012 * configure, config.in, Makefile.in: Rebuild.
12013 * testsuite/Makefile.in: Rebuild.
12014
edfbb029
CC
120152008-04-16 Cary Coutant <ccoutant@google.com>
12016
12017 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12018 (Target_i386::tls_base_symbol_defined_): New field.
12019 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12020 (Target_i386::Scan::global): Likewise.
12021 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12022 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12023 (Target_x86_64::tls_base_symbol_defined_): New field.
12024 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12025 (Target_x86_64::Scan::global): Likewise.
12026
f3c69fca
CC
120272008-04-16 Cary Coutant <ccoutant@google.com>
12028
12029 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12030 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12031 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12032 building shared libraries.
12033 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12034 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12035 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12036 * testsuite/Makefile.in: Rebuild.
12037 * testsuite/weak_undef.h: New file.
12038 * testsuite/weak_undef_file1.cc: Add extra test cases.
12039 * testsuite/weak_undef_file2.cc: Likewise.
12040 * testsuite/weak_undef_test.cc: Likewise.
12041
7c414435
DM
120422008-04-16 David S. Miller <davem@davemloft.net>
12043
32b769e1
DM
12044 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12045 Add issued_non_pic_error_ field. Declare check_non_pic.
12046 (Target_sparc::Scan::check_non_pic): New function.
12047 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12048 (Target_sparc::Scan::global): Likewise.
12049
11936fb1
DM
12050 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12051 * configure: Rebuild.
12052
7c414435
DM
12053 * options.h (DEFINE_enable): New macro.
12054 (new_dtags): New enable option.
12055 (initfirst, interpose, loadfltr, nodefaultlib,
12056 nodelete, nodlopen, nodump): New -z options.
12057 * layout.cc (Layout:finish_dynamic_section): If new
12058 dtags enabled, emit DT_RUNPATH. Also, emit a
12059 DT_FLAGS_1 containing any specified -z flags.
12060
85c7bf8b
ILT
120612008-04-16 Ian Lance Taylor <iant@google.com>
12062
12c0daef
ILT
12063 * copy-relocs.cc: New file.
12064 * copy-relocs.h: New file.
12065 * reloc.cc: Remove Copy_relocs code.
12066 * reloc.h: Likewise.
12067 * reloc-types.h (struct Reloc_types) [both versions]: Add
12068 get_reloc_addend_noerror.
12069 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12070 variants of add_global which take an addend which must be zero.
12071 * i386.cc: Include "copy-relocs.h".
12072 (class Target_i386): Change type of copy_relocs_ to variable,
12073 update initializer.
12074 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12075 Change all callers.
12076 (Target_i386::do_finalize_sections): Change handling of
12077 copy_relocs_.
12078 * sparc.cc: Include "copy-relocs.h".
12079 (class Target_sparc): Change type of copy_relocs_ to variable,
12080 update initializer.
12081 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12082 Change all callers.
12083 (Target_sparc::do_finalize_sections): Change handling of
12084 copy_relocs_.
12085 * x86_64.cc: Include "copy-relocs.h".
12086 (class Target_x86_64): Change type of copy_relocs_ to variable,
12087 update initializer.
12088 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12089 class. Change all callers.
12090 (Target_x86_64::do_finalize_sections): Change handling of
12091 copy_relocs_.
12092 * Makefile.am (CCFILES): Add copy-relocs.cc.
12093 (HFILES): Add copy-relocs.h.
12094
4f4995b6
ILT
12095 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12096
85c7bf8b
ILT
12097 * testsuite/script_test_4.sh: Permit leading zeroes.
12098
4f2a9edd
ILT
120992008-04-15 Ian Lance Taylor <iant@google.com>
12100
e6188289
ILT
12101 * script-sections.cc (Script_sections::create_segments): Use
12102 header_size_adjustment even when there is enough room for the
12103 headers.
12104 * testsuite/script_test_4.sh: New file.
12105 * testsuite/script_test_4.t: New file.
12106 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12107 (check_DATA): Add script_test_4.stdout.
12108 (MOSTLYCLEANFILES): Likewise.
12109 (script_test_4): New target.
12110 (script_test_4.stdout): New target.
12111 * testsuite/Makefile.in: Rebuild.
12112
4f2a9edd
ILT
12113 * sparc.cc: Add definitions for Output_data_plt_sparc class
12114 constants.
12115
f5314dd5
DM
121162008-04-14 David S. Miller <davem@davemloft.net>
12117
12118 * sparc.cc: New file.
12119 * Makefile.am (TARGETSOURCES): Add sparc.cc
12120 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12121 * configure.tgt: Document targ_extra_size and
12122 targ_extra_big_endian. Add entries for sparc-* and
12123 sparc64-*.
12124 * configure.ac: Handle targ_extra_size and
12125 targ_extra_big_endian.
12126 * Makefile.in: Rebuild.
12127 * configure: Likewise.
12128 * po/POTFILES.in: Likewise.
12129 * po/gold.pot: Likewise.
12130
154e0e9a
ILT
121312008-04-14 Ian Lance Taylor <iant@google.com>
12132
12133 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12134 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12135 in the name/type/flags to section mapping. Don't call
12136 allocate_output_section.
12137 (Layout::choose_output_section): Change parameter from adjust_name
12138 to is_input_section. Don't permit input sections after sections
12139 are attached to segments. Don't call allocate_output_section.
12140 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12141 not write_enable_output_section.
12142 (Layout::make_output_section): Don't push to
12143 unattached_section_list_ nor call attach_to_segment. Call
12144 attach_section_to_segment if sections are attached.
12145 (Layout::attach_sections_to_segments): New function.
12146 (Layout::attach_section_to_segment): New function.
12147 (Layout::attach_allocated_section_to_segment): Rename from
12148 attach_to_segment. Remove flags parameter.
12149 (Layout::allocate_output_section): Remove function.
12150 (Layout::write_enable_output_section): Remove function.
12151 * layout.h (class Layout): Update for above changes. Add new
12152 field sections_are_attached_.
12153 * output.h (Output_section::update_flags_for_input_section): New
12154 function.
12155 * output.cc (Output_section::add_input_section): Call
12156 update_flags_for_input_section.
12157 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12158
009a67a2
CC
121592008-04-11 Cary Coutant <ccoutant@google.com>
12160
12161 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12162 thought unnecessary.
12163 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12164
759b1a24
ILT
121652008-04-11 Ian Lance Taylor <iant@google.com>
12166
12167 * output.h (class Output_section_data): Remove inline definition
12168 of set_addralign.
12169 * output.cc (Output_section_data::set_addralign): New function.
12170
c2b45e22
CC
121712008-04-11 Cary Coutant <ccoutant@google.com>
12172
12173 Add support for TLS descriptors for i386 and x86_64.
12174 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12175 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12176 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12177 GOT_TYPE_TLS_DESC.
12178 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12179 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12180 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12181 relocations.
12182 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12183 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12184 Fix problem with initial-exec relocations.
12185 (Target_i386::Relocate::relocate_tls): Likewise.
12186 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12187 relaxation.
12188 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12189 support for section-plus-offset dynamic table entries.
12190 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12191 (Output_data_dynamic::Dynamic_entry): Add support for
12192 section-plus-offset dynamic table entries.
12193 (Output_data_dynamic::Classification): Likewise.
12194 (Output_data_dynamic::classification_): Renamed offset_.
12195 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12196 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12197 (Target_x86_64::make_plt_section): New function.
12198 (Target_x86_64::reserve_tlsdesc_entries): New function.
12199 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12200 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12201 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12202 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12203 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12204 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12205 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12206 add extra PLT entry for TLS descriptors.
12207 (Output_data_plt_x86_64::got_): New field.
12208 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12209 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12210 fields.
12211 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12212 descriptors.
12213 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12214 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12215 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12216 R_386_TLS_DESC_CALL relocations.
12217 (Target_x86_64::Scan::global): Likewise.
12218 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12219 for TLS descriptors.
12220 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12221 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12222 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12223 GD-to-IE relaxation.
12224 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12225 and TLS_DESCRIPTORS.
12226 * Makefile.in: Rebuild.
12227 * configure: Rebuild.
12228 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12229 (tls_test_shared2.so): New target.
12230 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12231 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12232 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12233 (tls_shared_gd_to_ie_test_LDADD): New variable.
12234 (tls_shared_gnu2_gd_to_ie_test): New target.
12235 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12236 New targets.
12237 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12238 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12239 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12240 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12241 (tls_shared_gnu2_test): New target.
12242 (tls_test_gnu2_shared.so): New target.
12243 (tls_shared_gnu2_test_SOURCES): New variable.
12244 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12245 (tls_shared_gnu2_test_LDFLAGS): New variable.
12246 (tls_shared_gnu2_test_LDADD): New variable.
12247 * testsuite/Makefile.in: Rebuild.
12248 * testsuite/Makefile.
12249
83bfb6b7
ILT
122502008-04-11 Ian Lance Taylor <iant@google.com>
12251
12252 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12253 justsyms.t.
12254 * testsuite/Makefile.in: Rebuild.
12255
12256 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12257 long.
12258 * testsuite/script_test_2.cc (main): Adjust test.
12259
706e1f5e
ILT
122602008-04-11 David S. Miller <davem@davemloft.net>
12261 Ian Lance Taylor <iant@google.com>
12262
12263 * options.h (General_options): Add entries for '-Y' and
12264 '-relax'.
12265 * options.cc (General_options:finalize): If -Y was used, add those
12266 entries to the library path instead of the default "/lib" and
12267 "/usr/lib".
12268
7c98e6bb
DM
122692008-04-11 David S. Miller <davem@davemloft.net>
12270
12271 * testsuite/justsyms.t: Start at 0x100.
12272 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12273 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12274 long.
12275 * testsuite/script_test_2.cc: Adjust string and section length
12276 checks.
7c98e6bb 12277
99a37bfd
ILT
122782008-04-09 Ian Lance Taylor <iant@google.com>
12279
2cefc357
ILT
12280 PR gold/5996
12281 * script-sections.cc (Sections_element::allocate_to_segment): Add
12282 orphan parameter.
12283 (Output_section_definition::allocate_to_segment): Likewise.
12284 (Orphan_output_section::allocate_to_segment): Likewise.
12285 (Script_sections::attach_sections_using_phdrs_clause): Don't
12286 propagate non-PT_LOAD segments to orphan sections.
12287 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12288 readelf rather than objdump.
12289 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12290 .interp section and PT_INTERP segment are the same size.
12291 * testsuite/Makefile.in: Rebuild.
12292
99a37bfd
ILT
12293 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12294 aliases for symbols defined in the same object.
12295 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12296 (weak_alias_test_SOURCES): New variable.
12297 (weak_alias_test_DEPENDENCIES): New variable.
12298 (weak_alias_test_LDFLAGS): New variable.
12299 (weak_alias_test_LDADD): New variable.
12300 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12301 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12302 (weak_alias_test_3.o): New target.
12303 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12304 * testsuite/weak_alias_test_main.cc: New file.
12305 * testsuite/weak_alias_test_1.cc: New file.
12306 * testsuite/weak_alias_test_2.cc: New file.
12307 * testsuite/weak_alias_test_3.cc: New file.
12308
780e49c5
ILT
123092008-04-08 Ian Lance Taylor <iant@google.com>
12310
cdb0b8f5
ILT
12311 * options.h (class General_options): Add --noinhibit-exec option.
12312 * main.cc (main): Check --noinhibit-exec.
12313
0864d551
ILT
12314 * options.h (class General_options): Define --wrap as a special
12315 option. Add wrap_symbols_ field.
12316 (General_options::any_wrap_symbols): New function.
12317 (General_options::is_wrap_symbol): New function.
12318 * options.cc (General_options::parse_wrap): New function.
12319 (General_options::General_options): Initialize wrap_symbols_.
12320 * symtab.cc (Symbol_table::wrap_symbol): New function.
12321 (Symbol_table::add_from_object): Handle --wrap.
12322 * symtab.h (class Symbol_table): Declare wrap_symbol.
12323 * target.h (Target::wrap_char): New function.
12324 (Target::Target_info): Add wrap_char field.
12325 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12326 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12327 * testsuite/testfile.cc (Target_test::test_target_info):
12328 Likewise.
12329
789aa6de
ILT
12330 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12331 there is one.
12332
2c38906f
ILT
12333 * layout.h (class Layout): Add added_eh_frame_data_ field.
12334 * layout.cc (Layout::Layout): Initialize new field.
12335 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12336 output section until we find a section we merged successfully.
12337 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12338 that the size be non-zero.
12339
780e49c5
ILT
12340 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12341 qualifier.
12342
7fcd0256
ILT
123432008-04-08 Craig Silverstein <csilvers@google.com>
12344
12345 * configure.ac: Export new conditional variable HAVE_ZLIB.
12346 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12347 on HAVE_ZLIB.
12348 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12349 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12350
6835af53
ILT
123512008-04-07 Ian Lance Taylor <iant@google.com>
12352
e24f324c
ILT
12353 * version.cc (version_string): Set to "1.5".
12354
a036edd8
ILT
12355 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12356 Add issued_non_pic_error_ field. Declare check_non_pic.
12357 (Target_x86_64::Scan::check_non_pic): New function.
12358 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12359 (Target_x86_64::Scan::global): Likewise.
12360
624f8810
ILT
12361 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12362 addend parameter. Change caller. Handle merge sections.
12363 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12364 Address to Addend. Don't add in the result of
12365 local_section_offset, pass down the addend and use the returned
12366 value.
12367 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12368 Update declarations of local_section_offset and symbol_value.
12369 * testsuite/two_file_test_1.cc (t18): New function.
12370 * testsuite/two_file_test_2.cc (f18): New function.
12371 * testsuite/two_file_test_main.cc (main): Call t18.
12372 * testsuite/two_file_test.h (t18, f18): Declare.
12373
6835af53
ILT
12374 * configure.ac: Don't test for objdump, c++filt, or readelf.
12375 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12376 conditionals.
12377 (TEST_READELF): New variable.
12378 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12379 (check_PROGRAMS): Add two_file_strip_test.
12380 (two_file_strip_test): New target.
12381 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12382 (two_file_same_shared_strip_test_SOURCES): New variable.
12383 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12384 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12385 (two_file_same_shared_strip_test_LDADD): New variable.
12386 (two_file_shared_strip.so): New target.
12387 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12388 (ver_test_5.syms, ver_test_7.syms): Likewise.
12389 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12390 (strip_test_3.stdout): Use TEST_OBJDUMP.
12391 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12392
86925eef
CC
123932008-04-04 Cary Coutant <ccoutant@google.com>
12394
12395 * symtab.h (Symbol::is_weak_undefined): New function.
12396 (Symbol::is_strong_undefined): New function.
12397 (Symbol::is_absolute): New function.
12398 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12399 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12400 absolute symbols.
12401 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12402 (weak_undef_test): New target.
12403 * testsuite/Makefile.in: Rebuild.
12404 * testsuite/weak_undef_file1.cc: New file.
12405 * testsuite/weak_undef_file2.cc: New file.
12406 * testsuite/weak_undef_test.cc: New file.
12407
126f3ece
ILT
124082008-04-03 Craig Silverstein <csilvers@google.com>
12409
12410 * compressed_output.h (class Output_compressed_section): Use
12411 unsigned buffer.
12412 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12413 add zlib header.
12414 (zlib_compressed_suffix): Removed.
12415 (Output_compressed_section::set_final_data_size): Use unsigned
12416 buffers.
12417 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12418 Fix linker invocation.
12419 (flagstest_o_specialfile_and_compress_debug_sections):
12420 Likewise.
12421 * testsuite/Makefile.in: Regenerated.
12422
deae2a14
DM
124232008-04-02 David S. Miller <davem@davemloft.net>
12424
12425 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12426 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12427
70752818
ILT
124282008-04-02 Craig Silverstein <csilvers@google.com>
12429
12430 * TODO: New file.
12431
39d0cb0e
ILT
124322008-04-02 Ian Lance Taylor <iant@google.com>
12433
12434 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12435 parameters. Update for new key type to views_. Change all
12436 callers.
12437 (File_read::read): Adjust for byteshift in returned view.
12438 (File_read::add_view): New function, broken out of
12439 find_and_make_view.
12440 (File_read::make_view): New function, broken out of
12441 find_and_make_view.
12442 (File_read::find_or_make_view): Add offset and aligned
12443 parameters. Rewrite accordingly. Change all callers.
12444 (File_read::get_view): Add offset and aligned parameters. Adjust
12445 for byteshift in return value.
12446 (File_read::get_lasting_view): Likewise.
12447 * fileread.h (class File_read): Update declarations.
12448 (class File_read::View): Add byteshift_ field. Add byteshift to
12449 constructor. Add byteshift method.
12450 * archive.h (Archive::clear_uncached_views): New function.
12451 (Archive::get_view): Add aligned parameter. Change all callers.
12452 * object.h (Object::get_view): Add aligned parameter. Change all
12453 callers.
12454 (Object::get_lasting_view): Likewise.
12455
12456 * fileread.cc (File_read::release): Don't call clear_views if
12457 there are multiple objects.
12458 * fileread.h (File_read::clear_uncached_views): New function.
12459 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12460 on the archive.
12461
a1207466
CC
124622008-03-31 Cary Coutant <ccoutant@google.com>
12463
12464 Add thin archive support.
12465 * archive.cc (Archive::armagt): New const.
12466 (Archive::setup): Remove task parameter and calls to unlock.
12467 (Archive::unlock_nested_archives): New function.
12468 (Archive::read_header): Add nested_off parameter. Change
12469 all callers.
12470 (Archive::interpret_header): Likewise.
12471 (Archive::include_all_members): Change to handle thin
12472 archives.
12473 (Archive::include_member): Likewise.
12474 * archive.h (Archive::Archive): Add new parameters and
12475 initializers.
12476 (Archive::armagt): New const.
12477 (Archive::setup): Remove task parameter.
12478 (Archive::unlock_nested_archives): New function.
12479 (Archive::read_header): Add nested_off parameter.
12480 (Archive::interpret_header): Likewise.
12481 (Archive::Nested_archive_table): New typedef.
12482 (Archive::is_thin_archive_): New field.
12483 (Archive::nested_archives_): New field.
12484 (Archive::options_): New field.
12485 (Archive::dirpath_): New field.
12486 (Archive::task_): New field.
12487 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12488 for thin archives. Pass additional parameters to
12489 Archive::Archive. Unlock the archive file after calling
12490 Archive::setup.
cd536b21 12491
479f6503
ILT
124922008-03-29 Ian Lance Taylor <iant@google.com>
12493
686c8caf
ILT
12494 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12495 version symbol to be local.
12496 * testsuite/ver_test_4.sh: New file.
12497 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12498 (check_DATA): Add ver_test_4.syms.
12499 (ver_test_4.syms): New target.
12500 * testsuite/Makefile.in: Rebuild.
12501
ab794b6b
ILT
12502 * output.cc
12503 (Output_section::Input_section_sort_entry::has_priority): New
12504 function.
12505 (Output_section::Input_section_sort_entry::match_file_name): New
12506 function.
12507 (Output_section::Input_section_sort_entry::match_section_name):
12508 Remove.
12509 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12510 Remove.
12511 (Output_section::Input_section_sort_entry::match_section_file):
12512 Remove.
12513 (Output_section::Input_section_sort_compare::operator()): Rewrite
12514 using new Input_section_sort_entry functions. Sort crtbegin and
12515 crtend first. Sort sections with no priority before sections with
12516 a priority.
12517 * testsuite/initpri1.c (d3): Check j != 4.
12518 (cd5): New constructor/destructor function.
12519 (main): Check j != 2.
12520
479f6503
ILT
12521 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12522 new symbol when resolving, don't call set_is_default.
12523 * testsuite/ver_test_7.cc: New file.
12524 * testsuite/ver_test_7.sh: New file.
12525 * testsuite/Makefile.am (ver_test_7.so): New target.
12526 (ver_test_7.o): New target.
12527 (check_SCRIPTS): Add ver_test_7.sh.
12528 (check_DATA): Add ver_test_7.syms.
12529 (ver_test_7.syms): New target.
12530
2fd32231
ILT
125312008-03-28 Ian Lance Taylor <iant@google.com>
12532
12533 * layout.cc (Layout::layout): If we see an input section with a
12534 name that needs sorting, set the must_sort flag for the output
12535 section.
12536 (Layout::make_output_section): If the name of the output section
12537 indicates that it might require sorting, set the may_sort flag.
12538 * output.h (Output_section::may_sort_attached_input_sections): New
12539 function.
12540 (Output_section::set_may_sort_attached_input_sections): New
12541 function.
12542 (Output_section::must_sort_attached_input_sections): New
12543 function.
12544 (Output_section::set_must_sort_attached_input_sections): New
12545 function.
12546 (class Output_section): Declare Input_section_sort_entry. Define
12547 Input_section_sort_compare. Declare
12548 sort_attached_input_sections. Add new fields:
12549 may_sort_attached_input_sections_,
12550 must_sort_attached_input_sections_,
12551 attached_input_sections_are_sorted_.
12552 * output.cc (Output_section::Output_section): Initialize new
12553 fields.
12554 (Output_section::add_input_section): Add an entry to
12555 input_sections_ if may_sort or must_sort are true.
12556 (Output_section::set_final_data_size): Call
12557 sort_attached_input_sections if necessary.
12558 (Output_section::Input_section_sort_entry): Define new class.
12559 (Output_section::Input_section_sort_compare::operator()): New
12560 function.
12561 (Output_section::sort_attached_input_sections): New function.
12562 * configure.ac: Check whether the compiler supports constructor
12563 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12564 * testsuite/initpri1.c: New file.
12565 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12566 CONSTRUCTOR_PRIORITY.
12567 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12568 (initpri1_LDFLAGS): New variable.
12569 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12570
18e6b24e
ILT
125712008-03-27 Ian Lance Taylor <iant@google.com>
12572
49bdd526
ILT
12573 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12574 * testsuite/common_test_1.c: New file.
12575 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12576 (common_test_1_SOURCES): New variable.
12577 (common_test_1_DEPENDENCIES): New variable.
12578 (common_test_1_LDFLAGS): New variable.
12579
18e6b24e
ILT
12580 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12581 and commons_ correctly when NAME/VERSION does not override
12582 NAME/NULL.
12583 * testsuite/ver_test_6.c: New file.
12584 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12585 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12586 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12587
04bf7072
ILT
125882008-03-26 Ian Lance Taylor <iant@google.com>
12589
5871526f
ILT
12590 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12591 of an undefined symbol from a version script.
12592 * testsuite/Makefile.am (ver_test_5.so): New target.
12593 (ver_test_5.o): New target.
12594 (check_SCRIPTS): Add ver_test_5.sh.
12595 (check_DATA): Add ver_test_5.syms.
12596 (ver_test_5.syms): New target.
12597 * testsuite/ver_test_5.cc: New file.
12598 * testsuite/ver_test_5.script: New file.
12599 * testsuite/ver_test_5.sh: New file.
12600 * Makefile.in, testsuite/Makefile.in: Rebuild.
12601
04bf7072
ILT
12602 PR gold/5986
12603 Fix problems building gold with gcc 4.3.0.
12604 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12605 (gold_error_at_location, gold_warning_at_location): Use it.
12606 * configure.ac: Check whether we can compile and use a template
12607 function with a printf attribute.
12608 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12609 when jumping over bytes.
12610 * object.cc: Instantiate Object::read_section_data.
12611 * debug.h: Include <cstring>
12612 * dwarf_reader.cc: Include <algorithm>
12613 * main.cc: Include <cstring>.
12614 * options.cc: Include <cstring>.
12615 * output.cc: Include <cstring>.
12616 * script.cc: Include <cstring>.
12617 * script.h: Include <string>.
12618 * symtab.cc: Include <cstring> and <algorithm>.
12619 * target-select.cc: Include <cstring>.
12620 * version.cc: Include <string>.
12621 * testsuite/testmain.cc: Include <cstdlib>.
12622 * configure, config.in: Rebuild.
12623
874c5b28
ILT
126242008-03-25 Ian Lance Taylor <iant@google.com>
12625
819d6c3a
ILT
12626 * options.cc: Include "../bfd/bfdver.h".
12627 (options::help): Print bug reporting address.
12628
f4b2c6f5
ILT
12629 * version.cc (print_version): Adjust output for current value of
12630 BFD_VERSION_STRING.
12631
12632 * NEWS: New file.
12633
e96caa79
ILT
12634 * options.cc (options::help): Print list of supported targets.
12635 * target-select.h: Include <vector>.
12636 (class Target_selector): Make machine_, size_, and is_big_endian_
12637 fields const. Add bfd_name_ and instantiated_target_ fields.
12638 (Target_selector::Target_selector): Add bfd_name parameter.
12639 (Target_selector::recognize): Make non-virtual, call
12640 do_recognize.
12641 (Target_selector::recognize_by_name): Make non-virtual, call
12642 do_recognize_by_name.
12643 (Target_selector::supported_names): New function.
12644 (Target_selector::bfd_name): New function.
12645 (Target_selector::do_instantiate_target): New pure virtual
12646 function.
12647 (Target_selector::do_recognize): New virtual function.
12648 (Target_selector::do_recognize_by_name): New virtual function.
12649 (Target_selector::instantiate_target): New private function.
12650 (supported_target_names): Declare.
12651 * target-select.cc (Target_selector::Target_selector): Update for
12652 new parameter and fields.
12653 (select_target_by_name): Check that the name matches before
12654 calling recognize_by_name.
12655 (supported_target_names): New function.
12656 * i386.cc (class Target_selector_i386): Update Target_selector
12657 constructor call. Remove recognize and recognize_by_name. Add
12658 do_instantiate_target.
12659 * x86_64.cc (class Target_selector_x86_64): Likewise.
12660 * testsuite/testfile.cc (class Target_selector_test): Update for
12661 changes to Target_selector.
12662
874c5b28
ILT
12663 * README: Rewrite, with some notes on unsupported features.
12664
0a65a3a7
CC
126652008-03-24 Cary Coutant <ccoutant@google.com>
12666
12667 * i386.cc (Target_i386::Got_type): New enum declaration.
12668 (Target_i386::Scan::local): Updated callers of Output_data_got
12669 member functions.
12670 (Target_i386::Scan::global): Likewise.
12671 (Target_i386::Relocate::relocate): Likewise.
12672 (Target_i386::Relocate::relocate_tls): Likewise.
12673 * object.h (Got_offset_list): New class.
12674 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12675 (Sized_relobj::local_got_offset): Likewise.
12676 (Sized_relobj::set_local_got_offset): Likewise.
12677 (Sized_relobj::local_has_tls_got_offset): Removed.
12678 (Sized_relobj::local_tls_got_offset): Removed.
12679 (Sized_relobj::set_local_tls_got_offset): Removed.
12680 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12681 * output.cc (Output_data_got::add_global): Added got_type parameter.
12682 (Output_data_got::add_global_with_rel): Likewise.
12683 (Output_data_got::add_global_with_rela): Likewise.
12684 (Output_data_got::add_global_pair_with_rel): New function.
12685 (Output_data_got::add_global_pair_with_rela): New function.
12686 (Output_data_got::add_local): Added got_type parameter.
12687 (Output_data_got::add_local_with_rel): Likewise.
12688 (Output_data_got::add_local_with_rela): Likewise.
12689 (Output_data_got::add_local_pair_with_rel): New function.
12690 (Output_data_got::add_local_pair_with_rela): New function.
12691 (Output_data_got::add_global_tls): Removed.
12692 (Output_data_got::add_global_tls_with_rel): Removed.
12693 (Output_data_got::add_global_tls_with_rela): Removed.
12694 (Output_data_got::add_local_tls): Removed.
12695 (Output_data_got::add_local_tls_with_rel): Removed.
12696 (Output_data_got::add_local_tls_with_rela): Removed.
12697 * output.h (Output_data_got::add_global): Added got_type parameter.
12698 (Output_data_got::add_global_with_rel): Likewise.
12699 (Output_data_got::add_global_with_rela): Likewise.
12700 (Output_data_got::add_global_pair_with_rel): New function.
12701 (Output_data_got::add_global_pair_with_rela): New function.
12702 (Output_data_got::add_local): Added got_type parameter.
12703 (Output_data_got::add_local_with_rel): Likewise.
12704 (Output_data_got::add_local_with_rela): Likewise.
12705 (Output_data_got::add_local_pair_with_rel): New function.
12706 (Output_data_got::add_local_pair_with_rela): New function.
12707 (Output_data_got::add_global_tls): Removed.
12708 (Output_data_got::add_global_tls_with_rel): Removed.
12709 (Output_data_got::add_global_tls_with_rela): Removed.
12710 (Output_data_got::add_local_tls): Removed.
12711 (Output_data_got::add_local_tls_with_rel): Removed.
12712 (Output_data_got::add_local_tls_with_rela): Removed.
12713 * resolve.cc (Symbol::override_base_with_special): Removed
12714 reference to has_got_offset_ field.
12715 * symtab.cc (Symbol::init_fields): Replaced initialization
12716 of got_offset_ with got_offsets_. Removed initialization
12717 of has_got_offset_
53fcba31 12718 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
12719 (Symbol::got_offset): Likewise.
12720 (Symbol::set_got_offset): Likewise.
12721 (Symbol::has_tls_got_offset): Removed.
12722 (Symbol::tls_got_offset): Removed.
12723 (Symbol::set_tls_got_offset): Removed.
12724 (Symbol::got_offset_): Removed.
12725 (Symbol::tls_mod_got_offset_): Removed.
12726 (Symbol::tls_pair_got_offset_): Removed.
12727 (Symbol::got_offsets_): New field.
12728 (Symbol::has_got_offset): Removed.
12729 (Symbol::has_tls_mod_got_offset): Removed.
12730 (Symbol::has_tls_pair_got_offset): Removed.
12731 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12732 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12733 member functions.
12734 (Target_x86_64::Scan::global): Likewise.
12735 (Target_x86_64::Relocate::relocate): Likewise.
12736 (Target_x86_64::Relocate::relocate_tls): Likewise.
12737
bd52eafb
BE
127382008-03-25 Ben Elliston <bje@au.ibm.com>
12739
12740 * yyscript.y: Fix spelling error in comment.
12741
8b105e34
ILT
127422008-03-24 Ian Lance Taylor <iant@google.com>
12743
8ed814a9
ILT
12744 * options.h (class General_options): Define build_id option.
12745 * layout.h (class Layout): Declare write_build_id, create_note,
12746 create_build_id. Add build_id_note_ member.
12747 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12748 "libiberty.h", "md5.h", "sha1.h".
12749 (Layout::Layout): Initialize eh_frame_data_,
12750 eh_frame_hdr_section_, and build_id_note_.
12751 (Layout::finalize): Call create_build_id.
12752 (Layout::create_note): New function, broken out of
12753 Layout::create_gold_note.
12754 (Layout::create_gold_note): Call create_note.
12755 (Layout::create_build_id): New function.
12756 (Layout::write_build_id): New function.
12757 (Close_task_runner::run): Call write_build_id.
12758
8b105e34
ILT
12759 * x86_64.cc: Correct license to GPLv3.
12760
086a1841
ILT
127612008-03-23 Ian Lance Taylor <iant@google.com>
12762
12763 * options.cc: Include "demangle.h".
12764 (parse_optional_string): New function.
12765 (parse_long_option): Handle takes_optional_argument.
12766 (parse_short_option): Update dash_z initializer. Handle
12767 takes_optional_argument.
12768 (General_options::General_options): Initialize do_demangle_.
12769 (General_options::finalize): Set do_demangle_. Handle demangling
12770 style.
12771 * options.h (parse_optional_string): Declare.
12772 (struct One_option): Add optional_arg field. Update constructor.
12773 Update call constructor calls. Add takes_optional_argument
12774 function.
12775 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12776 (DEFINE_optional_string): Define.
12777 (General_options::demangle): Change from DEFINE_bool to
12778 DEFINE_optional_string.
12779 (General_options::no_demangle): New function.
12780 (General_options::do_demangle): New function.
12781 (General_options::set_do_demangle): New function.
12782 (General_options::execstack_status_): Move definition to end of
12783 class definition.
12784 (General_options::static_): Likewise.
12785 (General_options::do_demangle_): New field.
12786 * object.cc (big_endian>::get_symbol_location_info): Call
12787 Options::do_demangle, not Options::demangle.
12788 * symtab.cc (demangle): Likewise.
12789
cbb93e63
ILT
127902008-03-22 Ian Lance Taylor <iant@google.com>
12791
12792 * gold.h: Include <cstddef> and <sys/types.h>
12793 * options.h: Include <cstring>.
12794
ec531623
ILT
127952008-03-21 Ian Lance Taylor <iant@google.com>
12796
12797 * Added source code to GNU binutils.
This page took 0.768327 seconds and 4 git commands to generate.