daily update
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
a5a5f7a3
DM
12012-04-24 David S. Miller <davem@davemloft.net>
2
3 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5 and R_SPARC_WPLT30.
6
f038d496
CC
72012-04-24 Cary Coutant <ccoutant@google.com>
8
9 * incremental-dump.cc (find_input_containing_global): Replace
10 magic number with symbolic constant.
11 (dump_incremental_inputs): Update version number.
12 * incremental.cc (Output_section_incremental_inputs): Update version
13 number; import symbolic constants from Incremental_inputs_reader.
14 (Incremental_inputs::create_data_sections): Align relocations
15 section correctly for 64-bit targets.
16 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
17 constants; add padding.
18 (Output_section_incremental_inputs::write_header): Add assert for
19 header_size.
20 (Output_section_incremental_inputs::write_input_files): Add assert
21 for input_entry_size.
22 (Output_section_incremental_inputs::write_info_blocks): Add padding;
23 add assert for object_info_size, input_section_entry_size,
24 global_sym_entry_size.
25 * incremental.h (Incremental_inputs_reader): Add symbolic constants
26 for data structure sizes; use them.
27 (Incremental_input_entry_reader): Import symbolic constants from
28 Incremental_inputs_reader; use them.
29
a4d85145
DM
302012-04-23 David S. Miller <davem@davemloft.net>
31
32 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
33 and elf_flags_set_.
34 (Target_sparc::Target_sparc): Initialize new fields.
35 (Target_sparc::do_make_elf_object): New function.
36 (Target_sparc::do_adjust_elf_header): New function.
37
1d509098
CC
382012-04-23 Cary Coutant <ccoutant@google.com>
39
40 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
41 CU range table of gdb index.
42
7ebeff7f
DM
432012-04-20 David S. Miller <davem@davemloft.net>
44
45 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
46 instead of false.
47
13cf9988
DM
482012-04-16 David S. Miller <davem@davemloft.net>
49
2a1079e8
DM
50 * sparc.cc (Target_sparc::got_address): New function.
51 (Sparc_relocate_functions::gdop_hix22): New function.
52 (Sparc_relocate_functions::gdop_lox10): New function.
53 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
54 relocs.
55 (Target_sparc::Scan::local): Likewise if the global symbol is not
56 preemptible and is not IFUNC.
57 (Target_sparc::Relocate::relocate): Perform GOTDATA code
58 transformations for local and non-preemptible non-IFUNC global
59 symbols.
60
0bc964fc
DM
61 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
62 writing out 64-bit part of ranges.
63
661d7a80
DM
64 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
65 -fpic and -fpie respectively.
66 * Makefile.in: Regenerate.
67
8c2bf391
DM
68 * sparc.cc (class Target_sparc): Add rela_ifunc_.
69 (Target_sparc::Target_sparc): Initialize new field.
70 (Target_sparc::do_plt_section_for_global): New function.
71 (Target_sparc::do_plt_section_for_local): New function.
72 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
73 (Target_sparc::make_plt_section): New function, broken out of
74 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
75 (Target_sparc::make_plt_entry): Call make_plt_section.
76 (Target_sparc::make_local_ifunc_plt_entry): New function.
77 (Target_sparc::rela_ifunc_section): New function.
78 (Target_sparc::plt_section): Remove const.
79 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
80 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
81 and ifunc_count_ fields.
82 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
83 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
84 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
85 (Output_data_plt_sparc::rela_ifunc): New function.
86 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
87 (Output_data_plt_sparc::has_ifunc_section): New function.
88 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
89 (Output_data_plt_sparc::address_for_global): New function.
90 (Output_data_plt_sparc::address_for_local): New function.
91 (Output_data_plt_sparc::plt_index_to_offset): New function.
92 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
93 and entry_count.
94 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
95 entry_count.
96 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
97 R_SPARC_JMP_IREL to switch.
98 (Target_sparc::Scan::check_non_pic): Likewise.
99 (Target_sparc::Scan::local): Handle IFUNC symbols.
100 (Target_sparc::Scan::local): Likewise.
101 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
102 and plt_address_for_local.
103 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
104 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
105
13cf9988
DM
106 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
107 (class Output_data_reloc): Adjust calls to Output_reloc_type.
108 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
109 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
110 global relocs too.
111 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
112 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
113 calls.
114 * sparc.cc (Target_sparc::Scan::global): Likewise.
115 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
116
31821be0
CC
1172012-04-16 Cary Coutant <ccoutant@google.com>
118
119 * archive.cc (Library_base::should_include_member): Check for
120 --export-dynamic-symbol.
121 * options.h (class General_options): Add --export-dynamic-symbol.
122 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
123 --export-dynamic-symbol.
124 (Symbol_table::gc_mark_undef_symbols): Likewise.
125 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
126
2615994e
DM
1272012-04-12 David S. Miller <davem@davemloft.net>
128
129 * sparc.cc (Reloc::wdisp10): New relocation method.
130 (Reloc::h34): Likewise.
131 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
132 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
133 R_SPARC_WDISP10.
134 (Target_sparc::Scan::local): Likewise.
135 (Target_sparc::Scan::global): Likewise.
136 (Target_sparc::Relocate::relocate): Likewise.
137
6782735d
CC
1382012-04-09 Cary Coutant <ccoutant@google.com>
139
140 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
141 low_pc == 0.
142
8c7a0b00
ILT
1432012-04-06 Ian Lance Taylor <iant@google.com>
144
145 * timer.cc: #include <unistd.h>.
146
58797674
RM
1472012-04-06 Roland McGrath <mcgrathr@google.com>
148
149 * configure.in (AC_CHECK_HEADERS): Add locale.h.
150 * config.in: Regenerate.
151 * configure: Regenerate.
152
44350750
NC
1532012-04-05 Nick Clifton <nickc@redhat.com>
154
155 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
156 (AM_LC_MESSAGES): Add.
157 * aclocal.m4: Regenerate.
158 * config.in: Regenerate.
159 * configure: Regenerate.
160
c1027032
CC
1612012-03-21 Cary Coutant <ccoutant@google.com>
162
163 * Makefile.am: Add gdb-index.cc, gdb-index.h.
164 * Makefile.in: Regenerate.
165 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
166 (Sized_elf_reloc_mapper::symbol_section): New function.
167 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
168 (make_elf_reloc_mapper): New function.
169 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
170 (Dwarf_abbrev_table::do_read_abbrevs): New function.
171 (Dwarf_abbrev_table::do_get_abbrev): New function.
172 (Dwarf_ranges_table::read_ranges_table): New function.
173 (Dwarf_ranges_table::read_range_list): New function.
174 (Dwarf_pubnames_table::read_section): New function.
175 (Dwarf_pubnames_table::read_header): New function.
176 (Dwarf_pubnames_table::next_name): New function.
177 (Dwarf_die::Dwarf_die): New function.
178 (Dwarf_die::read_attributes): New function.
179 (Dwarf_die::skip_attributes): New function.
180 (Dwarf_die::set_name): New function.
181 (Dwarf_die::set_linkage_name): New function.
182 (Dwarf_die::attribute): New function.
183 (Dwarf_die::string_attribute): New function.
184 (Dwarf_die::int_attribute): New function.
185 (Dwarf_die::uint_attribute): New function.
186 (Dwarf_die::ref_attribute): New function.
187 (Dwarf_die::child_offset): New function.
188 (Dwarf_die::sibling_offset): New function.
189 (Dwarf_info_reader::check_buffer): New function.
190 (Dwarf_info_reader::parse): New function.
191 (Dwarf_info_reader::do_parse): New function.
192 (Dwarf_info_reader::do_read_string_table): New function.
193 (Dwarf_info_reader::lookup_reloc): New function.
194 (Dwarf_info_reader::get_string): New function.
195 (Dwarf_info_reader::visit_compilation_unit): New function.
196 (Dwarf_info_reader::visit_type_unit): New function.
197 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
198 Sized_elf_reloc_mapper.
199 (Sized_dwarf_line_info::symbol_section): Remove function.
200 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
201 (Sized_dwarf_line_info::read_line_mappings): Remove object
202 parameter, adjust callers.
203 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
204 * dwarf_reader.h: Include <sys/types.h>.
205 (class Track_relocs): Remove forward declaration.
206 (class Elf_reloc_mapper): New class.
207 (class Sized_elf_reloc_mapper): New class.
208 (class Dwarf_abbrev_table): New class.
209 (class Dwarf_range_list): New class.
210 (class Dwarf_ranges_table): New class.
211 (class Dwarf_pubnames_table): New class.
212 (class Dwarf_die): New class.
213 (class Dwarf_info_reader): New class.
214 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
215 (Sized_dwarf_line_info::symbol_section): Remove member function.
216 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
217 base class.
218 * gdb-index.cc: New source file.
219 * gdb-index.h: New source file.
220 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
221 and .debug_types sections, call Layout::add_to_gdb_index.
222 (Sized_relobj_incr::do_section_name): Implement.
223 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
224 return type; Implement.
225 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
226 return type.
227 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
228 parameter list and return type.
229 (Sized_incr_dynobj::do_section_contents): Likewise.
230 * layout.cc: Include gdb-index.h.
231 (Layout::Layout): Initialize gdb_index_data_.
232 (Layout::init_fixed_output_section): Check for .gdb_index section.
233 (Layout::add_to_gdb_index): New function. Instantiate.
234 * layout.h: Add forward declaration for class Gdb_index.
235 (Layout::add_to_gdb_index): New member function.
236 (Layout::gdb_index_data_): New data member.
237 * main.cc: Include gdb-index.h.
238 (main): Print statistics for gdb index.
239 * object.cc (Object::section_contents): Move code into
240 do_section_contents.
241 (need_decompressed_section): Check for sections needed when building
242 gdb index.
243 (build_compressed_section_map): Likewise.
244 (Sized_relobj_file::do_read_symbols): Need local symbols when building
245 gdb index.
246 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
247 sections; call Layout::add_to_gdb_index.
248 (Sized_relobj_file::do_decompressed_section_contents): Call
249 do_section_contents directly.
250 * object.h (Object::do_section_contents): Adjust parameter list and
251 return type.
252 (Object::do_decompressed_section_contents): Call do_section_contents
253 directly.
254 (Sized_relobj_file::do_section_contents): Adjust parameter list and
255 return type.
256 * options.h (class General_options): Add --gdb-index option.
257 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
258 list and return type.
259 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
260 * reloc.h (Track_relocs::checkpoint): New function.
261 (Track_relocs::reset): New function.
262
263 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
264 New test cases.
265 * testsuite/Makefile.in: Regenerate.
266 * testsuite/gdb_index_test.cc: New test source file.
267 * testsuite/gdb_index_test_1.sh: New test source file.
268 * testsuite/gdb_index_test_2.sh: New test source file.
269
647f1574
DK
2702012-03-19 Doug Kwan <dougkwan@google.com>
271
272 * arm.cc (Target_arm::do_define_standard_symbols): New method.
273 (Target_arm::do_finalize_sections): Remove code which defines
274 __exidx_start and __exidx_end. Make symbol table parameter
275 anonymous as it is not used.
276 * gold.cc (queue_middle_tasks): Call target hook to define any
277 target-specific symbols.
278 * target.h (Target::define_standard_symbols): New method.
279 (Target::do_define_standard_symbols): Same.
280 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
281 * testsuite/Makefile.in: Regenerate.
282 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
283 and __exidx_end.
284 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
285 relocations are generated for __exidx_start and __exidx_end.
286
7c6109da
DK
2872012-03-16 Doug Kwan <dougkwan@google.com>
288
289 * testsuite/Makefile.am: Disable test initpri3b.
290 * testsuite/Makefile.in: Regenerate.
291
7b8957f8
DK
2922012-03-15 Doug Kwan <dougkwan@google.com>
293
294 * arm.cc (Target_arm::got_section): Make .got section read-only
295 if -z now is given.
296
14dc9ef7
ILT
2972012-03-15 Ian Lance Taylor <iant@google.com>
298
299 PR gold/13850
300 * layout.cc (Layout::make_output_section): Correctly mark
301 SHT_INIT_ARRAY, et. al., as relro.
302
fa40b62a
DK
3032012-03-14 Doug Kwan <dougkwan@google.com>
304
305 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
306 dynamic relocations for protected symbols in shared objects.
307
fd325007
ILT
3082012-03-13 Ian Lance Taylor <iant@google.com>
309
310 * resolve.cc (Symbol_table::resolve): When merging common symbols,
311 keep the larger alignment.
312
e8dd54e1
CC
3132012-03-12 Cary Coutant <ccoutant@google.com>
314
315 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
316 handling of DW_LNE_define_file.
317
feb5f3b0
CC
3182012-03-12 Cary Coutant <ccoutant@google.com>
319
320 * reduced_debug_output.cc
321 (Output_reduced_debug_info_section::get_die_end): Add new FORM
322 codes to switch.
323
a1fb4256
CC
3242012-02-29 Cary Coutant <ccoutant@google.com>
325
326 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
327
5dd8762a
CC
3282012-02-29 Cary Coutant <ccoutant@google.com>
329
330 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
331 Call Object::decompressed_section_contents.
332 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
333 New dtor.
334 (Sized_dwarf_line_info::buffer_start_): New data member.
335 * merge.cc (Output_merge_data::do_add_input_section): Call
336 Object::decompressed_section_contents.
337 (Output_merge_string::do_add_input_section): Likewise.
338 * object.cc (need_decompressed_section): New function.
339 (build_compressed_section_map): Decompress sections needed later.
340 (Sized_relobj_file::do_decompressed_section_contents): New function.
341 (Sized_relobj_file::do_discard_decompressed_sections): New function.
342 * object.h (Object::decompressed_section_contents): New function.
343 (Object::discard_decompressed_sections): New function.
344 (Object::do_decompressed_section_contents): New function.
345 (Object::do_discard_decompressed_sections): New function.
346 (Compressed_section_info): New type.
347 (Compressed_section_map): Include decompressed section contents.
348 (Sized_relobj_file::do_decompressed_section_contents): New function.
349 (Sized_relobj_file::do_discard_decompressed_sections): New function.
350
7b5de7ee
CC
3512012-02-16 Cary Coutant <ccoutant@google.com>
352
353 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
354 * testsuite/Makefile.in: Regenerate.
355
f9fa4a63
CC
3562012-02-14 Cary Coutant <ccoutant@google.com>
357
358 * options.cc (General_options::finalize): Disallow -pie and -static.
359
2c175ebc
DK
3602012-02-03 Doug Kwan <dougkwan@google.com>
361
362 * arm.cc (Arm_relocate_functions::abs8,
363 Arm_relocate_functions::abs16): Use
364 Bits::has_signed_unsigned_overflow32.
365 (Arm_relocate_functions::thm_abs8): Correct range of
366 overflow check.
367 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
368 in assertions.
369
90cff06f
DK
3702012-02-02 Doug Kwan <dougkwan@google.com>
371
372 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
373 position independent outputs, not just shared objects.
374
63887f3d
L
3752012-01-30 H.J. Lu <hongjiu.lu@intel.com>
376
377 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
378 * configure: Regenerated.
379
bef2b434
ILT
3802012-01-27 Ian Lance Taylor <iant@google.com>
381
382 * reloc.h (Bits): New class with static functions, copied from
383 namespace utils in arm.cc.
384 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
385 instead.
386
c335b55d
L
3872012-01-27 H.J. Lu <hongjiu.lu@intel.com>
388
389 * incremental.cc (write_info_blocks): Correct relocation offset.
390
41194d9f
L
3912012-01-27 H.J. Lu <hongjiu.lu@intel.com>
392
393 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
394 (Relocate::tls_gd_to_le): Likewise.
395
1bae613c
L
3962012-01-27 H.J. Lu <hongjiu.lu@intel.com>
397
398 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
399
24482ca0
L
4002012-01-27 H.J. Lu <hongjiu.lu@intel.com>
401
402 * configure.ac: Check if -mcmodel=medium works.
403 * configure: Regenerated.
404
c2c7840a
CC
4052012-01-24 Cary Coutant <ccoutant@google.com>
406
407 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
408 definition and ...
409 (read_unsigned_LEB_128_x): ... this new function.
410 (read_signed_LEB_128): Replaced with inline definition and ...
411 (read_signed_LEB_128_x): ... this new function.
412 * int_encoding.h (read_unsigned_LEB_128_x): New function.
413 (read_unsigned_LEB_128): Add inline definition.
414 (read_signed_LEB_128_x): New function.
415 (read_signed_LEB_128): Add inline definition.
416 * testsuite/Makefile.am (leb128_unittest): New unit test.
417 * testsuite/Makefile.in: Regenerate.
418 * testsuite/leb128_unittest.cc: New unit test.
419
833de760 4202012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
421
422 PR gold/13617
423 * i386.cc (Target_i386::do_code_fill): When using a jmp
424 instruction, pad with nop instructions.
425 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
426
618d6666
L
4272012-01-22 H.J. Lu <hongjiu.lu@intel.com>
428
429 * x86_64.cc (gc_process_relocs): Add typename on types used in
430 template.
431 (scan_relocs): Likewise.
432 (relocate_section): Likewise.
433 (apply_relocation): Likewise.
434
3660ff06
L
4352012-01-10 H.J. Lu <hongjiu.lu@intel.com>
436
437 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
438 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
439 under x32.
440
fc51264f
L
4412012-01-09 H.J. Lu <hongjiu.lu@intel.com>
442
443 * x86_64.cc: Initial support for x32.
444
dd74ae06
CC
4452012-01-03 Cary Coutant <ccoutant@google.com>
446
447 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
448 Use abstract base class for GOT.
449 * gold/output.h (class Output_data_got_base): New abstract base class.
450 (class Output_data_got): Derive from new base class, adjust ctors.
451 (Output_data_got::reserve_slot): Make virtual; rename to
452 do_reserve_slot; Adjust callers.
453 * gold/target.h (Sized_target::init_got_plt_for_update): Return
454 pointer to abstract base class.
455 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
456
83896202
ILT
4572011-12-18 Ian Lance Taylor <iant@google.com>
458
459 * object.h (Relobj::local_symbol_value): New function.
460 (Relobj::local_plt_offset): New function.
461 (Relobj::local_has_got_offset): New function.
462 (Relobj::local_got_offset): New function.
463 (Relobj::set_local_got_offset): New function.
464 (Relobj::do_local_symbol_value): New pure virtual function.
465 (Relobj::do_local_plt_offset): Likewise.
466 (Relobj::do_local_has_got_offset): Likewise.
467 (Relobj::do_local_got_offset): Likewise.
468 (Relobj::do_set_local_got_offset): Likewise.
469 (Sized_relobj::do_local_has_got_offset): Rename from
470 local_has_got_offset.
471 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
472 (Sized_relobj::do_set_local_got_offset): Rename from
473 set_local_got_offset.
474 (Sized_relobj_file::do_local_plt_offset): Rename from
475 local_plt_offset.
476 (Sized_relobj_file::do_local_symbol_value): New function.
477 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
478 local_plt_offset.
479 * output.cc (Output_data_got::Got_entry::write): Change object to
480 Relobj. Use local_symbol_value.
481 (Output_data_got::add_global_with_rel): Change rel_dyn to
482 Output_data_reloc_generic*. Use add_global_generic.
483 (Output_data_got::add_global_with_rela): Remove. Change all
484 callers to use add_global_with_rel.
485 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
486 Output_data_reloc_generic*. Use add_global_generic.
487 (Output_data_got::add_global_pair_with_rela): Remove. Change all
488 callers to use add_global_pair_with_rel.
489 (Output_data_got::add_local): Change object to Relobj*.
490 (Output_data_got::add_local_plt): Likewise.
491 (Output_data_got::add_local_with_rel): Change object to Relobj*,
492 change rel_dyn to Output_data_reloc_generic*. Use
493 add_local_generic.
494 (Output_data_got::add_local_with_rela): Remove. Change all
495 callers to use all_local_with_rel.
496 (Output_data_got::add_local_pair_with_rel): Change object to
497 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
498 add_output_section_generic.
499 (Output_data_got::add_local_pair_with_rela): Remove. Change all
500 callers to use add_local_pair_with_rel.
501 (Output_data_got::reserve_local): Change object to Relobj*.
502 * output.h: (class Output_data_reloc_generic): Add pure virtual
503 declarations for add_global_generic, add_local_generic,
504 add_output_section_generic.
505 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
506 functions for Output_data_reloc_generic. Update declarations for
507 changes listed in output.cc.
508 (class Output_data_got): Change template parameter to got_size.
509 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
510 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
511 function.
512 (Sized_relobj_incr::do_local_plt_offset): New function.
513 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
514 add_global_generic.
515
76677ad0
CC
5162011-12-17 Cary Coutant <ccoutant@google.com>
517
518 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
519 * resolve.cc (Symbol_table::resolve): Likewise.
520 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
521 arrays.
522 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
523
8b8dd8d5
ILT
5242011-12-16 Ian Lance Taylor <iant@google.com>
525
526 * output.h (Output_data_reloc_generic::add): Only call
527 add_dynamic_reloc if this is a dynamic reloc section.
528
d55525b9
L
5292011-12-15 H.J. Lu <hongjiu.lu@intel.com>
530
531 PR gold/13505
532 * target-reloc.h (apply_relocation): Replace <64, false> with
533 <size, big_endian>.
534
ff81c7c1
NC
5352011-11-25 Nick Clifton <nickc@redhat.com>
536
537 * po/it.po: New Italian translation.
538
628f39be
SA
5392011-11-17 Sterling Augustine <saugustine@google.com>
540
541 * script.cc (script_include_directive): Implement.
542 (read_script_file): New local variables name and search_path. Update
543 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
544 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
545 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
546
98ef3ea4
SA
5472011-11-11 Sterling Augustine <saugustine@google.com>
548
549 * yyscript.y (section_cmd): Add support for INCLUDE directive.
550 (file_or_sections_cmd): Likewise.
551
f4a8b6d7
DK
5522011-11-11 Doug Kwan <dougkwan@google.com>
553
554 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
555 if --just-symbols is given.
556
29ab395d
DK
5572011-11-10 Doug Kwan <dougkwan@google.com>
558
559 PR gold/13362
560 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
561 when processing data relocs.
562 * reloc.h (Relocate_functions::rel_unaligned): New method.
563 (Relocate_functions::pcrel_unaligned): Ditto.
564 (Relocate_functions::rel32_unaligned): Ditto.
565 (Relocate_functions::pcrel32_unaligned): Ditto.
566
2c339f71
DK
5672011-11-09 Doug Kwan <dougkwan@google.com>
568
569 PR gold/13362
570 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
571 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
572 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
573 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
574 (Relocate_functions::rel_unaligned): New.
575 (Relocate_functions::rel32_unaligned): New.
576 * target-reloc.h (relocate_for_relocatable): Add code to handle
577 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
578 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
579 arm_unaligned_reloc_r): New targets.
580 * testsuite/Makefile.in: Regenerate.
581 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
582 linking.
583
3f3cddf1
ILT
5842011-11-02 Ian Lance Taylor <iant@google.com>
585
586 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
587 NATIVE_LINKER.
588 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
589 * options.cc (General_options::finalize): Use library search path
590 from configure script if specified. If not native and no sysroot,
591 only search TOOLLIBDIR.
592 * options.h (Search_directory::Search_directory): Change name to
593 const std::string&.
594 (General_options::add_to_library_path_with_sysroot): Change arg to
595 const std::string&.
596 * configure, Makefile.in, config.in: Rebuild.
597
a8e2273b
ILT
5982011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
599
600 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
601 we are working around the ARM1176 Erratum.
602 * options.h (General_options::fix_arm1176): Add option.
603 * testsuite/Makefile.am: Add testcases, and keep current ones
604 working.
605 * testsuite/Makefile.in: Regenerate.
606 * testsuite/arm_fix_1176.s: New file.
607 * testsuite/arm_fix_1176.sh: Likewise.
608
cd6eab1c
ILT
6092011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
610
611 * arm.cc (Target_arm::Target_arm): Remove initialisation of
612 may_use_blx_.
613 (Target_arm::may_use_blx): Remove method.
614 (Target_arm::set_may_use_blx): Likewise.
615 (Target_arm::may_use_v4t_interworking): New method.
616 (Target_arm::may_use_v5t_interworking): Likewise.
617 (Target_arm::may_use_blx_): Remove member variable.
618 (Arm_relocate_functions::arm_branch_common): Check for v5T
619 interworking.
620 (Arm_relocate_functions::thumb_branch_common): Likewise.
621 (Reloc_stub::stub_type_for_reloc): Likewise.
622 (Target_arm::do_finalize_sections): Correct interworking checks.
623 * testsuite/Makefile.am: Add new tests.
624 * testsuite/Makefile.in: Regenerate.
625 * testsuite/arm_farcall_arm_arm.s: New test.
626 * testsuite/arm_farcall_arm_arm.sh: Likewise.
627 * testsuite/arm_farcall_arm_thumb.s: Likewise.
628 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
629 * testsuite/arm_farcall_thumb_arm.s: Likewise.
630 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
631 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
632 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
633
286adcf4
CC
6342011-10-31 Cary Coutant <ccoutant@google.com>
635
636 PR gold/13023
637 * expression.cc (Expression::eval_with_dot): Add
638 is_section_dot_assignment parameter.
639 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
640 absolute and assigning to dot within a section.
641 * script-sections.cc
642 (Output_section_element_assignment::set_section_addresses): Pass
643 dot_section to set_if_absolute.
644 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
645 as is_section_dot_assignment flag to eval_with_dot.
646 (Output_section_element_dot_assignment::set_section_addresses):
647 Likewise.
648 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
649 parameter. Also set value if relative to dot_section; set the
650 symbol's output_section.
651 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
652 parameter. Adjust all callers.
653 (Expression::eval_maybe_dot): Likewise.
654 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
655 Adjust all callers.
656 * testsuite/script_test_2.t: Test assignment of an absolute value
657 to dot within an output section element.
658
9634ed06
CC
6592011-10-31 Cary Coutant <ccoutant@google.com>
660
661 * options.h (class General_options): Add --[no-]gnu-unique options.
662 * symtab.cc (Symbol_table::sized_write_globals): Convert
663 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
664
de4101c7
CC
6652011-10-31 Cary Coutant <ccoutant@google.com>
666
667 PR gold/13359
668 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
669 unnecessary assertion.
670 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
671
7257cc92
ST
6722011-10-31 Sriraman Tallam <tmsriram@google.com>
673
674 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
675 gc_mark_symbol.
676 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
677 gc_mark_symbol.
678 Change to just keep the section associated with symbol.
679 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
680 they are externally visible and --export-dynamic is turned on.
681 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
682
bfc34b3f
ILT
6832011-10-19 Ian Lance Taylor <iant@google.com>
684
685 PR gold/13163
686 * script-sections.cc
687 (Output_section_element_dot_assignment::needs_output_section): New
688 function.
689
ea0d8c47
ILT
6902011-10-19 Ian Lance Taylor <iant@google.com>
691
692 PR gold/13204
693 * layout.cc (Layout::segment_precedes): Don't assert failure if a
694 --section-start option was seen.
695 * options.h (General_options::any_section_start): New function.
696
abd242a9
DM
6972011-10-18 David S. Miller <davem@davemloft.net>
698
699 PR binutils/13301
700 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
701 member to track relocation locations that have moved during TLS
702 reloc optimizations.
703 (Target_sparc::Relocate::Relocate): Initialize to NULL.
704 (Target_sparc::Relocate::relocate): Adjust view down by 4
705 bytes if it matches reloc_adjust_addr_.
706 (Target_sparc::Relocate::relocate_tls): Always move the
707 __tls_get_addr call delay slot instruction forward 4 bytes when
708 performing relaxation.
709
bab9090f
CC
7102011-10-18 Cary Coutant <ccoutant@google.com>
711
712 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
713 (Output_file::map_no_anonymous): Check for non-zero
714 return code from posix_fallocate.
715
f7c5b166
CC
7162011-10-17 Cary Coutant <ccoutant@google.com>
717
718 PR gold/13245
719 * plugin.cc (is_visible_from_outside): Check for symbols
720 referenced from dynamic objects.
721 * resolve.cc (Symbol_table::resolve): Don't count references
722 from dynamic objects as references from real ELF files.
723 * testsuite/plugin_test_2.sh: Adjust expected result.
724
b490c0bb
CC
7252011-10-17 Cary Coutant <ccoutant@google.com>
726
727 * gold.cc: Include timer.h.
728 (queue_middle_tasks): Stamp time.
729 (queue_final_tasks): Likewise.
730 * main.cc (main): Store timer in parameters. Print timers
731 for each pass.
732 * parameters.cc (Parameters::Parameters): Initialize timer_.
733 (Parameters::set_timer): New function.
734 (set_parameters_timer): New function.
735 * parameters.h (Parameters::set_timer): New function.
736 (Parameters::timer): New function.
737 (Parameters::timer_): New data member.
738 (set_parameters_timer): New function.
739 * timer.cc (Timer::stamp): New function.
740 (Timer::get_pass_time): New function.
741 * timer.h (Timer::stamp): New function.
742 (Timer::get_pass_time): New function.
743 (Timer::pass_times_): New data member.
744
f475cf7b
CC
7452011-10-17 Cary Coutant <ccoutant@google.com>
746
747 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
748 task for members of lib groups.
749
cdd7e244
CC
7502011-10-17 Cary Coutant <ccoutant@google.com>
751
752 PR gold/13288
4f95c8b4 753 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
754 (File_read::make_view): Move bounds check (replace with assert)...
755 (File_read::find_or_make_view): ... to here.
756
dfb45471
CC
7572011-10-12 Cary Coutant <ccoutant@google.com>
758
4f95c8b4 759 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
760 ::read returns less than requested size.
761
53bbcc1b
CC
7622011-10-10 Cary Coutant <ccoutant@google.com>
763
4f95c8b4 764 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
765 Initialize defined_count_.
766 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
767 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
768 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
769 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
770 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 771 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
772 member.
773 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 774 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
775 Return zeroes instead of internal error.
776
397b129b
CC
7772011-10-10 Cary Coutant <ccoutant@google.com>
778
779 PR gold/13249
4f95c8b4 780 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 781 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 782 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
783 (Output_reloc::type_): Adjust size of bit field.
784 (Output_reloc::use_plt_offset_): New bit field.
785 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
786 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
787 flag. Adjust all callers.
4f95c8b4 788 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
789 creating RELATIVE relocations.
790
d5698657
NC
7912011-10-10 Nick Clifton <nickc@redhat.com>
792
793 * po/es.po: Updated Spanish translation.
794 * po/fi.po: Updated Finnish translation.
795
6a59a5c2
DN
7962011-10-03 Diego Novillo <dnovillo@google.com>
797
798 * options.cc (parse_uint): Fix dereference of RETVAL.
799
f0558624
ST
8002011-09-29 Sriraman Tallam <tmsriram@google.com>
801
802 * layout.h (section_order_map_): New member.
803 (get_section_order_map): New member function.
804 * output.cc (Output_section::add_input_section): Check for patterns
805 only when --section-ordering-file is specified.
806 * gold.cc (queue_middle_tasks): Delay updating order of sections till
807 output_sections have been formed.
808 * layout.cc (Layout_Layout): Initialize section_order_map_.
809 * plugin.cc (update_section_order): Store order in order_map. Do not
810 update the order.
811 * testsuite/Makefile.am: Add test case for plugin_final_layout.
812 * testsuite/Makefile.in: Regenerate.
813 * testsuite/plugin_section_order.c: New file.
814 * testsuite/plugin_final_layout.cc: New file.
815 * testsuite/plugin_final_layout.sh: New file.
816
a7dac153
CC
8172011-09-29 Cary Coutant <ccoutant@google.com>
818
4f95c8b4 819 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 820 Check for NULL.
4f95c8b4 821 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
822 symbols during incremental update.
823 (Symbol_table::add_from_dynobj): Likewise.
824
eebd87a5
ILT
8252011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
826 Ian Lance Taylor <iant@google.com>
827
828 * symtab.cc (Symbol_table::define_special_symbol): Always
829 canonicalize version string.
830
403a3331
CC
8312011-09-26 Cary Coutant <ccoutant@google.com>
832
4f95c8b4
CC
833 * gold.cc (queue_initial_tasks): Move option checks ...
834 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
835 some options; make others fatal.
836
235061c2
CC
8372011-09-26 Cary Coutant <ccoutant@google.com>
838
839 gcc PR lto/47247
840 * plugin.cc (get_symbols_v2): New function.
841 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
842 (is_referenced_from_outside): New function.
843 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
844 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
845 (get_symbols): Pass version parameter.
846 (get_symbols_v2): New function.
847 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
848 parameter.
849 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
850 (onload): Add LDPT_GET_SYMBOLS_V2.
851 (all_symbols_read_hook): Use get_symbols_v2; check for
852 LDPR_PREVAILING_DEF_IRONLY_EXP.
853 * testsuite/plugin_test_3.sh: Update expected results.
854
dc87f620
ILT
8552011-09-23 Simon Baldwin <simonb@google.com>
856
857 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
858 configuration options.
859 * configure: Regenerate.
860 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
861 * Makefile.in: Regenerate.
862 * testsuite/Makefile.in: Regenerate.
863
a8279f82
ST
8642011-09-19 Sriraman Tallam <tmsriram@google.com>
865
866 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
867
0c9350c8
CC
8682011-09-19 Cary Coutant <ccoutant@google.com>
869
870 * incremental.cc (can_incremental_update): Fix typo in comment.
871 * incremental.h (can_incremental_update): Likewise.
872
aa06ae28
CC
8732011-09-18 Cary Coutant <ccoutant@google.com>
874
875 * incremental.cc (can_incremental_update): New function.
876 * incremental.h (can_incremental_update): New function.
877 * layout.cc (Layout::init_fixed_output_section): Call it.
878 (Layout::make_output_section): Don't allow patch space in .eh_frame.
879 * object.cc (Sized_relobj_file::do_layout): Call
880 can_incremental_update.
881
ebb300b2
CC
8822011-09-13 Cary Coutant <ccoutant@google.com>
883
884 * configure.ac: Check for glibc support for gnu_indirect_function
885 support with static linking, setting automake conditional
886 IFUNC_STATIC.
887 * Makefile.in: Regenerate.
888 * configure: Regenerate.
889
890 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
891 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
892 for IFUNC_STATIC.
893 * testsuite/Makefile.in: Regenerate.
894
1206d0d5
CC
8952011-09-13 Cary Coutant <ccoutant@google.com>
896
897 * incremental.cc (Sized_relobj_incr::do_layout): Call
898 report_comdat_group for kept comdat sections.
899 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
900 * testsuite/Makefile.in: Regenerate.
901 * testsuite/incr_comdat_test_1.cc: New source file.
902 * testsuite/incr_comdat_test_2_v1.cc: New source file.
903 * testsuite/incr_comdat_test_2_v2.cc: New source file.
904 * testsuite/incr_comdat_test_2_v3.cc: New source file.
905
40b29874
ILT
9062011-09-13 Ian Lance Taylor <iant@google.com>
907
908 * object.cc (Sized_relobj_file::do_layout): Remove unused local
909 variable external_symbols_offset.
910
1b045aac
ILT
9112011-09-12 Ian Lance Taylor <iant@google.com>
912
913 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
914 triggered if object has no symbols.
915
24c6c55a
DM
9162011-09-09 David S. Miller <davem@davemloft.net>
917
918 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
919 (Output_fill_debug_line::do_write): Likewise.
920
66570254
CC
9212011-08-29 Cary Coutant <ccoutant@google.com>
922
923 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
924 casts to match formatting specs.
925 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
926
8ea8cd50
CC
9272011-08-26 Cary Coutant <ccoutant@google.com>
928
929 * layout.cc (Free_list::allocate): Provide guarantee of minimum
930 remaining hole size when allocating.
931 (Layout::make_output_section): Set fill methods for debug sections.
932 * layout.h (Free_list::Free_list_node): Move from private to
933 public.
934 (Free_list::set_min_hole_size): New function.
935 (Free_list::begin, Free_list::end): New functions.
936 (Free_list::min_hole_): New data member.
937 * output.cc: Include dwarf.h.
938 (Output_fill_debug_info::do_minimum_hole_size): New function.
939 (Output_fill_debug_info::do_write): New function.
940 (Output_fill_debug_line::do_minimum_hole_size): New function.
941 (Output_fill_debug_line::do_write): New function.
942 (Output_section::Output_section): Initialize new data member.
943 (Output_section::set_final_data_size): Ensure patch space is larger
944 than minimum hole size.
945 (Output_section::do_write): Fill holes in debug sections.
946 * output.h (Output_fill): New class.
947 (Output_fill_debug_info): New class.
948 (Output_fill_debug_line): New class.
949 (Output_section::set_free_space_fill): New function.
950 (Output_section::free_space_fill_): New data member.
951 * testsuite/Makefile.am (incremental_test_3): Add
952 --incremental-patch option.
953 (incremental_test_4): Likewise.
954 (incremental_test_5): Likewise.
955 (incremental_test_6): Likewise.
956 (incremental_copy_test): Likewise.
957 (incremental_common_test_1): Likewise.
958 * testsuite/Makefile.in: Regenerate.
959
7cf80422
NC
9602011-08-26 Nick Clifton <nickc@redhat.com>
961
962 * po/es.po: Updated Spanish translation.
963
c3f7b0e5
CC
9642011-08-01 Cary Coutant <ccoutant@google.com>
965
966 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
967 * gold/testsuite/Makefile.in: Regenerate.
968 * gold/testsuite/justsyms_exec.c: New source file.
969 * gold/testsuite/justsyms_lib.c: New source file.
970
9590bf25
CC
9712011-08-01 Cary Coutant <ccoutant@google.com>
972
973 * layout.cc (Layout::set_segment_offsets): Don't realign text
974 segment if -Ttext was specified.
975 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
976 file type.
977 * object.h (Sized_relobj_file::e_type): New function.
978 (Sized_relobj_file::e_type_): New data member.
979 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
980 base address for ET_EXEC files.
981 * target.cc (Target::do_make_elf_object_implementation): Allow
982 ET_EXEC files with --just-symbols option.
983
dcd8d12e
CC
9842011-07-28 Cary Coutant <ccoutant@google.com>
985
986 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
987 Add thread_number parameter.
988 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
989 * workqueue-threads.cc
990 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
991 current thread if its thread number is greater than desired thread
992 count.
993 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
994 Add thread_number parameter.
995 (Workqueue::should_cancel_thread): Likewise.
996 (Workqueue::find_runnable_or_wait): Pass thread_number to
997 should_cancel_thread.
998 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
999 parameter.
1000
804eb480
ST
10012011-07-22 Sriraman Tallam <tmsriram@google.com>
1002
1003 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1004 only after checking if it cannot be forced local.
1005 * symtab.h (is_externally_visible): Check if the symbol is not forced
1006 local.
1007
f1ddb600
ILT
10082011-07-15 Ian Lance Taylor <iant@google.com>
1009
1010 * options.h (class General_options): Add --print-output-format.
1011 Move -EL next to -EB, for better --help output.
1012 * target-select.cc: Include <cstdio>, "options.h", and
1013 "parameters.h".
1014 (Target_selector::do_target_bfd_name): New function.
1015 (print_output_format): New function.
1016 * target-select.h (class Target_selector): Update declarations.
1017 (Target_selector::target_bfd_name): New function.
1018 (print_output_format): Declare.
1019 * main.cc: Include "target-select.h".
1020 (main): Handle --print-output-format.
1021 * gold.cc: Include "target-select.h".
1022 (queue_initial_tasks): Handle --print-output-format when there are
1023 no input files.
1024 * parameters.cc (parameters_force_valid_target): Give a better
1025 error message if -EB/-EL does not match target.
1026 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1027 function.
1028
7d172687
ILT
10292011-07-15 Ian Lance Taylor <iant@google.com>
1030
1031 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1032 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1033 (Output_data_plt_i386::do_write): Write address of .dynamic
1034 section to first entry in .got.plt section.
1035 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1036 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1037 Initialize layout_.
1038 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1039 section to first entry in .got.plt section.
1040 * layout.h (Layout::dynamic_section): New function.
1041
e9552f7e
ST
10422011-07-13 Sriraman Tallam <tmsriram@google.com>
1043
1044 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1045 to claim_file call.
1046 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1047 input_section_position_, and input_section_glob_.
1048 (read_layout_from_file): Call function section_ordering_specified.
1049 * layout.h (is_section_ordering_specified): New function.
1050 (section_ordering_specified): New function.
1051 (section_ordering_specified_): New boolean member.
1052 * main.cc(main): Call load_plugins after layout object is defined.
1053 * output.cc (Output_section::add_input_section): Use
1054 function section_ordering_specified to check if section ordering is
1055 needed.
1056 * output.cc (Output_section::add_relaxed_input_section): Use
1057 function section_ordering_specified to check if section ordering is
1058 needed.
1059 (Output_section::update_section_layout): New function.
1060 (Output_section::sort_attached_input_sections): Check if input section
1061 must be reordered.
1062 * output.h (Output_section::update_section_layout): New function.
1063 * plugin.cc (get_section_count): New function.
1064 (get_section_type): New function.
1065 (get_section_name): New function.
1066 (get_section_contents): New function.
1067 (update_section_order): New function.
58797674 1068 (allow_section_ordering): New function.
e9552f7e
ST
1069 (Plugin::load): Add the new interfaces to the transfer vector.
1070 (Plugin_manager::load_plugins): New parameter.
1071 (Plugin_manager::all_symbols_read): New parameter.
1072 (Plugin_manager::claim_file): New parameter. Save the elf object for
1073 unclaimed objects.
1074 (Plugin_manager::get_elf_object): New function.
1075 (Plugin_manager::get_view): Change to directly use the bool to check
1076 if get_view is called from claim_file_hook.
1077 * plugin.h (input_objects): New function
1078 (Plugin__manager::load_plugins): New parameter.
1079 (Plugin_manager::claim_file): New parameter.
1080 (Plugin_manager::get_elf_object): New function.
1081 (Plugin_manager::in_claim_file_handler): New function.
1082 (Plugin_manager::in_claim_file_handler_): New member.
1083 (layout): New function.
1084 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1085 handler with an extra parameter. Make the elf object before calling
1086 claim_file handler.
1087 * testsuite/plugin_test.c (get_section_count): New function pointer.
1088 (get_section_type): New function pointer.
1089 (get_section_name): New function pointer.
1090 (get_section_contents): New function pointer.
1091 (update_section_order): New function pointer.
1092 (allow_section_ordering): New function pointer.
1093 (onload): Check if the new interfaces exist.
1094
9446efde
ILT
10952011-07-13 Ian Lance Taylor <iant@google.com>
1096
1097 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1098 relro section.
1099 * x86_64.cc (Target_x86_64::got_section): Likewise.
1100 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1101 (relro_now_test_SOURCES): New variable.
1102 (relro_now_test_DEPENDENCIES): New variable.
1103 (relro_now_test_LDFLAGS): New variable.
1104 (relro_now_test_LDADD): New variable.
1105 (relro_now_test.so): New target.
1106 * testsuite/Makefile.in: Rebuild.
1107
07aa62f2
ILT
11082011-07-12 Ian Lance Taylor <iant@google.com>
1109
1110 PR gold/12980
1111 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1112 GLOB_DAT relocation rather than a RELATIVE relocation for a
1113 protected symbol when creating a shared library.
1114 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1115 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1116 * testsuite/protected_main_1.cc (main): Test that protected
1117 function has same address.
1118
e2153196
ILT
11192011-07-11 Ian Lance Taylor <iant@google.com>
1120
1121 PR gold/12979
1122 * options.h (class General_options): Add -Bgroup.
1123 * options.cc (General_options::finalize): If -Bgroup is set,
1124 default to --unresolved-symbols=report-all.
1125 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1126 * target-reloc.h (issue_undefined_symbol_error): Handle
1127 --unresolved-symbols=report-all.
1128
6daf5215
ILT
11292011-07-08 Ian Lance Taylor <iant@google.com>
1130
1131 PR gold/11985
1132 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1133 if linker script discards key sections.
1134 (Layout::create_dynamic_symtab): Likewise.
1135 (Layout::assign_local_dynsym_offsets): Likewise.
1136 (Layout::sized_create_version_sections): Likewise.
1137 (Layout::create_interp): Likewise.
1138 (Layout::finish_dynamic_section): Likewise.
1139 (Layout::set_dynamic_symbol_size): Likewise.
1140
beabb2c6
ILT
11412011-07-08 Ian Lance Taylor <iant@google.com>
1142
1143 PR gold/12386
1144 * options.h (class General_options): Add --unresolved-symbols.
1145 * target-reloc.h (issue_undefined_symbol_error): Check
1146 --unresolved-symbols. Add comments.
1147
9c16daf1
ILT
11482011-07-08 Ian Lance Taylor <iant@google.com>
1149
1150 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1151 expression more complex.
1152
191f1a2d
ILT
11532011-07-08 Ian Lance Taylor <iant@google.com>
1154
1155 PR gold/11317
1156 * target-reloc.h (issue_undefined_symbol_error): New inline
1157 function, broken out of relocate_section.
1158 (relocate_section): Call issue_undefined_symbol_error.
1159 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1160 there is no TLS segment if we are about to issue an undefined
1161 symbol error.
1162 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1163
62855347
ILT
11642011-07-08 Ian Lance Taylor <iant@google.com>
1165
1166 PR gold/12279
1167 * resolve.cc (Symbol_table::should_override): Add fromtype
1168 parameter. Change all callers. Give error when linking together
1169 TLS and non-TLS symbol.
1170 (Symbol_table::should_override_with_special): Add fromtype
1171 parameter. Change all callers.
1172 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1173 there is no TLS segment if we have reported some errors.
1174 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1175
67181c72
ILT
11762011-07-08 Ian Lance Taylor <iant@google.com>
1177
1178 PR gold/12372
1179 * target.h (Target::plt_address_for_global): New function.
1180 (Target::plt_address_for_local): New function.
1181 (Target::plt_section_for_global): Remove.
1182 (Target::plt_section_for_local): Remove.
1183 (Target::do_plt_address_for_global): New virtual function.
1184 (Target::do_plt_address_for_local): New virtual function.
1185 (Target::do_plt_section_for_global): Remove.
1186 (Target::do_plt_section_for_local): Remove.
1187 (Target::register_global_plt_entry): Add Symbol_table and Layout
1188 parameters.
1189 * output.cc (Output_data_got::Got_entry::write): Use
1190 plt_address_for_global and plt_address_for_local.
1191 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1192 address of output section.
1193 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1194 got_irelative_, and irelative_count_ fields. Update
1195 declarations.
1196 (Output_data_plt_i386::has_irelative_section): New function.
1197 (Output_data_plt_i386::entry_count): Add irelative_count_.
1198 (Output_data_plt_i386::set_final_data_size): Likewise.
1199 (class Target_i386): Add got_irelative_ and rel_irelative_
1200 fields. Update declarations.
1201 (Target_i386::Target_i386): Initialize new fields.
1202 (Target_i386::do_plt_address_for_global): New function replacing
1203 do_plt_section_for_global.
1204 (Target_i386::do_plt_address_for_local): New function replacing
1205 do_plt_section_for_local.
1206 (Target_i386::got_section): Create got_irelative_.
1207 (Target_i386::rel_irelative_section): New function.
1208 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1209 fields. Don't define __rel_iplt_{start,end}.
1210 (Output_data_plt_i386::add_entry): Add symtab and layout
1211 parameters. Change all callers. Use different PLT and GOT for
1212 IFUNC symbols.
1213 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1214 layout parameters. Change all callers. Use different PLT and
1215 GOT.
1216 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1217 (Output_data_plt_i386::rel_irelative): New function.
1218 (Output_data_plt_i386::address_for_global): New function.
1219 (Output_data_plt_i386::address_for_local): New function.
1220 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1221 IRELATIVE GOT when changing IFUNC GOT entries.
1222 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1223 reloc.
1224 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1225 if we didn't create an IRELATIVE GOT.
1226 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1227 plt_address_for_local.
1228 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1229 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1230 got_irelative_, and irelative_count_ fields. Update
1231 declarations.
1232 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1233 Initialize new fields. Remove symtab parameter. Change all
1234 callers.
1235 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1236 irelative_count_.
1237 (Output_data_plt_x86_64::has_irelative_section): New function.
1238 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1239 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1240 fields. Update declarations.
1241 (Target_x86_64::Target_x86_64): Initialize new fields.
1242 (Target_x86_64::do_plt_address_for_global): New function replacing
1243 do_plt_section_for_global.
1244 (Target_x86_64::do_plt_address_for_local): New function replacing
1245 do_plt_section_for_local.
1246 (Target_x86_64::got_section): Create got_irelative_.
1247 (Target_x86_64::rela_irelative_section): New function.
1248 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1249 all callers. Don't create __rel_iplt_{start,end}.
1250 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1251 parameters. Change all callers. Use different PLT and GOT for
1252 IFUNC symbols.
1253 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1254 layout parameters. Change all callers. Use different PLT and
1255 GOT.
1256 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1257 parameters. Change all callers. Use different PLT and GOT for
1258 IFUNC symbols.
1259 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1260 (Output_data_plt_x86_64::rela_irelative): New function.
1261 (Output_data_plt_x86_64::address_for_global): New function.
1262 (Output_data_plt_x86_64::address_for_local): New function.
1263 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1264 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1265 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1266 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1267 parameters.
1268 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1269 reloc.
1270 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1271 symbols if we didn't create an IRELATIVE GOT.
1272 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1273 plt_address_for_local.
1274 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1275 * testsuite/ifuncvar1.c: New test file.
1276 * testsuite/ifuncvar2.c: New test file.
1277 * testsuite/ifuncvar3.c: New test file.
1278 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1279 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1280 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1281 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1282 * testsuite/Makefile.in: Rebuild.
1283
33c15b45
CC
12842011-07-07 Cary Coutant <ccoutant@google.com>
1285
1286 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1287 (two_file_test_1_ndebug.o): Likewise.
1288 (two_file_test_1b_ndebug.o): Likewise.
1289 (two_file_test_2_ndebug.o): Likewise.
1290 (two_file_test_main_ndebug.o): Likewise.
1291 (incremental_test_2): Link with no-debug versions.
1292
f48b5fb7
CC
12932011-07-06 Cary Coutant <ccoutant@google.com>
1294
1295 * gold/incremental.cc
1296 (Output_section_incremental_inputs::write_info_blocks): Check for
1297 hidden and internal symbols.
1298
221597a5
CC
12992011-07-06 Cary Coutant <ccoutant@google.com>
1300
1301 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1302 Check disposition for startup file.
1303 (Incremental_inputs::report_command_line): Ignore
1304 --incremental-startup-unchanged option.
1305 * options.cc (General_options::parse_incremental_startup_unchanged):
1306 New function.
1307 (General_options::General_options): Initialize new data member.
1308 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1309 (General_options): Add --incremental-startup-unchanged option.
1310 (General_options::incremental_startup_disposition): New function.
1311 (General_options::incremental_startup_disposition_): New data member.
1312
e24719f6
CC
13132011-07-06 Cary Coutant <ccoutant@google.com>
1314
1315 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1316 input file index to Script_info ctor.
1317 (Sized_incremental_binary::do_file_has_changed): Find the
1318 command-line argument for files named in scripts.
1319 * incremental.h (Script_info::Script_info): New ctor
1320 with input file index.
1321 (Script_info::input_file_index): New function.
1322 (Script_info::input_file_index_): New data member.
1323 (Incremental_binary::get_library): Add const.
1324 (Incremental_binary::get_script_info): Add const.
1325 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1326 * testsuite/Makefile.am (incremental_test_5): New test case.
1327 (incremental_test_6): New test case.
1328 * testsuite/Makefile.in: Regenerate.
1329
8f7c81e8
CC
13302011-07-06 Cary Coutant <ccoutant@google.com>
1331
1332 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1333 debug output when command lines differ.
1334
9fbd3822
CC
13352011-07-06 Cary Coutant <ccoutant@google.com>
1336
1337 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1338 --incremental-patch option.
1339 * layout.cc (Free_list::allocate): Extend allocation beyond original
1340 end if enabled.
1341 (Layout::make_output_section): Mark sections that should get
1342 patch space.
1343 * options.cc (parse_percent): New function.
1344 * options.h (parse_percent): New function.
1345 (DEFINE_percent): New macro.
1346 (General_options): Add --incremental-patch option.
1347 * output.cc (Output_section::Output_section): Initialize new data
1348 members.
1349 (Output_section::add_input_section): Print section name when out
1350 of patch space.
1351 (Output_section::add_output_section_data): Likewise.
1352 (Output_section::set_final_data_size): Add patch space when
1353 doing --incremental-full.
1354 (Output_section::do_reset_address_and_file_offset): Remove patch
1355 space.
1356 (Output_segment::set_section_list_addresses): Print debug output
1357 only if --incremental-update.
1358 * output.h (Output_section::set_is_patch_space_allowed): New function.
1359 (Output_section::is_patch_space_allowed_): New data member.
1360 (Output_section::patch_space_): New data member.
1361 * parameters.cc (Parameters::incremental_full): New function.
1362 * parameters.h (Parameters::incremental_full): New function
1363 * testsuite/Makefile.am (incremental_test_2): Add test for
1364 --incremental-patch option.
1365 * testsuite/Makefile.in: Regenerate.
1366 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1367 (t18): Remove function body.
1368
f6cccc2c
DK
13692011-07-05 Doug Kwan <dougkwan@google.com>
1370
1371 PR gold/12771
1372 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1373 Arm_Address type for relocation result.
1374 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1375 overflow check.
1376 (Arm_relocate_functions::abs32): Use unaligned access.
1377 (Arm_relocate_functions::rel32): Ditto.
1378 (Arm_relocate_functions::prel31): Ditto.
1379 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1380 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1381 static data relocations.
1382 * testsuite/Makefile.in: Regnerate.
1383 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1384
28a13fec
ILT
13852011-07-05 Ian Lance Taylor <iant@google.com>
1386
1387 PR gold/12392
1388 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1389 symbols if necessary.
1390 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1391
24d47b34
ILT
13922011-07-05 Ian Lance Taylor <iant@google.com>
1393
1394 PR gold/12952
1395 * resolve.cc (Symbol::override_base_with_special): Simply override
1396 version with special symbol version, ignoring previous version.
1397
41f9cbbe
ILT
13982011-07-05 Ian Lance Taylor <iant@google.com>
1399
1400 * object.cc (Sized_relobj_file::include_section_group): Add
1401 information to comment about signature location.
1402
886288f1
ILT
14032011-07-02 Ian Lance Taylor <iant@google.com>
1404
1405 PR gold/12957
1406 * options.h (class General_options): Add -f and -F.
1407 * options.cc (General_options::finalize): Fatal error if -f/-F
1408 are used without -shared.
1409 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1410
ae3a6d4f
ILT
14112011-07-02 Ian Lance Taylor <iant@google.com>
1412
1413 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1414
21131061
ILT
14152011-07-01 Ian Lance Taylor <iant@google.com>
1416
1417 PR gold/12525
1418 PR gold/12952
1419 * resolve.cc (Symbol::override_base_with_special): Don't override
1420 the version if the overriding symbol has a different name.
1421 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1422 all callers. If we give an error about an undefined version,
1423 define the base version if necessary.
1424 * dynobj.h (class Versions): Update declaration.
1425 * testsuite/weak_alias_test_5.cc: New file.
1426 * testsuite/weak_alias_test.script: New file.
1427 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1428 and versioned_alias have the right value, and call t2.
1429 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1430 weak_alias_test_5.so.
1431 (weak_alias_test_LDADD): Likewise.
1432 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1433 * testsuite/Makefile.in: Rebuild.
1434
611062c0
ILT
14352011-07-01 Ian Lance Taylor <iant@google.com>
1436
1437 PR gold/12525
1438 * options.h (class General_options): Support -z notext.
1439 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1440 -Wl,-z,notext.
1441 (two_file_shared_nonpic.so): Likewise.
1442 (two_file_shared_mixed.so): Likewise.
1443 (two_file_shared_mixed_1.so): Likewise.
1444 (weak_undef_lib_nonpic.so): Likewise.
1445 (alt/weak_undef_lib_nonpic.so): Likewise.
1446 (tls_test_shared_nonpic.so): Likewise.
1447 * testsuite/Makefile.in: Rebuild.
1448
328c7c2f
ILT
14492011-07-01 Ian Lance Taylor <iant@google.com>
1450
1451 PR gold/12525
1452 * configure.ac: Test whether static linking works, setting
1453 the automake conditional HAVE_STATIC.
1454 * testsuite/Makefile.am: Disable tests using -static if
1455 HAVE_STATIC is not true.
1456 * configure, testsuite/Makefile.in: Rebuild.
1457
02d7cd44
ILT
14582011-07-01 Ian Lance Taylor <iant@google.com>
1459
1460 PR gold/12525
1461 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1462 Assert if we see DW_EH_PE_indirect.
1463 * target.h (Target::ehframe_datarel_base): New function.
1464 (Target::do_ehframe_datarel_base): New target function.
1465 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1466 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1467 function.
1468
07a60597
ILT
14692011-07-01 Ian Lance Taylor <iant@google.com>
1470
1471 PR gold/12571
1472 * options.h (class General_options): Add
1473 --ld-generated-unwind-info.
1474 * ehframe.cc (Fde::write): Add address parameter. Change all
1475 callers. If associated with PLT, fill in address and size.
1476 (Cie::set_output_offset): Only add merge mapping if there is an
1477 object.
1478 (Cie::write): Add address parameter. Change all callers.
1479 (Eh_frame::add_ehframe_for_plt): New function.
1480 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1481 input_offset_ fields into union u_, with new plt field.
1482 (Fde::Fde): Adjust for new union field.
1483 (Fde::Fde) [Output_data version]: New constructor.
1484 (Fde::add_mapping): Only add merge mapping if there is an object.
1485 (class Cie): Update declarations.
1486 (class Eh_frame): Declare add_ehframe_for_plt.
1487 * layout.cc (Layout::layout_eh_frame): Break out code into
1488 make_eh_frame_section, and call it.
1489 (Layout::make_eh_frame_section): New function.
1490 (Layout::add_eh_frame_for_plt): New function.
1491 * layout.h (class Layout): Update declarations.
1492 * merge.cc (Merge_map::add_mapping): Add assertion.
1493 * i386.cc: Include "dwarf.h".
1494 (class Output_data_plt_i386): Make first_plt_entry,
1495 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1496 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1497 and plt_eh_frame_fde.
1498 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1499 boundary. Call add_eh_frame_for_plt if appropriate.
1500 * x86_64.cc: Include "dwarf.h".
1501 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1502 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1503 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1504 and plt_eh_frame_fde.
1505 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1506 appropriate.
1507
14788a3f
ILT
15082011-06-29 Ian Lance Taylor <iant@google.com>
1509
1510 PR gold/12629
1511 * object.cc (Sized_relobj_file::layout_section): Change shdr
1512 parameter to be const.
1513 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1514 out of do_layout.
1515 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1516 appropriate. Call layout_eh_frame_section.
1517 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1518 sections.
1519 * object.h (class Sized_relobj_file): Update declarations.
1520
6c21fce1
ILT
15212011-06-29 Ian Lance Taylor <iant@google.com>
1522
37e41b03 1523 PR gold/12652
6c21fce1
ILT
1524 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1525 modifier.
1526 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1527
4d5e4e62
ILT
15282011-06-29 Ian Lance Taylor <iant@google.com>
1529
1530 PR gold/12675
1531 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1532 SHT_X86_64_UNWIND.
1533 * layout.cc (Layout::layout_eh_frame): Likewise.
1534
886f533a
ILT
15352011-06-29 Ian Lance Taylor <iant@google.com>
1536
1537 PR gold/12695
1538 * layout.cc (Layout::symtab_section_shndx): New function.
1539 * layout.h (class Layout): Declare symtab_section_shndx.
1540 * output.cc (Output_section::write_header): Call it.
1541
f3ae1b28
ILT
15422011-06-29 Ian Lance Taylor <iant@google.com>
1543
1544 PR gold/12818
1545 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1546 symbols which are not used in a relocation.
1547
aecf301f
ILT
15482011-06-28 Ian Lance Taylor <iant@google.com>
1549
1550 PR gold/12898
1551 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1552 script create indistinguishable segments.
1553 (Layout::set_segment_offsets): Use stable_sort when sorting
1554 segments. Pass this to Compare_segments constructor.
1555 * layout.h (class Layout): Make segment_precedes non-static.
1556 (class Compare_segments): Change from struct to class. Add
1557 layout_ field. Add constructor.
1558 * script-sections.cc
1559 (Script_sections::attach_sections_using_phdrs_clause): Rename
1560 local orphan to is_orphan. Don't report failure to put empty
1561 section in segment. On attachment failure, report name of
1562 section, and attach to first PT_LOAD segment.
1563
03ef7571
ILT
15642011-06-28 Ian Lance Taylor <iant@google.com>
1565
1566 PR gold/12934
1567 * target-select.cc (Target_selector::Target_selector): Add
1568 emulation parameter. Change all callers.
1569 (select_target_by_bfd_name): Rename from select_target_by_name.
1570 Change all callers.
1571 (select_target_by_emulation): New function.
1572 (supported_emulation_names): New function.
1573 * target-select.h (class Target_selector): Add emulation_ field.
1574 Update declarations.
1575 (Target_selector::recognize_by_bfd_name): Rename from
1576 recognize_by_name. Change all callers.
1577 (Target_selector::supported_bfd_names): Rename from
1578 supported_names. Change all callers.
1579 (Target_selector::recognize_by_emulation): New function.
1580 (Target_selector::supported_emulations): New function.
1581 (Target_selector::emulation): New function.
1582 (Target_selector::do_recognize_by_bfd_name): Rename from
1583 do_recognize_by_name. Change all callers.
1584 (Target_selector::do_supported_bfd_names): Rename from
1585 do_supported_names. Change all callers.
1586 (Target_selector::do_recognize_by_emulation): New function.
1587 (Target_selector::do_supported_emulations): New function.
1588 (select_target_by_bfd_name): Change name in declaration.
1589 (select_target_by_emulation): Declare.
1590 (supported_emulation_names): Declare.
1591 * parameters.cc (parameters_force_valid_target): Try to find
1592 target based on emulation from -m option.
1593 * options.h (class General_options): Change doc string for -m.
1594 * options.cc (help): Print emulations.
1595 (General_options::parse_V): Likewise.
1596 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1597 Add emulation parameter. Change all callers.
1598
200b2bb9
ILT
15992011-06-28 Ian Lance Taylor <iant@google.com>
1600
1601 * target.h (class Target): Add osabi_ field.
1602 (Target::osabi): New function.
1603 (Target::set_osabi): New function.
1604 (Target::Target): Initialize osabi_.
1605 (Target::do_adjust_elf_header): Make pure virtual.
1606 (Sized_target::do_adjust_elf_header): Declare.
1607 * target.cc (Sized_target::do_adjust_elf_header): New function.
1608 (class Sized_target): Instantiate all versions.
1609 * freebsd.h (class Target_freebsd): Remove.
1610 (Target_selector_freebsd::do_recognize): Call set_osabi on
1611 Target.
1612 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1613 (Target_selector_freebsd::set_osabi): Remove.
1614 * i386.cc (class Target_i386): Inherit from Sized_target rather
1615 than Target_freebsd.
1616 * x86_64.cc (class Target_x86_64): Likewise.
1617
b3ce541e
ILT
16182011-06-28 Ian Lance Taylor <iant@google.com>
1619
1620 * target.h (Target::can_check_for_function_pointers): Rewrite.
1621 Make non-virtual.
1622 (Target::can_icf_inline_merge_sections): Likewise.
1623 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1624 (Target::Target_info): Add can_icf_inline_merge_sections field.
1625 (Target::do_can_check_for_function_pointers): New virtual
1626 function.
1627 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1628 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1629 from can_check_for_function_pointers, move in file.
1630 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1631 section_may_have_icf_unsafe_poineters, move in file.
1632 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1633 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1634 Rename from can_check_for_function_pointers, move in file.
1635 (Target_i386::can_icf_inline_merge_sections): Remove.
1636 (Target_i386::i386_info): Initialize
1637 can_icf_inline_merge_sections.
1638 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1639 Initialize can_icf_inline_merge_sections.
1640 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1641 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1642 Rename from can_check_for_function_pointers, move in file.
1643 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1644 (Target_x86_64::x86_64_info): Initialize
1645 can_icf_inline_merge_sections.
1646 * testsuite/testfile.cc (Target_test::test_target_info):
1647 Likewise.
1648 * icf.cc (get_section_contents): Correct formatting.
1649
6d1c4efb
ILT
16502011-06-27 Ian Lance Taylor <iant@google.com>
1651
1652 * symtab.cc (Symbol::versioned_name): New function.
1653 (Symbol_table::add_to_final_symtab): Use versioned_name when
1654 appropriate.
1655 (Symbol_table::sized_write_symbol): Likewise.
1656 * symtab.h (class Symbol): Declare versioned_name.
1657 * stringpool.h (class Stringpool_template): Add variant of add
1658 which takes a std::basic_string.
1659 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1660 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1661 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1662 (ver_test_12.o): New target.
1663 * testsuite/Makefile.in: Rebuild.
1664
57eb9b50
DK
16652011-06-27 Doug Kwan <dougkwan@google.com>
1666
1667 * arm.cc (Arm_relocate_functions::thm_jump8,
1668 Arm_relocate_functions::thm_jump11): Use a wider signed
1669 type to compute offset.
1670 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1671 arm_thm_jump8.
1672 * testsuite/Makefile.in: Regenerate.
1673 * testsuite/arm_branch_in_range.sh: Check test results of
1674 arm_thm_jump11 and arm_thm_jump8.
1675 * testsuite/arm_thm_jump11.s: New test source file.
1676 * testsuite/arm_thm_jump11.t: New linker script.
1677 * testsuite/arm_thm_jump8.s: New test source file.
1678 * testsuite/arm_thm_jump8.t: New linker script.
1679
487b39df
ILT
16802011-06-24 Ian Lance Taylor <iant@google.com>
1681
1682 * layout.cc: Include "object.h".
1683 (ctors_sections_in_init_array): New static variable.
1684 (Layout::is_ctors_in_init_array): New function.
1685 (Layout::layout): Add entry to ctors_sections_in_init_array if
1686 appropriate.
1687 * layout.h (class Layout): Declare is_ctors_in_init_array.
1688 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1689 is_ctors_reverse_view is set.
1690 (Sized_relobj_file::write_sections): Add layout parameter. Change
1691 all callers. Set is_ctors_reverse_view field of View_size.
1692 (Sized_relobj_file::reverse_words): New function.
1693 * object.h (Sized_relobj_file::View_size): Add
1694 is_ctors_reverse_view field.
1695 (class Sized_relobj_file): Update declarations.
1696 * testsuite/initpri3.c: New test.
1697 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1698 initpri3b.
1699 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1700 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1701 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1702 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1703 * testsuite/Makefile.in: Rebuild.
1704
472076e4
CC
17052011-06-24 Cary Coutant <ccoutant@google.com>
1706
1707 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1708 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1709 (debug_msg_cdebug.err): New targets.
1710 * testsuite/Makefile.in: Regenerate.
1711 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1712 Fix checks for link with shared library.
1713
a60af0db
DK
17142011-06-24 Doug Kwan <dougkwan@google.com>
1715
1716 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1717 skip empty text sections.
1718 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1719
5393d741
ILT
17202011-06-22 Ian Lance Taylor <iant@google.com>
1721
1722 PR gold/12910
1723 * options.h (class General_options): Add --ctors-in-init-array.
1724 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1725 friends as SHT_PROGBITS for merging sections.
1726 (Layout::layout): Remove special handling of .init_array and
1727 friends. Don't sort if doing relocatable link. Sort for .ctors
1728 and .dtors if ctors_in_init_array.
1729 (Layout::make_output_section): Force correct section types for
1730 .init_array and friends. Don't sort if doing relocatable link,
1731 Don't sort .ctors and .dtors if ctors_in_init_array.
1732 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1733 (Layout::output_section_name): Add relobj parameter. Change all
1734 callers. Handle .ctors. and .dtors. in code rather than table.
1735 Handle .ctors and .dtors if ctors_in_init_array.
1736 (Layout::match_file_name): New function, moved from output.cc.
1737 * layout.h (class Layout): Update declarations.
1738 * output.cc: Include "layout.h".
1739 (Input_section_sort_entry::get_priority): New function.
1740 (Input_section_sort_entry::match_file_name): Just call
1741 Layout::match_file_name.
1742 (Output_section::Input_section_sort_init_fini_compare::operator()):
1743 Handle .ctors and .dtors. Sort by explicit priority rather than
1744 by name.
1745 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1746 * testsuite/initpri2.c: New test.
1747 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1748 (check_PROGRAMS): Add initpri2.
1749 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1750 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1751 * configure, testsuite/Makefile.in: Rebuild.
1752
e1f74f98
ILT
17532011-06-19 Ian Lance Taylor <iant@google.com>
1754
1755 PR gold/12880
1756 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1757 .interp section to a PT_INTERP segment even if we have seen a
1758 --dynamic-linker option. Don't do it if we have seen a PHDRS
1759 clause in a linker script.
1760 (Layout::finalize): Don't create a .interp section if we've
1761 already create a PT_INTERP segment.
1762 (Layout::create_interp): Always call choose_output_section (revert
1763 patch of 2011-06-17). Don't create PT_INTERP segment.
1764 * script-sections.cc
1765 (Script_sections::create_note_and_tls_segments): Add a .interp
1766 section to a PT_INTERP segment even if we have seen a
1767 --dynamic-linker option.
1768
766f91bb
ILT
17692011-06-18 Ian Lance Taylor <iant@google.com>
1770
1771 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1772 merely because a non-PT_LOAD segment has a dynamic reloc.
1773
0d212c3a
ILT
17742011-06-18 Ian Lance Taylor <iant@google.com>
1775
1776 * layout.cc (Layout::finish_dynamic_section): Don't create
1777 DT_FLAGS entry if not needed.
1778
911a5072
ILT
17792011-06-18 Ian Lance Taylor <iant@google.com>
1780
1781 PR gold/12745
1782 * layout.cc (Layout::layout_eh_frame): Correct handling of
1783 writable .eh_frame section.
1784
534b4e5f
ILT
17852011-06-17 Ian Lance Taylor <iant@google.com>
1786
1787 PR gold/12893
1788 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1789 symbol is redefined with the exact same object and value.
1790
10b4f102
ILT
17912011-06-17 Ian Lance Taylor <iant@google.com>
1792
1793 PR gold/12880
1794 * layout.h (class Layout): Add interp_segment_ field.
1795 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1796 (Layout::attach_allocated_section_to_segment): If making shared
1797 library, put .interp section in PT_INTERP segment.
1798 (Layout::finalize): Also call create_interp if -dynamic-linker
1799 option was used.
1800 (Layout::create_interp): Assert that there is no PT_INTERP
1801 segment. If not using a SECTIONS clause, use make_output_section.
1802 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1803 * script-sections.cc
1804 (Script_sections::create_note_and_tls_segments): If making shared
1805 library, put .interp section in PT_INTERP segment.
1806
a29b0dad
ILT
18072011-06-17 Ian Lance Taylor <iant@google.com>
1808
e588ea8d
ILT
1809 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1810 when making a shared library.
1811
18122011-06-17 Ian Lance Taylor <iant@google.com>
1813
1814 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1815 parameter. Change all callers. Don't issue warning about PC32
1816 against locally defined symbol.
a29b0dad 1817
9d3b0698
ILT
18182011-06-16 Ian Lance Taylor <iant@google.com>
1819
1820 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1821 occurs in same object.
1822
85b0f90c
AM
18232011-06-14 Alan Modra <amodra@gmail.com>
1824
1825 * po/POTFILES.in: Regenerate.
1826
a94907d9
ILT
18272011-06-09 Ian Lance Taylor <iant@google.com>
1828
1829 * script-sections.cc
1830 (Orphan_output_section::set_section_addresses): For a relocatable
1831 link set address to 0.
1832
4fb3a1c3
CC
18332011-06-09 Cary Coutant <ccoutant@google.com>
1834
1835 PR gold/12804
1836 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1837 used with --compress-debug-sections.
1838 * gold/object.cc (Sized_relobj_file::do_layout): Report
1839 uncompressed size of compressed input sections.
1840
61220854
CC
18412011-06-08 Cary Coutant <ccoutant@google.com>
1842
1843 PR gold/12804
1844 * testsuite/two_file_test_2_v1.cc: Change initialization of
1845 v2 to keep it in .data.
1846
e6455dfb
CC
18472011-06-07 Cary Coutant <ccoutant@google.com>
1848
1849 * common.cc (Symbol_table::do_allocate_commons_list): Call
1850 gold_fallback.
1851 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1852 (Errors::fallback): New function.
1853 (gold_fallback): New function.
1854 * errors.h (Errors::fallback): New function.
1855 * gold.cc (gold_exit): Change status parameter to enum; adjust
1856 all callers.
1857 (queue_initial_tasks): Call gold_fallback.
1858 * gold.h: Include cstdlib.
1859 (Exit_status): New enum type.
1860 (gold_exit): Change status parameter to enum.
1861 (gold_fallback): New function.
1862 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1863 (Layout::create_symtab_sections): Likewise.
1864 (Layout::create_shdrs): Likewise.
1865 * main.cc (main): Adjust call to gold_exit.
1866 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1867 (Output_data_got::add_got_entry_pair): Likewise.
1868 (Output_section::add_input_section): Likewise.
1869 (Output_section::add_output_section_data): Likewise.
1870 (Output_segment::set_section_list_addresses): Likewise.
1871 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1872
fb0e076f
CC
18732011-06-07 Cary Coutant <ccoutant@google.com>
1874
1875 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1876 for incremental links.
1877 * output.cc (Output_segment::set_section_list_addresses): Remove
1878 FIXME and test for TLS or BSS.
1879
a5ee4d5d
CC
18802011-06-07 Cary Coutant <ccoutant@google.com>
1881
1882 * testsuite/Makefile.am: Add incremental_copy_test,
1883 incremental_common_test_1.
1884 * testsuite/Makefile.in: Regenerate.
1885 * testsuite/common_test_1_v1.c: New source file.
1886 * testsuite/common_test_1_v2.c: New source file.
1887 * testsuite/copy_test_v1.cc: New source file.
1888
5146f448
CC
18892011-06-07 Cary Coutant <ccoutant@google.com>
1890
1891 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1892 update, allocate common from bss section's free list.
1893 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1894 linker-defined symbols.
1895 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1896 Skip GOT and PLT entries that are no longer referenced.
1897 (Output_section_incremental_inputs::write_info_blocks): Mark
1898 linker-defined symbols.
1899 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1900 * output.cc (Output_section::allocate): New function.
1901 * output.h (Output_section::allocate): New function.
1902 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1903 linker-defined symbols.
1904 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1905 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1906 (Symbol::init_base_output_data): Likewise.
1907 (Symbol::init_base_output_segment): Likewise.
1908 (Symbol::init_base_constant): Likewise.
1909 (Sized_symbol::init_output_data): Likewise.
1910 (Sized_symbol::init_output_segment): Likewise.
1911 (Sized_symbol::init_constant): Likewise.
1912 (Symbol_table::do_define_in_output_data): Likewise.
1913 (Symbol_table::do_define_in_output_segment): Likewise.
1914 (Symbol_table::do_define_as_constant): Likewise.
1915 * symtab.h (Symbol::is_predefined): New function.
1916 (Symbol::init_base_output_data): Add is_predefined parameter.
1917 (Symbol::init_base_output_segment): Likewise.
1918 (Symbol::init_base_constant): Likewise.
1919 (Symbol::is_predefined_): New data member.
1920 (Sized_symbol::init_output_data): Add is_predefined parameter.
1921 (Sized_symbol::init_output_segment): Likewise.
1922 (Sized_symbol::init_constant): Likewise.
1923 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1924
26d3c67d
CC
19252011-06-07 Cary Coutant <ccoutant@google.com>
1926
1927 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1928 instead of emit_copy_reloc.
1929 (Copy_relocs::emit_copy_reloc): Refactor.
1930 (Copy_relocs::make_copy_reloc): New function.
1931 (Copy_relocs::add_copy_reloc): Remove.
1932 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1933 section.
1934 (Copy_relocs::make_copy_reloc): New function.
1935 (Copy_relocs::add_copy_reloc): Remove.
1936 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1937 unchanged input files.
1938 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1939 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1940 Reserve BSS space for COPY relocations.
1941 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1942 (Output_section_incremental_inputs::write_info_blocks): Record
1943 whether a symbol is copied from a shared object.
1944 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1945 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1946 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1947 (Incremental_input_entry_reader::get_output_symbol_index): Add
1948 is_copy parameter.
1949 (Incremental_binary::emit_copy_relocs): New function.
1950 (Incremental_binary::do_emit_copy_relocs): New function.
1951 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1952 new data member.
1953 (Sized_incremental_binary::add_copy_reloc): New function.
1954 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1955 (Sized_incremental_binary::Copy_reloc): New struct.
1956 (Sized_incremental_binary::Copy_relocs): New typedef.
1957 (Sized_incremental_binary::copy_relocs_): New data member.
1958 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1959 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1960 * target.h (Sized_target::emit_copy_reloc): New function.
1961 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1962
7cdb37d9
CC
19632011-06-02 Cary Coutant <ccoutant@google.com>
1964
1965 PR gold/12163
1966 * gold/archive.cc (Archive::Archive): Initialize new data member.
1967 (Archive::include_all_members): Return if archive has already been
1968 included.
1969 * gold/archive.h (Archive::include_all_members_): New data member.
1970
cc643b88
NC
19712011-06-02 Nick Clifton <nickc@redhat.com>
1972
1973 * dynobj.h: Fix spelling mistake in comment.
1974 * output.cc: Likewise.
1975
f62a3ca7
DK
19762011-05-31 Doug Kwan <dougkwan@google.com>
1977 Asier Llano
1978
1979 PR gold/12826
cc643b88 1980 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1981 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1982 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1983 redundant arm_exidx_test.so.
1984 * testsuite/Makefile.in: Regenerate.
1985 (check_SCRIPTS): Add pr12826.sh
1986 (check_DATA): Add pr12826.stdout
1987 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1988 * testsuite/pr12826.sh: New file.
1989 * testsuite/pr12826_1.s: Ditto.
1990 * testsuite/pr12826_1.s: Ditto.
1991
8dbe1edc
ILT
19922011-05-30 Ian Lance Taylor <iant@google.com>
1993
1994 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1995 sections.
1996
c49875be
ILT
19972011-05-29 Ian Lance Taylor <iant@google.com>
1998
1999 PR gold/12804
2000 * testsuite/Makefile.am: Use different file name for two_file_test
2001 temporary file for each incremental test.
2002 * testsuite/Makefile.in: Rebuild.
2003
69d53f7a
ILT
20042011-05-29 Ian Lance Taylor <iant@google.com>
2005
2006 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2007 binary input file is empty.
2008
41d0ab5f
ILT
20092011-05-27 Ian Lance Taylor <iant@google.com>
2010
2011 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2012 (ver_test_9.so): Likewise.
2013 * testsuite/Makefile.in: Rebuild.
2014
89d8a36b
CC
20152011-05-26 Cary Coutant <ccoutant@google.com>
2016
2017 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2018 * incremental.cc (Incremental_inputs::report_input_section): Fix
2019 comment, indentation.
2020 (Incremental_inputs::report_comdat_group): New function.
2021 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2022 of data for incremental input file entry.
2023 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2024 group count, COMDAT group signatures.
2025 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2026 an unchanged input file.
2027 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2028 Initialize new data member.
2029 (Incremental_object_entry::add_comdat_group): New function.
2030 (Incremental_object_entry::get_comdat_group_count): New function.
2031 (Incremental_object_entry::get_comdat_signature_key): New function.
2032 (Incremental_object_entry::groups_): New data member.
2033 (Incremental_inputs::report_comdat_group): New function.
2034 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2035 data for incremental input file entry.
2036 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2037 (Incremental_input_entry_reader::get_input_section): Adjust size of
2038 data for incremental input file entry.
2039 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2040 (Incremental_input_entry_reader::get_comdat_group_signature): New
2041 function.
2042 * object.cc (Sized_relobj::include_section_group): Report kept
2043 COMDAT groups for incremental links.
2044
1706a06f
ILT
20452011-05-24 David Meyer <pdox@google.com>
2046
2047 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2048 with name parameter. Add found_name parameter.
2049 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2050 * dirsearch.h (class Dirsearch): Update declaration.
2051
a10ae760
ILT
20522011-05-24 Ian Lance Taylor <iant@google.com>
2053
2054 * archive.cc (Library_base::should_include_member): Pull in object
2055 from archive if it defines the entry symbol.
2056 * parameters.cc (Parameters::entry): New function.
2057 * parameters.h (class Parameters): Declare entry.
2058 * output.h (class Output_file_header): Remove entry_ field.
2059 * output.cc (Output_file_header::Output_file_header): Remove entry
2060 parameter. Change all callers.
2061 (Output_file_header::entry): Use parameters->entry.
2062 * gold.cc (queue_middle_tasks): Likewise.
2063 * plugin.cc (Plugin_hook::run): Likewise.
2064
aa92d6ed
CC
20652011-05-24 Cary Coutant <ccoutant@google.com>
2066
2067 * gold.cc (queue_initial_tasks): Pass incremental base filename
2068 to Output_file::open_base_file; don't print error message.
2069 * incremental-dump.cc (main): Adjust call to
2070 Output_file::open_for_modification.
2071 * incremental-dump.cc (main): Likewise.
2072 * incremental.cc (Incremental_inputs::report_command_line):
2073 Ignore --incremental-base option when comparing command lines.
2074 Ignore parameter when given as separate argument.
2075 * options.h (class General_options): Add --incremental-base.
2076 * output.cc (Output_file::Output_file):
2077 (Output_file::open_base_file): Add base_name and writable parameters;
2078 read base file into new file; print error message here.
2079 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2080 callers.
2081 * output.h (Output_file::open_for_modification): Rename to...
2082 (Output_file::open_base_file): ...this; add base_name and
2083 writable parameters; adjust all callers.
2084 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2085 callers.
2086 * testsuite/Makefile.am (incremental_test_4): Test
2087 --incremental-base.
2088 * testsuite/Makefile.in: Regenerate.
2089
2eedd706
CC
20902011-05-24 Cary Coutant <ccoutant@google.com>
2091
2092 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2093 incremental_test_4.
2094 * testsuite/Makefile.in: Regenerate.
2095 * testsuite/two_file_test_1_v1.cc: New test source file.
2096 * testsuite/two_file_test_1b_v1.cc: New test source file.
2097 * testsuite/two_file_test_2_v1.cc: New test source file.
2098
0f1c85a6
CC
20992011-05-24 Cary Coutant <ccoutant@google.com>
2100
2101 * dynobj.h (Dynobj::do_dynobj): New function.
2102 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2103 flag and soname for shared objects.
2104 * incremental.cc (Incremental_inputs::report_object): Make
2105 either Incremental_object_entry or Incremental_dynobj_entry; add
2106 soname to string table.
2107 (Incremental_inputs::report_input_section): Add assertion.
2108 (Output_section_incremental_inputs::set_final_data_size): Adjust
2109 type of input file entry for shared libraries; adjust size of
2110 shared library info entry.
2111 (Output_section_incremental_inputs::write_input_files): Write
2112 as_needed flag for shared libraries.
2113 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2114 of input file entry for shared libraries; write soname.
2115 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2116 soname from incremental info.
2117 * incremental.h (enum Incremental_input_flags): Add
2118 INCREMENTAL_INPUT_AS_NEEDED.
2119 (Incremental_input_entry::Incremental_input_entry): Initialize new
2120 data member.
2121 (Incremental_input_entry::set_as_needed): New function.
2122 (Incremental_input_entry::as_needed): New function.
2123 (Incremental_input_entry::do_dynobj_entry): New function.
2124 (Incremental_input_entry::as_needed_): New data member.
2125 (Incremental_object_entry::Incremental_object_entry): Don't check
2126 for shared library.
2127 (Incremental_object_entry::do_type): Likewise.
2128 (class Incremental_dynobj_entry): New class.
2129 (Incremental_input_entry_reader::as_needed): New function.
2130 (Incremental_input_entry_reader::get_soname): New function.
2131 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2132 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2133 size of shared library info entry.
58797674 2134 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2135 incremental link when adding DT_NEEDED entries.
2136 * object.h (Object::Object): Initialize new data member.
2137 (Object::dynobj): New function.
2138 (Object::set_as_needed): New function.
2139 (Object::as_needed): New function.
2140 (Object::do_dynobj): New function.
2141 (Object::as_needed_): New data member.
2142
6fa2a40b
CC
21432011-05-24 Cary Coutant <ccoutant@google.com>
2144
2145 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2146 info; adjust display of GOT entries.
2147 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2148 vector of input objects; remove file_status_.
2149 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2150 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2151 got_plt reader; call target hooks to reserve GOT entries.
2152 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2153 of input file info header and GOT info entry.
2154 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2155 relocation info.
2156 (Got_plt_view_info::got_descriptor): Remove.
2157 (Got_plt_view_info::sym_index): New data member.
2158 (Got_plt_view_info::input_index): New data member.
2159 (Local_got_offset_visitor::visit): Write input file index.
2160 (Global_got_offset_visitor::visit): Write 0 for input file index.
2161 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2162 with sym_index and input_index.
2163 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2164 incremental info GOT entry; replace got_descriptor with input_index.
2165 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2166 map from input file index to object.
2167 (Sized_relobj_incr::do_layout): Replace direct data member reference
2168 with accessor function.
2169 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2170 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2171 Adjust size of input file info header.
2172 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2173 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2174 (Incremental_input_entry_reader::get_input_section): Adjust size of
2175 input file info header.
2176 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2177 of incremental info GOT entry.
2178 (Incremental_got_plt_reader::get_got_desc): Remove.
2179 (Incremental_got_plt_reader::get_got_symndx): New function.
2180 (Incremental_got_plt_reader::get_got_input_index): New function.
2181 (Sized_incremental_binary::Sized_incremental_binary): Remove
2182 file_status_; add input_objects_.
2183 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2184 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2185 (Sized_incremental_binary::file_is_unchanged): Remove.
2186 (Sized_incremental_binary::set_input_object): New function.
2187 (Sized_incremental_binary::input_object): New function.
2188 (Sized_incremental_binary::file_status_): Remove.
2189 (Sized_incremental_binary::input_objects_): New data member.
2190 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2191 references.
2192 (Sized_relobj_incr::invalid_address): Move to base class.
2193 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2194 class.
2195 (Sized_relobj_incr::do_output_section_offset): Likewise.
2196 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2197 (Sized_relobj_incr::section_offsets_): Likewise.
2198 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2199 function.
2200 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2201 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2202 with accessor function.
2203 (Sized_relobj_file::do_layout): Likewise.
2204 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2205 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2206 (Sized_relobj_file::compute_final_local_value): Replace refs to
2207 section_offsets_ with accessor function.
2208 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2209 * object.h (Relobj::Relobj): Initialize new data members.
2210 (Relobj::add_dyn_reloc): New function.
2211 (Relobj::first_dyn_reloc): New function.
2212 (Relobj::dyn_reloc_count): New function.
2213 (Relobj::first_dyn_reloc_): New data member.
2214 (Relobj::dyn_reloc_count_): New data member.
2215 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2216 references.
2217 (Sized_relobj::Address): New typedef.
2218 (Sized_relobj::invalid_address): Move here from child class.
2219 (Sized_relobj::Sized_relobj): Initialize new data members.
2220 (Sized_relobj::sized_relobj): New function.
2221 (Sized_relobj::is_output_section_offset_invalid): Move here from
2222 child class.
2223 (Sized_relobj::get_output_section_offset): Likewise.
2224 (Sized_relobj::local_has_got_offset): Likewise.
2225 (Sized_relobj::local_got_offset): Likewise.
2226 (Sized_relobj::set_local_got_offset): Likewise.
2227 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2228 (Sized_relobj::clear_got_offsets): New function.
2229 (Sized_relobj::section_offsets): Move here from child class.
2230 (Sized_relobj::do_output_section_offset): Likewise.
2231 (Sized_relobj::do_set_section_offset): Likewise.
2232 (Sized_relobj::Local_got_offsets): Likewise.
2233 (Sized_relobj::local_got_offsets_): Likewise.
2234 (Sized_relobj::section_offsets_): Likewise.
2235 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2236 references.
2237 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2238 class.
2239 (Sized_relobj_file::sized_relobj): New function
2240 (Sized_relobj_file::local_has_got_offset): Move to base class.
2241 (Sized_relobj_file::local_got_offset): Likewise.
2242 (Sized_relobj_file::set_local_got_offset): Likewise.
2243 (Sized_relobj_file::get_output_section_offset): Likewise.
2244 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2245 (Sized_relobj_file::do_output_section_offset): Likewise.
2246 (Sized_relobj_file::do_set_section_offset): Likewise.
2247 (Sized_relobj_file::Local_got_offsets): Likewise.
2248 (Sized_relobj_file::local_got_offsets_): Likewise.
2249 (Sized_relobj_file::section_offsets_): Likewise.
2250 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2251 (all constructors).
2252 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2253 (Output_reloc::get_symbol_index): Likewise.
2254 (Output_reloc::local_section_offset): Likewise.
2255 (Output_reloc::get_address): Likewise.
2256 (Output_reloc::symbol_value): Likewise.
2257 (Output_data_got::reserve_slot): Move to class definition.
2258 (Output_data_got::reserve_local): New function.
2259 (Output_data_got::reserve_slot_for_global): Remove.
2260 (Output_data_got::reserve_global): New function.
2261 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2262 (all constructors, two instantiations).
2263 (Output_reloc::get_relobj): New function (two instantiations).
2264 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2265 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2266 (Output_data_reloc::add_global): Adjust type of relobj.
2267 (Output_data_reloc::add_global_relative): Likewise.
2268 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2269 (Output_data_reloc::add_local): Likewise.
2270 (Output_data_reloc::add_local_relative): Likewise.
2271 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2272 (Output_data_reloc::add_local_section): Likewise.
2273 (Output_data_reloc::add_output_section): Likewise.
2274 (Output_data_reloc::add_absolute): Likewise.
2275 (Output_data_reloc::add_target_specific): Likewise.
2276 (Output_data_got::reserve_slot): Move definition here.
2277 (Output_data_got::reserve_local): New function.
2278 (Output_data_got::reserve_global): New function.
2279 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2280 section_offsets_ with accessor function.
2281 (Sized_relobj_file::write_sections): Likewise.
2282 (Sized_relobj_file::do_relocate_sections): Likewise.
2283 * target.h (Sized_target::reserve_local_got_entry): New function.
2284 (Sized_target::reserve_global_got_entry): New function.
2285 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2286 (Target_x86_64::reserve_global_got_entry): New function.
2287 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2288
4829d394
CC
22892011-05-23 Cary Coutant <ccoutant@google.com>
2290
2291 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2292 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2293 bit when checking got_type.
2294 * incremental.cc (Sized_incremental_binary::setup_readers):
2295 Store symbol table and string table locations; initialize bit vector
2296 of file status flags.
2297 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2298 unchanged files.
2299 (Sized_incremental_binary::do_process_got_plt): New function.
2300 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2301 (Output_section_incremental_inputs::set_final_data_size): Record
2302 file index for each input file.
2303 (Output_section_incremental_inputs::write_got_plt): Store file index
2304 instead of input entry offset for each GOT entry.
2305 * incremental.h
2306 (Incremental_input_entry::Incremental_input_entry): Initialize new
2307 data member.
2308 (Incremental_input_entry::set_offset): Store file index.
2309 (Incremental_input_entry::get_file_index): New function.
2310 (Incremental_input_entry::file_index_): New data member.
2311 (Incremental_binary::process_got_plt): New function.
2312 (Incremental_binary::do_process_got_plt): New function.
2313 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2314 data members.
2315 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2316 (Sized_incremental_binary::set_file_is_unchanged): New function.
2317 (Sized_incremental_binary::file_is_unchanged): New function.
2318 (Sized_incremental_binary::do_process_got_plt): New function.
2319 (Sized_incremental_binary::file_status_): New data member.
2320 (Sized_incremental_binary::main_symtab_loc_): New data member.
2321 (Sized_incremental_binary::main_strtab_loc_): New data member.
2322 * output.cc (Output_data_got::Got_entry::write): Add case
2323 RESERVED_CODE.
2324 (Output_data_got::add_global): Call add_got_entry.
2325 (Output_data_got::add_global_plt): Likewise.
2326 (Output_data_got::add_global_with_rel): Likewise.
2327 (Output_data_got::add_global_with_rela): Likewise.
2328 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2329 (Output_data_got::add_global_pair_with_rela): Likewise.
2330 (Output_data_got::add_local): Call add_got_entry.
2331 (Output_data_got::add_local_plt): Likewise.
2332 (Output_data_got::add_local_with_rel): Likewise.
2333 (Output_data_got::add_local_with_rela): Likewise.
2334 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2335 (Output_data_got::add_local_pair_with_rela): Likewise.
2336 (Output_data_got::reserve_slot): New function.
2337 (Output_data_got::reserve_slot_for_global): New function.
2338 (Output_data_got::add_got_entry): New function.
2339 (Output_data_got::add_got_entry_pair): New function.
2340 (Output_section::add_output_section_data): Edit FIXME.
2341 * output.h
2342 (Output_section_data_build::Output_section_data_build): New
2343 constructor with size parameter.
2344 (Output_data_space::Output_data_space): Likewise.
2345 (Output_data_got::Output_data_got): Initialize new data member; new
2346 constructor with size parameter.
2347 (Output_data_got::add_constant): Call add_got_entry.
2348 (Output_data_got::reserve_slot): New function.
2349 (Output_data_got::reserve_slot_for_global): New function.
2350 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2351 (Output_data_got::add_got_entry): New function.
2352 (Output_data_got::add_got_entry_pair): New function.
2353 (Output_data_got::free_list_): New data member.
2354 * target.h (Sized_target::init_got_plt_for_update): New function.
2355 (Sized_target::register_global_plt_entry): New function.
2356 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2357 Initialize new data member; call init; add constructor with PLT count.
2358 (Output_data_plt_x86_64::init): New function.
2359 (Output_data_plt_x86_64::add_relocation): New function.
2360 (Output_data_plt_x86_64::reserve_slot): New function.
2361 (Output_data_plt_x86_64::free_list_): New data member.
2362 (Target_x86_64::init_got_plt_for_update): New function.
2363 (Target_x86_64::register_global_plt_entry): New function.
2364 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2365 incremental updates.
2366 (Output_data_plt_x86_64::add_relocation): New function.
2367 * testsuite/object_unittest.cc (Object_test): Set default options.
2368
ec69d6da
ILT
23692011-05-16 Ian Lance Taylor <iant@google.com>
2370
2371 * options.h (class General_options): Make -i a synonym for -r.
2372
732e31de
ILT
23732011-05-16 Ian Lance Taylor <iant@google.com>
2374
2375 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2376
403676b5
CC
23772011-05-10 Cary Coutant <ccoutant@google.com>
2378
2379 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2380 strip_all (-s).
2381
5b7b7d6e
ILT
23822011-05-06 Ian Lance Taylor <iant@google.com>
2383
2384 * layout.cc (Layout::layout): If the output section flags change,
2385 update the ordering.
2386
f0f9babf
CC
23872011-04-25 Cary Coutant <ccoutant@google.com>
2388
2389 * incremental-dump.cc (dump_incremental_inputs): Print local
2390 symbol info for each input file.
2391 * incremental.cc
2392 (Output_section_incremental_inputs::set_final_data_size): Add local
2393 symbol info to input file entries in incremental info.
2394 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2395 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2396 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2397 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2398 implementation.
2399 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2400 (Sized_incr_relobj::do_relocate): Write the local symbols.
2401 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2402 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2403 Adjust size of input file header.
2404 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2405 (Incremental_inputs_reader::get_local_symbol_count): New function.
2406 (Incremental_inputs_reader::get_input_section): Adjust size of input
2407 file header.
2408 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2409 (Sized_incr_relobj::This): New typedef.
2410 (Sized_incr_relobj::sym_size): New const data member.
2411 (Sized_incr_relobj::Local_symbol): New struct.
2412 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2413 (Sized_incr_relobj::do_local_symbol_offset): New function.
2414 (Sized_incr_relobj::local_symbol_count_): New data member.
2415 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2416 (Sized_incr_relobj::local_symbol_index_): New data member.
2417 (Sized_incr_relobj::local_symbol_offset_): New data member.
2418 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2419 (Sized_incr_relobj::local_symbols_): New data member.
2420 * object.h (Relobj::output_local_symbol_count): New function.
2421 (Relobj::local_symbol_offset): New function.
2422 (Relobj::do_output_local_symbol_count): New function.
2423 (Relobj::do_local_symbol_offset): New function.
2424 (Sized_relobj::do_output_local_symbol_count): New function.
2425 (Sized_relobj::do_local_symbol_offset): New function.
2426
d0a9ace3
ILT
24272011-04-22 Vladimir Simonov <sv@sw.ru>
2428
2429 * descriptors.cc (set_close_on_exec): New function.
2430 (Descriptors::open): Use set_close_on_exec.
2431 * output.cc (S_ISLNK): Define if not defined.
2432
94a3fc8b
CC
24332011-04-22 Cary Coutant <ccoutant@google.com>
2434
2435 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2436 global symbol map.
2437 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2438 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2439 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2440 relocations.
2441 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2442 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2443 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2444 * incremental.h
2445 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2446 function.
2447 (Incremental_binary::apply_incremental_relocs): New function.
2448 (Incremental_binary::do_apply_incremental_relocs): New function.
2449 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2450 data member.
2451 (Sized_incremental_binary::add_global_symbol): New function.
2452 (Sized_incremental_binary::global_symbol): New function.
2453 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2454 (Sized_incremental_binary::symbol_map_): New data member.
2455 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2456 * target.h (Sized_target::apply_relocation): New function.
2457 * target-reloc.h (apply_relocation): New function.
2458 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2459
c87e4302
DK
24602011-04-22 Doug Kwan <dougkwan@google.com>
2461
2462 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2463 flag of a SHT_ARM_EXIDX section.
2464 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2465 * testsuite/Makefile.in: Regenerate.
2466 * testsuite/arm_exidx_test.s: New file.
2467 * testsuite/arm_exidx_test.sh: Same.
2468
e7782cf6
CC
24692011-04-20 Cary Coutant <ccoutant@google.com>
2470
2471 PR gold/12689
2472 * archive.h (Incremental_archive_entry::Archive_member):
2473 Initialize arg_serial_ (second constructor).
2474
308ecdc7
ILT
24752011-04-17 Ian Lance Taylor <iant@google.com>
2476
2477 * object.cc (Relocate_info::location): Simplify location string.
2478 * errors.cc (Errors::error_at_location): Don't print program
2479 name.
2480 (Errors::warning_at_location): Likewise.
2481 (Errors::undefined_symbol): Likewise.
2482 * testsuite/debug_msg.sh: Update accordingly.
2483
bec5b579
CC
24842011-04-14 Cary Coutant <ccoutant@google.com>
2485
2486 * gold/layout.cc (Layout::symtab_section_offset): New function.
2487 * gold/layout.h (Layout::symtab_section_offset): New function.
2488 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2489
88597d34
ILT
24902011-04-12 Ian Lance Taylor <iant@google.com>
2491
2492 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2493 with MREMAP_MAYMOVE.
2494 * output.h (class Output_file): Add map_is_allocated_ field.
2495 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2496 not available, provide stubs. If mremap is not available, #define
2497 it to gold_mremap.
2498 (MREMAP_MAYMOVE): Define if not defined.
2499 (Output_file::Output_file): Initialize map_is_allocated_.
2500 (Output_file::resize): Check map_is_allocated_.
2501 (Output_file::map_anonymous): If mmap fails, use malloc.
2502 (Output_file::unmap): Don't do anything for an anonymous map.
2503 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2504 is not available, provide stubs.
2505 (File_read::View::~View): Use free rather than delete[].
2506 (File_read::make_view): Use malloc rather than new[]. If mmap
2507 fails, use malloc.
2508 (File_read::find_or_make_view): Use malloc rather than new[].
2509 * gold.h: Remove HAVE_REMAP code.
2510 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2511 exists. Rename mremap to gold_mremap. If mmap is not available
2512 don't do anything.
2513 * configure, config.in: Rebuild.
2514
11e361bc
ILT
25152011-04-11 Ian Lance Taylor <iant@google.com>
2516
2517 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2518 initialize local variable v.
2519
cdc29364
CC
25202011-04-11 Cary Coutant <ccoutant@google.com>
2521
2522 * archive.cc (Archive::include_member): Adjust call to
2523 report_object.
2524 (Add_archive_symbols::run): Track argument serial numbers.
2525 (Lib_group::include_member): Likewise.
2526 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2527 * archive.h (Incremental_archive_entry::Archive_member):
2528 Initialize arg_serial_.
2529 (Archive_member::arg_serial_): New data member.
2530 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2531 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2532 incremental link.
2533 (Sized_dynobj::do_for_all_local_got_entries): New function.
2534 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2535 function.
2536 * fileread.cc (get_mtime): New function.
2537 * fileread.h (get_mtime): New function.
2538 * gold.cc (queue_initial_tasks): Check for incremental update.
2539 (process_incremental_input): New function.
2540 (queue_middle_tasks): Don't force valid target for incremental
2541 update.
2542 * incremental-dump.cc (find_input_containing_global): Adjust
2543 size of symbol info entry.
2544 (dump_incremental_inputs): Dump argument serial number and
2545 in_system_directory flag; bias shndx by 1; print symbol names
2546 when dumping per-file symbol lists; use new symbol info readers.
2547 * incremental.cc
2548 (Output_section_incremental_inputs:update_data_size): New function.
2549 (Sized_incremental_binary::setup_readers): Setup input readers
2550 for each input file; build maps for files added from libraries
2551 and scripts.
2552 (Sized_incremental_binary::check_input_args): New function.
2553 (Sized_incremental_binary::do_check_inputs): Build map of argument
2554 serial numbers to input arguments.
2555 (Sized_incremental_binary::do_file_has_changed): Rename
2556 do_file_is_unchanged to this; compare file modification times.
2557 (Sized_incremental_binary::do_init_layout): New function.
2558 (Sized_incremental_binary::do_reserve_layout): New function.
2559 (Sized_incremental_binary::do_get_input_reader): Remove.
2560 (Sized_incremental_binary::get_symtab_view): New function.
2561 (Incremental_checker::can_incrementally_link_output_file): Remove.
2562 (Incremental_inputs::report_command_line): Exclude --debug options.
2563 (Incremental_inputs::report_archive_begin): Add parameter; track
2564 argument serial numbers; don't put input file entry for archive
2565 before archive members.
2566 (Incremental_inputs::report_archive_end): Put input file entry
2567 for archive after archive members.
2568 (Incremental_inputs::report_object): Add parameter; track argument
2569 serial numbers and in_system_directory flag.
2570 (Incremental_inputs::report_script): Add parameter; track argument
2571 serial numbers.
2572 (Output_section_incremental_inputs::set_final_data_size): Adjust
2573 size of symbol info entry; check for forwarding symbols.
2574 (Output_section_incremental_inputs::write_input_files): Write
2575 in_system_directory flag and argument serial number.
2576 (Output_section_incremental_inputs::write_info_blocks): Map section
2577 indices between incremental info and original input file; store
2578 input section index for each symbol.
2579 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2580 change operator() to visit().
2581 (class Global_got_offset_visitor): Likewise.
2582 (class Global_symbol_visitor_got_plt):
2583 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2584 classes.
2585 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2586 (Sized_incr_relobj::do_read_symbols): New function.
2587 (Sized_incr_relobj::do_layout): New function.
2588 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2589 (Sized_incr_relobj::do_add_symbols): New function.
2590 (Sized_incr_relobj::do_should_include_member): New function.
2591 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2592 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2593 (Sized_incr_relobj::do_section_size): New function.
2594 (Sized_incr_relobj::do_section_name): New function.
2595 (Sized_incr_relobj::do_section_contents): New function.
2596 (Sized_incr_relobj::do_section_flags): New function.
2597 (Sized_incr_relobj::do_section_entsize): New function.
2598 (Sized_incr_relobj::do_section_address): New function.
2599 (Sized_incr_relobj::do_section_type): New function.
2600 (Sized_incr_relobj::do_section_link): New function.
2601 (Sized_incr_relobj::do_section_info): New function.
2602 (Sized_incr_relobj::do_section_addralign): New function.
2603 (Sized_incr_relobj::do_initialize_xindex): New function.
2604 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2605 (Sized_incr_relobj::do_read_relocs): New function.
2606 (Sized_incr_relobj::do_gc_process_relocs): New function.
2607 (Sized_incr_relobj::do_scan_relocs): New function.
2608 (Sized_incr_relobj::do_count_local_symbols): New function.
2609 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2610 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2611 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2612 (Sized_incr_relobj::do_relocate): New function.
2613 (Sized_incr_relobj::do_set_section_offset): New function.
2614 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2615 (Sized_incr_dynobj::do_read_symbols): New function.
2616 (Sized_incr_dynobj::do_layout): New function.
2617 (Sized_incr_dynobj::do_add_symbols): New function.
2618 (Sized_incr_dynobj::do_should_include_member): New function.
2619 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2620 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2621 (Sized_incr_dynobj::do_section_size): New function.
2622 (Sized_incr_dynobj::do_section_name): New function.
2623 (Sized_incr_dynobj::do_section_contents): New function.
2624 (Sized_incr_dynobj::do_section_flags): New function.
2625 (Sized_incr_dynobj::do_section_entsize): New function.
2626 (Sized_incr_dynobj::do_section_address): New function.
2627 (Sized_incr_dynobj::do_section_type): New function.
2628 (Sized_incr_dynobj::do_section_link): New function.
2629 (Sized_incr_dynobj::do_section_info): New function.
2630 (Sized_incr_dynobj::do_section_addralign): New function.
2631 (Sized_incr_dynobj::do_initialize_xindex): New function.
2632 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2633 (make_sized_incremental_object): New function.
2634 (Incremental_library::copy_unused_symbols): New function.
2635 (Incremental_library::do_for_all_unused_symbols): New function.
2636 * incremental.h (enum Incremental_input_flags): New type.
2637 (class Incremental_checker): Remove.
2638 (Incremental_input_entry::Incremental_input_entry): Add argument
2639 serial number.
2640 (Incremental_input_entry::arg_serial): New function.
2641 (Incremental_input_entry::set_is_in_system_directory): New function.
2642 (Incremental_input_entry::is_in_system_directory): New function.
2643 (Incremental_input_entry::arg_serial_): New data member.
2644 (Incremental_input_entry::is_in_system_directory_): New data member.
2645 (class Script_info): Move here from script.h.
2646 (Script_info::Script_info): Add filename parameter.
2647 (Script_info::filename): New function.
2648 (Script_info::filename_): New data member.
2649 (Incremental_script_entry::Incremental_script_entry): Add argument
2650 serial number.
2651 (Incremental_object_entry::Incremental_object_entry): Likewise.
2652 (Incremental_object_entry::add_input_section): Build list of input
2653 sections with map to original shndx.
2654 (Incremental_object_entry::get_input_section_index): New function.
2655 (Incremental_object_entry::shndx_): New data member.
2656 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2657 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2658 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2659 serial number.
2660 (Incremental_inputs::report_archive_begin): Likewise.
2661 (Incremental_inputs::report_object): Likewise.
2662 (Incremental_inputs::report_script): Likewise.
2663 (class Incremental_global_symbol_reader): New class.
2664 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2665 and store flags and input file type.
2666 (Incremental_input_entry_reader::arg_serial): New function.
2667 (Incremental_input_entry_reader::type): Extract type from flags.
2668 (Incremental_input_entry_reader::is_in_system_directory): New function.
2669 (Incremental_input_entry_reader::get_input_section_count): Call
2670 accessor function for type.
2671 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2672 function for type; adjust size of global symbol entry.
2673 (Incremental_input_entry_reader::get_global_symbol_count): Call
2674 accessor function for type.
2675 (Incremental_input_entry_reader::get_object_count): Likewise.
2676 (Incremental_input_entry_reader::get_object_offset): Likewise.
2677 (Incremental_input_entry_reader::get_member_count): Likewise.
2678 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2679 (Incremental_input_entry_reader::get_member_offset): Likewise.
2680 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2681 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2682 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2683 (Incremental_input_entry_reader::get_global_symbol_reader): New
2684 function.
2685 (Incremental_input_entry_reader::get_output_symbol_index): New
2686 function.
2687 (Incremental_input_entry_reader::type_): Remove.
2688 (Incremental_input_entry_reader::flags_): New data member.
2689 (Incremental_inputs_reader::input_file_offset): New function.
2690 (Incremental_inputs_reader::input_file_index): New function.
2691 (Incremental_inputs_reader::input_file): Call input_file_offset.
2692 (Incremental_inputs_reader::input_file_at_offset): New function.
2693 (Incremental_relocs_reader::get_r_type): Reformat.
2694 (Incremental_relocs_reader::get_r_shndx): Reformat.
2695 (Incremental_relocs_reader::get_r_offset): Reformat.
2696 (Incremental_relocs_reader::data): New function.
2697 (Incremental_binary::Incremental_binary): Initialize new data members.
2698 (Incremental_binary::check_inputs): Add cmdline parameter.
2699 (Incremental_binary::file_is_unchanged): Remove.
2700 (Input_reader::arg_serial): New function.
2701 (Input_reader::get_unused_symbol_count): New function.
2702 (Input_reader::get_unused_symbol): New function.
2703 (Input_reader::do_arg_serial): New function.
2704 (Input_reader::do_get_unused_symbol_count): New function.
2705 (Input_reader::do_get_unused_symbol): New function.
2706 (Incremental_binary::input_file_count): New function.
2707 (Incremental_binary::get_input_reader): Change signature to use
2708 index instead of filename.
2709 (Incremental_binary::file_has_changed): New function.
2710 (Incremental_binary::get_input_argument): New function.
2711 (Incremental_binary::get_library): New function.
2712 (Incremental_binary::get_script_info): New function.
2713 (Incremental_binary::init_layout): New function.
2714 (Incremental_binary::reserve_layout): New function.
2715 (Incremental_binary::output_file): New function.
2716 (Incremental_binary::do_check_inputs): New function.
2717 (Incremental_binary::do_file_is_unchanged): Remove.
2718 (Incremental_binary::do_file_has_changed): New function.
2719 (Incremental_binary::do_init_layout): New function.
2720 (Incremental_binary::do_reserve_layout): New function.
2721 (Incremental_binary::do_input_file_count): New function.
2722 (Incremental_binary::do_get_input_reader): Change signature.
2723 (Incremental_binary::input_args_map_): New data member.
2724 (Incremental_binary::library_map_): New data member.
2725 (Incremental_binary::script_map_): New data member.
2726 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2727 new data members.
2728 (Sized_incremental_binary::output_section): New function.
2729 (Sized_incremental_binary::inputs_reader): Add const.
2730 (Sized_incremental_binary::symtab_reader): Add const.
2731 (Sized_incremental_binary::relocs_reader): Add const.
2732 (Sized_incremental_binary::got_plt_reader): Add const.
2733 (Sized_incremental_binary::get_symtab_view): New function.
2734 (Sized_incremental_binary::Inputs_reader): New typedef.
2735 (Sized_incremental_binary::Input_entry_reader): New typedef.
2736 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2737 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2738 (Sized_incremental_binary::do_file_has_changed): New function.
2739 (Sized_incremental_binary::do_init_layout): New function.
2740 (Sized_incremental_binary::do_reserve_layout): New function.
2741 (Sized_input_reader::Inputs_reader): Remove.
2742 (Sized_input_reader::Input_entry_reader): Remove.
2743 (Sized_input_reader::do_arg_serial): New function.
2744 (Sized_input_reader::do_get_unused_symbol_count): New function.
2745 (Sized_input_reader::do_get_unused_symbol): New function.
2746 (Sized_incremental_binary::do_input_file_count): New function.
2747 (Sized_incremental_binary::do_get_input_reader): Change signature;
2748 use index instead of filename.
2749 (Sized_incremental_binary::section_map_): New data member.
2750 (Sized_incremental_binary::input_entry_readers_): New data member.
2751 (class Sized_incr_relobj): New class.
2752 (class Sized_incr_dynobj): New class.
2753 (make_sized_incremental_object): New function.
2754 (class Incremental_library): New class.
2755 * layout.cc (Free_list::num_lists): New static data member.
2756 (Free_list::num_nodes): New static data member.
2757 (Free_list::num_removes): New static data member.
2758 (Free_list::num_remove_visits): New static data member.
2759 (Free_list::num_allocates): New static data member.
2760 (Free_list::num_allocate_visits): New static data member.
2761 (Free_list::init): New function.
2762 (Free_list::remove): New function.
2763 (Free_list::allocate): New function.
2764 (Free_list::dump): New function.
2765 (Free_list::print_stats): New function.
2766 (Layout_task_runner::run): Resize output file for incremental updates.
2767 (Layout::Layout): Initialize new data members.
2768 (Layout::set_incremental_base): New function.
2769 (Layout::init_fixed_output_section): New function.
2770 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2771 incremental updates.
2772 (Layout::create_gold_note): Do not create gold note section for
2773 incremental updates.
2774 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2775 for incremental updates.
2776 (Layout::set_section_offsets): For incremental updates, allocate space
2777 from free list.
2778 (Layout::create_symtab_sections): Layout with offsets relative to
2779 start of section; for incremental updates, allocate space from free
2780 list.
2781 (Layout::create_shdrs): For incremental updates, allocate space from
2782 free list.
2783 (Layout::finish_dynamic_section): For incremental updates, do not
2784 check --as-needed (fixed in subsequent patch).
2785 * layout.h (class Free_list): New class.
2786 (Layout::set_incremental_base): New function.
2787 (Layout::incremental_base): New function.
2788 (Layout::init_fixed_output_section): New function.
2789 (Layout::allocate): New function.
2790 (Layout::incremental_base_): New data member.
2791 (Layout::free_list_): New data member.
2792 * main.cc (main): Print Free_list statistics.
2793 * object.cc (Relobj::finalize_incremental_relocs): Add
2794 clear_counts parameter; clear counts only when clear_counts is set.
2795 (Sized_relobj::Sized_relobj): Initialize new base class.
2796 (Sized_relobj::do_layout): Don't report special sections.
2797 (Sized_relobj::do_for_all_local_got_entries): New function.
2798 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2799 symtab_off to all symbol table offsets.
2800 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2801 * object.h (class Got_offset_list): Move to top of file.
2802 (Object::Object): Allow case where input_file == NULL.
2803 (Object::~Object): Likewise.
2804 (Object::input_file): Assert that input_file != NULL.
2805 (Object::lock): Allow case where input_file == NULL.
2806 (Object::unlock): Likewise.
2807 (Object::is_locked): Likewise.
2808 (Object::token): Likewise.
2809 (Object::release): Likewise.
2810 (Object::is_incremental): New function.
2811 (Object::get_mtime): New function.
2812 (Object::for_all_local_got_entries): New function.
2813 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2814 (Object::set_is_in_system_directory): New function.
2815 (Object::is_in_system_directory): New function.
2816 (Object::do_is_incremental): New function.
2817 (Object::do_get_mtime): New function.
2818 (Object::do_for_all_local_got_entries): New function.
2819 (Object::is_in_system_directory_): New data member.
2820 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2821 (class Sized_relobj_base): New class.
2822 (class Sized_relobj): Derive from Sized_relobj_base.
2823 (class Sized_relobj::Symbols): Redeclare from base class.
2824 (class Sized_relobj::local_got_offset_list): Remove.
2825 (class Sized_relobj::Output_sections): Redeclare from base class.
2826 (class Sized_relobj::do_for_all_local_got_entries): New function.
2827 (class Sized_relobj::write_local_symbols): Add offset parameter.
2828 (class Sized_relobj::local_symbol_offset_): Update comment.
2829 (class Sized_relobj::local_dynsym_offset_): Update comment.
2830 * options.cc (Input_arguments::add_file): Remove const.
2831 * options.h (Input_file_argument::Input_file_argument):
2832 Initialize arg_serial_ (all constructors).
2833 (Input_file_argument::set_arg_serial): New function.
2834 (Input_file_argument::arg_serial): New function.
2835 (Input_file_argument::arg_serial_): New data member.
2836 (Input_arguments::Input_arguments): Initialize file_count_.
2837 (Input_arguments::add_file): Remove const.
2838 (Input_arguments::number_of_input_files): New function.
2839 (Input_arguments::file_count_): New data member.
2840 (Command_line::number_of_input_files): Call
2841 Input_arguments::number_of_input_files.
2842 * output.cc (Output_segment_headers::Output_segment_headers):
2843 Set current size.
2844 (Output_section::Input_section::current_data_size): New function.
2845 (Output_section::Output_section): Initialize new data members.
2846 (Output_section::add_input_section): Don't do merge sections for
2847 an incremental link; allocate space from free list for an
2848 incremental update.
2849 (Output_section::add_output_section_data): Allocate space from
2850 free list for an incremental update.
2851 (Output_section::update_data_size): New function.
2852 (Output_section::set_fixed_layout): New function.
2853 (Output_section::reserve): New function.
2854 (Output_segment::set_section_addresses): Remove const.
2855 (Output_segment::set_section_list_addresses): Remove const; allocate
2856 space from free list for an incremental update.
2857 (Output_segment::set_offset): Adjust size of RELRO segment for an
2858 incremental update.
2859 * output.h (Output_data::current_data_size): Move here from
2860 child classes.
2861 (Output_data::pre_finalize_data_size): New function.
2862 (Output_data::update_data_size): New function.
2863 (Output_section_headers::update_data_size): new function.
2864 (Output_section_data_build::current_data_size): Move to Output_data.
2865 (Output_data_strtab::update_data_size): New function.
2866 (Output_section::current_data_size): Move to Output_data.
2867 (Output_section::set_fixed_layout): New function.
2868 (Output_section::has_fixed_layout): New function.
2869 (Output_section::reserve): New function.
2870 (Output_section::update_data_size): New function.
2871 (Output_section::has_fixed_layout_): New data member.
2872 (Output_section::free_list_): New data member.
2873 (Output_segment::set_section_addresses): Remove const.
2874 (Output_segment::set_section_list_addresses): Remove const.
2875 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2876 New function.
2877 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2878 New function.
2879 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2880 parameter when calling Add_symbols constructor; store argument
2881 serial number for members of a lib group.
2882 (Add_symbols::locks): Allow case where token == NULL.
2883 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2884 (Read_member::~Read_member): New function.
2885 (Read_member::is_runnable): New function.
2886 (Read_member::locks): New function.
2887 (Read_member::run): New function.
2888 (Check_script::~Check_script): New function.
2889 (Check_script::is_runnable): New function.
2890 (Check_script::locks): New function.
2891 (Check_script::run): New function.
2892 (Check_library::~Check_library): New function.
2893 (Check_library::is_runnable): New function.
2894 (Check_library::locks): New function.
2895 (Check_library::run): New function.
2896 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2897 (Add_symbols::library_): New data member.
2898 (class Read_member): New class.
2899 (class Check_script): New class.
2900 (class Check_library): New class.
2901 * reloc.cc (Read_relocs::is_runnable): Allow case where
2902 token == NULL.
2903 (Read_relocs::locks): Likewise.
2904 (Scan_relocs::locks): Likewise.
2905 (Relocate_task::locks): Likewise.
2906 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2907 to clear counters.
2908 (Sized_relobj::incremental_relocs_scan): Fix comment.
2909 (Sized_relobj::do_relocate): Pass output file offset to
2910 write_local_symbols.
2911 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2912 from class declaration.
2913 * script.cc (read_input_script): Allocate Script_info; pass
2914 argument serial number to report_script.
2915 * script.h (class Script_info): Move to incremental.h.
2916 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2917 * symtab.h (Symbol_table::add_from_incrobj): New function.
2918 (Symbol_table::set_file_offset): New function.
2919
b961d0d7
CC
29202011-04-05 Cary Coutant <ccoutant@google.com>
2921
2922 * incremental-dump.cc (dump_incremental_inputs): Change signature
2923 to take a Sized_incremental_binary; change caller. Use readers
2924 in Sized_incremental_binary.
2925 * incremental.cc
2926 (Sized_incremental_binary::find_incremental_inputs_sections):
2927 Rename do_find_incremental_inputs_sections to this.
2928 (Sized_incremental_binary::setup_readers): New function.
2929 (Sized_incremental_binary::do_check_inputs): Check
2930 has_incremental_info_ flag; move setup code to setup_readers;
2931 use input readers.
2932 (Sized_incremental_binary::do_file_is_unchanged): New function.
2933 (Sized_incremental_binary::do_get_input_reader): New function.
2934 * incremental.h (class Incremental_binary): Move to end of file.
2935 (Incremental_binary::file_is_unchanged): New function.
2936 (Incremental_binary::do_file_is_unchanged): New function.
2937 (Incremental_binary::Input_reader): New class.
2938 (Incremental_binary::get_input_reader): New function.
2939 (class Sized_incremental_binary): Move to end of file.
2940 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2941 input section reader classes.
2942 (Sized_incremental_binary::has_incremental_info): New function.
2943 (Sized_incremental_binary::inputs_reader): New function.
2944 (Sized_incremental_binary::symtab_reader): New function.
2945 (Sized_incremental_binary::relocs_reader): New function.
2946 (Sized_incremental_binary::got_plt_reader): New function.
2947 (Sized_incremental_binary::do_file_is_unchanged): New function.
2948 (Sized_incremental_binary::Sized_input_reader): New class.
2949 (Sized_incremental_binary::get_input_reader): New function.
2950 (Sized_incremental_binary::find_incremental_inputs_sections):
2951 Rename do_find_incremental_inputs_sections to this.
2952 (Sized_incremental_binary::setup_readers): New function.
2953 (Sized_incremental_binary::has_incremental_info_): New data member.
2954 (Sized_incremental_binary::inputs_reader_): New data member.
2955 (Sized_incremental_binary::symtab_reader_): New data member.
2956 (Sized_incremental_binary::relocs_reader_): New data member.
2957 (Sized_incremental_binary::got_plt_reader_): New data member.
2958 (Sized_incremental_binary::current_input_file_): New data member.
2959
a869183f
PP
29602011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2961
2962 PR gold/12640
2963 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2964 violation.
2965
29662011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2967
2968 * archive.cc (Archive::include_member): Adjust call to report_object.
2969 (Add_archive_symbols::run): Add script_info to call to
2970 report_archive_begin.
2971 (Lib_group::include_member): Adjust call to report_object.
2972 (Add_lib_group_symbols::run): Adjust call to report_object.
2973 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2974 blocks. Add object count for script input files.
2975 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2976 script_info parameter; change all callers.
2977 (Incremental_inputs::report_object): Add script_info parameter;
2978 change all callers.
2979 (Incremental_inputs::report_script): Store backpointer to
2980 incremental info entry.
2981 (Output_section_incremental_inputs::set_final_data_size): Record
2982 additional information for scripts.
2983 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2984 * incremental.h (Incremental_script_entry::add_object): New function.
2985 (Incremental_script_entry::get_object_count): New function.
2986 (Incremental_script_entry::get_object): New function.
2987 (Incremental_script_entry::objects_): New data member; adjust
2988 constructor.
2989 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2990 (Incremental_inputs::report_object): Add script_info parameter.
2991 (Incremental_inputs_reader::get_object_count): New function.
2992 (Incremental_inputs_reader::get_object_offset): New function.
2993 * options.cc (Input_arguments::add_file): Return reference to
2994 new input argument.
2995 * options.h (Input_argument::set_script_info): New function.
2996 (Input_argument::script_info): New function.
2997 (Input_argument::script_info_): New data member; adjust all
2998 constructors.
2999 (Input_file_group::add_file): Return reference to new input argument.
3000 (Input_file_lib::add_file): Likewise.
3001 (Input_arguments::add_file): Likewise.
3002 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3003 * script.cc (Parser_closure::Parser_closure): Add script_info
3004 parameter; adjust all callers.
3005 (Parser_closure::script_info): New function.
3006 (Parser_closure::script_info_): New data member.
3007 (read_input_script): Report scripts earlier to incremental info.
3008 (script_add_file): Set script_info in Input_argument.
3009 (script_add_library): Likewise.
3010 * script.h (Script_options::Script_info): Rewrite class.
3011
a869183f 30122011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3013
3014 * archive.cc (Library_base::should_include_member): Move
3015 method here from class Archive.
3016 (Archive::Archive): Initialize base class.
3017 (Archive::should_include_member): Move to base class.
3018 (Archive::do_for_all_unused_symbols): New function.
3019 (Add_archive_symbols::run): Remove redundant access to
3020 incremental_inputs.
3021 (Lib_group::Lib_group): Initialize base class.
3022 (Lib_group::do_filename): New function.
3023 (Lib_group::include_member): Pass pointer to Lib_group to
3024 report_object.
3025 (Lib_group::do_for_all_unused_symbols): New function.
3026 (Add_lib_group_symbols::run): Report archive information for
3027 incremental links.
3028 * archive.h (class Library_base): New base class.
3029 (class Archive): Derive from Library_base.
3030 (Archive::filename): Move to base class.
3031 (Archive::set_incremental_info): Likewise.
3032 (Archive::incremental_info): Likewise.
3033 (Archive::Should_include): Likewise.
3034 (Archive::should_include_member): Likewise.
3035 (Archive::Armap_entry): Remove.
3036 (Archive::Unused_symbol_iterator): Remove.
3037 (Archive::unused_symbols_begin): Remove.
3038 (Archive::unused_symbols_end): Remove.
3039 (Archive::do_filename): New function.
3040 (Archive::do_get_mtime): New function.
3041 (Archive::do_for_all_unused_symbols): New function.
3042 (Archive::task_): Move to base class.
3043 (Archive::incremental_info_): Likewise.
3044 (class Lib_group): Derive from Library_base.
3045 (Lib_group::do_filename): New function.
3046 (Lib_group::do_get_mtime): New function.
3047 (Lib_group::do_for_all_unused_symbols): New function.
3048 (Lib_group::task_): Move to base class.
3049 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3050 function.
3051 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3052 function.
3053 * incremental.cc (Incremental_inputs::report_archive_begin):
3054 Use Library_base; call library's get_mtime; add incremental inputs
3055 entry before members.
3056 (class Unused_symbol_visitor): New class.
3057 (Incremental_inputs::report_archive_end): Use Library_base; use
3058 visitor class to record unused symbols; don't add incremental inputs
3059 entry after members.
3060 (Incremental_inputs::report_object): Use Library_base.
3061 * incremental.h
3062 (Incremental_archive_entry::Incremental_archive_entry): Remove
3063 unused Archive parameter.
3064 (Incremental_inputs::report_archive_begin): Use Library_base.
3065 (Incremental_inputs::report_archive_end): Likewise.
3066 (Incremental_inputs::report_object): Likewise.
3067 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3068 function.
3069 * object.h (Object::for_all_global_symbols): New function.
3070 (Object::do_for_all_global_symbols): New function.
3071 (Sized_relobj::do_for_all_global_symbols): New function.
3072 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3073 function.
3074 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3075 function.
3076
61ab3e40
ILT
30772011-03-27 Ian Lance Taylor <iant@google.com>
3078
3079 * archive.cc (Archive::interpret_header): Return -1 if something
3080 goes wrong. Change callers accordingly.
3081
30e1f9e6
CC
30822011-03-25 Cary Coutant <ccoutant@google.com>
3083
3084 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3085 * testsuite/Makefile.in: Regenerate.
3086
9370ce59 30872011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3088
3089 * plugin.cc (get_view): New.
3090 (Plugin::load): Pass get_view to the plugin.
3091 (Plugin_manager::get_view): New.
3092
9312bb0a
ILT
30932011-03-21 Ian Lance Taylor <iant@google.com>
3094
3095 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3096 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3097
7e12ba9e
ST
30982011-03-21 Sriraman Tallam <tmsriram@google.com>
3099
3100 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3101 Change == to -eq.
3102 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3103 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3104 Change == to -eq.
3105 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3106 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3107
fd7a005d
ILT
31082011-03-14 Ian Lance Taylor <iant@google.com>
3109
3110 * script-sections.cc (Sort_output_sections::script_compare):
3111 Rename from is_before, change return type.
3112 (Sort_output_sections::operator()): Adjust accordingly.
3113
ed16fd1b
ILT
31142011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3115
3116 PR gold/12572
3117 * testsuite/odr_violation2.cc: Add comment to make all error line
3118 numbers double digits.
3119 * testsuite/debug_msg.sh: Adjust expected errors.
3120
71ff8986
ILT
31212011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3122
3123 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3124 but mark earlier ones as non-canonical
3125 (offset_to_iterator): Update search target and example
3126 (do_addr2line): Return extra lines in a vector*
3127 (format_file_lineno): Extract from do_addr2line
3128 (one_addr2line): Add vector* out-param
3129 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3130 when a lineno entry appeared last for its instruction
3131 (Dwarf_line_info): Add vector* out-param
3132 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3133 * symtab.cc (Odr_violation_compare): Include the lineno in the
3134 comparison again.
3135 (linenos_from_loc): New. Combine the canonical line for an
3136 address with its other lines.
3137 (True_if_intersect): New. Helper functor to make
3138 std::set_intersection a query.
3139 (detect_odr_violations): Compare sets of lines instead of just
3140 one line for each function. This became less deterministic, but
3141 has fewer false positives.
3142 * symtab.h: Declarations.
3143 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3144 mix an optimized and non-optimized object in the same binary
3145 (odr_violation2.so): Same.
3146 * testsuite/Makefile.in: Regenerate from Makefile.am.
3147 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3148 * testsuite/debug_msg.sh: Update line numbers and add
3149 assertions.
3150 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3151 non-optimized context.
3152 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3153 isn't inlined, and use OdrDerived in an optimized context.
3154 * testsuite/odr_header1.h: Defines OdrDerived, where
3155 optimization will change the
3156 first-instruction-in-the-destructor's file and line number.
3157 * testsuite/odr_header2.h: Defines OdrBase.
3158
a19fefdc
ILT
31592011-03-09 Ian Lance Taylor <iant@google.com>
3160
3161 * fileread.cc (File_read::clear_views): Don't delete the whole
3162 file view.
3163
ecb351e9
ILT
31642011-03-08 Ian Lance Taylor <iant@google.com>
3165
3166 PR gold/12525
3167 * fileread.cc: #include <climits>.
3168 (GOLD_IOV_MAX): Define.
3169 (File_read::read_multiple): Limit number of entries by iov_max.
3170 * fileread.h (class File_read): Always set max_readv_entries to
3171 128.
3172
b821d13c
ILT
31732011-03-07 Ian Lance Taylor <iant@google.com>
3174
3175 PR gold/12525
3176 * options.h (class General_options): Add -dy and -dn.
3177
89243142
CC
31782011-03-02 Cary Coutant <ccoutant@google.com>
3179
3180 * testsuite/script_test_9.t: Add TLS segment.
3181
d0773f31
ILT
31822011-03-02 Simon Baldwin <simonb@google.com>
3183
3184 * configure.ac: Add check for gnu_indirect_function support in
3185 the toolchain building binutils.
3186 * configure: Rebuild.
3187
9370ce59 31882011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3189
3190 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3191 plugin only symbols.
3192 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3193 in plugin files as not needed in the symbol table.
3194
4cf7a849
ST
31952011-02-11 Sriraman Tallam <tmsriram@google.com>
3196
3197 * output.cc (Output_section::add_input_section): Delay fill
3198 generation for section ordering.
3199
b578bd7d
ILT
32002011-02-09 Ian Lance Taylor <iant@google.com>
3201
3202 PR gold/12316
3203 * object.h (class Sized_relobj): Remove clear_local_symbols.
3204 * reloc.cc (Sized_relobj::do_relocate): Don't call
3205 clear_local_symbols.
3206
9370ce59 32072011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3208
3209 * plugin.cc (is_visible_from_outside): Return true for symbols
3210 in the -u option.
3211
55382fb7
ILT
32122011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3213
3214 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3215 filename.
3216
4e271fff
ST
32172011-02-02 Sriraman Tallam <tmsriram@google.com>
3218
3219 * icf.h (is_section_foldable_candidate): Change type of parameter
3220 to std::string.
3221 * icf.cc (Icf::find_identical_sections): Change type of local variable
3222 section_name to be std::string.
3223 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3224
d433c3ac
ILT
32252011-01-25 Ian Lance Taylor <iant@google.com>
3226
3227 * script.cc (script_add_extern): Rewrite to use
3228 add_symbol_reference.
3229
880473a6
DK
32302011-01-25 Doug Kwan <dougkwan@google.com>
3231
d433c3ac 3232 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3233
f30f86fa
ILT
32342011-01-24 Ian Lance Taylor <iant@google.com>
3235
3236 * options.h (class General_options): Accept
3237 --no-detect-odr-violations.
3238
8e51a0b9
ILT
32392011-01-24 Ian Lance Taylor <iant@google.com>
3240
3241 * version.cc (version_string): Bump to 1.11.
3242
0f3b89d8
ILT
32432011-01-24 Ian Lance Taylor <iant@google.com>
3244
3245 * plugin.cc (class Plugin_rescan): Define new class.
3246 (Plugin_manager::claim_file): Set any_claimed_.
3247 (Plugin_manager::save_archive): New function.
3248 (Plugin_manager::save_input_group): New function.
3249 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3250 necessary.
3251 (Plugin_manager::new_undefined_symbol): New function.
3252 (Plugin_manager::rescan): New function.
3253 (Plugin_manager::rescannable_defines): New function.
3254 (Plugin_manager::add_input_file): Set any_added_.
3255 * plugin.h (class Plugin_manager): define new fields rescannable_,
3256 undefined_symbols_, any_claimed_, and any_added_. Declare
3257 Plugin_rescan as friend. Declare new functions.
3258 (Plugin_manager::Rescannable): Define type.
3259 (Plugin_manager::Rescannable_list): Define type.
3260 (Plugin_manager::Undefined_symbol_list): Define type.
3261 (Plugin_manager::Plugin_manager): Initialize new fields.
3262 * archive.cc (Archive::defines_symbol): New function.
3263 (Add_archive_symbols::run): Pass archive to plugins if any.
3264 * archive.h (class Archive): Declare defines_symbol.
3265 * readsyms.cc (Input_group::~Input_group): New function.
3266 (Finish_group::run): Pass input_group to plugins if any.
3267 * readsyms.h (class Input_group): Declare destructor.
3268 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3269 any.
3270
3bb951e5
ILT
32712011-01-10 Ian Lance Taylor <iant@google.com>
3272
3273 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3274 section as relro.
3275 (Layout::set_segment_offsets): Reset increase_relro before calling
3276 set_section_addresses a second time.
3277
0aa45fac
CC
32782011-01-04 Cary Coutant <ccoutant@google.com>
3279
3280 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3281 sections before NOBITS sections.
3282
0db46eb4
L
32832011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3284
3285 * version.cc (print_version): Update copyright to 2011.
3286
829c9745
CC
32872010-12-23 Cary Coutant <ccoutant@google.com>
3288
3289 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3290 of OS to this->add. Add OD parameter to second form of the function.
3291
7500420b
ILT
32922010-12-20 Ian Lance Taylor <iant@google.com>
3293
3294 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3295 second of two consecutive entries with same offset.
3296
f8e9a930
RW
32972010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3298
3299 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3300 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3301 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3302 to avoid unneeded links against $(LDADD).
3303 * testsuite/Makefile.in: Regenerate.
3304
2fbb4320
ILT
33052010-12-15 Ian Lance Taylor <iant@google.com>
3306
3307 PR gold/12324
3308 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3309 for R_X86_64_32 and R_X86_64_PC32.
3310 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3311 ver_matching_def_pic.o.
3312 (ver_matching_def_pic.o): New target.
3313
fedb228d
RW
33142010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3315
3316 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3317 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3318 Move definition before File_read::View member definitions.
3319 (File_read::View::~View): Initialize and hold lock before
3320 updating current_mapped_bytes.
3321
9b547ce6
RW
33222010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3323
3324 * dwarf_reader.cc: Remove outdated comment.
3325 * gold-threads.cc: Fix typo in error message.
3326 * archive.cc: Fix typos in comments.
3327 * archive.h: Likewise.
3328 * arm-reloc-property.cc: Likewise.
3329 * arm-reloc-property.h: Likewise.
3330 * arm-reloc.def: Likewise.
3331 * arm.cc: Likewise.
3332 * attributes.h: Likewise.
3333 * cref.cc: Likewise.
3334 * ehframe.cc: Likewise.
3335 * fileread.h: Likewise.
3336 * gold.h: Likewise.
3337 * i386.cc: Likewise.
3338 * icf.cc: Likewise.
3339 * incremental.h: Likewise.
3340 * int_encoding.cc: Likewise.
3341 * layout.h: Likewise.
3342 * main.cc: Likewise.
3343 * merge.h: Likewise.
3344 * object.cc: Likewise.
3345 * object.h: Likewise.
3346 * options.cc: Likewise.
3347 * readsyms.cc: Likewise.
3348 * reduced_debug_output.cc: Likewise.
3349 * reloc.cc: Likewise.
3350 * script-sections.cc: Likewise.
3351 * sparc.cc: Likewise.
3352 * symtab.h: Likewise.
3353 * target-reloc.h: Likewise.
3354 * target.cc: Likewise.
3355 * target.h: Likewise.
3356 * timer.cc: Likewise.
3357 * timer.h: Likewise.
3358 * x86_64.cc: Likewise.
3359
83e17bd5
CC
33602010-12-09 Cary Coutant <ccoutant@google.com>
3361
3362 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3363 stack.
3364 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3365 parameter; change all callers.
3366 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3367 * options.h (warn_execstack): New option.
3368
017257f8
DK
33692010-12-07 Doug Kwan <dougkwan@google.com>
3370
3371 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3372 like function call relocations.
3373
c20cbc06
ILT
33742010-12-07 Ian Lance Taylor <iant@google.com>
3375
3376 * archive.cc (Archive::get_elf_object_for_member): Permit
3377 punconfigured to be NULL.
3378 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3379 (Archive::include_member): Pass NULL to get_elf_object_for_member
3380 if we searched for the archive and this is the first included
3381 object.
3382
4dbfafcc
ILT
33832010-12-01 Ian Lance Taylor <iant@google.com>
3384
3385 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3386 track_relocs_type_ field.
3387 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3388 Set track_relocs_type_.
3389 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3390 contents when using RELA relocs.
3391 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3392 reloc_map_.
3393 * reloc.cc (Track_relocs::next_addend): New function.
3394 * reloc.h (class Track_relocs): Declare next_addend.
3395
e5e19edd
ILT
33962010-12-01 Ian Lance Taylor <iant@google.com>
3397
3398 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3399 virtual destructor.
3400
9a5ce24c
ILT
34012010-12-01 Ian Lance Taylor <iant@google.com>
3402
3403 * README: Update compilers known to work and fail.
3404
c7791212
NC
34052010-11-23 Matthias Klose <doko@ubuntu.com>
3406
3407 * configure.in: For --enable-gold, handle value `default' instead of
3408 `both*'. Always install ld as ld.bfd, install as ld if gold is
3409 not the default.
3410 * configure: Regenerate.
3411
0ad220c9
DK
34122010-11-18 Doug Kwan <dougkwan@google.com>
3413
3414 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3415 and right_alignment to be zero. Store result alignment only if it is
3416 greater than existing alignment.
3417
ab8056e0
CC
34182010-11-16 Cary Coutant <ccoutant@google.com>
3419
3420 PR gold/12220
3421 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3422 Check for ".zdebug_line".
3423
fd064a5b
CC
34242010-11-16 Doug Kwan <dougkwan@google.com>
3425 Cary Coutant <ccoutant@google.com>
3426
3427 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3428 by reference; adjust all callers.
3429 * output.cc (Output_segment::set_section_addresses): Adjust references
3430 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3431 list is empty.
3432 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3433 end at page boundary.
3434
6fc6ea19
CC
34352010-11-16 Cary Coutant <ccoutant@google.com>
3436
3437 PR gold/12220
3438 * layout.cc (Layout::choose_output_section): Transform names of
3439 compressed sections even when using a script with a SECTIONS clause.
3440 (Layout::output_section_name): Remove code to transform
3441 compressed debug section names.
3442 * output.cc (Output_section::add_input_section): Use uncompressed
3443 section size when tracking input sections.
3444
95a2c8d6
RS
34452010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3446
3447 * symtab.h (Symbol::NON_PIC_REF): Remove.
3448 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3449 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3450 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3451 (Symbol::use_plt_offset): Take a flags argument and pass it
3452 directly to needs_dynamic_reloc. Restrict check for undefined
3453 weak symbols to function calls.
3454 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3455 (Target_arm::Scan::global): Use it.
3456 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3457 (Target_arm::Relocate::relocate): Likewise.
3458 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3459 parameter with an r_type parameter. Use get_reference_flags
3460 to get the flags.
3461 (Target_arm::Relocate::relocate): Update accordingly.
3462 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3463 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3464 (Target_i386::Scan::global): Likewise.
3465 (Target_i386::Relocate::relocate): Likewise.
3466 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3467 parameter with an r_type parameter. Use get_reference_flags
3468 to get the flags.
3469 (Target_i386::Relocate::relocate): Update accordingly.
3470 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3471 (Target_powerpc::Scan::global): Use it.
3472 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3473 (Target_powerpc::Relocate::relocate): Likewise.
3474 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3475 (Target_sparc::Scan::global): Use it.
3476 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3477 (Target_sparc::Relocate::relocate): Likewise.
3478 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3479 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3480 (Target_x86_64::Scan::global): Likewise.
3481 (Target_x86_64::Relocate::relocate): Likewise.
3482
f625ae50
DK
34832010-11-08 Doug Kwan <dougkwan@google.com>
3484 Cary Coutant <ccoutant@google.com>
3485
3486 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3487 (Arm_exidx_merge_section::section_contents_): New data member.
3488 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3489 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3490 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3491 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3492 in parameters instead of calling Object::section_contents without
3493 locking.
3494 (Arm_output_section::group_section): New parameter TASK. Pass it
3495 to callees that need locking objects.
3496 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3497 to lock EXIDX input sections. Fix a formatting issue. Call
3498 Arm_exidx_merged_section::build_contents to create merged section
3499 contents.
3500 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3501 to lock object of stub table owner.
3502 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3503 TEXT_SIZE to initialize data member TEXT_SIZE_.
3504 (Arm_exidx_input_section::addralign): Fix typo in comment.
3505 (Arm_exidx_input_section::text_size): New method.
3506 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3507 that require locking objects. Lock objects before scanning for stubs
3508 and updating local symbols.
3509 (Arm_input_section<big_endian>::init): Copy contents of original
3510 input section.
3511 (Arm_input_section<big_endian>::do_write): Use saved contents of
3512 original input section instead of calling Object::section_contents
3513 without locking.
3514 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3515 size without calling Object::section_size().
3516 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3517 for size. Allocate a buffer for merged EXIDX entries.
3518 (Arm_exidx_merged_section::build_contents): New method.
3519 (Arm_exidx_merged_section::do_write): Move merge section contents
3520 building code to Arm_exidx_merged_section::build_contetns. Write
3521 out contetns in buffer instead of building it on the fly.
3522 (Arm_relobj::make_exidx_input_section): Also pass text section size
3523 to Arm_exidx_input_section constructor.
3524 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3525 (Arm_dynobj::do_read_symbols): Fix memory leak.
3526 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3527 * target.h: (class Task): Add forward declaration.
3528 (Target::relax): Add new parameter TASK and pass it to
3529 Target::do_relax().
3530 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3531
5f9bcf58
CC
35322010-11-05 Cary Coutant <ccoutant@google.com>
3533
3534 PR gold/10708
3535 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3536 object when reading from the file.
3537 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3538 second layout pass.
3539 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3540 when reading section contents.
3541 (get_section_contents): Likewise.
3542 (icf::find_identical_sections): Likewise.
3543 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3544 object when reading from the file.
3545 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3546 the object when doing deferred section layout.
3547
e597fa08
NC
35482010-11-03 Nick Clifton <nickc@redhat.com>
3549
3550 PR gold/12001
3551 * script.h (class Symbol_assignment: name): New member. Returns
3552 the name of the symbol.
3553 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3554 Returns true if the given symbol name is on the list of
3555 assignments wating to be processed.
3556 * archive.cc (should_incldue_member): If the symbol is undefined,
3557 check to see if it is on the list of symbols pending assignment.
3558
3f9a3278
ILT
35592010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3560
3561 * script-sections.cc (Script_sections::find_memory_region): Check
3562 for a NULL output section pointer.
3563
d06fb4d1
DK
35642010-10-29 Doug Kwan <dougkwan@google.com>
3565
3566 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3567 Output_section::add_relaxed_input_section.
3568 * output.cc (Output_section::add_relaxed_input_section): Add new
3569 arguments LAYOUT and NAME. Set section order index.
3570 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3571 Copy section order index.
3572 * output.h (Output_section::add_relaxed_input_section): Add new
3573 arguments LAYOUT and NAME.
3574
90e24de5
ILT
35752010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3576
3577 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3578 NATIVE_OR_CROSS_LINKER.
3579 * testsuite/Makefile.in: Regenerate.
3580
c9484ea5
DK
35812010-10-20 Doug Kwan <dougkwan@google.com>
3582
3583 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3584 without SHF_LINK_ORDER flags.
3585 * layout.cc (Layout::choose_output_section): Do not filter
3586 SHF_LINK_ORDER flag in a relocatable link.
3587
5bc2f5be
CC
35882010-10-17 Cary Coutant <ccoutant@google.com>
3589
3590 * output.h (Output_segment::set_section_addresses): Change function
3591 signature. Update all callers.
3592 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3593 sections.
3594 (Output_segment::set_section_addresses): Align after last TLS
3595 section. Add padding before last relro section instead of after.
3596
0c91cf04
DK
35972010-10-17 Doug Kwan <dougkwan@google.com>
3598
3599 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3600 GOT output section to be writable.
3601
8c21d9d3
CC
36022010-10-14 Cary Coutant <ccoutant@google.com>
3603
3604 * debug.h (DEBUG_INCREMENTAL): New flag.
3605 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3606 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3607 mode.
3608 * incremental.cc (report_command_line): Ignore all forms of
3609 --incremental.
3610 * layout.cc (Layout::Layout): Check parameters for incremental link
3611 mode.
3612 * options.cc (General_options::parse_incremental): New function.
3613 (General_options::parse_no_incremental): New function.
3614 (General_options::parse_incremental_full): New function.
3615 (General_options::parse_incremental_update): New function.
3616 (General_options::incremental_mode_): New data member.
3617 (General_options::finalize): Check incremental_mode_.
3618 * options.h (General_options): Update help text for --incremental.
3619 Add --no-incremental, --incremental-full, --incremental-update.
3620 (General_options::Incremental_mode): New enum type.
3621 (General_options::incremental_mode): New function.
3622 (General_options::incremental_mode_): New data member.
3623 * parameters.cc (Parameters::incremental_mode_): New data member.
3624 (Parameters::set_options): Set incremental_mode_.
3625 (Parameters::set_incremental_full): New function.
3626 (Parameters::incremental): New function.
3627 (Parameters::incremental_update): New function.
3628 (set_parameters_incremental_full): New function.
3629 * parameters.h (Parameters::set_incremental_full): New function.
3630 (Parameters::incremental): New function.
3631 (Parameters::incremental_update): New function.
3632 (Parameters::incremental_mode_): New data member.
3633 (set_parameters_incremental_full): New function.
3634 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3635 incremental link mode.
3636 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3637 (Sized_relobj::do_relocate_sections): Likewise.
3638 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3639 option.
3640 * testsuite/Makefile.in: Regenerate.
3641 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3642
bb32aa18 36432010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3644
3645 * script-sections.h (class Script_sections): Make
3646 Sections_elements typedef public.
3647 * script-sections.cc (class Sort_output_sections): Add elements_
3648 field. Add constructor which sets it; change all callers.
3649 (Sort_output_sections::is_before): New function.
3650 (Sort_output_sections::operator()): Call is_before.
3651 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3652 conditional.
3653 * testsuite/script_test_10.sh: New test. Test script section
3654 order.
3655 * testsuite/script_test_10.t: Likewise.
3656 * testsuite/script_test_10.s: Likewise.
3657 * testsuite/Makefile.am: Wrap the cross linker tests and the
3658 common tests into NATIVE_OR_CROSS_LINKER.
3659 (check_SCRIPTS): Add script_test_10.sh.
3660 (check_DATA): Add script_test_10.stdout.
3661 (script_test_10.o, script_test_10): New targets.
3662 (script_test_10.stdout): New target.
3663 * configure, testsuite/Makefile.in: Regenerate.
3664
3cef7179
ILT
36652010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3666
3667 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3668 error for the deprecated relocations.
3669 (Target_arm::Scan::global): Likewise.
3670 (Target_arm::Relocate::relocate): Likewise.
3671
7411e9a8
RS
36722010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3673
3674 * fileread.cc (Input_file::find_file): Initialize *found_name
3675 and *namep when using the fallback search for case 4.
3676
6a9da32a
CC
36772010-10-11 Cary Coutant <ccoutant@google.com>
3678
3679 * options.h (class General_options): Redefine -z lazy as an alias for
3680 the negation of -z now.
3681
ac897c20
ILT
36822010-10-11 Ian Lance Taylor <iant@google.com>
3683
3684 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3685 binding.
3686
ea5cae92
NC
36872010-10-06 Nick Clifton <nickc@redhat.com>
3688
3689 * script-sections.cc(class Memory_region): Remove
3690 current_lma_offset_ field. Rename current_vma_offset_ to
3691 current_offset_. Add last_section_ field.
3692 (Memory_region::get_current_vma_address): Rename to
3693 get_current_address.
3694 (Memory_region::get_current_lma_address): Delete.
3695 (Memory_region::increment_vma_offset): Rename to
3696 increment_offset.
3697 (Memory_region::increment_lma_offset): Delete.
3698 (Memory_region::attributes_compatible): New method. Returns
3699 true if the provided section is compatible with the region.
3700 (Memory_region::get_last_section): New method. Returns the last
3701 section to use the region.
3702 (Memory_region::set_last_section): New method. Stores the last
3703 section to use the region.
3704 (Script_sections::block_in_region): New method. Returns true if
3705 a block of memory is contained within a region.
3706 (Script_sections::find_memory_region): New method. Locates a
3707 memory region to be used to set a VMA or LMA address.
3708 (Output_section_definition::set_section_addresses): Add code to
3709 check for addresses set by memory regions.
3710 (Output_segment::set_section_addresses): Remove memory region
3711 walking code.
3712 (Script_sections::create_segment): Add a warning if a header
3713 segment is created outside of any region.
3714 * script-sections.h (class Script_sections): Add prototypes for
3715 find_memory_region and block_in_region methods.
3716 * testsuite/memory_test.s: Use .long instead of .word.
3717 * testsuite/memory_test.t: Add some more output sections.
3718 * testsuite/memory_test.sh: Update expected output.
3719
a9bfd952
DK
37202010-10-02 Doug Kwan <dougkwan@google.com>
3721
3722 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3723 defintion to symtab.h
3724 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3725 declaration to defintion.
3726
bacff3ab
NC
37272010-10-01 Nick Clifton <nickc@redhat.com>
3728
3729 * expression.cc (eval): Replace dummy argument with NULL.
3730 (eval_maybe_dot): Check for a NULL result section pointer.
3731 (Symbol_expression::value): Likewise.
3732 (Dot_expression::value): Likewise.
3733 (BINARY_EXPRESSION): Likewise.
3734 (Max_expression::value): Likewise.
3735 (Min_expression::value): Likewise.
3736 (Absolute_expression::value): Likewise.
3737 (Addr_expression::value_from_output_section): Likewise.
3738 (Loaddddr_expression::value_from_output_section): Likewise.
3739 (Segment_start_expression::value): Likewise.
3740 * script-sections.cc
3741 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3742 argument with NULL.
3743 (Sections_elememt_dot_assignment::set_section_addresses):
3744 Likewise.
3745 (Output_data_expression::do_write_to_buffer): Likewise.
3746 (Output_section_definition::finalize_symbols): Likewise.
3747 (Output_section_definition::set_section_addresses): Likewise.
3748
f81bc8b5
DK
37492010-09-30 Doug Kwan <dougkwan@google.com>
3750
3751 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3752
c95e9f27
ST
37532010-09-28 Sriraman Tallam <tmsriram@google.com>
3754
3755 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 3756 function.
c95e9f27
ST
3757 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3758 virtual function.
3759 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3760 virtual function.
3761 * icf.cc (get_section_contents): Inline merge sections only when
3762 target allows it.
3763
3cac54d2
RW
37642010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3765
3766 * configure: Regenerate.
3767
2904037a
ILT
37682010-09-17 Ian Lance Taylor <iant@google.com>
3769
3770 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
3771 * testsuite/Makefile.am (memory_test.o): New target.
3772 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3773 memory_test.t.
3774 * testsuite/Makefile.in: Rebuild.
2904037a 3775
bca7fb63
DK
37762010-09-17 Doug Kwan <dougkwan@google.com>
3777
3778 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3779 defintion if relocation uses GOT entries of the symbol.
3780 * testsuite/icf_safe_test.sh: Fix test.
3781 * testsuite/icf_safe_so_test.sh: Fix test.
3782
4ef28648
CC
37832010-09-16 Cary Coutant <ccoutant@google.com>
3784
3785 * script_sections.cc (class Memory_region): Remove "NULL" from
3786 vector initializations.
3787
793990de
CC
37882010-09-15 Cary Coutant <ccoutant@google.com>
3789
3790 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3791 Resolve forwarding symbols.
3792
81e015e2
DK
37932010-09-15 Doug Kwan <dougkwan@google.com>
3794
3795 * gold/testsuite/script_test_3.t: Add ARM special sections.
3796 * gold/testsuite/script_test_4.t: Same.
3797 * gold/testsuite/script_test_5.t: Same.
3798 * gold/testsuite/script_test_6.t: Same.
3799 * gold/testsuite/script_test_7.t: Same.
3800 * gold/testsuite/script_test_7.t: Same.
3801 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3802
36171d64
CC
38032010-09-14 Cary Coutant <ccoutant@google.com>
3804
3805 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3806 (Target_x86_64::Relocate::relocate_tls): Replace check for
3807 saw_tls_block_reloc_ with test for executable section.
3808
d89051bd
CC
38092010-09-12 Cary Coutant <ccoutant@google.com>
3810
3811 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3812 position-independent executables to shared libraries need dynamic
3813 relocations.
3814 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3815 position-independent executables.
3816 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3817 * testsuite/Makefile.in: Regenerate.
3818
fca41f0f
NC
38192010-09-10 Nick Clifton <nickc@redhat.com>
3820
3821 PR gold/11997
3822 * testsuite/memory_test.t: Discard any sections that are not
3823 needed.
3824
6695e4b3
L
38252010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3826
3827 PR gold/11996
3828 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3829 "This::" to work around a bug in gcc 4.2.
3830
3831 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3832
0f72bf6f
RÁE
38332010-09-09 Rafael Espindola <espindola@google.com>
3834
3835 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3836 sections with different PF_X flags in the same segment.
3837 (Layout::find_first_load_seg): Search all segments to find the first
3838 one.
3839 * options.h (rosegment): New.
3840
38412010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3842
05a79166 3843 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3844
aa98ff75
DK
38452010-09-08 Doug Kwan <dougkwan@google.com>
3846
3847 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3848 (Arm_relobj::do_relocate_sections): Add new parameter for output
3849 file to match the parent.
3850 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3851 of local symbols instead of input values. Update code to track
3852 changes in gold::relocate_section.
3853 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3854 (Sized_relobj::compute_final_local_value_internal): New methods.
3855 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3856 body into private version of Sized_relobj::compute_final_local_value.
3857 Call the inline method.
3858 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3859 merged symbol value if there is one.
3860 (Symbol_value::has_output_value): New method defintiion.
3861 (Sized_relobj::Compute_final_local_value_status): New enum type.
3862 (Sized_relobj::compute_final_local_value): New methods.
3863 (Sized_relobj::compute_final_local_value_internal): New methods.
3864 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3865 and arm_cortex_a8.sh.
3866 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3867 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3868 New tests.
3869 * Makefile.in: Regenerate.
3870 * testsuite/arm_bl_out_of_range.s: Update test.
3871 * testsuite/thumb_bl_out_of_range.s: Ditto.
3872 * testsuite/thumb_blx_out_of_range.s: Ditto.
3873 * testsuite/arm_branch_out_of_range.sh: New file.
3874 * testsuite/arm_cortex_a8.sh: Ditto.
3875 * testsuite/arm_cortex_a8_b.s: Ditto.
3876 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3877 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3878 * testsuite/arm_cortex_a8_bl.s: Ditto.
3879 * testsuite/arm_cortex_a8_blx.s: Ditto.
3880 * testsuite/arm_cortex_a8_local.s: Ditto.
3881 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3882 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3883
05a79166
L
38842010-09-08 Rafael Espindola <espindola@google.com>
3885
3886 * Makefile.am (memory_test.stdout): Run readelf with -W.
3887 * Makefile.in: Regenerate.
3888 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3889 64 bit output.
3890
33dbc701
RÁE
38912010-09-08 Rafael Espindola <espindola@google.com>
3892
3893 * script-sections.cc (Script_sections::add_memory_region): Convert
3894 field precision to int.
3895 * script.cc (script_set_section_region, script_set_section_region):
3896 Convert field precision to int.
3897
731ca54a
RÁE
38982010-09-08 Rafael Espindola <espindola@google.com>
3899
3900 * arm.cc (do_finalize_sections): Create the __exidx_start and
3901 __exdix_end symbols even when the section is missing.
3902
7f8cd844
NC
39032010-09-08 Nick Clifton <nickc@redhat.com>
3904
3905 * README: Remove claim that MEMORY is not supported.
3906 * expression.cc (script_exp_function_origin)
3907 (script_exp_function_length): Move from here to ...
3908 * script.cc: ... here.
3909 (script_set_section_region, script_add_memory)
3910 (script_parse_memory_attr, script_include_directive): New
3911 functions.
3912 * script-sections.cc
3913 (class Memory_region): New class.
3914 (class Output_section_definition): Add set_memory_region,
3915 set_section_vma, set_section_lma and get_section_name methods.
3916 (class Script_Sections): Add add_memory_region,
3917 find_memory_region, find_memory_region_origin,
3918 find_memory_region_length and set_memory_region methods.
3919 Have set_section_addresses method walk the list of set memory
3920 regions.
3921 Extend the print methos to display memory regions.
3922 * script-sections.h: Add prototypes for new methods.
3923 Add enum for MEMORY region attributes.
3924 * yyscript.y: Add support for parsing MEMORY regions.
3925 * script-c.h: Add prototypes for new functions.
3926 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3927 * testsuite/Makefile.in: Regenerate.
3928 * testsuite/memory_test.sh: New script.
3929 * testsuite/memory_test.s: New assembler source file.
3930 * testsuite/memory_test.t: New linker script.
3931
a4649286
DK
39322010-08-27 Doug Kwan <dougkwan@google.com>
3933
3934 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3935 reference override an existing dynamic weak reference.
3936 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3937 * testsuite/Makefile.in: Regenerate.
3938 * testsuite/dyn_weak_ref.sh: New file.
3939 * testsuite/dyn_weak_ref_1.c: Ditto.
3940 * testsuite/dyn_weak_ref_2.c: Ditto.
3941
b56648ad
ILT
39422010-08-27 Ian Lance Taylor <iant@google.com>
3943
3944 * incremental.h (class Incremental_input_entry): Add virtual
3945 destructor.
3946
809313cb
ILT
39472010-08-27 Ian Lance Taylor <iant@google.com>
3948
3949 * testsuite/start_lib_test_3.c: Mark t3 as used.
3950
11e32464
NC
39512010-08-27 Nick Clifton <nickc@redhat.com>
3952
3953 * options.cc (version_script): Fix small typo in previous
3954 whitespace tidyup.
3955
ca09d69a
NC
39562010-08-25 Nick Clifton <nickc@redhat.com>
3957
3958 * archive.cc: Formatting fixes: Remove whitespace between
3959 typename and following asterisk. Remove whitespace between
3960 function name and opening parenthesis.
3961 * archive.h: Likewise.
3962 * arm.cc: Likewise.
3963 * attributes.cc: Likewise.
3964 * attributes.h: Likewise.
3965 * common.cc: Likewise.
3966 * copy-relocs.cc: Likewise.
3967 * dirsearch.h: Likewise.
3968 * dynobj.cc: Likewise.
3969 * ehframe.cc: Likewise.
3970 * ehframe.h: Likewise.
3971 * expression.cc: Likewise.
3972 * fileread.cc: Likewise.
3973 * fileread.h: Likewise.
3974 * gc.h: Likewise.
3975 * gold-threads.cc: Likewise.
3976 * gold.cc: Likewise.
3977 * i386.cc: Likewise.
3978 * icf.h: Likewise.
3979 * incremental-dump.cc: Likewise.
3980 * incremental.cc: Likewise.
3981 * layout.cc: Likewise.
3982 * layout.h: Likewise.
3983 * main.cc: Likewise.
3984 * merge.cc: Likewise.
3985 * merge.h: Likewise.
3986 * object.cc: Likewise.
3987 * object.h: Likewise.
3988 * options.cc: Likewise.
3989 * options.h: Likewise.
3990 * output.cc: Likewise.
3991 * output.h: Likewise.
3992 * plugin.cc: Likewise.
3993 * plugin.h: Likewise.
3994 * powerpc.cc: Likewise.
3995 * reloc.cc: Likewise.
3996 * script-c.h: Likewise.
3997 * script-sections.cc: Likewise.
3998 * script.cc: Likewise.
3999 * stringpool.cc: Likewise.
4000 * symtab.cc: Likewise.
4001 * symtab.h: Likewise.
4002 * target.cc: Likewise.
4003 * timer.cc: Likewise.
4004 * timer.h: Likewise.
4005 * version.cc: Likewise.
4006 * x86_64.cc: Likewise.
4007
b8fa8750
NC
40082010-08-24 Nick Clifton <nickc@redhat.com>
4009
4010 PR 11899
4011 * layout.cc (segment_precedes): Sort segments by their physical
4012 addresses, if they have been set.
4013
9919d93b
CC
40142010-08-23 Cary Coutant <ccoutant@google.com>
4015
4016 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4017 symbols data.
4018 (Lib_group::include_member): Unlock object after deleting its
4019 symbols data.
4020 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4021 the bug fixed here.
4022
97b4be1c
CC
40232010-08-19 Neil Vachharajani <nvachhar@google.com>
4024 Cary Coutant <ccoutant@google.com>
4025
4026 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4027 constructor, and set_blocker.
4028 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4029 readsyms_blocker_.
4030 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4031 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4032 * testsuite/Makefile.am (start_lib_test): New test case.
4033 * testsuite/Makefile.in: Regenerate.
4034 * testsuite/start_lib_test_main.c: New file.
4035 * testsuite/start_lib_test_1.c: New file.
4036 * testsuite/start_lib_test_2.c: New file.
4037 * testsuite/start_lib_test_3.c: New file.
4038
dd0b1884
ILT
40392010-08-19 Ian Lance Taylor <iant@google.com>
4040
4041 * Makefile.in: Rebuild with automake 1.11.1.
4042 * aclocal.m4: Likewise.
4043 * testsuite/Makefile.in: Likewise.
4044
7223e9ca
ILT
40452010-08-19 Ian Lance Taylor <iant@google.com>
4046
4047 PR 10893
4048 * i386.cc (class Output_data_plt_i386): Update declarations.
4049 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4050 local_ifuncs_ fields.
4051 (Target_i386::do_plt_section_for_global): New function.
4052 (Target_i386::do_plt_section_for_local): New function.
4053 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4054 parameter; change all callers. Initialize global_ifuncs_ and
4055 local_ifuncs_. If doing a static link define __rel_iplt_start and
4056 __rel_iplt_end.
4057 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4058 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4059 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4060 symbols.
4061 (Target_i386::make_plt_section): New function, broken out of
4062 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4063 (Target_i386::make_plt_entry): Call make_plt_section.
4064 (Target_i386::make_local_ifunc_plt_entry): New function.
4065 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4066 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4067 R_386_IRELATIVE to switch.
4068 (Target_i386::Scan::global): Likewise.
4069 (Target_i386::Relocate::relocate): Likewise.
4070 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4071 switch.
4072 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4073 (Target_x86_64::do_plt_section_for_global): New function.
4074 (Target_x86_64::do_plt_section_for_local): New function.
4075 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4076 parameter; change all callers. If doing a static link define
4077 __rela_iplt_start and __rela_iplt_end.
4078 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4079 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4080 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4081 to point to .plt.
4082 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4083 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4084 switch.
4085 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4086 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4087 R_X86_64_IRELATIVE to switch.
4088 (Target_x86_64::Scan::global): Likewise.
4089 (Target_x86_64::Relocate::relocate): Likewise.
4090 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4091 switch.
4092 * target.h (class Target): Add plt_section_for_global and
4093 plt_section_for_local functions. Add do_plt_section_for_global
4094 and do_plt_section_for_local virtual functions.
4095 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4096 clarifying comments.
4097 (Symbol::use_plt_offset): Handle IFUNC symbol.
4098 * object.cc (Sized_relobj::Sized_relobj): Initialize
4099 local_plt_offsets_.
4100 (Sized_relobj::local_has_plt_offset): New function.
4101 (Sized_relobj::local_plt_offset): New function.
4102 (Sized_relobj::set_local_plt_offset): New function.
4103 (Sized_relobj::do_count): Handle IFUNC symbol.
4104 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4105 a bit away from input_shndx_ field. Add set_is_func_symbol and
4106 is_ifunc_symbol functions.
4107 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4108 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4109 local_plt_offsets_ field.
4110 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4111 * output.h (class Output_section_data): Add non-const
4112 output_section function.
4113 (class Output_data_got): Update declarations.
4114 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4115 Add use_plt_offset parameter to global and local constructors.
4116 Change all callers. Change local_sym_index_ field to 31 bits.
4117 Change GSYM_CODE and CONSTANT_CODE accordingly.
4118 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4119 doing a static link don't set sh_link field.
4120 (Output_data_got::Got_entry::write): Use PLT offset if
4121 appropriate.
4122 (Output_data_got::add_global_plt): New function.
4123 (Output_data_got::add_local_plt): New function.
4124 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4125 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4126 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4127 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4128 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4129 IFUNC conditional.
4130 * testsuite/ifunc-sel.h: New file.
4131 * testsuite/ifuncmain1.c: New file.
4132 * testsuite/ifuncmain1vis.c: New file.
4133 * testsuite/ifuncmod1.c: New file.
4134 * testsuite/ifuncdep2.c: New file.
4135 * testsuite/ifuncmain2.c: New file.
4136 * testsuite/ifuncmain3.c: New file.
4137 * testsuite/ifuncmod3.c: New file.
4138 * testsuite/ifuncmain4.c: New file.
4139 * testsuite/ifuncmain5.c: New file.
4140 * testsuite/ifuncmod5.c: New file.
4141 * testsuite/ifuncmain6pie.c: New file.
4142 * testsuite/ifuncmod6.c: New file.
4143 * testsuite/ifuncmain7.c: New file.
4144 * configure, testsuite/Makefile.in: Rebuild.
4145
56f75c03
ILT
41462010-08-18 Ian Lance Taylor <iant@google.com>
4147
4148 * incremental.cc
4149 (Output_section_incremental_inputs::write_input_files): Add cast
4150 to avoid signed/unsigned comparison warning.
4151 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4152
55455f89
CC
41532010-08-12 Cary Coutant <ccoutant@google.com>
4154
4155 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4156
e2054bcb
ILT
41572010-08-13 Ian Lance Taylor <iant@google.com>
4158
4159 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4160
74f67560
DK
41612010-08-12 Cary Coutant <ccoutant@google.com>
4162 Doug Kwan <dougkwan@google.com>
4163
4164 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4165 defintion overrides non-weak undef, remember that the original undef
4166 is not weak.
4167 * symtab.cc (Symbol_table::sized_write_global): For undef without
4168 an original weak binding, set binding to global in output.
4169 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4170 * testsuite/Makefile.in: Regenerate.
4171 * testsuite/strong_ref_weak_def.sh: New file.
4172 * testsuite/strong_ref_weak_def_1.c: Ditto.
4173 * testsuite/strong_ref_weak_def_2.c: Ditto.
4174
d1238d12
CC
41752010-08-12 Cary Coutant <ccoutant@google.com>
4176
4177 * testsuite/incremental_test.sh: Rewrite.
4178 * testsuite/incremental_test_1.c: Rewrite.
4179 * testsuite/incremental_test_2.c: Rewrite.
4180
0e70b911
CC
41812010-08-12 Cary Coutant <ccoutant@google.com>
4182
4183 * arm.cc (Target_arm::got_size): Add const.
4184 (Target_arm::got_entry_count): New function.
4185 (Target_arm::plt_entry_count): New function.
4186 (Target_arm::first_plt_entry_offset): New function.
4187 (Target_arm::plt_entry_size): New function.
4188 (Output_data_plt_arm::entry_count): New function.
4189 (Output_data_plt_arm::first_plt_entry_offset): New function.
4190 (Output_data_plt_arm::get_plt_entry_size): New function.
4191 * i386.cc (Target_i386::got_size): Add const.
4192 (Target_i386::got_entry_count): New function.
4193 (Target_i386::plt_entry_count): New function.
4194 (Target_i386::first_plt_entry_offset): New function.
4195 (Target_i386::plt_entry_size): New function.
4196 (Output_data_plt_i386::entry_count): New function.
4197 (Output_data_plt_i386::first_plt_entry_offset): New function.
4198 (Output_data_plt_i386::get_plt_entry_size): New function.
4199 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4200 find_incremental_inputs_sections. Dump incremental_got_plt section.
4201 * incremental.cc: Include target.h.
4202 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4203 parameter. Adjust all callers. Find incremental_got_plt section.
4204 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4205 section.
4206 (Output_section_incremental_inputs::set_final_data_size): Calculate
4207 size of incremental_got_plt section.
4208 (Output_section_incremental_inputs::do_write): Write the
4209 incremental_got_plt section.
4210 (Got_plt_view_info): New struct.
4211 (Local_got_offset_visitor): New class.
4212 (Global_got_offset_visitor): New class.
4213 (Global_symbol_visitor_got_plt): New class.
4214 (Output_section_incremental_inputs::write_got_plt): New function.
4215 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4216 Add parameter. Adjust all callers.
4217 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4218 (Incremental_inputs::got_plt_section): New function.
4219 (Incremental_inputs::got_plt_section_): New data member.
4220 (Incremental_got_plt_reader): New class.
4221 * layout.cc (Layout::create_incremental_info_sections): Add the
4222 incremental_got_plt section.
4223 * object.h (Got_offset_list::get_list): New function.
4224 (Got offset_list::for_all_got_offsets): New function.
4225 (Sized_relobj::local_got_offset_list): New function.
4226 * powerpc.cc (Target_powerpc::got_size): Add const.
4227 (Target_powerpc::got_entry_count): New function.
4228 (Target_powerpc::plt_entry_count): New function.
4229 (Target_powerpc::first_plt_entry_offset): New function.
4230 (Target_powerpc::plt_entry_size): New function.
4231 (Output_data_plt_powerpc::entry_count): New function.
4232 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4233 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4234 * sparc.cc (Target_sparc::got_size): Add const.
4235 (Target_sparc::got_entry_count): New function.
4236 (Target_sparc::plt_entry_count): New function.
4237 (Target_sparc::first_plt_entry_offset): New function.
4238 (Target_sparc::plt_entry_size): New function.
4239 (Output_data_plt_sparc::entry_count): New function.
4240 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4241 (Output_data_plt_sparc::get_plt_entry_size): New function.
4242 * symtab.h (Symbol::got_offset_list): New function.
4243 (Symbol_table::for_all_symbols): New function.
4244 * target.h (Sized_target::got_entry_count): New function.
4245 (Sized_target::plt_entry_count): New function.
4246 (Sized_target::plt_entry_size): New function.
4247 * x86_64.cc (Target_x86_64::got_size): Add const.
4248 (Target_x86_64::got_entry_count): New function.
4249 (Target_x86_64::plt_entry_count): New function.
4250 (Target_x86_64::first_plt_entry_offset): New function.
4251 (Target_x86_64::plt_entry_size): New function.
4252 (Output_data_plt_x86_64::entry_count): New function.
4253 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4254 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4255
09ec0418
CC
42562010-08-12 Cary Coutant <ccoutant@google.com>
4257
4258 * archive.cc: Include incremental.h.
4259 (Archive::Archive): Initialize incremental_info_.
4260 (Archive::include_member): Record archive members in incremental info.
4261 (Add_archive_symbols::run): Record begin and end of an archive in
4262 incremental info.
4263 (Lib_group::include_member): Record objects in incremental info.
4264 * archive.h (Incremental_archive_entry): Forward declaration.
4265 (Archive::set_incremental_info): New member function.
4266 (Archive::incremental_info): New member function.
4267 (Archive::Unused_symbol_iterator): New class.
4268 (Archive::unused_symbols_begin): New member function.
4269 (Archive::unused_symbols_end): New member function.
4270 (Archive::incremental_info_): New data member.
4271 * incremental-dump.cc (find_input_containing_global): New function.
4272 (dump_incremental_inputs): Dump new incremental info sections.
4273 * incremental.cc: Include symtab.h.
4274 (Output_section_incremental_inputs): New class.
4275 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4276 new incremental info sections.
4277 (Sized_incremental_binary::do_check_inputs): Likewise.
4278 (Incremental_inputs::report_archive): Remove.
4279 (Incremental_inputs::report_archive_begin): New function.
4280 (Incremental_inputs::report_archive_end): New function.
4281 (Incremental_inputs::report_object): New function.
4282 (Incremental_inputs::finalize_inputs): Remove.
4283 (Incremental_inputs::report_input_section): New function.
4284 (Incremental_inputs::report_script): Rewrite.
4285 (Incremental_inputs::finalize): Do nothing but finalize string table.
4286 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4287 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4288 (Incremental_inputs::create_data_sections): New function.
4289 (Incremental_inputs::relocs_entsize): New function.
4290 (Output_section_incremental_inputs::set_final_data_size): New function.
4291 (Output_section_incremental_inputs::do_write): New function.
4292 (Output_section_incremental_inputs::write_header): New function.
4293 (Output_section_incremental_inputs::write_input_files): New function.
4294 (Output_section_incremental_inputs::write_info_blocks): New function.
4295 (Output_section_incremental_inputs::write_symtab): New function.
4296 * incremental.h (Incremental_script_entry): Forward declaration.
4297 (Incremental_object_entry): Forward declaration.
4298 (Incremental_archive_entry): Forward declaration.
4299 (Incremental_inputs): Forward declaration.
4300 (Incremental_inputs_header_data): Remove.
4301 (Incremental_inputs_header): Remove.
4302 (Incremental_inputs_header_write): Remove.
4303 (Incremental_inputs_entry_data): Remove.
4304 (Incremental_inputs_entry): Remove.
4305 (Incremental_inputs_entry_write): Remove.
4306 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4307 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4308 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4309 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4310 Likewise.
4311 (Incremental_input_entry): New class.
4312 (Incremental_script_entry): New class.
4313 (Incremental_object_entry): New class.
4314 (Incremental_archive_entry): New class.
4315 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4316 (Incremental_inputs::report_inputs): Remove.
4317 (Incremental_inputs::report_archive): Remove.
4318 (Incremental_inputs::report_archive_begin): New function.
4319 (Incremental_inputs::report_archive_end): New function.
4320 (Incremental_inputs::report_object): Change prototype.
4321 (Incremental_inputs::report_input_section): New function.
4322 (Incremental_inputs::report_script): Change prototype.
4323 (Incremental_inputs::get_reloc_count): New function.
4324 (Incremental_inputs::set_reloc_count): New function.
4325 (Incremental_inputs::create_data_sections): New function.
4326 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4327 (Incremental_inputs::inputs_section): New function.
4328 (Incremental_inputs::symtab_section): New function.
4329 (Incremental_inputs::relocs_section): New function.
4330 (Incremental_inputs::get_stringpool): Add const.
4331 (Incremental_inputs::command_line): Add const.
4332 (Incremental_inputs::inputs): Remove.
4333 (Incremental_inputs::command_line_key): New function.
4334 (Incremental_inputs::input_file_count): New function.
4335 (Incremental_inputs::input_files): New function.
4336 (Incremental_inputs::relocs_entsize): New function.
4337 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4338 (Incremental_inputs::finalize_inputs): Remove.
4339 (Incremental_inputs::Input_info): Remove.
4340 (Incremental_inputs::lock_): Remove.
4341 (Incremental_inputs::inputs_): Change type.
4342 (Incremental_inputs::inputs_map_): Remove.
4343 (Incremental_inputs::current_object_entry_): New data member.
4344 (Incremental_inputs::inputs_section_): New data member.
4345 (Incremental_inputs::symtab_section_): New data member.
4346 (Incremental_inputs::relocs_section_): New data member.
4347 (Incremental_inputs::reloc_count_): New data member.
4348 (Incremental_inputs_reader): New class.
4349 (Incremental_symtab_reader): New class.
4350 (Incremental_relocs_reader): New class.
4351 * layout.cc (Layout::finalize): Move finalization of incremental info
4352 and creation of incremental info sections to follow finalization of
4353 symbol table. Set offsets for postprocessing sections.
4354 (Layout::create_incremental_info_sections): Call
4355 Incremental_inputs::create_data_sections. Add incremental symtab
4356 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4357 sections to layout after input sections.
4358 * layout.h (struct Timespec): Forward declaration.
4359 (Layout::incremental_inputs): Add const.
4360 (Layout::create_incremental_info_sections): Add parameter.
4361 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4362 * object.cc: Include incremental.h.
4363 (Relobj::finalize_incremental_relocs): New function.
4364 (Sized_relobj::do_layout): Record input sections in incremental info.
4365 * object.h (Object::output_section): New function.
4366 (Object::output_section_offset): Moved from Relobj.
4367 (Object::get_incremental_reloc_base): New function.
4368 (Object::get_incremental_reloc_count): New function.
4369 (Object::do_output_section): New function.
4370 (Object::do_output_section_offset): Moved from Relobj.
4371 (Object::do_get_incremental_reloc_base): New function.
4372 (Object::do_get_incremental_reloc_count): New function.
4373 (Object::Object): Initialize new data members.
4374 (Relobj::output_section): Renamed do_output_section and moved to
4375 protected.
4376 (Relobj::output_section_offset): Moved to Object.
4377 (Relobj::do_get_incremental_reloc_base): New function.
4378 (Relobj::do_get_incremental_reloc_count): New function.
4379 (Relobj::allocate_incremental_reloc_counts): New function.
4380 (Relobj::count_incremental_reloc): New function.
4381 (Relobj::finalize_incremental_relocs): New function.
4382 (Relobj::next_incremental_reloc_index): New function.
4383 (Relobj::reloc_counts_): New data member.
4384 (Relobj::reloc_bases_): New data member.
4385 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4386 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4387 (Sized_relobj::incremental_relocs_scan): New function.
4388 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4389 (Sized_relobj::incremental_relocs_write): New function.
4390 (Sized_relobj::incremental_relocs_write_reltype): New function.
4391 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4392 incremental link.
4393 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4394 archives and object files elsewhere.
4395 (Add_symbols::run): Report object files here.
4396 (Finish_group::run): Report end of archive at end of group.
4397 * reloc.cc: Include layout.h, incremental.h.
4398 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4399 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4400 (Sized_relobj::incremental_relocs_scan): New function.
4401 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4402 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4403 (Sized_relobj::incremental_relocs_write): New function.
4404 (Sized_relobj::incremental_relocs_write_reltype): New function.
4405 * script.cc (read_input_script): Rewrite test for incremental link.
4406 Change call to Incremental_inputs::report_script.
4407 * symtab.h (Symbol_table::first_global_index): New function.
4408 (Symbol_table::output_count): New function.
4409
ce0d1972
DK
44102010-08-12 Doug Kwan <dougkwan@google.com>
4411
4412 * arm.cc (Target_arm::merge_object_attributes): Check command line
4413 options --no-wchar-size-warning and --no-enum-size-warning.
4414 * options.h (General_options): Add ld-compatible options
4415 --no-enum-size-warning and --no-wchar-size-warning.
4416
6e5710ce
ILT
44172010-08-04 Ian Lance Taylor <iant@google.com>
4418
4419 * x86_64.cc (Target_x86_64::Scan::local): Use
4420 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4421 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4422 (Target_x86_64::Scan::global): Likewise.
4423 (Target_x86_64::Relocate::relocate): Likewise.
4424 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4425 Likewise.
4426
fef830db
CC
44272010-08-03 Cary Coutant <ccoutant@google.com>
4428
4429 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4430 to reserve space in merged_strings vector. Keep total input size
4431 for stats.
4432 (Output_merge_string::do_print_merge_stats): Print total input size.
4433 * merge.h (Output_merge_string): Add input_size_ field.
4434 * stringpool.cc (Stringpool_template::string_length): Move
4435 implementations out of Stringpool_template class and place in
4436 stringpool.h.
4437 * stringpool.h (string_length): Move out of Stringpool_template.
4438
1e3811b0
ILT
44392010-08-03 Ian Lance Taylor <iant@google.com>
4440
4441 PR 11712
4442 * layout.cc (relaxation_loop_body): If address of load segment is
4443 set, adjust address to include headers if possible.
4444
7af0c620
ILT
44452010-08-03 Ian Lance Taylor <iant@google.com>
4446
4447 * version.cc (version_string): Bump to 1.10.
4448
22f0da72
ILT
44492010-08-03 Ian Lance Taylor <iant@google.com>
4450
4451 PR 11805
4452 * layout.h (enum Output_section_order): Define.
4453 (class Layout): Update declarations.
4454 * layout.cc (Layout::get_output_section): Add order parameter.
4455 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4456 is_first_non_relro parameters. Change all callers.
4457 (Layout::choose_output_section): Likewise.
4458 (Layout::add_output_section_data): Likewise.
4459 (Layout::make_output_section): Likewise. Set order.
4460 (Layout::default_section_order): New function.
4461 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4462 * output.cc (Output_section::Output_section): Initialize order_.
4463 Don't initialize deleted fields.
4464 (Output_segment::Output_segment): Don't initialize deleted
4465 fields.
4466 (Output_segment::add_output_section_to_load): New function
4467 replacing add_output_section. Change all callers to call this or
4468 add_output_section_to_nonload.
4469 (Output_segment::add_output_section_to_nonload): New function.
4470 (Output_segment::remove_output_section): Rewrite.
4471 (Output_segment::add_initial_output_data): Likewise.
4472 (Output_segment::has_any_data_sections): Likewise.
4473 (Output_segment::is_first_section_relro): Likewise.
4474 (Output_segment::maximum_alignment): Likewise.
4475 (Output_segment::has_dynamic_reloc): New function replacing
4476 dynamic_reloc_count. Change all callers.
4477 (Output_segment::has_dynamic_reloc_list): New function replacing
4478 dynamic_reloc_count_list. Change all callers.
4479 (Output_segment::set_section_addresses): Rewrite.
4480 (Output_segment::set_offset): Rewrite.
4481 (Output_segment::find_first_and_last_list): Remove.
4482 (Output_segment::set_tls_offsets): Rewrite.
4483 (Output_segment::first_section_load_address): Likewise.
4484 (Output_segment::output_section_count): Likewise.
4485 (Output_segment::section_with_lowest_load_address): Likewise.
4486 (Output_segment::write_section_headers): Likewise.
4487 (Output_segment::print_sections_to_map): Likewise.
4488 * output.h (class Output_data): Remove dynamic_reloc_count_
4489 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4490 (Output_data::add_dynamic_reloc): Rewrite.
4491 (Output_data::has_dynamic_reloc): New function.
4492 (Output_data::dynamic_reloc_count): Remove.
4493 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4494 is_last_relro_, is_first_non_relro_, is_interp_,
4495 is_dynamic_linker_section_ fields. Add order and set_order
4496 functions. Remove is_relro_local, set_is_relro_local,
4497 is_last_relro, set_is_last_relro, is_first_non_relro,
4498 set_is_first_non_relro functions, is_interp, set_is_interp,
4499 is_dynamic_linker_section, and set_is_dynamic_linker_section
4500 functions.
4501 (class Output_segment): Change Output_data_list from std::list to
4502 std:;vector. Add output_lists_ field. Remove output_data_ and
4503 output_bss_ fields. Update declarations.
4504
3ff2ccb0
ILT
45052010-08-02 Ian Lance Taylor <iant@google.com>
4506
4507 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4508 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4509 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4510
88a4108b
ILT
45112010-08-02 Ian Lance Taylor <iant@google.com>
4512
4513 PR 11855
4514 * script.cc (Script_options::Script_options): Initialize
4515 symbol_definitions_ and symbol_references_.
4516 (Script_options::add_symbol_assignment): Update
4517 symbol_definitions_ and symbol_references_.
4518 (Script_options::add_symbol_reference): New function.
4519 (script_symbol): New function.
4520 * script.h (class Script_options): Add symbol_definitions_ and
4521 symbol_references_ fields.
4522 (Script_options::referenced_const_iterator): New type.
4523 (Script_options::referenced_begin): New function.
4524 (Script_options::referenced_end): New function.
4525 (Script_options::is_referenced): New function.
4526 (Script_options::any_unreferenced): New function.
4527 * script-c.h (script_symbol): Declare.
4528 * yyscript.y (exp): Call script_symbol.
4529 * symtab.cc: Include "script.h".
4530 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4531 Change all callers. Check symbols referenced by scripts.
4532 (Symbol_table::add_undefined_symbols_from_command_line): Add
4533 layout parameter. Change all callers.
4534 (Symbol_table::do_add_undefined_symbols_from_command_line):
4535 Likewise. Break out loop body. Check symbols referenced by
4536 scripts.
4537 (Symbol_table::add_undefined_symbol_from_command_line): New
4538 function broken out of
4539 do_add_undefined_symbols_from_command_line.
4540 * symtab.h (class Symbol_table): Update declarations.
4541 * archive.cc: Include "layout.h".
4542 (Archive::should_include_member): Add layout parameter. Change
4543 all callers. Check for symbol mentioned in expression.
4544 * archive.h (class Archive): Update declaration.
4545 * object.cc (Sized_relobj::do_should_include_member): Add layout
4546 parameter.
4547 * object.h (Object::should_include_member): Add layout parameter.
4548 Change all callers.
4549 (Object::do_should_include_member): Add layout parameter.
4550 (class Sized_relobj): Update declaration.
4551 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4552 parameter.
4553 * dynobj.h (class Sized_dynobj): Update declaration.
4554 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4555 layout parameter.
4556 * plugin.h (class Sized_pluginobj): Update declaration.
4557
5f1ab67a
ILT
45582010-08-02 Ian Lance Taylor <iant@google.com>
4559
4560 PR 11866
4561 * output.cc (Output_segment::set_offset): Search for the first and
4562 last sections rather than assuming that the list is in order.
4563 (Output_segment::find_first_and_last_list): New function.
4564 * output.h (class Output_segment): Update declarations.
4565 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4566 (relro_strip_test_SOURCES): New variable.
4567 (relro_strip_test_DEPENDENCIES): New variable.
4568 (relro_strip_test_LDFLAGS): New variable.
4569 (relro_strip_test_LDADD): New variable.
4570 (relro_strip_test.so): New target.
4571
a8df5856
ILT
45722010-08-02 Ian Lance Taylor <iant@google.com>
4573
4574 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4575 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4576 (Target_i386::got_tlsdesc_section): New function.
4577 (Target_i386::got_section): Create space for GOT entries for
4578 TLSDESC relocations.
4579 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4580 R_386_TLS_GOTDESC.
4581 (Target_i386::Scan::global): Likewise.
4582 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4583 using TLSDESC GOT.
4584 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4585 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4586 (Target_x86_64::got_tlsdesc_section): New function.
4587 (Target_x86_64::got_section): Create space for GOT entries for
4588 TLSDESC relocations.
4589 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4590 R_386_TLS_GOTDESC.
4591 (Target_x86_64::Scan::global): Likewise.
4592 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4593 using TLSDESC GOT.
4594
0c10a0a6
ILT
45952010-08-02 Ian Lance Taylor <iant@google.com>
4596
4597 * testsuite/final_layout.sh: Use dc to convert from hex to
4598 decimal.
4599
41cbeecc
ST
46002010-07-29 Sriraman Tallam <tmsriram@google.com>
4601
4602 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4603 paramter to the call to gold::gc_process_relocs.
4604 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4605 paramter to the call to gold::gc_process_relocs.
4606 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4607 parameter to the call to gold::gc_process_relocs.
4608 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4609 template parameter to the call to gold::gc_process_relocs.
4610 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4611 paramter to the call to gold::gc_process_relocs.
4612 * gc.h (get_embedded_addend_size): New function.
4613 (gc_process_relocs): Save the size of the reloc for use by ICF.
4614 * icf.cc (get_section_contents): Get the addend from the text section
4615 for SHT_REL relocation sections.
4616 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4617 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4618 * int_encoding.h (read_from_pointer): New overloaded function.
4619 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4620 * testsuite/icf_sht_rel_addend_test.sh: New file.
4621 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4622 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4623
6ea55b82
RW
46242010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4625
4626 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4627 * Makefile.in: Regenerate.
4628 * testsuite/Makefile.in: Regenerate.
4629
9691462b
ILT
46302010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4631
4632 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4633 * gold/testsuite/debug_msg.cc: Likewise.
4634 * gold/testsuite/odr_violation1.cc
4635 * gold/testsuite/odr_violation2.cc
4636
76897331
CC
46372010-07-21 Cary Coutant <ccoutant@google.com>
4638
4639 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4640 string, and length fields.
4641 (Output_merge_string::Merged_strings_list): New type.
4642 (Output_merge_string::Merged_strings_lists): New typedef.
4643 (Output_merge_string): Replace merged_strings_ with
4644 merged_strings_lists_.
4645 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4646 Merged_strings_list per input object and section. Don't store pointer
4647 to the string. Don't store length with each merged string entry.
4648 (Output_merge_string::finalize_merged_data): Loop over list of merged
4649 strings lists. Recompute length of each merged string.
4650
78384e8f
CC
46512010-07-15 Cary Coutant <ccoutant@google.com>
4652
4653 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4654 here.
4655
783659f9
ILT
46562010-07-14 Ian Lance Taylor <iant@google.com>
4657
4658 * descriptors.cc (Descriptors::open): Report correct name in error
4659 message.
4660
131687b4
DK
46612010-07-13 Doug Kwan <dougkwan@google.com>
4662
4663 * arm.cc (Arm_input_section::Arm_input_section): For a
4664 SHT_ARM_EXIDX section, always keeps the input sections.
4665 (Arm_input_section::set_exidx_section_link): New method.
4666 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4667 has_errors_ to false.
4668 (Arm_exidx_input_section::has_errors,
4669 Arm_exidx_input_section::set_has_errors): New methods.
4670 (Arm_exidx_input_section::has_errors_): New data member.
4671 (Arm_relobj::get_exidx_shndx_list): New method.
4672 (Arm_output_section::append_text_sections_to_list): Do not skip
4673 section without SHF_EXECINSTR.
4674 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4675 errors.
4676 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4677 section header. Make error messages more verbose. Check for
4678 a non-executable section linked to an EXIDX section.
4679 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4680 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4681 check that there is no deferred EXIDX section if we exit early.
4682 Instead of not making an EXIDX section in case of an error, make one
4683 and set the has_errors flag of it.
4684 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4685 in a relocatable link.
4686 (Target_arm::do_relax): Look for the EXIDX output section instead of
4687 assuming that it is called .ARM.exidx.
4688 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4689 section list. Do not check for SHF_EXECINSTR section flags but
4690 skip any input section with errors.
4691 * output.cc (Output_section::Output_section): Initialize
4692 always_keeps_input_sections_ to false.
4693 (Output_section::add_input_section): Check for
4694 always_keeps_input_sections_.
4695 * output.h (Output_section::always_keeps_input_sections,
4696 Output_section::set_always_keeps_input_sections): New methods.
4697 (Output_section::always_keeps_input_sections): New data member.
4698
69517287
RÁE
46992010-07-13 Rafael Espindola <espindola@google.com>
4700
4701 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4702 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4703
82742395
ILT
47042010-07-13 Philip Herron <herron.philip@googlemail.com>
4705 Ian Lance Taylor <iant@google.com>
4706
4707 * output.h (Output_section_lookup_maps::add_merge_section):
4708 Correct check of whether value was inserted.
4709 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4710 (Output_section_lookup_maps::add_relaxed_input_section):
4711 Likewise.
4712 * arm.cc (Target_arm::got_section): Remove used local os.
4713 * i386.cc (Target_i386::got_section): Likewise.
4714 * x86_64.cc (Target_x86_64::got_section): Likewise.
4715 * sparc.cc (Target_sparc::got_section): Likewise.
4716 (Target_sparc::relocate): Remove unused local have_got_offset.
4717 * powerpc.cc (Target_powerpc::relocate): Likewise.
4718
f2d707b5
ILT
47192010-07-13 Ian Lance Taylor <iant@google.com>
4720
241531d6
ILT
4721 * compressed_output.cc (zlib_decompress): Fix signature in
4722 !HAVE_ZLIB_H case.
4723
f2d707b5
ILT
4724 * archive.cc (Archive::include_member): Unlock an external member
4725 of a thin archive. Don't bother to delete an object we know is
4726 NULL.
4727
a2e47362
CC
47282010-07-12 Cary Coutant <ccoutant@google.com>
4729
4730 * compressed_output.cc (zlib_decompress): New function.
4731 (get_uncompressed_size): New function.
4732 (decompress_input_section): New function.
4733 * compressed_output.h (get_uncompressed_size): New function.
4734 (decompress_input_section): New function.
4735 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4736 Handle compressed debug sections.
4737 * layout.cc (is_compressed_debug_section): New function.
4738 (Layout::output_section_name): Map compressed section names to
4739 canonical names.
4740 * layout.h (is_compressed_debug_section): New function.
4741 (is_debug_info_section): Recognize compressed debug sections.
4742 * merge.cc: Include compressed_output.h.
4743 (Output_merge_data::do_add_input_section): Handle compressed
4744 debug sections.
4745 (Output_merge_string::do_add_input_section): Handle compressed
4746 debug sections.
4747 * object.cc: Include compressed_output.h.
4748 (Sized_relobj::Sized_relobj): Initialize new data members.
4749 (build_compressed_section_map): New function.
4750 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4751 * object.h (Object::section_is_compressed): New method.
4752 (Object::do_section_is_compressed): New method.
4753 (Sized_relobj::Compressed_section_map): New type.
4754 (Sized_relobj::do_section_is_compressed): New method.
4755 (Sized_relobj::compressed_sections_): New data member.
4756 * output.cc (Output_section::add_input_section): Handle compressed
4757 debug sections.
4758 * reloc.cc: Include compressed_output.h.
4759 (Sized_relobj::write_sections): Handle compressed debug sections.
4760
ce279a62
CC
47612010-07-08 Cary Coutant <ccoutant@google.com>
4762
4763 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4764 weak when resolving to a dynamic def.
4765 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4766 for weak undef/dynamic def cases. Adjust callers.
4767 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4768 undef_binding_weak_.
4769 (Symbol_table::sized_write_globals): Adjust symbol binding.
4770 (Symbol_table::sized_write_symbol): Add binding parameter.
4771 * symtab.h (Symbol::set_undef_binding): New method.
4772 (Symbol::is_undef_binding_weak): New method.
4773 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4774 (Symbol_table::should_override): Add new parameter.
4775 (Symbol_table::sized_write_symbol): Add new parameter.
4776
4777 * testsuite/weak_undef_file1.cc: Add new test case.
4778 * testsuite/weak_undef_file2.cc: Fix header comment.
4779 * testsuite/weak_undef_test.cc: Add new test case.
4780
b2286c10
DK
47812010-06-29 Doug Kwan <dougkwan@google.com>
4782
4783 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4784 Initialize USE_SYMBOL_.
4785 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4786 definition.
4787 (Arm_reloc_property::uses_symbol_): New data member declaration.
4788 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4789 uses symbol value and symbol is undefined but not weakly undefined.
4790
4802450a
RÁE
47912010-06-28 Rafael Espindola <espindola@google.com>
4792
4793 * plugin.cc (Plugin::load): Use dlerror.
4794
e5ca47ba
ILT
47952010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4796
4797 * symtab.cc (detect_odr_violations): When reporting an ODR
4798 violation, report an object where the symbol is defined.
4799
8a75a161
DK
48002010-06-25 Doug Kwan <dougkwan@google.com>
4801
4802 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4803 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4804 definition.
4805 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4806 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4807 target hook to detect function points.
4808 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4809 * icf.h (Icf::check_section_for_function_pointers): Change type of
4810 parameter SECTION_NAME to const reference to std::string. Use
4811 target hook to determine if section may have unsafe pointers.
4812 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4813 method definition.
4814
42218b9f
RÁE
48152010-06-21 Rafael Espindola <espindola@google.com>
4816
4817 * fileread.cc (Input_file::find_fie): New
4818 (Input_file::open): Use Input_file::find_fie.
4819 * fileread.h (Input_file::find_fie): New
4820 * plugin.cc (set_extra_library_path): New.
4821 (Plugin::load): Add set_extra_library_path to the transfer vector.
4822 (Plugin_manager::set_extra_library_path): New.
4823 (Plugin_manager::add_input_file): Use the extra search path if set.
4824 (set_extra_library_path(): New.
4825 * plugin.h (Plugin_manager): Add set_extra_library_path and
4826 extra_search_path_.
4827
a0506cca
CC
48282010-06-19 Cary Coutant <ccoutant@google.com>
4829
4830 * layout.cc (gdb_sections): Add .debug_types.
4831 (lines_only_debug_sections): Likewise.
4832
6508b958
RÁE
48332010-06-18 Rafael Espindola <espindola@google.com>
4834
4835 * plugin.cc (add_input_file,add_input_library)
4836 (Plugin_manager::add_input_file): Make filename arguments const.
4837 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4838 const.
4839
3e235302
DK
48402010-06-16 Doug Kwan <dougkwan@google.com>
4841
4842 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4843 .ARM.attributes section if we have not merged any input
4844 attributes sections.
4845
106e8a6c
DK
48462010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4847
4848 * arm.cc: Allow combining objects with no EABI version
4849 information.
4850
91ff43fe
RÁE
48512010-06-15 Rafael Espindola <espindola@google.com>
4852
4853 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4854
68ed838c
ILT
48552010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4856
4857 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4858 (struct iovec): Correct !HAVE_READV definition.
4859
f3a2388f
CC
48602010-06-10 Cary Coutant <ccoutant@google.com>
4861
4862 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4863 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4864 reloc sections.
4865 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4866
4867 PR 11683
4868 * symtab.h (Symbol::is_placeholder): New member function.
4869 * target-reloc.h (relocate_section): Check for placeholder symbols.
4870
4871 * testsuite/Makefile.am (plugin_test_8): New test.
4872 (plugin_test_9): New test.
4873 * testsuite/Makefile.in: Regenerate.
4874
e1df38aa
NC
48752010-06-09 Nick Clifton <nickc@redhat.com>
4876
4877 * yyscript.y (input_list_element): Allow strings prefixed with
4878 the '-' character. Treat these as libraries.
4879 * script.cc (script_add_library): New function. Adds a library
4880 specified by "-l<name>" found in an input script.
4881 * script-c.h: Add prototype for script_add_library.
4882
25bbe950
DK
48832010-06-07 Doug Kwan <dougkwan@google.com>
4884
4885 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4886 Restrict stub-group size to be within long conditional branch
4887 range when working around cortex-A8 erratum.
4888
0f32ea4c
ILT
48892010-06-07 Damien Diederen <dd@crosstwine.com>
4890
4891 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4892 #ifdef typo.
4893
8fe2a369
ST
48942010-06-03 Sriraman Tallam <tmsriram@google.com>
4895
4896 PR gold/11658
4897 * output.cc
4898 (Output_section::Input_section_sort_entry::compare_section_ordering):
4899 Change to return non-zero correctly.
4900 (Output_section::Input_section_sort_section_order_index_compare
4901 ::operator()): Change to fix ambiguity in comparisons.
4902
6e9ba2ca
ST
49032010-06-01 Sriraman Tallam <tmsriram@google.com>
4904
4905 * gold.h (is_wildcard_string): New function.
4906 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4907 (Layout::layout_eh_frame): Ditto.
4908 (Layout::find_section_order_index): New method.
4909 (Layout::read_layout_from_file): New method.
4910 * layout.h (Layout::find_section_order_index): New method.
4911 (Layout::read_layout_from_file): New method.
4912 (Layout::input_section_position_): New private member.
4913 (Layout::input_section_glob_): New private member.
4914 * main.cc (main): Call read_layout_from_file here.
4915 * options.h (--section-ordering-file): New option.
4916 * output.cc (Output_section::input_section_order_specified_): New
4917 member.
4918 (Output_section::Output_section): Initialize new member.
4919 (Output_section::add_input_section): Add new parameter.
4920 Keep input sections when --section-ordering-file is used.
4921 (Output_section::set_final_data_size): Sort input sections when
4922 section ordering file is specified.
4923 (Output_section::Input_section_sort_entry): Add new parameter.
4924 Check sorting type.
4925 (Output_section::Input_section_sort_entry::compare_section_ordering):
4926 New method.
4927 (Output_section::Input_section_sort_compare::operator()): Change to
4928 consider section_order_index.
4929 (Output_section::Input_section_sort_init_fini_compare::operator()):
4930 Change to consider section_order_index.
4931 (Output_section::Input_section_sort_section_order_index_compare
4932 ::operator()): New method.
4933 (Output_section::sort_attached_input_sections): Change to sort
4934 according to section order when specified.
e1df38aa
NC
4935 (Output_section::add_input_section<32, true>): Add new parameter.
4936 (Output_section::add_input_section<64, true>): Add new parameter.
4937 (Output_section::add_input_section<32, false>): Add new parameter.
4938 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4939 * output.h (Output_section::add_input_section): Add new parameter.
4940 (Output_section::input_section_order_specified): New
4941 method.
4942 (Output_section::set_input_section_order_specified): New method.
4943 (Input_section::Input_section): Initialize section_order_index_.
4944 (Input_section::section_order_index): New method.
4945 (Input_section::set_section_order_index): New method.
4946 (Input_section::section_order_index_): New member.
4947 (Input_section::Input_section_sort_section_order_index_compare): New
4948 struct.
4949 (Output_section::input_section_order_specified_): New member.
4950 * script-sections.cc (is_wildcard_string): Delete and move modified
4951 method to gold.h.
4952 (Output_section_element_input::Output_section_element_input): Modify
4953 call to is_wildcard_string.
4954 (Output_section_element_input::Input_section_pattern
4955 ::Input_section_pattern): Ditto.
4956 (Output_section_element_input::Output_section_element_input): Ditto.
4957 * testsuite/Makefile.am (final_layout): New test case.
4958 * testsuite/Makefile.in: Regenerate.
4959 * testsuite/final_layout.cc: New file.
4960 * testsuite/final_layout.sh: New file.
4961
3537c84b
RÁE
49622010-06-01 Rafael Espindola <espindola@google.com>
4963
4964 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4965
105b6afd
RÁE
49662010-06-01 Rafael Espindola <espindola@google.com>
4967
4968 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4969 visibility of symbols.
4970
29e11421
DK
49712010-05-27 Doug Kwan <dougkwan@google.com>
4972
4973 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4974 from start of output section instead of address for a local symbol
4975 in a merged or relaxed section when doing a relocatable link.
4976
5e0f337e
RÁE
49772010-05-26 Rafael Espindola <espindola@google.com>
4978
4979 PR 11604
4980 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4981 adding sections the garbage collector removed.
4982 * gold/testsuite/Makefile.am: Add test.
4983 * gold/testsuite/Makefile.in: Regenerate.
4984 * gold/testsuite/plugin_test_7.sh: New.
4985 * gold/testsuite/plugin_test_7_1.c: New.
4986 * gold/testsuite/plugin_test_7_2.c: New.
4987
f4187277
RÁE
49882010-05-26 Rafael Espindola <espindola@google.com>
4989
4990 * script-sections.cc (Output_section_definition::set_section_addresses):
4991 Check for --section-start.
4992
5c388529
DK
49932010-05-26 Doug Kwan <dougkwan@google.com>
4994
4995 * arm.cc (Arm_scan_relocatable_relocs): New class.
4996 (Target_arm::relocate_special_relocatable): New method.
4997 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4998 (Arm_relocate_functions::thumb_branch_common): Same.
4999 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5000 instead of Default_scan_relocatable_relocs.
5001 * target-reloc.h (relocate_for_relocatable): Let target handle
5002 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5003 * target.h (Sized_target::relocate_special_relocatable): New method.
5004
bca1c3ae
ILT
50052010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5006
5007 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5008
0439c796
DK
50092010-05-23 Doug Kwan <dougkwan@google.com>
5010
5011 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5012 instead of a cast.
5013 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5014 with a direct branch, not a conditional branch, to a stub.
5015 * merge.cc (Output_merge_base::record_input_section): New method
5016 defintion.
5017 (Output_merge_data::do_add_input_section): Record input section if
5018 keeps-input-sections flag is set.
5019 (Output_merge_string::do_add_input_section): Ditto.
5020 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5021 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5022 INPUT_SECTIONS_.
5023 (Output_merge_base::keeps_input_sections,
5024 Output_merge_base::set_keeps_input_sections,
5025 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5026 method definitions.
5027 (Output_merge_base::Input_sections): New type declaration.
5028 (Output_merge_base::input_sections_begin,
5029 Output_merge_base::input_sections_end,
5030 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5031 (Output_merge_base::bool keeps_input_sections_,
5032 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5033 Output_merge_base::input_sections_): New data members.
5034 (Output_merge_data::do_set_keeps_input_sections): New method
5035 defintion.
5036 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5037 * output.cc (Output_section::Input_section::relobj): Move method
5038 defintion from class declaration to here and handle merge sections.
5039 (Output_section::Input_section::shndx): Ditto.
5040 (Output_section::Output_section): Remove initializations of removed
5041 data members and initialize new data member LOOKUP_MAPS_.
5042 (Output_section::add_input_section): Set keeps-input-sections flag
5043 for a newly created merge output section as appropriate. Adjust code
5044 to use Output_section_lookup_maps class.
5045 (Output_section::add_relaxed_input_section): Adjst code for lookup
5046 maps code refactoring.
5047 (Output_section::add_merge_input_section): Add a new parameter
5048 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5049 class. If adding input section to a newly created merge output
5050 section fails, remove the new merge section.
5051 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5052 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
5053 (Output_section::find_merge_section): Ditto.
5054 (Output_section::build_lookup_maps): New method defintion.
5055 (Output_section::find_relaxed_input_section): Adjust code to use
5056 Output_section_lookup_maps class.
5057 (Output_section::get_input_sections): Export merge sections. Adjust
5058 code to use Output_section_lookup_maps class.
5059 (Output_section:::add_script_input_section): Adjust code to use
5060 Output_section_lookup_maps class. Update lookup maps for merge
5061 sections also.
5062 (Output_section::discard_states): Use Output_section_lookup_maps.
5063 (Output_section::restore_states): Same.
5064 * output.h (Merge_section_properties): Move class defintion out of
5065 Output_section.
5066 (Output_section_lookup_maps): New class.
5067 (Output_section::Input_section::is_merge_section): New method
5068 defintion.
5069 (Output_section::Input_section::relobj): Move defintion out of class
5070 defintion. Declare method only.
5071 (Output_section::Input_section::shndx): Ditto.
5072 (Output_section::Input_section::output_merge_base): New method defintion.
5073 (Output_section::Input_section::u2_.pomb): New union field.
5074 (Output_section::Merge_section_by_properties_map,
5075 Output_section::Output_section_data_by_input_section_map,
5076 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5077 Remove types.
5078 (Output_section::add_merge_input_section): Add new parameter
5079 KEEPS_INPUT_SECTIONS.
5080 (Output_section::build_lookup_maps): New method declaration.
5081 (Output_section::merge_section_map_,
5082 Output_section::merge_section_by_properties_map_,
5083 Output_section::relaxed_input_section_map_,
5084 Output_section::is_relaxed_input_section_map_valid_): Remove data
5085 members.
5086 (Output_section::lookup_maps_): New data member.
5087
76295588
L
50882010-05-21 Doug Kwan <dougkwan@google.com>
5089
5090 PR gold/11619
5091 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5092 avoid a compilation error.
5093
d103a984
RÁE
50942010-05-19 Rafael Espindola <espindola@google.com>
5095
5096 * script-sections.cc (Output_section_definition::allocate_to_segment):
5097 Update the phdrs_list even when the output section is NULL.
5098 * testsuite/Makefile.am: Add test.
5099 * testsuite/Makefile.in: Regenerate.
5100 * testsuite/script_test_9.cc: New.
5101 * testsuite/script_test_9.sh: New.
5102 * testsuite/script_test_9.t: New.
5103
6625d24e
DK
51042010-05-19 Doug Kwan <dougkwan@google.com>
5105
5106 * arm.cc (Arm_input_section::original_size): New method.
5107 (Arm_input_section::do_addralign): Add a cast.
5108 (Arm_input_section::do_output_offset): Remove static cast.
5109 (Arm_input_section::original_addralign,
5110 Arm_input_section::original_size_): Change type to uint32_t.
5111 (Arm_input_section::init): Add safe casts for section alignment
5112 and size.
5113 (Arm_input_section::set_final_data_size): Do not set address and
5114 offset of stub table.
5115 (Arm_output_section::fix_exidx_coverage): Change use of of
5116 Output_section::Simple_input_section to that of
5117 Output_section::Input_section.
5118 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5119 except for the first pass.
5120 * output.cc (Output_section::get_input_sections): Change type of
5121 input_sections to std::list<Input_section>.
5122 (Output_section::add_script_input_section): Rename from
5123 Output_section::add_simple_input_section. Change type of SIS
5124 parameter from Simple_input_section to Input_section.
5125 * output.h (Output_section::Simple_input_section): Remove class.
5126 (Output_section::Input_section): Change class visibility to public.
5127 (Output_section::Input_section::addralign): Use stored alignments
5128 for special input sections if set.
5129 (Output_section::Input_section::set_addralign): New method.
5130 (Output_section::get_input_sections): Change parameter type from
5131 list of Simple_input_section to list of Input_section.
5132 (Output_section::add_script_input_section): Rename from
5133 Output_section::add_simple_input_section. Change first parameter's
5134 type from Simple_input_section to Input_section and remove the
5135 second and third parameters.
5136 * script-sections.cc (Input_section::Input_section_list): Change
5137 type to list of Output_section::Input_section/
5138 (Input_section_info::Input_section_info): Change parameter type of
5139 INPUT_SECTION to Output_section::Input_section.
5140 (Input_section_info::input_section): Change return type.
5141 (Input_section_info::input_section_): Change type to
5142 Output_section::Input_section.
5143 (Output_section_element_input::set_section_addresses): Adjust code
5144 to use Output_section::Input_section instead of
5145 Output_section::Simple_input_section. Adjust code for renaming
5146 of Output_section::add_simple_input_section.
5147 (Orphan_output_section::set_section_addresses): Ditto.
5148
e1e82ea4
RW
51492010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5150
5151 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5152 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5153
91e75c8a
RÁE
51542010-05-18 Rafael Espindola <espindola@google.com>
5155
5156 * options.cc (General_options::finalize): Handle -nostdlib.
5157 * options.h (nostdlib): New option.
5158 * script.cc (script_add_search_dir): Handle -nostdlib.
5159
da59ad79
DK
51602010-05-12 Doug Kwan <dougkwan@google.com>
5161
5162 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5163 attributes section only if there no attributes section after merging.
5164 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5165 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5166 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5167 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5168 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5169 and arm_attr_merge_7.stdout.
5170 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5171 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5172 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5173 arm_attr_merge_7b.o): New rules.
5174 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5175 arm_attr_merge_7
5176 * testsuite/Makefile.in: Regenerate.
5177 * testsuite/arm_attr_merge.sh: New file.
5178 * testsuite/arm_attr_merge_[67][ab].s: Same.
5179
3e01a7fd
NC
51802010-05-05 Nick Clifton <nickc@redhat.com>
5181
5182 * po/es.po: Updated Spanish translation.
5183
7ad2014a
L
51842010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5185
5186 * Makefile.am (install-exec-local): Properly install gold as
5187 default cross linker.
5188 * Makefile.in: Regenerated.
5189
4fda8867
NC
51902010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5191 Nick Clifton <nickc@redhat.com>
5192
5193 * configure.ac (install_as_default): Define and set to false
5194 unless --enable-gold or --enable-gold=both/gold has been
5195 specified.
5196 * configure: Regenerate.
5197
5198 * Makefile.am (install-exec-local): Install the executable as
5199 'ld.gold'. If install_as_default is true then also install it as
5200 'ld'.
5201 * Makefile.in: Regenerated.
5202
bd288ea2
ILT
52032010-04-24 Ian Lance Taylor <iant@google.com>
5204
5205 * layout.cc (Layout::layout_reloc): In relocatable link don't
5206 combine reloc sections for grouped sections.
5207
ef38fd8a
ST
52082010-04-23 Sriraman Tallam <tmsriram@google.com>
5209
5210 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5211 sections that are not ordinary to icf.
5212 * icf.cc (get_section_contents): Handle relocation pointing to section
5213 with no object or shndx information.
5214 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5215 * testsuite/Makefile.in: Regenerate.
5216 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5217 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5218
f6973bdc
ILT
52192010-04-22 Ian Lance Taylor <iant@google.com>
5220
5221 * expression.cc (Expression::Expression_eval_info): Add
5222 result_alignment_pointer field.
5223 (Expression::eval_with_dot): Add result_alignment_pointer
5224 parameter. Change all callers.
5225 (Expression::eval_maybe_dot): Likewise.
5226 (class Binary_expression): Add alignment_pointer parameter to
5227 left_value and right_value. Change all callers.
5228 (BINARY_EXPRESSION): Set result alignment.
5229 (class Trinary_expression): Add alignment_pointer parameter to
5230 arg2_value and arg3_value. Change all callers.
5231 (Trinary_cond::value): Set result alignment.
5232 (Max_expression::value, Min_expression::value): Likewise.
5233 (Align_expression::value): Likewise.
5234 * script-sections.cc (class Sections_element): Add dot_alignment
5235 parameter to set_section_addresses virtual function. Update
5236 instantiations.
5237 (class Output_section_element): Likewise.
5238 (Script_sections::create_segments): Add dot_alignment parameter.
5239 Change all callers.
5240 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5241 (Script_sections::set_phdrs_clause_addresses): Likewise.
5242 * script-sections.h: Update declarations.
5243 * script.h: Update declarations.
5244 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5245 min_p_align.
5246 * testsuite/script_test_3.t: Set large alignment.
5247 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5248 segment has expected alignment.
5249
9c9c98a5
NC
52502010-04-22 Nick Clifton <nickc@redhat.com>
5251
5252 * po/gold.pot: Updated by the Translation project.
5253 * po/vi.po: Updated Vietnamese translation.
5254
2253bfba
L
52552010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5256
5257 * testsuite/Makefile.am (check_PROGRAMS): Add
5258 icf_virtual_function_folding_test.
5259 * testsuite/Makefile.in: Regenerated.
5260
85fdf906
AH
52612010-04-15 Andrew Haley <aph@redhat.com>
5262
5263 * options.h (merge_exidx_entries): New option.
5264 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5265 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5266 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5267 (Target_arm::merge_exidx_entries): New function.
5268 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5269 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5270 to Arm_exidx_fixup constructor.
5271 Add new arg, merge_exidx_entries.
5272 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5273 Arm_output_section::fix_exidx_coverage.
5274
ce97fa81
ST
52752010-04-18 Sriraman Tallam <tmsriram@google.com>
5276
5277 * icf.cc (get_section_contents): Check for preemptible functions.
5278 Ignore addend when appropriate.
5279 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5280 section folded.
5281 (add_from_relobj): Check for section folded.
5282 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5283 * symtab.h (should_add_dynsym_entry): Add new parameter.
5284 * target-reloc.h (scan_relocs): Check for section folded.
5285 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5286 Check reloc types for function pointers in shared objects.
5287 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5288 case.
5289 (icf_preemptible_functions_test): New test case.
5290 (icf_string_merge_test): New test case.
5291 * testsuite.Makefile.in: Regenerate.
5292 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5293 bar_glob. Refactor code.
5294 * testsuite/icf_preemptible_functions_test.cc: New file.
5295 * testsuite/icf_preemptible_functions_test.sh: New file.
5296 * testsuite/icf_string_merge_test.cc: New file.
5297 * testsuite/icf_string_merge_test.sh: New file.
5298 * testsuite/icf_virtual_function_folding_test.cc: New file.
5299 * testsuite/icf_virtual_function_folding_test.sh: New file.
5300
04ceb17c
DK
53012010-04-14 Doug Kwan <dougkwan@google.com>
5302
5303 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5304 for local symbol recounting if we remove a section due to ICF.
5305 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5306 there are no regular objects in input.
5307
153e7da4
DK
53082010-04-13 Doug Kwan <dougkwan@google.com>
5309
5310 * arm.cc (Arm_input_section::set_final_data_size): Compute
5311 accurate final data size instead of using current data size.
5312
4dbd9faf
DK
53132010-04-09 Doug Kwan <dougkwan@google.com>
5314
5315 * layout.cc (Layout::choose_output_section): Handle script section
5316 types.
5317 (Layout::make_output_section_for_script): Add section type parameter.
5318 Handle script section types.
5319 * layout.h (Layout::make_output_section_for_script): Add section
5320 type parameter.
5321 * output.cc (Output_section::Output_section): Initialize data member
5322 is_noload_.
5323 (Output_section::do_reset_address_and_file_offset): Do not set address
5324 to 0 if section is a NOLOAD section.
5325 * output.h (Output_section::is_noload): New method.
5326 (Output_section::set_is_noload): Ditto.
5327 (Output_section::is_noload_): New data member.
5328 * script-c.h (Script_section_type): New enum type.
5329 (struct Parser_output_section_header): Add new file section_type.
5330 * script-sections.cc (Sections_element::output_section_name): Add
5331 parameter for returning script section type.
5332 (Output_section_definition::output_section_name): Ditto.
5333 (Output_section_definition::section_type)P; New method.
5334 (Output_section_definiton::script_section_type_name): Ditto.
5335 (Output_section_definition::script_section_type_): New data member.
5336 (Output_section_definition::Output_section_definition): Initialize
5337 data member Output_section_definition::script_section_type_.
5338 (Output_section_definition::create_sections): Pass script section type
5339 to Layout::make_output_section_for_script.
5340 (Output_section_definition::output_section_name): Return script
5341 section type to caller.
5342 (Output_section_definition::set_section_address): Do not advance
5343 dot value and load address if section type is NOLOAD. Set address
5344 of NOLOAD sections regardless of section flags.
5345 (Output_section_definition::print): Print section type if it is
5346 not SCRIPT_SECTION_TYPE_NONE.
5347 (Output_section_definition::section_type): New method.
5348 (Output_section_definition::script_section_type_name): Ditto.
5349 (Script_sections::output_section_name): Add new parameter
5350 PSECTION_TYPE for returning script section type. Pass it to
5351 section elements. Handle discard sections.
5352 (Sort_output_sections::operator()): Handle NOLOAD sections.
5353 * script-sections.h (Script_sections::Section_type): New enum type.
5354 (Script_sections::output_section_name): Add a new parameter for
5355 returning script section type.
5356 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5357 INFO and NOLOAD.
5358 * yyscript.y (union): Add new field SECTION_TYPE.
5359 (COPY, DSECT, INFO, NOLOAD): New tokens.
5360 (opt_address_and_section_type): Change type to output_section_header.
5361 (section_type): New non-terminal
5362 (section_header): Handle section type.
2253bfba 5363 (opt_address_and_section_type): Return section type value.
4dbd9faf 5364
721ea635
L
53652010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5366
5367 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5368 * testsuite/plugin_common_test_2.c (foo): Likewise.
5369
6bf924b0
DK
53702010-04-08 Doug Kwan <dougkwan@google.com>
5371
5372 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5373 Output_merge_data.
5374 * output.cc (Output_section::add_merge_input_section): Simplify
5375 code and return status of Output_merge_base::add_input_section.
e1df38aa 5376 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5377 returns true.
5378
24af6f92
DK
53792010-04-07 Doug Kwan <dougkwan@google.com>
5380
5381 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5382 if section is marked as containing instructions but has no mapping
5383 symbols.
5384 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5385 correct section index.
5386 (Arm_relobj::find_linked_text_section): Ditto.
5387
00698fc5
CC
53882010-04-07 Cary Coutant <ccoutant@google.com>
5389
5390 * archive.cc (include_member): Destroy Read_symbols_data object before
5391 releasing file.
5392 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5393 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5394 (Read_symbols_data::~Read_symbols_data) New destructor.
5395 (Section_relocs::Section_relocs) New constructor.
5396 (Section_relocs::~Section_relocs) New destructor.
5397 (Read_relocs_data::Read_relocs_data) New constructor.
5398 (Read_relocs_data::~Read_relocs_data) New destructor.
5399 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5400 pointers to NULL after deleting.
5401
7296d933
DK
54022010-04-07 Doug Kwan <dougkwan@google.com>
5403
5404 * arm.cc: Replace "endianity" with "endianness" in comments.
5405 (Arm_exidx_cantunwind): Ditto.
5406 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5407 (Arm_relobj::merge_flags_and_attributes): New method.
5408 (Arm_relobj::merge_flags_and_attributes_): New data member.
5409 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5410 (Arm_relobj::scan_sections_for_stubs): Ditto.
5411 (Arm_relobj::do_read_symbols): Check to see if we really want to
5412 merge processor-specific flags and attributes. Exit early if
5413 an object is empty except for section names and the undefined symbol.
5414 (Target_arm::do_finalize_sections): Move check for ELF format to
5415 Arm_relobj::do_read_symbols. Merge processor specific flags and
5416 attributes from a regular object only when we have determined that
5417 it is aapropriate. Do not create an .ARM.attributes section in
5418 output if there is no regular input object.
5419 (Target_arm::merge_processor_specific_flags): Check
5420 --warn-mismatch before printing any error.
5421 (Target_arm::merge_object_attributes): Ditto.
5422 * gold.cc (queue_middle_tasks): Handle the case in which there is
5423 no regular object in input.
5424 * options.cc (General_options::parse_EB): New method.
5425 (General_options::parse_EL): Same.
5426 (General_options::General_options): Initialize endianness_.
5427 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5428 New options.
5429 (General_options::Endianness): New enum.
5430 (General_options::endianness): New method.
5431 (General_options::endianness_): New data member.
5432 * parameters.cc (Parameters::set_options): Check target endianness.
5433 (Parameters::set_target_once): Ditto.
5434 (Parameters::check_target_endianness): New method.
5435 (parameters_force_valid_target): If either -EL or -EB is specified,
5436 use it to define endianness of default target.
5437 * parameters.h (Parameters::check_target_endianness): New method
5438 declaration.
5439 * target.h (class Target): Change "endianity" to "endianness"
5440 in comments.
5441
efc8d4f2
RW
54422010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5443
5444 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5445 * configure: Regenerate.
5446 * Makefile.in: Regenerate.
5447 * testsuite/Makefile.in: Regenerate.
5448
be234d88
CC
54492010-04-06 Cary Coutant <ccoutant@google.com>
5450
5451 gcc PR lto/42757
5452 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5453 prevailing definitions of common symbols.
5454 * testsuite/plugin_test_6.sh: New test case.
5455 * testsuite/plugin_common_test_1.c: New test case.
5456 * testsuite/plugin_common_test_2.c: New test case.
5457 * testsuite/Makefile.am (plugin_test_6): New test case.
5458 * testsuite/Makefile.in: Regenerate.
5459
bd32c6bd
NC
54602010-04-06 Nick Clifton <nickc@redhat.com>
5461
5462 * po/vi.po: New Vietnamese translation.
5463
323c532f
DK
54642010-03-30 Doug Kwan <dougkwan@google.com>
5465
5466 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5467
4fcd97eb
DK
54682010-03-25 Doug Kwan <dougkwan@google.com>
5469
5470 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5471 to avoid a conversion warning on a 32-bit host.
5472
4ebf39db
ILT
54732010-03-24 Ian Lance Taylor <iant@google.com>
5474
5475 * testsuite/script_test_3.t: Add a TLS segment.
5476 * testsuite/Makefile.am (check_PROGRAMS): Add
5477 tls_phdrs_script_test.
5478 (tls_phdrs_script_test_SOURCES): Define.
5479 (tls_phdrs_script_test_DEPENDENCIES): Define.
5480 (tls_phdrs_script_test_LDFLAGS): Define.
5481 (tls_phdrs_script_test_LDADD): Define.
5482 * testsuite/Makefile.in: Rebuild.
5483
4a599bdd
CC
54842010-03-23 Cary Coutant <ccoutant@google.com>
5485
5486 * fileread.cc (find_or_make_view): Fix comment.
5487
6c93b22c
ILT
54882010-03-23 Ian Lance Taylor <iant@google.com>
5489
5490 * script-sections.cc (class Orphan_section_placement): Define
5491 PLACE_TLS and PLACE_TLS_BSS.
5492 (Orphan_section_placement::Orphan_section_placement): Initialize
5493 new places.
5494 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5495 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5496 (tls_script_test_SOURCES): Define.
5497 (tls_script_test_DEPENDENCIES): Define.
5498 (tls_script_test_LDFLAGS): Define.
5499 (tls_script_test_LDADD): Define.
5500 * testsuite/Makefile.in: Rebuild.
5501
a2c7281b
DK
55022010-03-22 Doug Kwan <dougkwan@google.com>
5503
5504 * arm.cc (Arm_relocate_functions::abs8,
5505 Arm_relocate_functions::abs16): Use correct check for overflow
5506 specified in the ARM ELF specs.
5507 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5508 target of a BLX instruction specially.
5509 (Reloc_stub::stub_type_for_reloc): Ditto.
5510 (Relocate::relocate): Use symbolic names instead of numeric relocation
5511 codes to report error.
5512 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5513 workaround.
5514 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5515 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5516 thumb2_blx_out_of_range.stdout
5517 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5518 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5519 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5520 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5521 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5522 thumb2_blx_in_range, thumb2_blx_in_range.o,
5523 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5524 thumb2_blx_out_of_range.o): New rules.
5525 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5526 thumb2_blx_in_range and thumb2_blx_out_of_range.
5527 * testsuite/Makefile.in: Regenerate.
5528 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5529 * testsuite/thumb_blx_in_range.s: New file.
5530 * testsuite/thumb_blx_out_of_range.s: New file.
5531
b0193076
RÁE
55322010-03-22 Rafael Espindola <espindola@google.com>
5533
5534 * archive.cc (Should_include): Move to archive.h.
5535 (should_include_member): Make it a member of Archive.
5536 (Lib_group): New.
5537 (Add_lib_group_symbols): New.
5538 * archive.h: Include options.h.
5539 (Archive_member): Moved from Archive.
5540 (Should_include): Moved from archive.cc.
5541 (Lib_group): New.
5542 (Add_lib_group_symbols): New.
5543 * dynobj.cc (do_should_include_member): New.
5544 * dynobj.h (do_should_include_member): New.
5545 * gold.cc (queue_initial_tasks): Update call to queue.
5546 * main.cc (main): Print lib group stats.
5547 * object.cc (do_should_include_member): New.
5548 * object.h: Include archive.h.
5549 (Object::should_include_member): New.
5550 (Object::do_should_include_member): New.
5551 (Sized_relobj::do_should_include_member): New.
5552 * options.cc (General_options::parse_start_lib): New.
5553 (General_options::parse_end_lib): New.
5554 (Input_arguments::add_file): Handle lib groups.
5555 (Input_arguments::start_group): Check we are not in a lib.
5556 (Input_arguments::start_lib): New.
5557 (Input_arguments::end_lib): New.
5558 * options.h (General_options): Add start_lib and end_lib.
5559 (Input_argument::lib_): New.
5560 (Input_argument::lib): New.
5561 (Input_argument::is_lib): New.
5562 (Input_file_lib): New.
5563 (Input_arguments::in_lib_): New.
5564 (Input_arguments::in_lib): New.
5565 (Input_arguments::start_lib): New.
5566 (Input_arguments::end_lib_): New.
5567 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5568 in unused members as preempted.
5569 (Sized_pluginobj::do_should_include_member): New.
5570 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5571 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5572 return the blocker.
5573 (Read_symbols::do_whole_lib_group): New.
5574 (Read_symbols::do_lib_group): New.
5575 (Read_symbols::do_read_symbols): Handle lib groups.
5576 (Read_symbols::get_name): Handle lib groups.
5577 * readsyms.h (Read_symbols): Add an archive member pointer.
5578 (Read_symbols::do_whole_lib_group): New.
5579 (Read_symbols::do_lib_group): New.
5580 (Read_symbols::member_): New.
5581 * script.cc (read_input_script): Update call to queue_soon.
5582
d099120c
DK
55832010-03-19 Doug Kwan <dougkwan@google.com>
5584
5585 * arm.cc (Stub_table::Stub_table): Initialize new data members
5586 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5587 (Stub_table::add_reloc_stub): Assign stub offset and update
5588 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5589 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5590 New data members.
5591 (Stub_table::update_data_size_and_addralign): Use
5592 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5593 instead of going over all reloc stubs.
5594 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5595 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5596 Stringpool_template::offset_ to size of Stringpool_char.
5597 (Stringpool_template::new_key_offset): Remove code to initialize
5598 Stringpool_template::offset_.
5599 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5600 Stringpool_template::offset_ to zero.
5601
1aa37384
DK
56022010-03-15 Doug Kwan <dougkwan@google.com>
5603
5604 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5605 offset_.
5606 (Stringpool_template::new_key_offset): New method.
5607 (Stringpool_template::add_string): Assign offsets when adding new
5608 strings.
5609 (Stringpool_template::set_string_offsets): Do not set string offsets
5610 when not optimizing.
5611 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5612 member size_.
5613 (Chunked_vector::clear): Clear size_.
5614 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5615 (Chunked_vector::size): Return size_.
5616 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5617 (Chunked_vector::size_): New data member.
1aa37384
DK
5618 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5619 (Stringpool_template::new_key_offset): New method declaration.
5620 (Stringpool_template::offset_): New data member.
5621
b672b057
RÁE
56222010-03-15 Rafael Espindola <espindola@google.com>
5623
5624 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5625 Add_symbols' constructor.
5626 * readsyms.h (Add_symbols): Remove the input_group member.
5627
b6848d3c
ILT
56282010-03-10 Ian Lance Taylor <iant@google.com>
5629
5630 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5631 target to ask whether a reference to a symbol requires a stack
5632 split.
5633 * target.h (Target::is_call_to_non_split): New function.
5634 (Target::do_is_call_to_non_split): Declare virtual function.
5635 * target.cc: Include "symtab.h".
5636 (Target::do_is_call_to_non_split): New function.
5637 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5638
a2a5469e
CC
56392010-03-10 Cary Coutant <ccoutant@google.com>
5640
5641 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5642 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5643 (File_read::open[2]): Add whole_file_view_ to list of views.
5644 (File_read::make_view): Remove test of whole_file_view_.
5645 (File_read::find_or_make_view): Create whole_file_view_ if
5646 necessary.
5647 (File_read::clear_views): Replace bool parameter with enum;
5648 adjust all callers. Don't delete views with permanent data;
5649 do delete cached views and views from archives if
5650 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5651 if clearing the corresponding view.
5652 * fileread.h (File_read::Clear_views_mode): New enum.
5653 (File_read::View::is_permanent_view): New method.
5654 (File_read::clear_views): Replace bool parameter
5655 with enum; adjust all callers.
5656 * options.h (General_options): Change keep_files_mapped option;
5657 add map_whole_files.
5658 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5659 releasing the file.
5660 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5661 the file.
5662
8861f32b
DM
56632010-03-10 David S. Miller <davem@davemloft.net>
5664
5665 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5666
d62d0f5f
ST
56672010-03-09 Sriraman Tallam <tmsriram@google.com>
5668
5669 * icf.cc (get_section_contents): Add '@' marker after processing the
5670 merge reloc.
5671
9177756d
DK
56722010-03-08 Doug Kwan <dougkwan@google.com>
5673
5674 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5675 due to a conversion warning.
5676 (Arm_relobj::update_output_local_symbol_count): Check for local
5677 symbol with unset output index.
5678
9e9e071b
ILT
56792010-03-05 Ian Lance Taylor <iant@google.com>
5680
5681 * options.h (class General_options): Add --spare-dynamic-tags.
5682 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5683 --spare-dynamic-tags.
5684
a81ee015
ILT
56852010-03-05 Ian Lance Taylor <iant@google.com>
5686
5687 * incremental.cc: Include "libiberty.h".
5688
44ec90b9
RO
56892010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5690
5691 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5692 function, is_info_ member.
5693 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5694 (Versions::Versions): Update caller.
5695 (Versions::define_base_version): Likewise.
5696 (Versions::add_def): Likewise.
5697
0897ed3b
ST
56982010-03-03 Sriraman Tallam <tmsriram@google.com>
5699
5700 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5701 (Scan::possible_function_pointer_reloc): New function.
5702 (Scan::local_reloc_may_be_function_pointer): Change to call
5703 possible_function_pointer_reloc.
5704 (Scan::global_reloc_may_be_function_pointer): Ditto.
5705 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5706 relocations in ".data.rel.ro._ZTV" section.
5707 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5708 * testsuite/icf_safe_so_test.cc: Ditto.
5709 * testsuite/icf_safe_test.cc: Ditto.
5710 * testsuite/icf_safe_test.sh: Ditto.
5711
d3bbad62
ILT
57122010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5713 Ian Lance Taylor <iant@google.com>
5714
5715 * target-reloc.h (relocate_section): Check the symbol table index
5716 for -1U before setting the local symbol index.
5717 (scan_relocatable_relocs): If copying the relocation, record that
5718 the local symbol is required.
5719 * object.h (Symbol_value::is_output_symtab_index_set): New
5720 function.
5721 (Symbol_value::may_be_discarded_from_output_symtab): New
5722 function.
5723 (Symbol_value::has_output_symtab_entry): New function.
5724 (Symbol_value::needs_output_symtab_entry): Remove.
5725 (Symbol_value::output_symtab_index): Make sure the symbol index is
5726 set.
5727 (Symbol_value::set_output_symtab_index): Make sure the symbol
5728 index is not set. Make sure the new index is valid.
5729 (Symbol_value::set_must_have_output_symtab_entry): New function.
5730 (Symbol_value::has_output_dynsym_entry): New function.
5731 (Symbol_value::set_output_dynsym_index): Make sure the new index
5732 is valid.
5733 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5734 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5735 local symbol if permitted.
5736 (Sized_relobj::do_finalize_local_symbols): Call
5737 is_output_symtab_index_set rather than needs_output_symtab_entry.
5738 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5739 rather than needs_output_symtab_entry. Call
5740 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5741 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5742 is_output_symtab_index_set rather than needs_output_symtab_entry.
5743 * testsuite/discard_locals_relocatable_test.c: New file.
5744 * testsuite/discard_locals_test.sh: Test -r.
5745 * testsuite/Makefile.am (check_DATA): Add
5746 discard_locals_relocatable_test1.syms,
5747 discard_local_relocatable_test2.syms.
5748 (MOSTLYCLEANFILES): Likewise. Also add
5749 discard_locals_relocatable_test1.lout and
5750 discard_locals_relocatable_test2.out.
5751 (discard_locals_relocatable_test1.syms): New target.
5752 (discard_locals_relocatable_test.o): New target.
5753 (discard_locals_relocatable_test1.out): New target.
5754 (discard_locals_relocatable_test2.syms): New target.
5755 (discard_locals_relocatable_test2.out): New target.
5756 (various): Add missing ../ld-new dependencies.
5757 * testsuite/Makefile.in: Rebuild.
5758
7e8ccf26
NC
57592010-03-03 Nick Clifton <nickc@redhat.com>
5760
5761 * po/fi.po: New Finnish translation.
5762
2a0ff005
DK
57632010-03-01 Doug Kwan <dougkwan@google.com>
5764
5765 * layout.cc (Layout::Layout): Force section types of .init_array*,
5766 .preinit_array* and .fini_array* sections.
5767 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5768 Fix check of return value of std::string::find.().
5769 (Output_section::Input_section_sort_compare::operator()): Remove
5770 comment about .init_array.
5771 (Output_section::Input_section_sort_init_fini_compare::operator()):
5772 New method.
5773 (Output_section::sort_attached_input_sections): Handle .init_array
5774 and .fini_array specially.
5775 * output.h (Output_section::Inut_section_sort_compare): Update
5776 comment.
5777 (Output_section::Input_section_sort_init_fini_compare): New struct.
5778
c3e4ae29
DK
57792010-02-26 Doug Kwan <dougkwan@google.com>
5780
5781 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5782 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5783 * testsuite/debug_msg.sh: Avoid matching source line number for
5784 use of global variable undef_int.
5785
2fd9ae7a
DK
57862010-02-26 Doug Kwan <dougkwan@google.com>
5787
5788 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5789 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5790 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5791 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5792 * options.cc (General_options::General_options): Initialize member
5793 fix_v4bx_.
5794 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5795 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5796 and rm_no_fix_v4bx.stdout
5797 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5798 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5799 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5800 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5801 and arm_no_fix_v4bx.
5802 * Makefile.in: Regenerate.
5803 * testsuite/arm_fix_v4bx.s: New file.
5804 * testsuite/arm_fix_v4bx.sh: Ditto.
5805
67ec7d0b
DK
58062010-02-24 Doug Kwan <dougkwan@google.com>
5807
5808 * arm.cc (Target_arm::got_section): Make the .got section the first
5809 non RELRO section in the data segment.
5810 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5811 suffixes of section names.
5812
10165461
DK
58132010-02-24 Doug Kwan <dougkwan@google.com>
5814
5815 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5816 flags and attributes merging if an input file is a binary file.
5817 * fileread.cc (Input_file::open): Record format of original file.
5818 * fileread.h (Input_file::Format): New enum type.
5819 (Input_file::Input_file): Initialize data member format_.
5820 (Input_file::format): New method definition.
5821 (Input_file::format_):: New data member.
5822
4a54abbb
DK
58232010-02-24 Doug Kwan <dougkwan@google.com>
5824
5825 * arm.cc (Arm_output_data_got): New class.
5826 (ARM_TCB_SIZE): New constant
5827 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5828 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5829 If user uses a script with a SECTIONS clause, issue only a warning
5830 for a misplaced EXIDX input section. Otherwise, issue an error.
5831 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5832 garbage collection.
5833 (Target_arm::got_mode_index_entry): Handle static linking.
5834 (Target_arm::Scan::local): Ditto.
5835 (Target_arm::Scan::global): Ditto.
5836 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5837 all incorrectly implemented relocations.
e1df38aa 5838 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5839 Arm_output_section::fix_exidx_coverage.
5840 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5841 from ".ARM.exidx." and ".ARM.extab.".
5842
ca419a6f
ILT
58432010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5844
5845 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5846 section if it does not already exist.
5847 * attributes.cc (Attributes_section_data::Attributes_section_data):
5848 Don't crash if size is zero.
5849
135b9c78
ILT
58502010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5851 Ian Lance Taylor <iant@google.com>
5852
5853 * gold.cc (queue_middle_tasks): If no input files were opened,
5854 exit.
5855 * workqueue.h (Task_function::Task_function): Assert that there is
5856 a blocker.
5857
bb0bfe4f
DK
58582010-02-22 Doug Kwan <dougkwan@google.com>
5859
5860 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5861 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5862 types to avoid warnings due to different uint64_t implementations
5863 on different hosts.
5864
2a2b6d42
DK
58652010-02-21 Doug Kwan <dougkwan@google.com>
5866
5867 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5868 handling of the maximum backward branch offset.
5869 (Arm_relocate_functions::thumb_branch_common): Ditto.
5870 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5871 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5872 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5873 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5874 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5875 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5876 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5877 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5878 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5879 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5880 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5881 thumb2_bl_out_of_range.o): New rules.
5882 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5883 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5884 thumb2_bl_out_of_range
5885 * testsuite/Makefile.in: Regenerate.
5886 * testsuite/arm_bl_in_range.s: New file.
5887 * testsuite/arm_bl_out_of_range.s: Ditto.
5888 * testsuite/arm_branch_in_range.sh: Ditto.
5889 * testsuite/arm_branch_range.t: Ditto.
5890 * testsuite/thumb2_branch_range.t: Ditto.
5891 * testsuite/thumb_bl_in_range.s: Ditto.
5892 * testsuite/thumb_bl_out_of_range.s: Ditto.
5893 * testsuite/thumb_branch_range.t: Ditto.
5894
b487ad64
ST
58952010-02-20 Sriraman Tallam <tmsriram@google.com>
5896
5897 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5898 Add reloc offset information.
5899 * icf.cc (get_section_contents): Change iterators to point to the new
5900 vectors. Add reloc offset information to the contents.
5901 * icf.h (Icf::Sections_reachable_info): New typedef.
5902 (Icf::Sections_reachable_list): New typedef.
5903 (Icf::Offset_info): New typedef.
5904 (Icf::Reloc_info): New struct typedef.
5905 (Icf::Reloc_info_list): New typedef.
5906 (Icf::symbol_reloc_list): Delete method.
5907 (Icf::addend_reloc_list): Delete method.
5908 (Icf::section_reloc_list): Delete method.
5909 (Icf::reloc_info_list): New method.
5910 (Icf::reloc_info_list_): New member.
5911
f96accdf
DK
59122010-02-19 Doug Kwan <dougkwan@google.com>
5913
5914 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5915 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5916 * arm.cc (Arm_relocation_functions): New forward declaration.
5917 (Target_arm::Target_arm): Initialize new data members
5918 got_mod_index_offset_ and tls_base_symbol_defined_.
5919 (Target_arm::Relocate::relocate_tls): New method.
5920 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5921 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5922 New methods.
5923 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5924 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5925 (Target_arm::got_mod_index_offset_,
5926 Target_arm::tls_base_symbol_defined_): New data members.
5927 (Target_arm::Scan::local, Target::Scan::global,
5928 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5929 relocations.
5930
c8761b9a
DK
59312010-02-18 Doug Kwan <dougkwan@google.com>
5932
5933 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5934 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5935 text section as a parameter becuase some broken tools may not set
5936 the link in section header.
5937 (Target_arm::has_got_section): New method.
5938 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5939 without any mapping symbol as data only. Remove warning.
5940 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5941 link in its section header, try to discover the link by inspecting the
5942 REL31 relocation at the beginning of the section.
5943 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5944 in error message.
5945 (Target_arm::Scan::global): Treat any reference to the symbol
5946 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5947
21bb3914
ST
59482010-02-12 Sriraman Tallam <tmsriram@google.com>
5949
5950 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5951 (Scan::global_reloc_may_be_function_pointer): New function.
5952 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5953 (Scan::global_reloc_may_be_function_pointer): New function.
5954 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5955 (Scan::global_reloc_may_be_function_pointer): New function.
5956 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5957 (Scan::global_reloc_may_be_function_pointer): New function.
5958 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5959 (Scan::global_reloc_may_be_function_pointer): New function.
5960 (Scan::possible_function_pointer_reloc): New function.
5961 (Target_x86_64::can_check_for_function_pointers): New function.
5962 * gc.h (gc_process_relocs): Scan relocation types to determine if
5963 function pointers were taken for targets that support it.
5964 * icf.cc (Icf::find_identical_sections): Include functions for
5965 folding in safe ICF whose pointer is not taken.
5966 * icf.h (Secn_fptr_taken_set): New typedef.
5967 (fptr_section_id_): New member.
5968 (section_has_function_pointers): New function.
5969 (set_section_has_function_pointers): New function.
5970 (check_section_for_function_pointers): New function.
5971 * options.h: Fix comment for safe ICF option.
5972 * target.h (can_check_for_function_pointers): New function.
5973 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5974 Modify icf_safe_test for X86-64.
5975 * testsuite/Makefile.in: Regenerate.
5976 * testsuite/icf_safe_so_test.cc: New file.
5977 * testsuite/icf_safe_so_test.sh: New file.
5978 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5979 (main): Change to take pointer to function kept_func_3.
5980 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5981 folding is done correctly for X86-64.
5982
0da6fa6c
DM
59832010-02-12 David S. Miller <davem@davemloft.net>
5984
5985 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5986 is_symbolless parameter.
5987 (Output_reloc<SHT_REL>::is_symbolless): New.
5988 (Output_reloc<SHT_REL>::is_symbolless_): New.
5989 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5990 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5991 (Output_reloc<SHT_RELA>::is_symbolless): New.
5992 (Output_data_reloc::add_global): Handle is_symbolless.
5993 (Output_data_reloc::add_global_relative): Likewise.
5994 (Output_data_reloc::add_local): Likewise.
5995 (Output_data_reloc::add_local_relative): Likewise.
5996 (Output_data_reloc::add_symbolless_global_addend): New.
5997 (Output_data_reloc::add_symbolless_local_addend): New.
5998 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5999 is_symbolless.
6000 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6001 instead of ->is_relative_
6002 (Output_reloc::write): Likewise.
6003 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6004 (Output_reloc::write_rel): Simplify.
6005
6006 * sparc.cc (Target_sparc::Scan::local): Use
6007 ->add_symbolless_local_addend as needed.
6008 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6009 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6010 based upon relocation offset.
6011
e4782e83
DK
60122010-02-11 Doug Kwan <dougkwan@google.com>
6013
6014 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6015 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6016 beginning of function.
6017 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6018 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6019 parameter is_32bit in calls to should_apply_static_reloc.
6020 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6021 (check_DATA): Add arm_abs_global.stdout.
6022 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6023 arm_abs_global.stdout): New rules.
6024 (MOSTLLYCLEANFILES): Add arm_abs_global
6025 * Makefile.in: Regenerate.
6026 * testsuite/arm_abs_global.s: New file.
6027 * testsuite/arm_abs_global.sh: Ditto.
6028 * testsuite/arm_abs_lib.s: Ditto.
6029
93ceb764
ILT
60302010-02-11 Ian Lance Taylor <iant@google.com>
6031
6032 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6033 Read_relocs task.
6034 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6035 Allocate_commons_task first.
6036 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6037 task, rather than symtab_lock_.
6038 (Gc_process_relocs::~Gc_process_relocs): New function.
6039 (Gc_process_relocs::is_runnable): Check this_blocker_.
6040 (Gc_process_relocs::locks): Use next_blocker_ rather than
6041 blocker_.
6042 (Scan_relocs::~Scan_relocs): New function.
6043 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6044 symtab_lock_.
6045 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6046 next_blocker_.
6047 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6048 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6049 constructor accordingly.
6050 (class Gc_process_relocs): Likewise.
6051 (class Scan_relocs): Likewise.
6052 * common.h (class Allocate_commons_task): Remove symtab_lock_
6053 field, and corresponding constructor parameter.
6054 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6055 symtab_lock_.
6056 (Allocate_commons_task::locks): Likewise.
6057
114dfbe1
ILT
60582010-02-11 Ian Lance Taylor <iant@google.com>
6059
6060 * gold-threads.h (class Once): Define.
6061 (class Initialize_lock): Rewrite as child of Once.
6062 * gold-threads.cc (class Once_initialize): Define.
6063 (once_pointer_control): New static variable.
6064 (once_pointer, once_arg): New static variables.
6065 (c_run_once): New static function.
6066 (Once::Once, Once::run_once, Once::internal_run): New functions.
6067 (class Initialize_lock_once): Remove.
6068 (initialize_lock_control): Remove.
6069 (initialize_lock_pointer): Remove.
6070 (initialize_lock_once): Remove.
6071 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6072 (Initialize_lock::initialize): Rewrite.
6073 (Initialize_lock::do_run_once): New function.
6074 * archive.cc (Archive::interpret_header): Only clear name if it is
6075 not already empty.
6076 * fileread.cc: Include "gold-threads.h"
6077 (file_counts_lock): New static variable.
6078 (file_counts_initialize_lock): Likewise.
6079 (File_read::release): Only increment counts when using --stats.
6080 Use a lock around the increment.
6081 * parameters.cc (class Set_parameters_target_once): Define.
6082 (set_parameters_target_once): New static variable.
6083 (Parameters::Parameters): Move here from parameters.h.
6084 (Parameters::set_target): Rewrite.
6085 (Parameters::set_target_once): New function.
6086 (Parameters::clear_target): Move here and rewrite.
6087 * parameters.h (class Parameters): Update declarations. Add
6088 set_parameters_target_once_ field.
6089 (Parameters::Parameters): Move to parameters.cc.
6090 (Parameters::clear_target): Likewise.
6091 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6092 task.
6093 (Start_group::~Start_group): New function.
6094 (Start_group::is_runnable): New function.
6095 (Start_group::locks, Start_group::run): New functions.
6096 (Finish_group::run): Change saw_undefined to size_t.
6097 * readsyms.h (class Start_group): Define.
6098 (class Finish_group): Change saw_undefined_ field to size_t.
6099 (Finish_group::Finish_group): Remove saw_undefined and
6100 this_blocker parameters. Change all callers.
6101 (Finish_group::set_saw_undefined): New function.
6102 (Finish_group::set_blocker): New function.
6103 * symtab.h (class Symbol_table): Change saw_undefined to return
6104 size_t. Change saw_undefined_ field to size_t.
6105 * target-select.cc (Set_target_once::do_run_once): New function.
6106 (Target_selector::Target_selector): Initialize set_target_once_
6107 field. Don't initialize lock_ and initialize_lock_ fields.
6108 (Target_selector::instantiate_target): Rewrite.
6109 (Target_selector::set_target): New function.
6110 * target-select.h (class Set_target_once): Define.
6111 (class Target_selector): Update declarations. Make
6112 Set_target_once a friend. Remove lock_ and initialize_lock_
6113 fields. Add set_target_once_ field.
6114
fa17a3f4
ILT
61152010-02-10 Ian Lance Taylor <iant@google.com>
6116
6117 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6118 queueing any tasks.
6119 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6120 (queue_middle_tasks): Add all blockers before queueing any tasks.
6121 (queue_final_tasks): Likewise.
6122 * token.h (Task_token::add_blockers): New function.
6123 * object.h (Input_objects::number_of_relobjs): New function.
6124
c7177d31
ILT
61252010-02-10 Ian Lance Taylor <iant@google.com>
6126
5de0e392
ILT
6127 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6128 shared, not if not position independent.
6129 * x86_64.cc (Relocate::relocate_tls): Likewise.
6130 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6131 (tls_pie_pic_test): New target.
6132 * testsuite/Makefile.in: Rebuild.
6133
c7177d31
ILT
6134 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6135 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6136 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6137 * testsuite/Makefile.in: Rebuild.
6138
684b268a
DM
61392010-02-09 David S. Miller <davem@davemloft.net>
6140
6141 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6142 R_SPARC_RELATIVE using ->add_local_relative().
6143 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6144
612a8d3d
DM
6145 * output.h (Output_data_dynamic::add_section_size): New method
6146 that takes two Output_data objects.
6147 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6148 entry param. Handle it in initializers.
6149 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6150 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6151 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6152 arg.
6153 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6154 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6155 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6156 for dynrel_includes_plt.
6157 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6158 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6159 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6160 before .rela.plt
6161 (Target_sparc::do_finalize_sections): Update to pass true for
6162 dynrel_includes_plt.
6163 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6164 output before .rela.plt
6165 (Target_powerpc::do_finalize_sections): Update to pass true for
6166 dynrel_includes_plt when 32-bit.
6167
cb1be87e
DK
61682010-02-08 Doug Kwan <dougkwan@google.com>
6169
6170 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6171 method.
6172 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6173 Arm_relobj::scan_section_for_cortex_a8_stubs,
6174 Arm_relobj::do_relocation_section): Instead of calling
6175 Output_section::output_address, use faster
6176 Arm_relobj::simple_input_section_output_address.
6177
705b5121
DM
61782010-02-08 David S. Miller <davem@davemloft.net>
6179
6180 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6181 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6182 relocation helper function.
6183
024c4466
DM
6184 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6185 just like R_SPARC_GOT{10,13,22}.
6186 (Target_sparc::Scan::local): Likewise.
6187 (Target_sparc::Relocate:relocate): Likewise.
6188
9109c078
ILT
61892010-02-06 Ian Lance Taylor <iant@google.com>
6190
6191 * configure.ac: Rewrite targetobjs duplicate removal code to use
6192 only shell constructs.
6193 * configure: Rebuild.
6194
cf846138
DK
61952010-02-05 Doug Kwan <dougkwan@google.com>
6196
6197 PR 11247
6198 * arm.cc (Arm_relobj::section_is_scannable): New method.
6199 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6200 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6201
6cfaf60b
DK
62022010-02-04 Doug Kwan <dougkwan@google.com>
6203
6204 PR 11247
6205 * arm-reloc-property.cc (cstdio): Include.
6206 * configure.ac (targetobjs): Remove duplicates.
6207 * configure: Regenerate.
6208 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6209 big and little endian version for a given address size.
6210
5c57f1be
DK
62112010-02-03 Doug Kwan <dougkwan@google.com>
6212
6213 * arm-reloc-property.cc
6214 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6215 definition.
6216 * arm-reloc-property.h
6217 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6218 New method definition.
6219 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6220 declaration.
6221 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6222 overflow to N.
6223 (GOT_PREL): Change implemented to Y.
6224 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6225 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6226 (Arm_relocate_functions::movw_abs_nc): Remove method.
6227 (Arm_relocate_functions::movt_abs): Ditto.
6228 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6229 (Arm_relocate_functions::thm_movt_abs): Ditto.
6230 (Arm_relocate_functions::movw_rel_nc): Ditto.
6231 (Arm_relocate_functions::movw_rel): Ditto.
6232 (Arm_relocate_functions::movt_rel): Ditto.
6233 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6234 (Arm_relocate_functions:thm_movw_rel): Ditto.
6235 (Arm_relocate_functions:thm_movt_rel): Ditto.
6236 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6237 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6238 New method definitions.
6239 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6240 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6241 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6242 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6243 (Target_arm::Relocate::relocate): Check for non-static or
6244 unimplemented relocation code and exit early. Change calls to
6245 Target_arm::reloc_uses_thumb_bit and
6246 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6247 instead. Refactor code to handle similar relocations to increase
6248 code sharing. Remove check for unsupported relocation code in switch
6249 statement.
6250 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6251 relocation property table to find out size. Change error message to
6252 print out the name of a relocation code instead of the numeric value.
6253 (Target_arm::scan_reloc_for_stub): Use relocation property table
6254 instead of calling Target_arm::reloc_uses_thumb_bit().
6255
218c5831
DK
62562010-02-02 Doug Kwan <dougkwan@google.com>
6257
6258 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6259 types of relaxed input section.
6260
0d31c79d
DK
62612010-02-02 Doug Kwan <dougkwan@google.com>
6262
6263 * Makefile.am (HFILES): Add arm-reloc-property.h.
6264 (DEFFILES): New.
6265 (TARGETSOURCES): Add arm-reloc-property.cc
6266 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6267 (libgold_a_SOURCES): $(DEFFILES)
6268 * Makefile.in: Regenerate.
6269 * arm-reloc-property.cc: New file.
6270 * arm-reloc-property.h: New file.
6271 * arm-reloc.def: New file.
6272 * arm.cc: Update comments.
6273 (arm-reloc-property.h): New included header.
6274 (arm_reloc_property_table): New global variable.
6275 (Target_arm::do_select_as_default_target): New method definition.
6276 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6277 arm-reloc-property to targ_extra_obj.
6278 * parameters.cc (set_parameters_target): Call
6279 Target::select_as_default_target().
6280 * target.h (Target::select_as_default_target): New method definition.
6281 (Target::do_select_as_default_target): Same.
6282
546c7457
DK
62832010-02-01 Doug Kwan <dougkwan@google.com>
6284
6285 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6286 first_output_text_section_.
6287 (Arm_exidx_fixup::first_output_text_section): New method definition.
6288 (Arm_exidx_fixup::first_output_text_section_): New data member.
6289 (Arm_exidx_fixup::process_exidx_section): Record the first text
6290 output section seen.
6291 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6292 and entsize in output section header.
6293
11b861d5
DK
62942010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6295
6296 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6297 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6298 (Arm_relocate_functions::thm_alu11): New Method.
6299 (Arm_relocate_functions::thm_pc8): New Method.
6300 (Arm_relocate_functions::thm_pc12): New Method.
6301 (Target_arm::Scan::local): Handle the relocations.
6302 (Target_arm::Scan::global): Likewise.
6303 (Target_arm::Relocate::relocate): Likewise.
6304 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6305
c9a2c125
DK
63062010-01-29 Doug Kwan <dougkwan@google.com>
6307
6308 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6309 of relocation types as ld.
6310
1521477a
DK
63112010-01-29 Doug Kwan <dougkwan@google.com>
6312
6313 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6314 to public.
6315 (Arm_relocate_functions::thumb_branch_common): Ditto.
6316 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6317 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6318 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6319 Arm_relocate_functions::jump24): Remove.
6320 (Target_arm::Relocate::relocate): Adjust code to call
6321 Arm_relocation_functions::arm_branch_common and
6322 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6323 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6324
e7eca48c
DK
63252010-01-29 Doug Kwan <dougkwan@google.com>
6326
6327 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6328 output_local_symbol_count_needs_update_.
6329 (Arm_relobj::output_local_symbol_count_needs_update,
6330 Arm_relobj::set_output_local_symbol_count_needs_update,
6331 Arm_relobj::update_output_local_symbol_count): New methods.
6332 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6333 member.
6334 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6335 of pointed function as in a R_ARM_PREL31 relocation.
6336 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6337 for output local symbol count updating.
6338 (Target_arm::do_relax): Update output local symbol counts in objects
6339 if necessary.
6340 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6341
02961d7e
ILT
63422010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6343
6344 * arm.cc: Added support for the ARM relocations:
6345 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6346 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6347 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6348 movw_prel_nc).
6349 (Arm_relocate_functions::movw_rel): New method.
6350 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6351 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6352 thm_movw_prel_nc).
6353 (Arm_relocate_functions::thm_movw_rel): New method.
6354 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6355 thm_movt_prel).
6356 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6357 relocations.
6358 (Target_arm::Scan::global): Likewise.
6359 (Target_arm::Relocate::relocate): Likewise.
6360 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6361 Likewise.
6362
b10d2873
ILT
63632010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6364
6365 * arm.cc: Added support for ARM group relocations.
6366 (Target_arm::reloc_needs_sym_origin): New method.
6367 (Arm_relocate_functions::calc_grp_kn): New method.
6368 (Arm_relocate_functions::calc_grp_residual): New method.
6369 (Arm_relocate_functions::calc_grp_gn): New method.
6370 (Arm_relocate_functions::arm_grp_alu): New Method.
6371 (Arm_relocate_functions::arm_grp_ldr): New Method.
6372 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6373 (Arm_relocate_functions::arm_grp_ldc): New Method.
6374 (Target_arm::Scan::local): Handle the ARM group relocations.
6375 (Target_arm::Scan::global): Likewise.
6376 (Target_arm::Relocate::relocate): Likewise.
6377 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6378 Likewise.
6379
2b328d4e
DK
63802010-01-26 Doug Kwan <dougkwan@google.com>
6381
6382 * arm.cc (set): Include.
6383 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6384 pointer type.
6385 (Arm_output_section::Text_section_list): New type.
6386 (Arm_output_section::append_text_sections_to_list): New method.
6387 (Arm_output_section::fix_exidx_coverage): Ditto.
6388 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6389 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6390 Relobj::set_section_offset() instead of
6391 Sized_relobj::invalidate_section_offset().
6392 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6393 parameter for section headers. Ignore relocation sections for
6394 unallocated sections and EXIDX sections.
6395 (Target_arm::fix_exidx_coverage): New method.
6396 (Target_arm::output_section_address_less_than): New type.
6397 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6398 linked text section instead of the EXIDX section.
6399 (Arm_output_section::create_stub_group): Add an assertion to check
6400 that this is not an EXIDX output section.
6401 (Arm_output_section::append_text_sections_to_list): New method.
6402 (Arm_output_section::fix_exidx_coverage): Ditto.
6403 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6404 Arm_relobj::section_needs_reloc_stub_scanning.
6405 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6406 first pass.
6407 (Target_arm::fix_exidx_coverage): New method.
6408 * object.h (Relobj::set_output_section): New method.
6409 (Sized_relobj::invalidate_section_offset): Remove method.
6410 (Sized_relobj::do_invalidate_section_offset): Remove method.
6411 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6412
c7f3c371
DK
64132010-01-25 Doug Kwan <dougkwan@google.com>
6414
6415 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6416 Fix warning due to signed and unsigned comparison on a 32-bit host.
6417
8923b24c
DK
64182010-01-22 Doug Kwan <dougkwan@google.com>
6419
6420 * arm.cc (Target_arm::do_relax): Record an output section for section
6421 offset adjustment it contains any stub table that has changed.
6422 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6423 offsets in an output section if necessary.
6424 * output.cc (Output_section::Output_section): Initialize
6425 section_offsets_need_adjustments_.
6426 (Output_section::add_input_section_for_script): Renamed to
6427 Output_section::add_simple_input_section.
6428 (Output_section::save_states): Add a comment.
6429 (Output_section::discard_states): New method defintion.
6430 (Output_section::adjust_section_offsets): Same.
6431 * output.h (Output_section::add_input_section_for_script): Renamed to
6432 Output_section::add_simple_input_section.
6433 (Output_section::discard_states): New method declaration.
6434 (Output_section::adjust_section_offsets): Same.
6435 (Output_section::section_offsets_need_adjustment,
6436 Output_section::set_section_offsets_need_adjustment): New method
6437 definitions.
6438 (Output_section::section_offsets_need_adjustment_): New data member.
6439 * script-sections.cc
6440 (Output_section_element_input::set_section_address): Adjust code for
6441 renaming of Output_section::add_input_section_for_script.
6442 (Orphan_output_section::set_section_address): Same.
6443
9b2fd367
DK
64442010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6445
6446 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6447 Fix_v4bx enum values .
6448 * gold/options.h (General_options): New option definitions.
6449 (General_options::fix_v4bx): New method.
6450 (General_options::Fix_v4bx): New enum.
6451 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6452 (General_options::parse_fix_v4bx_interworking): New method.
6453
80d0d023
DK
64542010-01-22 Doug Kwan <dougkwan@google.com>
6455
6456 * arm.cc (Arm_exidx_fixup): New class.
6457
af2cdeae
DK
64582010-01-21 Doug Kwan <dougkwan@google.com>
6459
6460 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6461 classes.
6462 (Arm_exidx_section_offset_map): New type.
6463
993d07c1
DK
64642010-01-21 Doug Kwan <dougkwan@google.com>
6465
6466 * arm.cc (Arm_exidx_input_section): New class.
6467 (Arm_relobj::exidx_input_section_by_link,
6468 Arm_relobj::exidx_input_section_by_shndx,
6469 Arm_relobj::make_exidx_input_section): New methods.
6470 (read_arm_attributes_section): Remove.
6471 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6472 information about them.
6473 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6474 to here.
6475
5ac169d4
DK
64762010-01-20 Doug Kwan <dougkwan@google.com>
6477
6478 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6479 Input_section_specifier to Section_id.
6480 (Target_arm::new_arm_input_section: Adjust code for change of key
6481 type.
6482 (Target_arm::find_arm_input_section): Ditto.
6483 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6484 (Section_id): Remove.
6485 (Garbage_collection::Section_id_hash): Remove.
6486 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6487 (Section_id): Remove.
6488 (Icf::Section_id_hash): Remove.
6489 * object.h (Section_id, Const_section_id, Section_id_hash,
6490 Const_section_id_hash): New type definitions.
6491 * output.cc (Output_section::add_relaxed_input_section): Change to
6492 use Const_section_id instead of Input_section_specifier as key type.
6493 (Output_section::add_merge_input_section): Ditto.
6494 (Output_section::build_relaxation_map): Change to use Section_id
6495 instead of Input_section_specifier as key type.
6496 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6497 Ditto.
6498 (Output_section::convert_input_sections_to_relaxed_sections): Change
6499 to use Const_section_id instead of Input_section_specifier as key type.
6500 (Output_section::find_merge_section): Ditto.
6501 (Output_section::find_relaxed_input_section): Ditto.
6502 * output.h (Input_section_specifier): Remove class.
6503 (Output_section::Output_section_data_by_input_section_map): Change
6504 key type to Const_section_id.
6505 (Output_section::Output_relaxed_input_section_by_input_section_map):
6506 Ditto.
6507 (Output_section::Relaxation_map): Change key type to Section_id.
6508
a2162063
ILT
65092010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6510
6511 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6512 (class Arm_v4bx_stub): New class.
6513 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6514 (Stub_factory::make_arm_v4bx_stub): New method.
6515 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6516 (Stub_table::empty): Handle v4bx stubs.
6517 (Stub_table::add_arm_v4bx_stub): New method.
6518 (Stub_table::find_arm_v4bx_stub): New method.
6519 (Arm_relocate_functions::v4bx): New method.
6520 (Target_arm::fix_v4bx): New method.
6521 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6522 (Stub_table::relocate_stubs): Likewise.
6523 (Stub_table::do_write): Likewise.
6524 (Stub_table::update_data_size_and_addralign): Likewise.
6525 (Stub_table::finalize_stubs): Likewise.
6526 (Target_arm::Scan::local): Likewise.
6527 (Target_arm::Scan::global): Likewise.
6528 (Target_arm::do_finalize_sections): Likewise.
6529 (Target_arm::Relocate::relocate): Likewise.
6530 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6531 Likewise.
6532 (Target_arm::scan_reloc_for_stub): Likewise.
6533 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6534
5696ab0b
ILT
65352010-01-19 Ian Lance Taylor <iant@google.com>
6536
6537 * output.cc (Output_section_headers::do_sized_write): Write large
6538 segment count to sh_info field.
6539 (Output_file_header::do_sized_write): For large segment count,
6540 write PN_XNUM to e_phnum field.
6541
800d0f56
ILT
65422010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6543
6544 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6545 (Arm_relocate_functions::thm_jump8): New function.
6546 (Arm_relocate_functions::thm_jump11): New function.
6547 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6548 R_ARM_THM_JUMP11.
6549 (Target_arm::Scan::global): Likewise.
6550 (Target_arm::Relocate::relocate): Likewise.
6551 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6552 Likewise.
6553
41263c05
DK
65542010-01-14 Doug Kwan <dougkwan@google.com>
6555
6556 * arm.cc (map, utility): Include headers.
6557 (Target_arm::apply_cortex_a8_workaround): New method.
6558 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6559 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6560 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6561 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6562 the --[no-]fix-cortex-a8 command line options.
6563 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6564 (Target_arm::relocate_stub): Use addend in instruction template.
6565 * options.h (DEFINE_bool): Set the user-set flag.
6566 (General_options): Add --[no-]-fix-cortex options.
6567 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6568 : Update fast look-up map after conversion.
41263c05 6569
459e9b03
ST
65702010-01-14 Sriraman Tallam <tmsriram@google.com>
6571
6572 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6573 in the first pass of do_layout.
6574
b521dfe4
DK
65752010-01-13 Doug Kwan <dougkwan@google.com>
6576
6577 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6578 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6579 apparent compiler problem of not folding static constant integral
6580 data members of elfcpp::Elf_sizes<32>.
6581
44272192
DK
65822010-01-13 Doug Kwan <dougkwan@google.com>
6583
6584 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6585 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6586 Arm_relobj::scan_section_for_cortex_a8_erratum,
6587 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6588 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6589 sections to scan for relocation stubs into a new method
6590 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6591 relocation and Cortex-A8 stub scanning.
6592 (Target_arm::do_relax): Force stubs to be after stubbed sections
6593 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6594 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6595 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6596
44b71ece
ILT
65972010-01-12 Ian Lance Taylor <iant@google.com>
6598
6599 * target-reloc.h (visibility_error): New inline function.
6600 (relocate_section): Call visibility_error.
6601 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6602 (MOSTLYCLEANFILES): Likewise.
6603 (protected_4_pic.o, protected_3.err): New targets.
6604 * testsuite/protected_4.cc: New file.
6605
a120bc7f
DK
66062010-01-12 Doug Kwan <dougkwan@google.com>
6607
6608 * arm.cc (Cortex_a8_reloc): New class.
6609 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6610 and cortex_a8_relocs_info_.
6611 (Target_arm::fix_cortex_a8): New method definition.
6612 (Target_arm::Cortex_a8_relocs_info): New type.
6613 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6614 New data member declarations.
6615 (Target_arm::scan_reloc_for_stub): Record information about
6616 relocations for THUMB branches that might be exempted from the
6617 Cortex-A8 workaround.
6618 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6619 at the beginning of a relaxation pass.
6620
20138696
DK
66212010-01-12 Doug Kwan <dougkwan@google.com>
6622
6623 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6624 (Arm_relobj::Mapping_symbol_position,
6625 Arm_reloj::Mapping_symbol_position_less,
6626 Arm_relobj::Mapping_symbols_info): New types.
6627 (Target_arm::is_mapping_symbol_name): New method definition.
6628 (Arm_relobj::do_count_local_symbols): Save information about mapping
6629 symbols.
6630
089d69dc
DK
66312010-01-11 Doug Kwan <dougkwan@google.com>
6632
6633 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6634 Arm_relocate_functions::thumb32_branch_upper,
6635 Arm_relocate_functions::thumb32_branch_lower,
6636 Arm_relocate_functions::thumb32_cond_branch_offset,
6637 Arm_relocate_functions::thumb32_cond_branch_upper,
6638 Arm_relocate_functions::thumb32_cond_branch_lower,
6639 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6640 branch offset encoding.
6641 (Arm_relocate_functions::thumb_branch_common): Use new branch
6642 offset encoding methods to avoid code duplication.
6643 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6644 (Stub_addend_reader::operator()): Use new branch encoding method
6645 to avoid code duplication.
6646
99e5bff2
DK
66472010-01-11 Doug Kwan <dougkwan@google.com>
6648
6649 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6650 (Target_arm::do_finalize_sections): Define special EXIDX section
6651 symbols only if referenced.
6652 * gc.h (Garbage_collection::add_reference): New method.
6653 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6654 code duplication.
6655
98e090bd
ILT
66562010-01-11 Ian Lance Taylor <iant@google.com>
6657
d0a91bd8
ILT
6658 * script.cc (Version_script_info::build_expression_list_lookup):
6659 Change complaing about duplicate wildcard match from error to
6660 warning.
6661
98e090bd
ILT
6662 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6663 of 2009-12-30.
6664 (Version_script_info::Version_script_info): Initialize globs_,
6665 default_version_, default_is_global_, and exact_. Don't
6666 initialize globals_ or locals_.
6667 (Version_script_info::build_lookup_tables): Build local symbols
6668 first.
6669 (Version_script_info::unquote): New function.
6670 (Version_script_info::add_exact_match): New function.
6671 (Version_script_info::build_expression_list_lookup): Remove lookup
6672 parameter. Add is_global parameter. Change all callers. Handle
6673 wildcard pattern specially. Unquote pattern. Call
6674 add_exact_match.
6675 (Version_script_info::get_name_to_match): New function.
6676 (Version_script_info::get_symbol_version): New function.
6677 (Version_script_info::get_symbol_version_helper): Remove.
6678 (Version_script_info::check_unmatched_names): Call unquote.
6679 * script.h (class Version_script_info): Change get_symbol_version
6680 to be non-inline and add is_global parameter; change all callers.
6681 Rewrite symbol_is_local. Update declarations. Define struct
6682 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6683 Remove globals_ and locals_ members. Add exact_, globs_,
6684 default_version_, is_global_.
6685 (Version_script_info::Glob): Remove pattern, add expression and
6686 is_global. Update constructor. Change all callers.
6687 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6688 default version.
6689 (Versions::symbol_section_contents): If a symbol is undefined, or
6690 defined in a dynamic object, set the version index to
6691 VER_NDX_LOCAL.
6692 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6693 symbol_is_local.
6694 (Symbol_table::add_from_pluginobj): Likewise.
6695 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6696
d56962d3
DK
66972010-01-11 Doug Kwan <dougkwan@google.com>
6698
6699 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6700 (incremental_dump_LDADD): Add linking option for libintl.
6701 * Makefile.in: Regenerate.
6702
94e6ee91
L
67032010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6704
6705 PR gold/11144
6706 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6707 instead of -Ds.
6708 * testsuite/Makefile.in: Regenerated.
6709
e96c574b
DK
67102010-01-10 Doug Kwan <dougkwan@google.com>
6711
6712 * options.h (DEFINE_var): Use parentheses around argument varname__
6713 in macro body to avoid any unintended subsequent substitutions.
6714
7198066b
ILT
67152010-01-10 Ian Lance Taylor <iant@google.com>
6716
ba4d53bf
ILT
6717 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6718 candidates before doing symbol resolution.
6719
7198066b
ILT
6720 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6721 ODR candidates if only one is weak.
6722
a2beed37
ILT
67232010-01-08 Ian Lance Taylor <iant@google.com>
6724
6725 * script.cc (Version_script_info::build_expression_list_lookup):
6726 Don't warn about ambiguous version, just record the ambiguity.
6727 (Version_script_info::get_symbol_version_helper): Give error if
6728 version is ambiguous.
6729
2fb7225c
DK
67302010-01-08 Doug Kwan <dougkwan@google.com>
6731
6732 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6733 prev_data_size_ and prev_addralign_. Remove initializer for
6734 deleted data member has_been_changed_.
6735 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6736 to determine if the table is empty.
6737 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6738 Remove.
6739 (Stub_table::add_reloc_stub): Define method in class definition
6740 instead of just declaring it there.
6741 (Stub_table::add_cortex_a8_stub): New method definition.
6742 (Stub_table::update_data_size_and_addralign): Ditto.
6743 (Stub_table::finalize_stubs): Ditto.
6744 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6745 (Stub_table::do_addralign_): Return address alignment in the
6746 (Stub_table::do_reset_address_and_file_offset): Define method in
6747 class definition instead of declaring it there. Set current data
6748 size to be the data size of the previous pass.
6749 (Stub_table::set_final_data_size): Use current data size as the
6750 final data size.
6751 (Stub_table::relocate_stub): Change parameter type of stub from
6752 Reloc_stub pointer to Stub pointer.
6753 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6754 (Stub_table::Cortex_a8_stub_list): New typedef.
6755 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6756 Stub_table::prev_addralign_): New data member.
6757 (Arm_relobj::Arm_relobj): Initialize data member
6758 section_has_cortex_a8_workaround_.
6759 (Arm_relobj::section_has_cortex_a8_workaround,
6760 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6761 definitions.
6762 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6763 declarations.
6764 (Target_arm::relocate_stub): Change parameter type of stub from
6765 Reloc_stub pointer to Stub pointer.
6766 (Insn_template::size, Insn_template::alignment): Handle
6767 THUMB16_SPECIAL_TYPE.
6768 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6769 Stub_table::update_data_size_and_addralign,
6770 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6771 definitions.
6772 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6773 (Stub_table::do_write): Ditto.
6774 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6775
880cd20d
ILT
67762010-01-08 Ian Lance Taylor <iant@google.com>
6777
6778 PR 11108
6779 * symtab.h (class Symbol): Remove fields is_target_special_ and
6780 has_plt_offset_. Add field is_defined_in_discarded_section_.
6781 (Symbol::is_defined_in_discarded_section): New function.
6782 (Symbol::set_is_defined_in_discarded_section): New function.
6783 (Symbol::has_plt_offset): Rewrite.
6784 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6785 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6786 Don't initialize is_target_special_ or has_plt_offset_.
6787 Initialize is_defined_in_discarded_section_.
6788 (Symbol_table::add_from_relobj): If appropriate, set
6789 is_defined_in_discarded_section.
6790 * resolve.cc (Symbol::override_base_with_special): Don't test
6791 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6792 * target-reloc.h (relocate_section): Do special handling for
6793 symbols defined in discarded sections for global symbols as well
6794 as local symbols.
6795
2703e3eb
ILT
67962010-01-08 Ian Lance Taylor <iant@google.com>
6797
6798 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6799 the SHT_SYMTAB case.
6800
339d40a3
ILT
68012010-01-08 Ian Lance Taylor <iant@google.com>
6802
6803 * object.cc (Sized_relobj::do_layout): Don't get confused if
6804 layout_eh_frame returns NULL.
6805
abecea76
ILT
68062010-01-08 Ian Lance Taylor <iant@google.com>
6807
6808 PR 11084
6809 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6810 dynamic symbol table, use the normal symbol table.
6811 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6812 symbol table.
6813
6b7dd3f3
ILT
68142010-01-08 Ian Lance Taylor <iant@google.com>
6815
6816 PR 11072
6817 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6818 sections.
6819
36c50e63
L
68202010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6821
6822 * version.cc (print_version): Change to "Copyright 2010".
6823
e291e7b9
ILT
68242010-01-08 Ian Lance Taylor <iant@google.com>
6825
6826 PR 10287
6827 PR 11063
6828 * i386.cc (class Target_i386): Change return type of plt_section
6829 to be non-const.
6830 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6831 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6832 tls_desc_rel_ field.
6833 (Output_data_plt_i386::rel_tls_desc): New function.
6834 (Target_i386::rel_tls_desc_section): New function.
6835 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6836 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6837 R_386_TLS_DESC reloc in rel_tls_desc_section.
6838 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6839 Define struct Tlsdesc_info.
6840 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6841 (Target_x86_64::do_reloc_symbol_index): New function.
6842 (Target_x86_64::add_tlsdesc_info): New function.
6843 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6844 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6845 tlsdesc_rel_ field.
6846 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6847 all callers.
6848 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6849 (Target_x86_64::rela_tlsdesc_section): New function.
6850 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6851 handling.
6852 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6853 (Target_x86_64::do_reloc_addend): New function.
6854 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6855 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6856 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6857 (Output_reloc::type): New function.
6858 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6859 (Output_reloc::is_target_specific): New function.
6860 (Output_reloc::target_arg): New function.
6861 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6862 absolute relocs and target specific relocs.
6863 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6864 add_target_specific.
6865 (class Output_data_reloc) [SHT_RELA]: Likewise.
6866 * output.cc (Output_reloc::Output_reloc): Add four new versions
6867 for absolute relocs and target specific relocs.
6868 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6869 (Output_reloc::get_symbol_index): Likewise.
6870 (Output_reloc::local_section_offset): Check that local_sym_index_
6871 is not TARGET_CODE or 0.
6872 (Output_reloc::symbol_value): Likewise.
6873 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6874 reloc.
6875 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6876 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6877 functions.
6878 * layout.cc (add_target_dynamic_tags): Use output section for
6879 DT_PLTRELSZ and DT_JMPREL.
6880
3a44184e
ILT
68812010-01-07 Ian Lance Taylor <iant@google.com>
6882
6883 PR 11061
6884 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6885 function.
6886 (class Output_data_reloc_generic): Define.
6887 (class Output_data_reloc_base): Change base class to
6888 Output_data_reloc_generic. Change add() method to call
6889 bump_relative_reloc_count for a relative reloc. Remove
6890 sort_relocs_ field.
6891 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6892 to sort_relocs().
6893 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6894 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6895 appropriate.
6896 * layout.h (class Layout): Update declaration.
6897
ea715a34
ILT
68982010-01-07 Ian Lance Taylor <iant@google.com>
6899
6900 * output.h (class Output_data): Add const version of
6901 output_section and do_output_section.
6902 (class Output_section_data): Add const version of
6903 do_output_section.
6904 (class Output_section): Likewise.
6905 * layout.cc (Layout::add_target_dynamic_tags): New function.
6906 * layout.h (class Layout): Update declarations.
6907 * arm.cc (Target_arm::do_finalize_sections): Use
6908 add_target_dynamic_tags.
6909 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6910 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6911 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6912 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6913
659948a4
ILT
69142010-01-07 Ian Lance Taylor <iant@google.com>
6915
6916 PR 11042
6917 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6918 object as needed.
6919
9d3b86f6
ILT
69202010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6921 Ian Lance Taylor <iant@google.com>
6922
6923 PR 11019
6924 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6925 Xindex::read_symtab_xindex.
6926
bb0d3eb0
DK
69272010-01-07 Doug Kwan <dougkwan@google.com>
6928
6929 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6930 (Insn_template::thumb16_bcond_insn): New method declaration.
6931 (Insn_template): Fix spelling.
6932 (Stub::thumb16_special): New method declaration.
6933 (Stub::do_write): Define virtual method which was previously pure
6934 virtual.
6935 (Stub::do_thumb16_special): New method declaration.
6936 (Stub::do_fixed_endian_write): New template member.
6937 (Reloc_stub::do_write): Remove.
6938 (Reloc_stub::do_fixed_endian_write): Remove.
6939 (Cortex_a8_stub): New class definition.
6940 (Stub_factory::make_cortex_a8_stub): New method definition.
6941 (Stub_factory::Stub_factory): Add missing static storage class
6942 qualifier for elf32_arm_stub_a8_veneer_blx.
6943
ffeef7df
ILT
69442010-01-07 Ian Lance Taylor <iant@google.com>
6945
dc3f80fe
ILT
6946 PR 10980
6947 * options.h (class General_options): Add --warn-unresolved-symbols
6948 and --error-unresolved-symbols.
6949 * errors.cc (Errors::undefined_symbol): Implement
6950 --warn-unresolved-symbols.
6951
ffeef7df
ILT
6952 * options.h (class General_options): Add -z text and -z textoff.
6953 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6954
f1ec9ded
ST
69552010-01-06 Sriraman Tallam <tmsriram@google.com>
6956
6957 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6958 (Garbage_collection::cident_sections): New function.
6959 (Garbage_collection::add_cident_section): New function.
6960 (Garbage_collection::cident_sections_): New member.
6961 (gc_process_relocs): Add references to sections whose names are C
6962 identifiers.
6963 * gold.h (cident_section_start_prefix): New constant.
6964 (cident_section_stop_prefix): New constant.
6965 (is_cident): New function.
6966 * layout.cc (Layout::define_section_symbols): Replace string constants
6967 with the newly defined constants.
6968 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6969 C identifiers.
6970 * testsuite/Makefile.am: Add gc_orphan_section_test.
6971 * testsuite/Makefile.in: Regenerate.
6972 * testsuite/gc_orphan_section_test.cc: New file.
6973 * testsuite/gc_orphan_section_test.sh: New file.
6974
6eda8c29
ILT
69752010-01-06 Ian Lance Taylor <iant@google.com>
6976
b9674e17
ILT
6977 PR 10980
6978 * options.h (class General_options): Add --warn-shared-textrel.
6979 * layout.cc (Layout::finish_dynamic_section): Implement
6980 --warn-shared-textrel.
6981
6eda8c29
ILT
6982 PR 10980
6983 * options.h (class General_options): Add --warn-multiple-gp.
6984
32dcd44e
ILT
69852010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6986
6987 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6988 $(THREADSLIB) and $(LIBDL).
6989 * Makefile.in: Rebuild.
6990
a192ba05
ILT
69912010-01-06 Ian Lance Taylor <iant@google.com>
6992
6993 PR 10980
6994 * options.cc (General_options::parse_section_start): New function.
6995 (General_options::section_start): New function.
6996 (General_options::General_options): Initialize all members.
6997 * options.h: Include <map>
6998 (class General_options): Add --section-start. Add section_starts_
6999 member.
7000 * layout.cc (Layout::attach_allocated_section_to_segment): If
7001 --section-start was used, set the address of the segment. Remove
7002 local sort_sections.
7003 (Layout::relaxation_loop_body): If the address of the load segment
7004 has been set by --section-start, don't use it.
7005 * output.h (Output_segment::update_flags_for_output_section): New
7006 function.
7007 * output.cc (Output_segment::add_output_section): Call
7008 update_flags_for_output_section.
7009
dde3f402
ILT
70102010-01-05 Ian Lance Taylor <iant@google.com>
7011
62dfdd4d
ILT
7012 PR 10980
7013 * options.h (class General_options): Add --undefined-version.
7014 * script.cc (struct Version_expression): Add was_matched_by_symbol
7015 field.
7016 (Version_script_info::matched_symbol): New function.
7017 (Version_script_info::get_symbol_version_helper): Call
7018 matched_symbol.
7019 (Version_script_info::check_unmatched_names): New function.
7020 * script.h (class Version_script_info): Update declarations.
7021 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7022
9c4ae156
ILT
7023 * options.h (class General_options): Use DEFINE_bool_alias for
7024 allow_multiple_definition.
7025 * resolve.cc (Symbol_table::should_override): Don't test
7026 allow_multiple_definition.
7027
dde3f402
ILT
7028 PR 10980
7029 * options.h (class General_options): Add --cref.
7030 * main.cc (main): Print cref table if --cref. Don't close mapfile
7031 until after printing cref table.
7032 * cref.cc: Include "symtab.h".
7033 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7034 (Cref_table_compare::operator()): New function.
7035 (Cref_inputs::gather_cref): New function.
7036 (filecol): New static const.
7037 (Cref_inputs::print_cref): New function.
7038 (Cref::print_cref): New function.
7039 * cref.h: Include <cstdio>.
7040 (class Cref): Update declarations.
7041 * mapfile.h (Mapfile::file): New function.
7042 * object.h (class Object): Define Symbols. Declare virtual
7043 do_get_global_symbols.
7044 (Object::get_global_symbols): New function.
7045 * object.cc (Input_objects::add_object): Pass object to cref_ if
7046 --cref.
7047 (Input_objects::archive_start): Likewise.
7048 (Input_objects::archive_stop): Likewise.
7049 (Input_objects::print_cref): New function.
7050 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7051 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7052 --cref.
7053 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7054 function.
7055 * plugin.h (class Sized_pluginobj): Update declarations.
7056
8781f709
ILT
70572010-01-05 Ian Lance Taylor <iant@google.com>
7058
7059 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7060 to is_default_version. Rename insdef to insdefault.
7061 (Symbol_table::add_from_relobj): Rename def to is_default_version
7062 and local to is_forced_local.
7063 (Symbol_table::add_from_pluginobj): Likewise.
7064 (Symbol_table::add_from_dynobj): Likewise.
7065 (Symbol_table::define_special_symbol): Rename insdef to
7066 insdefault.
7067
fe35d28d
ILT
70682010-01-04 Ian Lance Taylor <iant@google.com>
7069
30bc8c46
ILT
7070 PR 10980
7071 * options.h (class General_options): Add
7072 --allow-multiple-definition and -z muldefs.
7073 * resolve.cc (Symbol_table::should_override): Don't warn about a
7074 multiple symbol definition if --allow-multiple-definition or -z
7075 muldefs.
7076
7eaea549
ILT
7077 PR 10980
7078 * options.h (class General_options): Add --add-needed and
7079 --copy-dt-needed-entries. Tweak --as-needed help entry.
7080 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7081 error if --copy-dt-needed-entries aka --add-needed is used and
7082 would cause a change in behaviour.
7083
fe35d28d
ILT
7084 PR 10980
7085 * options.h (class General_options): Add -G as a short version of
7086 --shared. Add no-op options -assert, -g, and -i.
7087
55a2bb35
ST
70882010-01-04 Sriraman Tallam <tmsriram@google.com>
7089
7090 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7091 check for .text or .gnu.linkonce.t sections.
7092 * icf.cc (Icf::find_identical_sections): Ditto.
7093 Change the detection for mangled function name within the section
7094 name.
7095 * icf.h (is_section_foldable_candidate): New function.
7096
719328e1
ILT
70972009-12-30 Ian Lance Taylor <iant@google.com>
7098
7099 PR 10980
7100 * options.h (class General_options): Permit two dashes with
7101 --retain-symbols-file.
7102
d7bb5745
ILT
71032009-12-30 Ian Lance Taylor <iant@google.com>
7104
403a15dd
ILT
7105 PR 10979
7106 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7107 don't put the file header and segment headers in the text
7108 segment.
7109
eda294df
ILT
7110 PR 10979
7111 * common.cc (Sort_commons::operator()): Stabilize sort when both
7112 entries are NULL.
7113 (Symbol_table::do_allocate_commons_list): When allocating common
7114 symbols, skip a symbol which is no longer common.
7115 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7116 an object before checking its type.
7117 * testsuite/common_test_2.c: New file.
7118 * testsuite/common_test_3.c: New file.
7119 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7120 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7121 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7122 (common_test_2_pic.o, common_test_2.so): New targets.
7123 (common_test_3_pic.o, common_test_3.so): New targets.
7124 * testsuite/Makefile.in: Rebuild.
7125
d7bb5745
ILT
7126 PR 10979
7127 * script.cc (read_input_script): If we see a new SECTIONS clause,
7128 and we have added an input section, give an error.
7129 * layout.h (class Layout): Add have_added_input_section function.
7130 Add have_added_input_section_ field.
7131 * layout.cc (Layout::Layout): Initialize
7132 have_added_input_section_.
7133 (Layout::layout): Set have_added_input_section_.
7134 (Layout::layout_eh_frame): Likewise.
7135
fc59c572
ILT
71362009-12-30 Ian Lance Taylor <iant@google.com>
7137
7138 PR 10931
7139 * options.h (class General_options): Add --sort-common option.
7140 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7141 * common.cc (Sort_common): Add sort_order parameter to
7142 constructor. Add sort_order_ field.
7143 (Sort_commons::operator): Check sort_order_.
7144 (Symbol_table::allocate_commons): Determine the sort order.
7145 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7146 Change all callers.
7147 (Symbol_table::do_allocate_commons_list): Likewise.
7148
1c74fab0
ILT
71492009-12-30 Ian Lance Taylor <iant@google.com>
7150
7151 PR 10916
7152 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7153 symbols from this object, don't change the visibility of an
7154 undefined symbol.
7155 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7156
6affe781
ILT
71572009-12-30 Ian Lance Taylor <iant@google.com>
7158
7159 PR 10861
7160 * script.h (class Version_script_info): Define Language enum.
7161 Update declarations. Define Glob, Exact, and Lookup types. Add
7162 new fields globals_, locals_, and is_finalized_.
7163 * script.cc: Various formatting fixes.
7164 (class Parser_closure): Change language_stack_ from a vector of
7165 std::string to one of Version_script_info::Language. Adjust all
7166 uses accordingly.
7167 (class Lazy_demangler): Remove.
7168 (struct Version_expression): Change language from std::string to
7169 Version_script_info::Language.
7170 (Version_script_info::Version_script_info): New function.
7171 (Version_script_info::~Version_script_info): Don't call clear.
7172 (Version_script_info::finalize): New function.
7173 (Version_script_info::build_lookup_tables): New function.
7174 (Version_script_info::build_expression_list_lookup): New
7175 function.
7176 (Version_script_info::get_symbol_version_helper): Rewrite to use
7177 lookup tables.
7178 (Version_script_info::print_expression_list): Adjust to use
7179 Version_script_info::Language.
7180 (script_push_lex_into_version_mode): Check that the version script
7181 has not been finalized.
7182 (version_script_push_lang): Change language string to
7183 Version_script_info::Language.
7184 * options.cc (Command_line::version_script): New function.
7185 * options.h (class General_options): Add finalize_dynamic_list
7186 function. Change version_script from declaration to definition.
7187 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7188 * testsuite/version_script.map: Remove duplicate def of foo.
7189 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7190 version_script.map.
7191 * testsuite/Makefile.in: Rebuild.
7192
818bf354
ILT
71932009-12-30 Ian Lance Taylor <iant@google.com>
7194
7195 PR 10843
7196 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7197 if the input symbol index is 0, make the output symbol index 0.
7198
ebcc8304
ILT
71992009-12-30 Ian Lance Taylor <iant@google.com>
7200
7201 PR 10670
7202 * options.h (class General_options): Add -x/--discard-all.
7203 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7204 --discard-all. If the local symbol needs a dynamic entry, check
7205 that before handling --discard-locals.
7206
176fe33f
ILT
72072009-12-30 Ian Lance Taylor <iant@google.com>
7208
bb321bb1
ILT
7209 PR 10450
7210 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7211 flags to PF_R.
7212 (Output_segment::add_output_section): Don't change the flags if
7213 the type is PT_TLS.
7214
176fe33f
ILT
7215 PR 10450
7216 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7217 GNU hash table if they need a dynamic value. Otherwise, don't add
7218 them if they are defined in a dynamic object or are forced local.
7219
e8cd95c7
ILT
72202009-12-29 Ian Lance Taylor <iant@google.com>
7221
1b81fb71
ILT
7222 PR 10450
7223 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7224 .gnu.hash table for a 32-bit target.
7225
8d6d383d
ILT
7226 PR 10450
7227 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7228 regular and a dynamic object only needs a dynamic symbol table
7229 entry if it is externally visible.
7230
e785ec03
ILT
7231 PR 10450
7232 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7233 constructor. Add global_offset_table_ field.
7234 (Target_i386::got_section): Set global_offset_table_.
7235 (Target_i386::do_finalize_sections): Set global_offset_table_
7236 size.
7237 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7238 in constructor. Add global_offset_table_ field.
7239 (Target_x86_64::got_section): Set global_offset_table_.
7240 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7241 size.
7242
1a2dff53
ILT
7243 * layout.cc (Layout::Layout): Initialize increase_relro_.
7244 (Layout::get_output_section): Add is_relro, is_last_relro, and
7245 is_first_non_relro parameters. Change all callers.
7246 (Layout::choose_output_section): Likewise.
7247 (Layout::add_output_section_data): Likewise.
7248 (Layout::make_output_section): Likewise.
7249 (Layout::set_segment_offsets): Clear increase_relro when using a
7250 linker script.
7251 * layout.h (class Layout): Add increase_relro method. Add
7252 increase_relro_ field. Update declarations.
7253 * output.cc (Output_section::Output_section): Initialize
7254 is_last_relro_ and is_first_non_relro_.
7255 (Output_segment::add_output_section): Group relro sections is
7256 do_sort is true. Handle is_last_relro and is_first_non_relro.
7257 (Output_segment::maximum_alignment): Remove relro handling.
7258 (Output_segment::set_section_addresses): Add increase_relro
7259 parameter. Change all callers. Add initial alignment to align
7260 relro sections on separate page. Remove old relro handling.
7261 (Output_segment::set_section_list_addresses): Remove in_relro
7262 parameter. Change all callers.
7263 (Output_segment::set_offset): Add increase parameter. Change all
7264 callers. Remove old relro handling.
7265 * output.h (class Output_section): Add new methods: is_last_relro,
7266 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7267 Add is_last_relro_ and is_first_non_relro_ fields.
7268 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7269 Create separate .got.plt section. Call increase_relro.
7270 * x86_64.cc (Target_x86_64::got_section): Likewise.
7271 * testsuite/relro_script_test.t: Add .got.plt.
7272
f0ba79e2
ILT
7273 PR 10450
7274 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7275 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7276 (Layout::finalize): Call set_dynamic_symbol_size.
7277 (Layout::set_dynamic_symbol_size): New function.
7278 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7279 set_dynamic_symbol_size.
7280
e8cd95c7
ILT
7281 PR 10450
7282 * output.h (class Output_section): Add is_entsize_zero_ field.
7283 * output.cc (Output_section::Output_section): Initialize
7284 is_entsize_zero_.
7285 (Output_section::set_entsize): If two different entsizes are
7286 requested, force it to zero.
7287 (Output_section::add_input_section): Set flags for .debug_str
7288 before updating section flags. Set entsize.
7289 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7290 and SHF_STRING if all input sections have those flags.
7291
3e1b9a8a
RÁE
72922009-12-29 Rafael Espindola <espindola@google.com>
7293
7294 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7295 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7296 reporting.
3e1b9a8a 7297
3dcad376
ST
72982009-12-29 Sriraman Tallam <tmsriram@google.com>
7299
7300 * options.cc (General_options::parse_version): Allow -v to exit
7301 without an error if there is nothing to link.
7302
084e2665
ILT
73032009-12-29 Ian Lance Taylor <iant@google.com>
7304
7305 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7306 using a version of gcc before 4.1.
7307 * configure: Rebuild.
7308
250acde3
CD
73092009-12-28 Chris Demetriou <cgd@google.com>
7310
7311 * attributes.cc (Output_attributes_section_data::do_write): Use
7312 std::vector::front rather than std::vector::data.
7313
99fff23b
ILT
73142009-12-28 Ian Lance Taylor <iant@google.com>
7315
7316 * symtab.h (class Symbol_table): Add enum Defined.
7317 * resolve.cc (Symbol_table::should_override): Add defined
7318 parameter. Change all callers. Test whether object is NULL
7319 before calling a method on it.
7320 (Symbol_table::report_resolve_problem): Add defined parameter.
7321 Change all callers.
7322 (Symbol_table::should_override_with_special): Likewise.
7323 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7324 parameter. Change all callers.
7325 (Symbol_table::do_define_in_output_data): Likewise.
7326 (Symbol_table::define_in_output_segment): Likewise.
7327 (Symbol_table::do_define_in_output_segment): Likewise.
7328 (Symbol_table::define_as_constant): Likewise.
7329 (Symbol_table::do_define_as_constant): Likewise.
7330 * script.h (class Symbol_assignment): Add is_defsym parameter to
7331 constructor; change all callers.
7332 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7333 parameter. Change all callers. Add is_defsym_ field.
7334 (class Parser_closure): Add parsing_defsym parameter to
7335 constructor; change all callers. Add parsing_defsym accessor
7336 function. Add parsing_defsym_ field.
7337
556bd683
ILT
73382009-12-28 Ian Lance Taylor <iant@google.com>
7339
7340 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7341 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7342
1782c879
ILT
73432009-12-23 Ian Lance Taylor <iant@google.com>
7344
7345 * i386.cc (Target_i386::do_calls_non_split): Recognize
7346 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7347 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7348 -fsplit-stack prologue when using %r11.
1782c879 7349
329ca2b1
ST
73502009-12-21 Sriraman Tallam <tmsriram@google.com>
7351
7352 * options.cc (General_options::parse_version): Make -v continue and do
7353 the link like GNU ld does.
7354
d675ff46
RÁE
73552009-12-17 Rafael Avila de Espindola <espindola@google.com>
7356
7357 * Makefile.am (CCFILES): Add timer.cc.
7358 (HFILES): Add timer.h.
7359 * configure.ac: Check for sysconf and times.
7360 * main.cc: include timer.h.
7361 (main): Use Timer instead of get_run_time.
7362 * timer.cc: New.
7363 * timer.h: New.
7364 * workqueue.cc: include timer.h.
7365 (Workqueue::find_and_run_task):
7366 Report user, sys and wall time.
7367 * Makefile.in: Regenerate.
7368 * config.in: Regenerate.
7369 * configure: Regenerate.
7370
d6344fb5
DK
73712009-12-16 Doug Kwan <dougkwan@google.com>
7372
7373 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7374 sections.
7375 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7376 relaxed input sections.
7377 * output.cc (Output_section::find_relaxed_input_section): Change
7378 return type to Output_relaxed_input_section pointer. Adjust code
7379 for new type of relaxed_input_section_map_.
7380 * output.h (Output_section::find_relaxed_input_section): Change
7381 return type to Output_relaxed_input_section pointer.
7382 (Output_section::Output_relaxed_input_section_by_input_section_map):
7383 New type.
7384 (Output_section::relaxed_input_section_map_): Change type to
7385 Output_section::Output_relaxed_input_section_by_input_section_map.
7386 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7387 input section.
7388
0e0d5469
ILT
73892009-12-15 Ian Lance Taylor <iant@google.com>
7390
7391 * layout.cc (Layout::create_shstrtab): Only write out after input
7392 sections if we are compressing debug sections.
7393
0649a889
ILT
73942009-12-15 Ian Lance Taylor <iant@google.com>
7395
7396 * archive.cc (Archive::add_symbols): Only look up a symbol without
7397 a version if there is, in fact, a version.
7398
2ea97941
ILT
73992009-12-14 Ian Lance Taylor <iant@google.com>
7400
7401 Revert -Wshadow changes, all changes from:
7402 2009-12-11 Doug Kwan <dougkwan@google.com>
7403 2009-12-11 Nick Clifton <nickc@redhat.com>
7404 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7405
b0eec2cc
DK
74062009-12-11 Doug Kwan <dougkwan@google.com>
7407
7408 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7409 due to -Wshadow.
7410 * attributes.cc (Object_attribute::size): Ditto.
7411 (Attributes_section_data::size): Ditto.
7412 (Attributes_section_data::Attributes_section_data): Ditto.
7413 (Output_attributes_section_data::do_write): Ditto.
7414 * attributes.h (Object_attribute::set_type): Ditto.
7415 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7416
91d6fa6a
NC
74172009-12-11 Nick Clifton <nickc@redhat.com>
7418
7419 * archive.cc: Fix shadowed variable warnings.
7420 * arm.cc: Likewise.
7421 * compressed_output.cc: Likewise.
7422 * compressed_output.h: Likewise.
7423 * configure: Likewise.
7424 * dwarf_reader.cc: Likewise.
7425 * dynobj.cc: Likewise.
7426 * dynobj.h: Likewise.
7427 * ehframe.cc: Likewise.
7428 * ehframe.h: Likewise.
7429 * errors.cc: Likewise.
7430 * expression.cc: Likewise.
7431 * fileread.cc: Likewise.
7432 * fileread.h: Likewise.
7433 * freebsd.h: Likewise.
7434 * i386.cc: Likewise.
7435 * icf.cc: Likewise.
7436 * incremental.h: Likewise.
7437 * layout.cc: Likewise.
7438 * layout.h: Likewise.
7439 * mapfile.cc: Likewise.
7440 * merge.cc: Likewise.
7441 * merge.h: Likewise.
7442 * object.cc: Likewise.
7443 * object.h: Likewise.
7444 * options.h: Likewise.
7445 * output.cc: Likewise.
7446 * output.h: Likewise.
7447 * parameters.cc: Likewise.
7448 * plugin.cc: Likewise.
7449 * powerpc.cc: Likewise.
7450 * reduced_debug_output.cc: Likewise.
7451 * reduced_debug_output.h: Likewise.
7452 * reloc.cc: Likewise.
7453 * reloc.h: Likewise.
7454 * resolve.cc: Likewise.
7455 * script-sections.cc: Likewise.
7456 * script.cc: Likewise.
7457 * script.h: Likewise.
7458 * sparc.cc: Likewise.
7459 * symtab.cc: Likewise.
7460 * symtab.h: Likewise.
7461 * target-select.cc: Likewise.
7462 * target-select.h: Likewise.
7463 * token.h: Likewise.
7464 * workqueue.cc: Likewise.
7465 * workqueue.h: Likewise.
7466 * x86_64.cc: Likewise.
7467
a0351a69
DK
74682009-12-10 Doug Kwan <dougkwan@google.com>
7469
7470 * arm.cc (attributes.h): New include.
7471 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7472 (Arm_relobj::~Arm_relobj): Delete object pointed by
7473 attributes_section_data_.
7474 (Arm_relobj::attributes_section_data): New method definition.
7475 (Arm_relobj::attributes_section_data_): New data member declaration.
7476 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7477 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7478 attributes_section_data_.
7479 (Arm_dynobj::attributes_section_data): New method definition.
7480 (Arm_dynobj::attributes_section_data_): New data member declaration.
7481 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7482 initialization value of may_use_blx_ to false.
7483 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7484 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7485 object attributes to compute results instead of hard-coding.
7486 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7487 Target_arm::get_secondary_compatible_arch,
7488 Target_arm::set_secondary_compatible_arch
7489 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7490 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7491 New method declarations.
7492 (Target_arm::get_aeabi_object_attribute): New method definition.
7493 (Target_arm::attributes_section_data_): New data member declaration.
7494 (read_arm_attributes_section): New template definition.
7495 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7496 (Arm_dynobj::do_read_symbols): Ditto.
7497 (Target_arm::do_finalize_sections): Merge attributes sections from
7498 input. Check for BLX use after attributes section merging.
7499 Fix __exidx_start and __exidx_end visibility. Create an
7500 .ARM.attributes section if necessary.
7501 (Target_arm::get_secondary_compatible_arch,
7502 Target_arm::set_secondary_compatible_arch,
7503 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7504 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7505 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7506 New method definitions.
7507
b59befec
ILT
75082009-12-09 Ian Lance Taylor <iant@google.com>
7509
7510 * plugin.cc (Plugin::load): Don't cast from void* to a function
7511 pointer.
7512
1276bc89
ILT
75132009-12-09 Ian Lance Taylor <iant@google.com>
7514
7515 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7516 information fields.
7517
2f2de248
L
75182009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7519
7520 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7521 Replace two_file_shared_1.so with two_file_shared_2.so.
7522 * testsuite/Makefile.in: Regenerated.
7523
4f787271
DK
75242009-12-08 Doug Kwan <dougkwan@google.com>
7525
7526 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7527 (HFILES): Add attributes.h and int_encoding.h.
7528 * Makefile.in: Regenerate.
7529 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7530 function definitions to int_encoding.cc
7531 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7532 prototypes to int_encoding.h
7533 * reduced_debug_output.cc (int_encoding.h): New include.
7534 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7535 function definitions to int_encoding.cc
7536 (insert_into_vector, read_from_pointer): Move template definitions to
7537 int_encoding.h
7538 * attributes.cc: New file.
7539 * attributes.h: New file.
7540 * int_encoding.cc: New file.
7541 * int_encoding.h: New file.
7542
20b52f1a
RÁE
75432009-12-07 Rafael Avila de Espindola <espindola@google.com>
7544
7545 PR gold/11055
7546 * incremental-dump.cc (dump_incremental_inputs): New.
7547 (main): Use dump_incremental_inputs.
7548
53d7974c
L
75492009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7550
7551 PR gold/10893
7552 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7553 checking elfcpp::STT_FUNC.
7554 (Target_i386::Relocate::relocate): Likewise.
7555 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7556
7557 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7558 symbols from shared libraries into normal FUNC symbols.
7559
7560 * symtab.h (Symbol): Add is_func and use it.
7561
05a352e6
DK
75622009-12-05 Doug Kwan <dougkwan@google.com>
7563
7564 * arm.cc (Target_arm::arm_info): Initialize new fields
7565 attributes_section and attributes_vendor.
7566 * i386.cc (Target_i386::i386_info): Same.
7567 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7568 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7569 fields attributes_section and attributes_vendor.
53d7974c 7570 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7571 * target.h (Target::attributes_section, Target::attributes_vendor,
7572 Target::is_attributes_section, Target::attribute_arg_type,
7573 Target::attributes_order): New method definitions.
7574 (Target::Target_info::attributes_section,
7575 Target::Target_info::attributes_vendor): New fields.
7576 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7577 virtual method definitions.
7578 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7579 attributes_section and attributes_vendor.
7580 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7581
f4e5969c
DK
75822009-12-05 Doug Kwan <dougkwan@google.com>
7583
7584 * arm.cc: Update comments about interworking and stub generation.
7585 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7586 considered as non-PIC.
7587 (Arm_relocate_functions::base_abs): Fix formatting.
7588 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7589 of function to use GOT entry address instead of offset.
7590 (Target_arm::Scan::global): Issue an error if a symbol would need a
7591 PLT does not get one because it is untyped. Remove code to create
7592 dynamic symbols for relative branches.
7593 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7594 takes unsigned integer instead of boolean.
7595
1abce4a6
L
75962009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7597
7598 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7599 (two_file_test_LDADD): Likewise.
7600 (common_test_1_LDADD): Likewise.
7601 (exception_test_LDADD) Likewise.
7602 (weak_test_LDADD): Likewise.
7603 (many_sections_test_LDADD): Likewise.
7604 (initpri1_LDADD): Likewise.
7605 (script_test_1_LDADD): Likewise.
7606 (script_test_2_LDADD): Likewise.
7607 (justsyms_LDADD): Likewise.
7608 (binary_test_LDADD): Likewise.
7609 (large_LDADD): Likewise.
7610 * testsuite/Makefile.in: Regenerated.
7611
adcf2816 76122009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7613
adcf2816
L
7614 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7615 (Symbol_table::override_with_special): Likewise.
7616 (Symbol_table::add_from_object): Likewise.
7617
28e67f5d
RÁE
76182009-12-04 Rafael Avila de Espindola <espindola@google.com>
7619
7620 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7621 Don't set the data_offset twice.
7622
ae10a101
RÁE
76232009-12-04 Rafael Avila de Espindola <espindola@google.com>
7624
7625 * testsuite/Makefile.in: Regenerate.
7626
f59f41f3
DK
76272009-12-03 Doug Kwan <dougkwan@google.com>
7628
7629 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7630 (Target_arm::do_finalize_sections): Add parameter for symbol table
7631 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7632 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7633 parameter for symbol table pointer.
7634 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7635 an additional parameter for a pointer to symbol table.
7636 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7637 parameter for a symbol table pointer.
7638 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7639 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7640 Ditto.
7641 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7642 parameter for a symbol table pointer.
7643
ca55d848
RÁE
76442009-12-03 Rafael Avila de Espindola <espindola@google.com>
7645
7646 * incremental.cc (Incremental_inputs_header)
7647 (Incremental_inputs_header_write, Incremental_inputs_entry)
7648 (Incremental_inputs_entry_write): Move ...
7649 * incremental.h (Incremental_inputs_header)
7650 (Incremental_inputs_header_write, Incremental_inputs_entry)
7651 (Incremental_inputs_entry_write): here.
7652
3aec4f9c
RÁE
76532009-12-02 Rafael Avila de Espindola <espindola@google.com>
7654
7655 * incremental.cc (make_sized_incremental_binary): Set the target.
7656 Error if it is incompatible.
7657 * output.h (Output_file): Add filename method.
7658
9c0ae74d
RÁE
76592009-12-02 Rafael Avila de Espindola <espindola@google.com>
7660
7661 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7662 from the get_* methods.
7663
a45500ae
RÁE
76642009-12-02 Rafael Avila de Espindola <espindola@google.com>
7665
7666 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7667 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7668 Write 0 for the data_offset of scripts.
7669
325e6408
RÁE
76702009-12-02 Rafael Avila de Espindola <espindola@google.com>
7671
7672 * testsuite/Makefile.am: Add the incremental_test.sh test.
7673 * testsuite/incremental_test.sh: New.
7674 * testsuite/incremental_test_1.c: New.
7675 * testsuite/incremental_test_2.c: New.
7676
954c3e2e
RÁE
76772009-12-01 Rafael Avila de Espindola <espindola@google.com>
7678
7679 * incremental-dump.cc (main): Fix typos.
7680
f8086623
RÁE
76812009-11-27 Rafael Avila de Espindola <espindola@google.com>
7682
7683 PR gold/11025
7684 * incremental-dump.cc (main): Use llu to print 64 bit values.
7685
3b0dd6ac
L
76862009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7687 H.J. Lu <hongjiu.lu@intel.com>
7688
7689 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7690 $(LIBDL).
7691 (incremental_dump_LDADD): Likewise.
7692 * Makefile.in: Regenerated.
7693
a6d1ef57 76942009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7695
a6d1ef57
DK
7696 Revert:
7697
7698 2009-11-25 Doug Kwan <dougkwan@google.com>
7699
7700 * arm.cc (Target_arm::Target_arm): Move method definition
7701 outside of class definition. Add code to handle
7702 --target1-rel, --target1-abs and --target2= options.
7703 (Target_arm::get_reloc_reloc_type): Change method to be
7704 non-static and const.
7705 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7706 New data member declaration.
7707 (Target_arm::Scan::local, Target_arm::Scan::global,
7708 Target_arm::Relocate::relocate,
7709 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7710 Adjust call to Target_arm::get_real_reloc_type.
7711 (Target_arm::get_real_reloc_type): Use command line options
7712 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7713 * options.h (--target1-rel, --target1-abs, --target2): New
7714 ARM-only options.
7715
50aeb7d4
DK
77162009-11-25 Doug Kwan <dougkwan@google.com>
7717
7718 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7719 class definition. Add code to handle --target1-rel, --target1-abs
7720 and --target2= options.
7721 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7722 and const.
7723 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7724 member declaration.
7725 (Target_arm::Scan::local, Target_arm::Scan::global,
7726 Target_arm::Relocate::relocate,
7727 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7728 call to Target_arm::get_real_reloc_type.
7729 (Target_arm::get_real_reloc_type): Use command line options to
7730 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7731 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7732 options.
7733
51938283
DK
77342009-11-25 Doug Kwan <dougkwan@google.com>
7735
7736 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7737 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7738 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7739 formatting.
7740 (Arm_relocate_functions::thm_call): Replace body with a call to
7741 Arm_relocate_functions::thumb_branch_common.
7742 (Arm_relocate_functions::thm_jump24,
7743 Arm_relocate_functions::thm_xpc22): New method definitions.
7744 (Arm_relocate_functions::thumb_branch_common): New method definition.
7745 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7746 operator.
7747 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7748 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7749
e2b8f3c4
RÁE
77502009-11-24 Rafael Avila de Espindola <espindola@google.com>
7751
7752 * Makefile.am: Build incremental-dump
7753 * Makefile.in: Regenerate.
7754 * incremental-dump.cc: New.
7755 * incremental.cc (Incremental_inputs_header_data,
7756 Incremental_inputs_entry_data): Move to incremental.h
7757 * incremental.h: (Incremental_inputs_header_data,
7758 Incremental_inputs_entry_data): Move from incremental.cc
7759
bcba9aec
RÁE
77602009-11-24 Rafael Avila de Espindola <espindola@google.com>
7761
7762 * incremental.cc (Incremental_inputs_header,
7763 Incremental_inputs_header_write, Incremental_inputs_entry,
7764 Incremental_inputs_entry_write): Add a typedef with the data type.
7765
7c3afe08
RÁE
77662009-11-24 Rafael Avila de Espindola <espindola@google.com>
7767
7768 * incremental.cc (Incremental_inputs_header,
7769 Incremental_inputs_header_write, Incremental_inputs_entry,
7770 Incremental_inputs_entry_write): Update comment about which
7771 type has the filed descriptions.
7772
d204b6e9
DK
77732009-11-15 Doug Kwan <dougkwan@google.com>
7774
7775 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7776 (Arm_relocate_functions::arm_branch_common): Change method defintion
7777 in class definition to a method declaration and update list of formal
7778 parameters.
7779 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7780 Arm_relocation_functions::jump24): Adjust call to
7781 Arm_relocate_functions::arm_branch_common. Update list of formal
7782 parameters.
7783 (Arm_relocate_functions::xpc25): New method definition.
7784 (Arm_relocate_functions::arm_branch_common): Move method defintion
7785 out from class definition. Use stubs for mode-switching and extending
7786 branch ranges.
7787 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7788 specially. Change code to enable use of stubs in ARM branches.
7789
43d12afe
DK
77902009-11-10 Doug Kwan <dougkwan@google.com>
7791
7792 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7793 in method declaration.
7794 (Target_arm::relocate_stub): New method declaration.
7795 (Target_arm::default_target): Change to return a pointer instead of
7796 a const reference.
7797 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7798 Target_arm::default_target.
7799 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7800 method definition.
7801 (Target_arm::relocate_section): Adjust view.
7802 (Target_arm::relocate_stub): New method definition.
7803
ac33a407
DK
78042009-11-10 Doug Kwan <dougkwan@google.com>
7805
7806 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7807 a format warning.
7808 * incremental.cc (open_incremental_binary): Initialized local
7809 variables to avoid warnings.
7810 * object.cc (make_elf_object): Ditto.
7811 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7812 a format warning.
e1df38aa 7813
88ee28e9
L
7814009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7815
7816 PR gold/10930
7817 * testsuite/plugin_test.c: Include "config.h".
7818
2daedcd6
DK
78192009-11-09 Doug Kwan <dougkwan@google.com>
7820
7821 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7822 (arm_symbol_value): Remove.
7823 (Arm_relocate_functions::arm_branch_common,
7824 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7825 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7826 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7827 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7828 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7829 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7830 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7831 Arm_relocate_functions::thm_mobw_abs_nc,
7832 Arm_relocate_functions::thm_mov_abs,
7833 Arm_relocate_functions::movw_prel_nc,
7834 Arm_relocate_functions::thm_movt_abs,
7835 Arm_relocate_functions::movt_prel,
7836 Arm_relocate_functions::thm_movw_prel_nc,
7837 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7838 (Target_arm::Relocate::relocate): Only decompose address into two
7839 parts if relocation type uses the thumb-bit and pass the actual
7840 bit instead of a flag indicating that the thumb-bit is used. Adjust
7841 calls to methods in Arm_relocate_functions for this change.
7842
1276bc89 78432009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7844
7845 PR 10925
7846 * reloc.cc: Instantiate
7847 Sized_relobj::initialize_input_to_output_maps and
7848 Sized_relobj:free_input_to_output_maps.
7849
e53ad1b5
ILT
78502009-11-06 Ian Lance Taylor <iant@google.com>
7851
7852 PR 10876
7853 * defstd.cc (in_segment): Set only_if_ref true for "end".
7854
eb44217c
DK
78552009-11-06 Doug Kwan <dougkwan@google.com>
7856
7857 * arm.cc (class Reloc_stub): Correct a comment.
7858 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7859 (Target_arm::scan_section_for_stubs): New method declaration.
7860 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7861 Change methods from private to protected.
7862 (Target_arm::do_may_relax): New method definition.
7863 (Target_arm::do_relax, Target_arm::group_sections,
7864 Target_arm::scan_reloc_for_stub,
7865 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7866 (Target_arm::arm_input_section_map_): New data member declaration.
7867 (Target_arm::scan_reloc_for_stub,
7868 Target_arm::scan_reloc_section_for_stubs,
7869 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7870 Target_arm::do_relax): New method definitions.
7871
5d329b7d
ILT
78722009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7873
7874 * configure.ac: Check for (struct stat)::st_mtim
7875 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7876 * config.in: Regenerate.
7877 * configure: Regenerate.
7878
96a0d71b
ILT
78792009-11-05 Ian Lance Taylor <iant@google.com>
7880
7881 PR 10910
7882 * output.cc (Output_segment::add_output_section): Add missing
7883 return statement.
7884
594c8e5e
ILT
78852009-11-04 Ian Lance Taylor <iant@google.com>
7886
7887 PR 10880
7888 * object.h (class Object): Add is_needed and set_is_needed
7889 methods. Add is_needed_ field. Make bool fields into bitfields.
7890 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7891 defined in a dynamic object and referenced by a regular object,
7892 set is_needed for the dynamic object.
7893 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7894 if the file is marked with as_needed and it is not needed.
7895
22b127cc
ILT
78962009-11-04 Ian Lance Taylor <iant@google.com>
7897
7898 PR 10887
7899 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7900 tags if data is discarded by linker script.
7901 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7902 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7903 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7904 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7905
f5c870d2
ILT
79062009-11-04 Ian Lance Taylor <iant@google.com>
7907
7908 * layout.cc (Layout::get_output_section): Add is_interp and
7909 is_dynamic_linker_section parameters. Change all callers.
7910 (Layout::choose_output_section): Likewise.
7911 (Layout::make_output_section): Likewise.
7912 (Layout::add_output_section_data): Add is_dynamic_linker_section
7913 parameter. Change all callers.
7914 * layout.h (class Layout): Update declarations.
7915 * output.h (class Output_section): Add is_interp, set_is_interp,
7916 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7917 Add is_interp_, is_dynamic_linker_section_ fields. Change
7918 generate_code_fills_at_write_ to a bitfield.
7919 * output.cc (Output_section::Output_sections): Initialize new
7920 fields.
7921 (Output_segment::add_output_section): Add do_sort parameter.
7922 Change all callers.
7923
1ae4d23b
ILT
79242009-11-03 Ian Lance Taylor <iant@google.com>
7925
7926 PR 10860
7927 * options.h (class General_options): Add --warn-common.
7928 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7929 merging two common symbols.
7930 (Symbol_table::should_override): Handle --warn-common when merging
7931 a common symbol with a defined symbol. Use report_resolve_problem
7932 for multiple definitions.
7933 (Symbol_table::report_resolve_problem): New function.
7934 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7935
55da9579
DK
79362009-11-03 Doug Kwan <dougkwan@google.com>
7937
7938 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7939 stub_factory_.
7940 (Target_arm::stub_factory): New method definition.
7941 (Target_arm::new_arm_input_section,
7942 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7943 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7944 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7945 New type definitions.
7946 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7947 member declarations.
7948 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7949 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7950 New method definitions.
7951
37a9ac43
ILT
79522009-11-03 Ian Lance Taylor <iant@google.com>
7953
7954 * options.h (class General_options): Add --warn_constructors.
7955
b3d6a3d4
ILT
79562009-11-03 Ian Lance Taylor <iant@google.com>
7957
7958 PR 10893
7959 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7960 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7961
934b01dd
ILT
79622009-11-03 Ian Lance Taylor <iant@google.com>
7963
7964 PR 10895
7965 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7966 --msgid-bugs-address.
7967 (install-pdf): New target.
7968 (install-data_yes): Look up one directory to find mkinstalldirs.
7969
03c1939b
L
79702009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7971
7972 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7973 tree.
7974
ebd95253
DK
79752009-10-30 Doug Kwan <dougkwan@google.com>
7976
7977 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7978
e9bbb538
DK
79792009-10-30 Doug Kwan <dougkwan@google.com>
7980
7981 * arm.cc (Stub_addend_reader): New struct template definition
7982 and partial specializations.
7983 (Stub_addend_reader::operator()): New method definition for a
7984 partially specialized template.
7985
d5b40221
DK
79862009-10-30 Doug Kwan <dougkwan@google.com>
7987
7988 * arm.cc (Arm_relobj::processor_specific_flags): New method
7989 definition.
7990 (Arm_relobj::do_read_symbols): New method declaration.
7991 (Arm_relobj::processor_specific_flags_): New data member declaration.
7992 (Arm_dynobj): New class definition.
7993 (Target_arm::do_finalize_sections): Add input_objects parameter.
7994 (Target_arm::do_adjust_elf_header): New method declaration.
7995 (Target_arm::are_eabi_versions_compatible,
7996 (Target_arm::merge_processor_specific_flags): New method declaration.
7997 (Target_arm::do_make_elf_object): New overloaded method definitions
7998 and declaration.
7999 (Arm_relobj::do_read_symbols): New method definition.
8000 (Arm_dynobj::do_read_symbols): Ditto.
8001 (Target_arm::do_finalize_sections): Add input_objects parameters.
8002 Merge processor-specific flags from all input objects.
8003 (Target_arm::are_eabi_versions_compatible,
8004 Target_arm::merge_processor_specific_flags,
8005 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8006 New method definitions.
8007 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8008 Input_objects pointer type parameter.
8009 * layout.cc (Layout::finalize): Pass input objects to target's.
8010 finalize_sections function.
8011 * output.cc (Output_file_header::do_sized_write): Set ELF file
8012 header's processor-specific flags.
8013 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8014 Input_objects pointer type parameter.
8015 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8016 * target.h (Input_objects): New forward class declaration.
8017 (Target::processor_specific_flags,
8018 Target::are_processor_specific_flags_sect): New method definitions.
8019 (Target::finalize_sections): Add input_objects parameter.
8020 (Target::Target): Initialize processor_specific_flags_ and
8021 are_processor_specific_flags_set_.
8022 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8023 parameter.
8024 (Target::set_processor_specific_flags): New method definition.
8025 (Target::processor_specific_flags_,
8026 Target::are_processor_specific_flags_set_): New data member
8027 declarations.
8028 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8029 Input_objects pointer type parameter.
8030
ebabffbd
DK
80312009-10-30 Doug Kwan <dougkwan@google.com>
8032
8033 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8034
ad0f2072
ILT
80352009-10-28 Ian Lance Taylor <iant@google.com>
8036
8037 * object.h (class Relobj): Drop options parameter from
8038 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8039 do_scan_relocs, do_relocate. Change all callers.
8040 (class Sized_relobj): Drop options parameters from
8041 do_gc_process_relocs, do_scan_relocs, do_relocate,
8042 do_relocate_sections, relocate_sections, emit_relocs_scan,
8043 emit_relocs_scan_reltype. Change all callers.
8044 (struct Relocate_info): Remove options field and all references to
8045 it.
8046 * reloc.h (class Read_relocs): Remove options constructor
8047 parameter and options_ field. Change all callers.
8048 (class Gc_process_relocs, class Scan_relocs): Likewise.
8049 (class Relocate_task): Likewise.
8050 * target-reloc.h (scan_relocs): Remove options parameter. Change
8051 all callers.
8052 (scan_relocatable_relocs): Likewise.
8053 * target.h (class Sized_target): Remove options parameter from
8054 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8055 all callers.
8056 * gc.h (gc_process_relocs): Remove options parameter. Change all
8057 callers.
8058 * arm.cc: Update functions to remove options parameters.
8059 * i386.cc: Likewise.
8060 * powerpc.cc: Likewise.
8061 * sparc.cc: Likewise.
8062 * x86_64.cc: Likewise.
8063 * testsuite/testfile.cc: Likewise.
8064
8ffa3667
DK
80652009-10-28 Doug Kwan <dougkwan@google.com>
8066
8067 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8068 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8069 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8070 New method definitions.
8071
40f36857
CC
80722009-10-28 Cary Coutant <ccoutant@google.com>
8073
8074 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8075 (Plugin::cleanup_done_): New member.
8076 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8077 (Plugin_manager::cleanup_done_): Remove.
8078 (Plugin_manager::add_input_file): Edit error message.
8079 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8080 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8081
2c849493
ILT
80822009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8083
8084 * fileread.cc: (File_read::View::~View): Use the new
8085 data_ownership_ filed.
8086 (File_read::~File_read): Dispose the new whole_file_view_.
8087 (File_read::open): Mmap the whole file if needed.
8088 (File_read::open): Use whole_file_view_ instead of contents_.
8089 (File_read::find_view): Use whole_file_view_ if applicable.
8090 (File_read::do_read): Use whole_file_view_ instead of contents_.
8091 (File_read::make_view): Use whole_file_view_ instead of contents_,
8092 update File_read::View::View call.
8093 (File_read::find_or_make_view): Update File_read::View::View
8094 call.
8095 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8096 remove contents_
8097 (File_read::View::Data_ownership): New enum.
8098 (File_read::View::View): Replace bool mapped_ with Data_ownership
8099 argument.
8100 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8101 (File_read::View::data_ownership_): New field.
8102 (File_read::contents_): Remove (replaced by whole_file_view_).
8103 (File_read::whole_file_view_): New field.
8104 * options.h (class General_options): Add --keep-files-mapped.
8105
24998053
CC
81062009-10-27 Cary Coutant <ccoutant@google.com>
8107
8108 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8109 * testsuite/Makefile.am (plugin_test_5): New test case.
8110 * testsuite/Makefile.in: Regenerate.
8111
72adc4fa
DK
81122009-10-25 Doug Kwan <dougkwan@google.com>
8113
8114 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8115 from private to protected to allow access by child class.
8116 (Sized_relobj::do_relocate_sections): New method declaration.
8117 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8118 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8119 Sized_relobj::relocate_sections. Instantiate template explicitly
8120 for different target sizes and endianity.
8121
07f508a2
DK
81222009-10-24 Doug Kwan <dougkwan@google.com>
8123
8124 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8125 (Arm_input_section::as_arm_input_section): New method.
8126 (Arm_output_section): New class definition.
8127 (Arm_output_section::create_stub_group,
8128 Arm_output_section::group_sections): New method definitions.
8129
10ad9fe5
DK
81302009-10-22 Doug Kwan <dougkwan@google.com>
8131
8132 * arm.cc (Arm_input_section): New class definition.
8133 (Arm_input_section::init, Arm_input_section:do_write,
8134 Arm_input_section::set_final_data_size,
8135 Arm_input_section::do_reset_address_and_file_offset): New method
8136 definitions.
8137
56ee5e00
DK
81382009-10-21 Doug Kwan <dougkwan@google.com>
8139
8140 * arm.cc (Stub_table, Arm_input_section): New forward class
8141 declarations.
8142 (Stub_table): New class defintion.
8143 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8144 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8145 New method definition.
8146
b569affa
DK
81472009-10-21 Doug Kwan <dougkwan@google.com>
8148
8149 * arm.cc: Update copyright comments.
8150 (Target_arm): New forward class template declaration.
8151 (Arm_address): New type.
8152 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8153 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8154 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8155 constants.
8156 (Insn_template): Same.
8157 (DEF_STUBS): New macro.
8158 (Stub_type): New enum type.
8159 (Stub_template): New class definition.
8160 (Stub): Same.
8161 (Reloc_stub): Same.
8162 (Stub_factory): Same.
8163 (Target_arm::Target_arm): Initialize may_use_blx_ and
8164 should_force_pic_veneer_.
8165 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8166 Target_arm::should_force_pic_veneer,
8167 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8168 Target_arm::using_thumb_only, Target_arm:;default_target): New
8169 method defintions.
8170 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8171 New data member declarations.
8172 (Insn_template::size, Insn_template::alignment): New method defintions.
8173 (Stub_template::Stub_template): New method definition.
8174 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8175 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8176 (Stub_factory::Stub_factory): New method definition.
8177 * gold.h (string_hash): New template.
8178 * output.h (Input_section_specifier::hash_value): Use
8179 gold::string_hash.
8180 (Input_section_specifier::string_hash): Remove.
8181 * stringpool.cc (Stringpool_template::string_hash): Use
8182 gold::string_hash.
8183
6c172549
DK
81842009-10-20 Doug Kwan <dougkwan@google.com>
8185
8186 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8187 symbols of relaxed input sections.
8188 * output.h (Output_section::find_relaxed_input_section): Make
8189 method public.
8190
c5617f2f
DK
81912009-10-16 Doug Kwan <dougkwan@google.com>
8192
8193 * dynobj.cc (Versions::Versions): Initialize version_script_.
8194 Only insert base version symbol definition for a shared object
8195 if version script defines any version versions.
8196 (Versions::define_base_version): New method definition.
8197 (Versions::add_def): Check that base version is not needed.
8198 (Versions::add_need): Define base version lazily.
8199 * dynobj.h (Versions::define_base_version): New method declaration.
8200 (Versions::needs_base_version_): New data member declaration.
8201 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8202 (check_DATA): Add no_version_test.stdout.
8203 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8204 New make rules.
8205 * testsuite/Makefile.in: Regenerate.
8206 * testsuite/no_version_test.c: New file.
8207 * testsuite/no_version_test.sh: Ditto.
8208
3c12dcdb
DK
82092009-10-16 Doug Kwan <dougkwan@google.com>
8210
8211 * expression.cc (class Segment_start_expression): New class definition.
8212 (Segment_start_expression::value): New method definition.
8213 (script_exp_function_segment_start): Return a new
8214 Segment_start_expression.
8215 * gold/script-c.h (script_saw_segment_start_expression): New function
8216 prototype.
8217 * script-sections.cc (Script_sections::Script_sections): Initialize
8218 SAW_SEGMENT_START_EXPRESSION_ to false.
8219 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8220 and -Tbbs options to specify section addresses if given in
8221 command line and no SEGMENT_START expression is seen in a script.
8222 * script-sections.h (Script_sections::saw_segment_start_expression,
8223 Script_sections::set_saw_segment_start_expression): New method
8224 definition.
8225 (Script_sections::saw_segment_start_expression_): New data member
8226 declaration.
8227 * script.cc (script_saw_segment_start_expression): New function.
8228 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8229 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8230 script_test_7.sh and script_test_8.sh.
8231 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8232 script_test_8.stdout.
8233 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8234 (script_test_6, script_test_6.stdout, script_test_7,
8235 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8236 * Makefile.in: Regenerate.
8237 * testsuite/script_test_6.sh: New file.
8238 * testsuite/script_test_6.t: Same.
8239 * testsuite/script_test_7.sh: Same.
8240 * testsuite/script_test_7.t: Same.
8241 * testsuite/script_test_8.sh: Same.
8242
64b1ae37
DK
82432009-10-16 Doug Kwan <dougkwan@google.com>
8244
8245 * output.cc (Output_segment::set_section_list_address): Cast
8246 expressions to unsigned long long type to avoid format warnings.
8247
661be1e2
ILT
82482009-10-15 Ian Lance Taylor <iant@google.com>
8249
12edd763 8250 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8251 dot assignment to script_sections_.
12edd763
ILT
8252 * script-sections.cc (Script_sections::add_dot_assignment):
8253 Initialize if necessary.
8254
68b6574b
ILT
8255 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8256 program headers with no load segment if there is a linker script.
8257
661be1e2
ILT
8258 * layout.cc (Layout::set_segment_offsets): Align the file offset
8259 to the segment aligment for -N or -n with no load segment.
8260 * output.cc (Output_segment::add_output_section): Don't crash if
8261 the first section is a TLS section.
8262 (Output_segment::set_section_list_addresses): Print an error
8263 message if the address moves backward in a linker script.
8264 * script-sections.cc
8265 (Output_section_element_input::set_section_addresses): Don't
8266 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8267 (Orphan_output_section::set_section_addresses): Likewise.
8268
f15f61a7
DK
82692009-10-15 Doug Kwan <dougkwan@google.com>
8270
8271 * layout.cc (Layout::finish_dynamic_section): Generate tags
8272 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8273 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8274 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8275
82bb573a
ILT
82762009-10-14 Ian Lance Taylor <iant@google.com>
8277
8278 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8279 fields.
8280 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8281 data_shdr fields of relinfo.
8282 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8283 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8284 R_386_TLS_LDO_32, adjust based on section flags.
8285 (Target_i386::Relocate::fix_up_ldo): Remove.
8286
374ad285
ILT
82872009-10-13 Ian Lance Taylor <iant@google.com>
8288
8289 Add support for -pie.
8290 * options.h (class General_options): Add -pie and
8291 --pic-executable.
8292 (General_options::output_is_position_independent): Test -pie.
8293 (General_options::output_is_executable): Return true if not shared
8294 and not relocatable.
8295 (General_options::output_is_pie): Remove.
8296 * options.cc (General_options::finalize): Reject incompatible uses
8297 of -pie.
8298 * gold.cc (queue_middle_tasks): A -pie link is not static.
8299 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8300 * symtab.cc (Symbol::final_value_is_known): Return false if
8301 output_is_position_independent.
8302 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8303 output_is_position_independent.
8304 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8305 output_is_position_independent.
8306 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8307 output_is_position_independent.
8308 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8309 two_file_pie_test.
8310 (basic_pie_test.o, basic_pie_test): New targets.
8311 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8312 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8313 (two_file_pie_test): New target.
8314 * testsuite/Makefile.in: Rebuild.
8315 * README: Remove note saying that -pie is not supported.
8316
c6585162
ILT
83172009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8318
8319 * options.h (class General_options): Add -init and -fini.
8320 * layout.cc (Layout::finish_dynamic_section): Emit
8321 given init and fini functions.
8322
032ce4e9
ST
83232009-10-13 Sriraman Tallam <tmsriram@google.com>
8324
8325 * gc.h (gc_process_relocs): Check if icf is enabled using new
8326 function.
8327 * gold.cc (queue_initial_tasks): Likewise.
8328 (queue_middle_tasks): Likewise.
8329 * object.cc (do_layout): Likewise.
8330 * symtab.cc (is_section_folded): Likewise.
8331 * main.cc (main): Likewise.
8332 * reloc.cc (Read_relocs::run): Likewise.
8333 (Sized_relobj::do_scan_relocs): Likewise.
8334 * icf.cc (is_function_ctor_or_dtor): New function.
8335 (Icf::find_identical_sections): Check if function is ctor or dtor when
8336 safe icf is chosen.
8337 * options.h (General_options::icf): Change option to be an enum.
8338 (Icf_status): New enum.
8339 (icf_enabled): New method.
8340 (icf_safe_folding): New method.
8341 (set_icf_status): New method.
8342 (icf_status_): New variable.
8343 * (options.cc) (General_options::finalize): Set icf_status_.
8344 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8345 icf_test and icf_keep_unique_test to use the --icf enum flag.
8346 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8347 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8348
f345227a
ST
83492009-10-12 Sriraman Tallam <tmsriram@google.com>
8350
8351 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8352 includes to gc.h and icf.h.
8353 * arm.cc: Include gc.h.
8354 * gold.cc: Likewise.
8355 * i386.cc: Likewise.
8356 * powerpc.cc: Likewise.
8357 * sparc.cc: Likewise.
8358 * x86_64.cc: Likewise.
8359 * gc.h: Include icf.h.
8360
1c7814ed
ILT
83612009-10-11 Ian Lance Taylor <iant@google.com>
8362
8363 * plugin.cc: Include "gold.h" before other header files.
8364
ae3b5189
CD
83652009-10-10 Chris Demetriou <cgd@google.com>
8366
8367 * options.h (Input_file_argument::Input_file_type): New enum.
8368 (Input_file_argument::is_lib_): Replace with...
8369 (Input_file_argument::type_): New member.
8370 (Input_file_argument::Input_file_argument): Take Input_file_type
8371 'type' rather than boolean 'is_lib' as second argument.
8372 (Input_file_argument::is_lib): Use type_.
8373 (Input_file_argument::is_searched_file): New function.
8374 (Input_file_argument::may_need_search): Handle is_searched_file.
8375 * options.cc (General_options::parse_library): Support -l:filename.
8376 (General_options::parse_just_symbols): Update for Input_file_argument
8377 changes.
8378 (Command_line::process): Likewise.
8379 * archive.cc (Archive::get_file_and_offset): Likewise.
8380 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8381 * script.cc (read_script_file, script_add_file): Likewise.
8382 * fileread.cc (Input_file::Input_file): Likewise.
8383 (Input_file::will_search_for): Handle is_searched_file.
8384 (Input_file::open): Likewise.
8385 * readsyms.cc (Read_symbols::get_name): Likewise.
8386 * testsuite/Makefile.am (searched_file_test): New test.
8387 * testsuite/Makefile.in: Regenerate.
8388 * testsuite/searched_file_test.cc: New file.
8389 * testsuite/searched_file_test_lib.cc: New file.
8390
f3048a1d
ILT
83912009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8392 Ian Lance Taylor <iant@google.com>
8393
8394 * descriptor.cc: Include <cstdio> and "binary-io.h".
8395 (Descriptors::open): Open the files in binary mode always.
8396 * script.cc (Lex::get_token): Treat \r as whitespace.
8397
d4780e57
ILT
83982009-10-09 Ian Lance Taylor <iant@google.com>
8399
8400 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8401
d9a893b8
ILT
84022009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8403 Ian Lance Taylor <iant@google.com>
8404
8405 * configure.ac: Check for readv function also.
8406 * fileread.cc (readv): Define if not HAVE_READV.
8407 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8408 does not exist.
8409 * config.in: Regenerate.
8410 * configure: Regenerate.
8411
c0a62865
DK
84122009-10-09 Doug Kwan <dougkwan@google.com>
8413
8414 * layout.cc (Layout::make_output_section): Call target hook to make
8415 ordinary output section.
8416 (Layout::finalize): Adjust parameter list of call the
8417 Target::may_relax().
8418 * layout.h (class Layout::section_list): New method.
8419 * merge.h (Output_merge_base::entsize): Change visibility to public.
8420 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8421 New methods.
8422 (Output_merge_string::do_is_string): New method.
8423 * object.cc (Sized_relobj::do_setup): renamed from
8424 Sized_relobj::set_up.
8425 * object.h (Sized_relobj::adjust_shndx,
8426 Sized_relobj::initializ_input_to_output_maps,
8427 Sized_relobj::free_input_to_output_maps): Change visibilities to
8428 protected.
8429 (Sized_relobj::setup): Virtualize.
8430 (Sized_relobj::do_setup): New method declaration.
8431 (Sized_relobj::invalidate_section_offset,
8432 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8433 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8434 * options.cc (parse_int): New function.
8435 * options.h (parse_int): New declaration.
8436 (DEFINE_int): New macro.
8437 (stub_group_size): New option.
8438 * output.cc (Output_section::Output_section): Initialize memebers
8439 merge_section_map_, merge_section_by_properties_map_,
8440 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8441 (Output_section::add_input_section): Handled deferred code-fill
8442 generation and remove an old comment.
8443 (Output_section::add_relaxed_input_section): New method definition.
8444 (Output_section::add_merge_input_section): Use merge section by
8445 properties map to speed to search. Update merge section maps
8446 as appropriate.
8447 (Output_section::build_relaxation_map): New method definition.
8448 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8449 Same.
8450 (Output_section::relax_input_section): Renamed to
8451 Output_section::convert_input_sections_to_relaxed_sections and change
8452 interface to take a vector of pointers to relaxed sections.
8453 (Output_section::find_merge_section,
8454 Output_section::find_relaxed_input_section): New method definitions.
8455 (Output_section::is_input_address_mapped,
8456 Output_section::output_offset, Output_section::output_address):
8457 Use output section data maps to speed up searching.
8458 (Output_section::find_starting_output_address): Add comments.
8459 (Output_section::do_write,
8460 Output_section::write_to_postprocessing_buffer): Do code-fill
8461 generation as appropriate.
8462 (Output_section::get_input_sections): Invalidate relaxed input section
8463 map.
8464 (Output_section::restore_states): Adjust type of checkpoint .
8465 Invalidate relaxed input section map.
8466 * output.h (Output_merge_base): New class declaration.
8467 (Input_section_specifier): New class defintion.
8468 (class Output_relaxed_input_section) Change base class to
8469 Output_section_data_build.
8470 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8471 base class initializer.
8472 (Output_section::add_relaxed_input_section): New method declaration.
8473 (Output_section::Input_section): Change visibility to protected.
8474 (Output_section::Input_section::relobj,
8475 Output_section::Input_section::shndx): Handle relaxed input sections.
8476 Output_section::input_sections) Change visibility to protected. Also
8477 define overload to return a non-const pointer.
8478 (Output_section::Merge_section_properties): New class defintion.
8479 (Output_section::Merge_section_by_properties_map,
8480 Output_section::Output_section_data_by_input_section_map,
8481 Output_section::Relaxation_map): New types.
8482 (Output_section::relax_input_section): Rename method to
8483 Output_section::convert_input_sections_to_relaxed_sections and change
8484 interface to take a vector of relaxed section pointers.
8485 (Output_section::find_merge_section,
8486 Output_section::find_relaxed_input_section,
8487 Output_section::build_relaxation_map,
8488 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8489 New method declarations.
8490 (Output_section::merge_section_map_
8491 Output_section::merge_section_by_properties_map_,
8492 Output_section::relaxed_input_section_map_,
8493 Output_section::is_relaxed_input_section_map_valid_,
8494 Output_section::generate_code_fills_at_write_): New data members.
8495 * script-sections.cc
8496 (Output_section_element_input::set_section_addresses): Call
8497 current_data_size and addralign methods of relaxed input sections.
8498 (Orphan_output_section::set_section_addresses): Call current_data_size
8499 and addralign methods of relaxed input sections.
8500 * symtab.cc (Symbol_table::compute_final_value): Extract template
8501 from the body of Symbol_table::sized_finalize_symbol.
8502 (Symbol_table::sized_finalized_symbol): Call
8503 Symbol_table::compute_final_value.
8504 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8505 (Symbol_table::compute_final_value): New templated method declaration.
8506 * target.cc (Target::do_make_output_section): New method defintion.
8507 * target.h (Target::make_output_section): New method declaration.
8508 (Target::relax): Add more parameters for input objects, symbol table
8509 and layout. Adjust call to do_relax.
8510 (Target::do_make_output_section): New method declaration.
8511 (Target::do_relax): Add parameters for input objects, symbol table
8512 and layout.
8513
d446d6c4
ILT
85142009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8515
8516 * pread.c: Include stdio.h.
8517
bc06c745
ILT
85182009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8519
8520 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8521 defined.
8522
75aea3d0
ILT
85232009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8524
8525 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8526 Change read_shndx type to unsigned int.
8527 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8528 int.
8529 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8530 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8531 Change read_shndx type to unsigned int.
8532 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8533 int.
8534 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8535 * layout.cc (Layout::create_symtab_sections): Cast the result of
8536 local_symcount * symsize to off_t in the gold_assert.
8537
be8fcb75
ILT
85382009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8539
8540 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8541 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8542 R_ARM_BASE_ABS.
8543 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8544 (Arm_relocate_functions::thm_abs5): New function.
8545 (Arm_relocate_functions::abs12): New function.
8546 (Arm_relocate_functions::abs16): New function.
8547 (Arm_relocate_functions::base_abs): New function.
8548 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8549 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8550 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8551 R_ARM_BASE_ABS.
8552 (Scan::global): Likewise.
8553 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8554 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8555 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8556 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8557 R_ARM_BASE_ABS.
8558
c2a122b6
ILT
85592009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8560
8561 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8562 (Arm_relocate_functions::movt_prel): New function.
8563 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8564 (Arm_relocate_functions::thm_movt_prel): New function.
8565 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8566 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8567 (Scan::global, Relocate::relocate): Likewise.
8568 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8569
c4aa1e2d
ILT
85702009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8571
8572 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8573 Incremental_checker.
8574 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8575 unsigned int.
8576 (class Incremental_inputs_header): New class.
8577 (Incremental_inputs_header_writer): Edit comment.
8578 (Incremental_inputs_entry): New class.
8579 (Incremental_inputs_entry_writer): Edit comment.
8580 (Sized_incremental_binary::do_find_incremental_inputs_section):
8581 Add *strtab_shndx parameter, fill it.
8582 (Sized_incremental_binary::do_check_inputs): New method.
8583 (Incremental_checker::can_incrementally_link_output_file): Use
8584 Sized_incremental_binary::check_inputs.
8585 (Incremental_inputs::report_command_line): Save command line in
8586 command_line_.
8587 * incremental.h:
8588 (Incremental_binary::find_incremental_inputs_section): New
8589 method.
8590 (Incremental_binary::do_find_incremental_inputs_section): Add
8591 strtab_shndx parameter.
8592 (Incremental_binary::do_check_inputs): New pure virtual method.
8593 (Sized_incremental_binary::do_check_inputs): Declare.
8594 (Incremental_checker::Incremental_checker): Add incremental_inputs
8595 parameter, use it to initialize incremental_inputs_.
8596 (Incremental_checker::incremental_inputs_): New field.
8597 (Incremental_checker::command_line): New method.
8598 (Incremental_checker::inputs): New method.
8599 (Incremental_checker::command_line_): New field.
8600
c549a694
ILT
86012009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8602
8603 * incremental.cc: Include <cstdarg> and "target-select.h".
8604 (vexplain_no_incremental): New function.
8605 (explain_no_incremental): New function.
8606 (Incremental_binary::error): New method.
8607 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8608 method.
8609 (make_sized_incremental_binary): New function.
8610 (open_incremental_binary): New function.
8611 (can_incrementally_link_file): Add checks if output is ELF and has
8612 inputs section.
8613 * incremental.h: Include "elfcpp_file.h" and "output.h".
8614 (Incremental_binary): New class.
8615 (Sized_incremental_binary): New class.
8616 (open_incremental_binary): Declare.
8617 * object.cc (is_elf_object): Use
8618 elfcpp::Elf_recognizer::is_elf_file.
8619 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8620 * output.h (Output_file::filesize): New method.
8621
fd3c5f0b
ILT
86222009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8623
8624 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8625 New function.
8626 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8627 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8628 function.
8629 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8630 function.
8631 (Arm_relocate_functions::movw_abs_nc): New function.
8632 (Arm_relocate_functions::movt_abs): New function.
8633 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8634 (Arm_relocate_functions::thm_movt_abs): New function.
8635 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8636 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8637 (Scan::global): Likewise.
8638 (Relocate::relocate): Likewise.
8639 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8640
7f5309a5
ILT
86412009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8642
8643 * arm.cc (Arm_relocate_functions::got_prel) New function.
8644 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8645 (Relocate::relocate): Likewise.
8646 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8647
364c7fa5
ILT
86482009-10-06 Ian Lance Taylor <iant@google.com>
8649
8650 * options.h (class General_options): Define
8651 split_stack_adjust_size parameter.
8652 * object.h (class Object): Add uses_split_stack_ and
8653 has_no_split_stack_ fields. Add uses_split_stack and
8654 has_no_split_stack accessor functions. Declare
8655 handle_split_stack_section.
8656 (class Reloc_symbol_changes): Define.
8657 (class Sized_relobj): Define Function_offsets. Declare
8658 split_stack_adjust, split_stack_adjust_reltype, and
8659 find_functions.
8660 * object.cc (Object::handle_split_stack_section): New function.
8661 (Sized_relobj::do_layout): Call handle_split_stack_section.
8662 * dynobj.cc (Sized_dynobj::do_layout): Call
8663 handle_split_stack_section.
8664 * reloc.cc (Sized_relobj::relocate_sections): Call
8665 split_stack_adjust for executable sections in split_stack
8666 objects. Pass reloc_map to relocate_section.
8667 (Sized_relobj::split_stack_adjust): New function.
8668 (Sized_relobj::split_stack_adjust_reltype): New function.
8669 (Sized_relobj::find_functions): New function.
8670 * target-reloc.h: Include "object.h".
8671 (relocate_section): Add reloc_symbol_changes parameter. Change
8672 all callers.
8673 * target.h (class Target): Add calls_non_split method. Declare
8674 do_calls_non_split virtual method. Declare match_view and
8675 set_view_to_nop.
8676 * target.cc: Include "elfcpp.h".
8677 (Target::do_calls_non_split): New function.
8678 (Target::match_view): New function.
8679 (Target::set_view_to_nop): New function.
8680 * gold.cc (queue_middle_tasks): Give an error if mixing
8681 split-stack and non-split-stack objects with -r.
8682 * i386.cc (Target_i386::relocate_section): Add
8683 reloc_symbol_changes parameter.
8684 (Target_i386::do_calls_non_split): New function.
8685 * x86_64.cc (Target_x86_64::relocate_section): Add
8686 reloc_symbol_changes parameter.
8687 (Target_x86_64::do_calls_non_split): New function.
8688 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8689 parameter.
8690 * powerpc.cc (Target_powerpc::relocate_section): Add
8691 reloc_symbol_changes parameter.
8692 * sparc.cc (Target_sparc::relocate_section): Add
8693 reloc_symbol_changes parameter.
8694 * configure.ac: Call AM_CONDITIONAL for the default target.
8695 * configure: Rebuild.
8696 * testsuite/Makefile.am (TEST_AS): New variable.
8697 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8698 (check_DATA): Add split_i386 and split_x86_64 files.
8699 (SPLIT_DEFSYMS): Define.
8700 (split_i386_[1234n].o): New targets.
8701 (split_i386_[124]): New targets.
8702 (split_i386_[1234r].stdout): New targets.
8703 (split_x86_64_[1234n].o): New targets.
8704 (split_x86_64_[124]): New targets.
8705 (split_x86_64_[1234r].stdout): New targets.
8706 (MOSTLYCLEANFILES): Add new executables.
8707 * testsuite/split_i386.sh: New file.
8708 * testsuite/split_x86_64.sh: New file.
8709 * testsuite/split_i386_1.s: New file.
8710 * testsuite/split_i386_2.s: New file.
8711 * testsuite/split_i386_3.s: New file.
8712 * testsuite/split_i386_4.s: New file.
8713 * testsuite/split_i386_n.s: New file.
8714 * testsuite/split_x86_64_1.s: New file.
8715 * testsuite/split_x86_64_2.s: New file.
8716 * testsuite/split_x86_64_3.s: New file.
8717 * testsuite/split_x86_64_4.s: New file.
8718 * testsuite/split_x86_64_n.s: New file.
8719 * testsuite/testfile.cc (Target_test): Update relocation_section
8720 function.
8721 * testsuite/Makefile.in: Rebuild.
8722
e8a9fcda
ILT
87232009-10-06 Ian Lance Taylor <iant@google.com>
8724
8725 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8726 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8727 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8728 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8729 the address on ldo_addrs_.
8730 (Target_i386::Relocate::fix_up_ldo): New function.
8731
e99daf92
ILT
87322009-10-06 Rafael Espindola <espindola@google.com>
8733
8734 * plugin.cc (add_input_library): New.
8735 (Plugin::load): Add add_input_library to tv.
8736 (Plugin_manager::add_input_file): Add the is_lib argument.
8737 (add_input_file): Update call to Plugin_manager::add_input_file.
8738 (add_input_library): New.
8739 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8740
966d4097
DK
87412009-09-30 Doug Kwan <dougkwan@google.com>
8742
8743 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8744 symbol and call Symbol::may_need_copy_reloc to determine if
8745 a copy reloc is needed.
8746 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8747 nocopyreloc is given in command line.
8748 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8749 given in command line.
8750 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8751 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8752 of the removed Target_i386::may_need_copy_reloc.
8753 * options.h (copyreloc): New option with default value false.
8754 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8755 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8756 instead of the removed Target_powerpc::may_need_copy_reloc.
8757 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8758 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8759 instead of the removed Target_sparc::may_need_copy_reloc.
8760 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8761 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8762 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8763 instead of the removed Target_x86_64::may_need_copy_reloc.
8764
029ba973
ILT
87652009-09-30 Ian Lance Taylor <iant@google.com>
8766
8767 * object.h (class Object): Remove target_ field, and target,
8768 sized_target, and set_target methods.
8769 (Object::sized_target): Remove.
8770 (class Sized_relobj): Update declarations. Remove sized_target.
8771 * object.cc (Sized_relobj::setup): Remove target parameter.
8772 Change all callers.
8773 (Input_objects::add_object): Don't do anything with the target.
8774 (make_elf_sized_object): Add punconfigured parameter. Change all
8775 callers. Set or test parameter target.
8776 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8777 Change all callers.
8778 * parameters.cc (Parameters::set_target): Change parameter type to
8779 be non-const.
8780 (Parameters::default_target): Remove.
8781 (set_parameters_target): Change parameter type to be non-const.
8782 (parameters_force_valid_target): New function.
8783 (parameters_clear_target): New function.
8784 * parameters.h (class Parameters): Update declarations. Remove
8785 default_target method. Add sized_target and clear_target
8786 methods. Change target_ to be non-const.
8787 (set_parameters_target): Update declaration.
8788 (parameters_force_valid_target): Declare.
8789 (parameters_clear_target): Declare.
8790 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8791 as NULL if we aren't searching.
8792 (Add_symbols::run): Don't check for compatible target.
8793 * fileread.cc (Input_file::open_binary): Call
8794 parameters_force_valid_target.
8795 * gold.cc (queue_middle_tasks): Likewise.
8796 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8797 set_target on object.
8798 * dynobj.h (class Sized_dynobj): Update declarations.
8799 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8800 make_elf_object returns NULL.
8801 (Archive::include_member): Don't check whether object target is
8802 compatible.
8803 * output.cc (Output_section::add_input_section): Get target from
8804 parameters.
8805 (Output_section::relax_input_section): Likewise.
8806 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8807 parameters.
8808 (Sized_relobj::do_scan_relocs): Likewise.
8809 (Sized_relobj::relocate_sections): Likewise.
8810 * resolve.cc (Symbol_table::resolve): Likewise.
8811 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8812 parameter. Change all callers.
8813 (Symbol_table::add_from_object): Get target from parameters.
8814 (Symbol_table::add_from_relobj): Don't check object target.
8815 (Symbol_table::add_from_dynobj): Likewise.
8816 (Symbol_table::define_special_symbol): Get target from
8817 parameters.
8818 * symtab.h (class Symbol_table): Update declaration.
8819 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8820 parameter. Change all callers. Clear parameter target.
8821 (Binary_test): Test target here.
8822 * testsuite/object_unittest.cc (gold_testsuite): Remove
8823 target_test_pointer parameter. Change all callers.
8824 (Object_test): Test target here.
8825
a6a22b83
ILT
88262009-09-26 Ian Lance Taylor <iant@google.com>
8827
8828 * testsuite/initpri1.c: Don't try to use constructor priorities if
8829 compiling with gcc before 4.3.
8830
6a8f49fe
ILT
88312009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8832
8833 * testsuite/retain_symbols_file_test.sh (check_present): Change
8834 output file name to retain_symbols_file_test.stdout.
8835 (check_absent): Likewise.
8836
8c604651
CS
88372009-09-18 Craig Silverstein <csilvers@google.com>
8838
8839 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8840 * options.cc: Include <cerrno> and <fstream>.
8841 (General_options::finalize): Parse -retain-symbols-file tag.
8842 * options.h: New flag.
8843 (General_options): New method should_retain_symbol, new
8844 variable symbols_to_retain.
8845 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8846 should_retain_symbol map.
8847 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8848 * testsuite/Makefile.in: Regenerate.
8849 * testsuite/retain_symbols_file_test.sh: New file.
8850
ca58b19f
NC
88512009-09-18 Nick Clifton <nickc@redhat.com>
8852
8853 * po/es.po: Updated Spanish translation.
8854
20e6d0d6
DK
88552009-09-17 Doug Kwan <dougkwan@google.com>
8856
8857 * debug.h (DEBUG_RELAXATION): New constant.
8858 (DEBUG_ALL): Add DEBUG_RELAXATION.
8859 (debug_string_to_enum): Add relaxation debug option.
8860 * layout.cc
8861 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8862 Layout::Relaxation_debug_check::read_sections,
8863 Layout::Relaxation_debug_check::read_sections): New method definitions.
8864 (Layout::Layout): Initialize data members
8865 record_output_section_data_from_scrips_,
8866 script_output_section_data_list_ and relaxation_debug_check_.
8867 (Layout::save_segments, Layout::restore_segments,
8868 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8869 Layout::relaxation_loop_body): New method definitions.
8870 (Layout::finalize): Support relaxation. Move section layout code to
8871 Layout::relaxation_loop_body.
8872 (Layout::set_asection_address_from_script): Move code for orphan
8873 section placement out.
8874 (Layout::place_orphan_sections_in_script): New method definition.
8875 * layout.h (Output_segment_headers, Output_file_header):
8876 New forward class declarations.
8877 (Layout::~Layout): Define.
8878 (Layout::new_output_section_data_from_script): New method definition.
8879 (Layout::place_orphan_sections_in_script): New method declaration.
8880 (Layout::Segment_states): New type declaration.
8881 (Layout::save_segments, Layout::restore_segments,
8882 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8883 Layout::relaxation_loop_body): New method declarations.
8884 (Layout::Output_section_data_list): New type declaration.
8885 (Layout::Relaxation_debug_check): New class definition.
8886 (Layout::record_output_section_data_from_script_,
8887 Layout::script_output_section_data_list_, Layout::segment_states_,
8888 Layout::relaxation_debug_check_): New data members.
8889 * output.cc: (Output_section_headers::do_size): New method definition.
8890 (Output_section_headers::Output_section_headers): Move size
8891 computation to Output_section_headers::do_size.
8892 (Output_segment_headers::do_size): New method definition.
e1df38aa 8893 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8894 Output_file_header::do_size and call it.
8895 (Output_file_header::do_size): New method definition.
8896 (Output_data_group::Output_data_group): Adjust call to
8897 Output_section_data.
8898 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8899 (Output_symtab_xindex::do_write): Add array bound check.
8900 (Output_section::Input_section::print_to_mapfile): Handle
8901 RELAXED_INPUT_SECTION_CODE.
8902 (Output_section::Output_section): Initialize data member checkpoint_.
8903 (Output_section::~Output_section): Delete checkpoint object pointed
8904 by checkpoint_.
8905 (Output_section::add_input_section): Always add an Input_section if
8906 relaxing.
8907 (Output_section::add_merge_input_section): Add assert.
8908 (Output_section::relax_input_section): New method definition.
8909 (Output_section::set_final_data_size): Set load address to zero for
8910 an unallocated section.
8911 (Output_section::do_address_and_file_offset_have_reset_values):
8912 New method definition.
8913 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8914 Handle relaxed input section.
8915 (Output_section::sort_attached_input_sections): Checkpoint input
8916 section list lazily.
8917 (Output_section::get_input_sections): Change type of input_sections to
8918 list of Simple_input_section pointers. Checkpoint input section list
8919 lazily. Also handle relaxed input sections.
8920 (Output_section::add_input_section_for_script): Take a reference to
8921 a Simple_input_section object instead of Relobj pointer and section
8922 index as parameter. Handle relaxed input sections.
8923 (Output_section::save_states, Output_section::restore_states): New
8924 method definitions.
8925 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8926 (Output_data::is_data_size_fixed): New method definition.
8927 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8928 if it is fixed.
8929 (Output_data::address_and_file_offset_have_reset_values): New method
8930 definition.
8931 (Output_data::do_address_and_file_offset_have_reset_values): New method
8932 definition.
8933 (Output_data::set_data_size): Check that data size is not fixed.
8934 (Output_data::fix_data_size): New method definition.
8935 (Output_data::is_data_size_fixed_): New data member.
8936 (Output_section_headers::set_final_data_size): New method definition.
8937 (Output_section_headers::do_size): New method declaration.
8938 (Output_segment_headers::set_final_data_size): New method definition.
8939 (Output_segment_headers::do_size): New method declaration.
8940 (Output_file_header::set_final_data_size)::New method definition.
8941 (Output_file_header::do_size)::New method declaration.
8942 (Output_section_data::Output_section_data): Add new parameter
8943 is_data_size_fixed and use it to fix data size.
8944 (Output_data_const::Output_data_const): Adjust call to base class
8945 constructor and fix data size.
8946 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8947 base class constructor and fix data size.
8948 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8949 base class constructor and fix data size.
8950 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8951 class constructor and fix data size.
8952 (Output_data_group::set_final_data_size): New method definition.
8953 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8954 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8955 class constructor and fix data size.
8956 (Output_relaxed_input_section): New class definition.
8957 (Output_section::Simple_input_section): New class definition.
8958 (Output_section::get_input_sections): Adjust parameter list.
8959 (Output_section::add_input_section_for_script): Same.
8960 (Output_section::save_states, Output_section::restore_states,
8961 Output_section::do_address_and_file_offset_have_reset_values,
8962 (Output_section::Input_section::Input_section): Handle
8963 RELAXED_INPUT_SECTION_CODE. Add new overload for
8964 Output_relaxed_input_section.
8965 (Output_section::Input_section::is_input_section,
8966 Output_section::Input_section::set_output_section): Handle relaxed
8967 input section.
8968 (Output_section::Input_section::is_relaxed_input_section,
8969 Output_section::Input_section::output_section_data,
8970 Output_section::Input_section::relaxed_input_section): New method
8971 definitions.
8972 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8973 value.
8974 (Output_section::Input_section::u1_): Update comments.
8975 (Output_section::Input_section::u2_): Add new union member poris.
8976 (Output_section::Checkpoint_output_section): New classs definition.
8977 (Output_section::relax_input_section): New method declaration.
8978 (Output_section::checkpoint_): New data member.
8979 (Output_segment): Update comments.
8980 (Output_segment::Output_segment): Un-privatize copy constructor.
8981 (Output_segment::operator=): Un-privatize.
8982 * script-sections.cc (Output_section_element::Input_section_list):
8983 Change element type to Output_section::Simple_input_section.
8984 (Output_section_element_dot_assignment::set_section_addresses):
8985 Register output section data for relaxation clean up.
8986 (Output_data_exression::Output_data_expression): Adjust call to base
8987 constructor to fix data size.
8988 (Output_section_element_data::set_section_addresses): Register
8989 Output_data_expression object for relaxation clean up.
8990 (struct Input_section_info): Replace Relobj pointer and section index
8991 pair with Output_section::Simple_input_section and Convert struct to a
8992 class.
8993 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8994 Input_section_info data member to use accessors.
20e6d0d6
DK
8995 (Output_section_element_input::set_section_addresses): Use layout
8996 parameter. Adjust code to use Output_section::Simple_input_section
8997 and Input_secction_info classes. Register filler for relaxation
8998 clean up.
8999 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9000 and section index pair with Output_section::Simple_input_section
9001 class. Adjust code accordingly.
9002 (Phdrs_element::release_segment): New method definition.
9003 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9004 segment list.
9005 (Script_sections::release_segments): New method definition.
9006 * gold/script-sections.h (Script_sections::release_segments): New
9007 method declaration.
9008 * gold/target.h (Target::may_relax, Target::relax,
9009 Target::do_may_relax, Target::do_relax): New method definitions.
9010
5e445df6
ILT
90112009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9012
9013 * arm.cc (has_signed_unsigned_overflow): New function.
9014 (Arm_relocate_functions::abs8): New function.
9015 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9016 (Target_arm::Scan::global): Likewise.
9017 (Target_arm::relocate::relocate): Likewise.
9018 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9019 Likewise.
9020
8c604651 90212009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9022
9023 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9024 * testsuite/Makefile.in: Regenerate.
9025
1e9cc1c2
NC
90262009-09-11 Nick Clifton <nickc@redhat.com>
9027
9028 * po/gold.pot: Updated by the Translation project.
9029
6a89f575
CC
90302009-09-08 Cary Coutant <ccoutant@google.com>
9031
9032 * output.cc (Output_file::open): Add execute permission to empty file.
9033 * testsuite/Makefile.am (permission_test): New test.
9034 * testsuite/Makefile.in: Regenerate.
9035
fdcac5af
ILT
90362009-09-02 Ian Lance Taylor <iant@google.com>
9037
9038 * output.cc (Output_file::resize): Call map_no_anonymous rather
9039 than map.
9040
44453f85
ILT
90412009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9042
9043 * gold.cc: Include "incremental.h".
9044 (queue_initial_tasks): Call Incremental_checker methods.
9045 * incremental.cc: Include "output.h".
9046 (Incremental_checker::can_incrementally_link_output_file): New
9047 method.
9048 * incremental.h (Incremental_checker): New class.
9049
9050 * output.cc (Output_file::open_for_modification): New method.
9051 (Output_file::map_anonymous): Changed return type to bool. Record
9052 map in base_ field.
9053 (Output_file::map_no_anonymous): New method, broken out of map.
9054 (Output_file::map): Use map_no_anonymous and map_anonymous.
9055 * output.h (class Output_file): Update declarations.
9056
293c1386
CC
90572009-08-24 Cary Coutant <ccoutant@google.com>
9058
9059 * options.h (Command_line::Pre_options): New class.
9060 (Command_line::pre_options): New member.
9061 * options.cc (gold::options::ready_to_register): New variable.
9062 (One_option::register_option): Do nothing if not registering options.
9063 Assert if same short option registered twice.
9064 (General_options::General_options): Turn off option registration when
9065 done constructing.
9066 (Command_line::Pre_options::Pre_options): New constructor.
9067
f773f3d2
CC
90682009-08-24 Cary Coutant <ccoutant@google.com>
9069
06a73cfe
CC
9070 * options.h (General_options::no_keep_memory): Remove incorrect
9071 short option.
f773f3d2 9072
a15af8e2
RW
90732009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9074
9075 * Makefile.am (am__skiplex, am__skipyacc): New.
9076 * Makefile.in: Regenerate.
9077
c462b41b
RW
90782009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9079
14ec8efd
RW
9080 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9081 (INCLUDES): ... this.
9082 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9083 (AM_CPPFLAGS): Renamed from ...
9084 (INCLUDE): ... this.
9085 * Makefile.in, testsuite/Makefile.in: Regenerate.
9086
81ecdfbb
RW
9087 * Makefile.in: Regenerate.
9088 * aclocal.m4: Likewise.
9089 * config.in: Likewise.
9090 * configure: Likewise.
9091 * testsuite/Makefile.in: Likewise.
9092
c462b41b
RW
9093 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9094 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9095 * Makefile.in: Regenerate.
9096 * testsuite/Makefile.in: Regenerate.
9097
2da73f13
CC
90982009-08-19 Cary Coutant <ccoutant@google.com>
9099
9100 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9101 symbols in shared libraries overridden by hidden or internal symbols
9102 in the main program.
9103
2db70501
CD
91042009-08-19 Chris Demetriou <cgd@google.com>
9105
9106 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9107 checking source file names in error messages.
9108
f733487b
DK
91092009-08-18 Doug Kwan <dougkwan@google.com>
9110
9111 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9112 an elcpp::Ehdr as parameter. Adjust call to set_target.
9113 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9114 an elfcpp::Ehdr as parameter.
9115 * object.cc (Object::set_target): Remove the version that looks up
9116 a target and sets it.
9117 (Sized_relobj::setup): Take a Target object instead of
9118 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9119 (make_elf_sized_object): Find target and ask target to
9120 make an ELF object.
9121 * object.h: (Object::set_target): Remove the version that looks up
9122 a target and sets it.
9123 (Sized_relobj::setup): Take a Target object instead of
9124 an elfcpp:Ehdr as parameter.
9125 * target.cc: Include dynobj.h.
9126 (Target::do_make_elf_object_implementation): New.
9127 (Target::do_make_elf_object): New.
9128 * target.h (Target::make_elf_object): New template declaration.
9129 (Target::do_make_elf_object): New method declarations.
9130 (Target::do_make_elf_object_implementation): New template declaration.
9131
cc70f101
ILT
91322009-08-14 Ian Lance Taylor <iant@google.com>
9133
9134 * gold.h (FUNCTION_NAME): Define.
9135 (gold_unreachable): Use FUNCTION_NAME.
9136
ef5e0cb1
ST
91372009-08-12 Sriraman Tallam <tmsriram@google.com>
9138
9139 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9140 symbol in the --keep-unique list is not found.
9141
48c187ce
ST
91422009-08-12 Sriraman Tallam <tmsriram@google.com>
9143
9144 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9145 been maked as --keep-unique.
9146 (Icf::unfold_section): New function.
9147 * icf.h (Icf::unfold_section): New function.
9148 * options.h (General_options::keep_unique): New option.
9149 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9150 * testsuite/Makefile.in: Regenerate.
9151 * testsuite/icf_keep_unique_test.sh: New file.
9152 * testsuite/icf_keep_unique_test.cc: New file.
9153
645afe0c
CC
91542009-08-12 Cary Coutant <ccoutant@google.com>
9155
9156 PR 10471
9157 * resolve.cc (Symbol_table::resolve): Check for references from
9158 dynamic objects to hidden and internal symbols.
9159 * testsuite/Makefile.am (hidden_test.sh): New test.
9160 * testsuite/Makefile.in: Regenerate.
9161 * testsuite/hidden_test.sh: New script.
9162 * testsuite/hidden_test_1.c: New test source.
9163 * testsuite/hidden_test_main.c: New test source.
9164
11af873f
DK
91652009-08-11 Doug Kwan <dougkwan@google.com>
9166
9167 * arm.cc: Update comments.
9168 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9169 segment to locate the .ARM.exidx section if present.
9170
b9f7d72d
DK
91712009-08-09 Doug Kwan <dougkwan@google.com>
9172
9173 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9174 patch.
9175
ddd3c53c
ST
91762009-08-07 Sriraman Tallam <tmsriram@google.com>
9177 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9178 compiler warnings.
9179
27721062
ST
91802009-08-06 Sriraman Tallam <tmsriram@google.com>
9181
9182 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9183 valid tls_segment only for non-debug-section relocations.
9184 * testsuite/Makefile.am: Add gc_tls_test.
9185 * testsuite/Makefile.in: Regenerate.
9186 * testsuite/gc_tls_test.cc: New file.
9187 * testsuite/gc_tls_test.sh: New file.
9188
ef15dade 91892009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9190
ef15dade
ST
9191 * icf.cc: New file.
9192 * icf.h: New file.
9193 * Makefile.am (CCFILES): Add icf.cc.
9194 (HFILES): Add icf.h
9195 * Makefile.in: Regenerate.
9196 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9197 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9198 section, symbol and addend information for the relocs.
9199 * gold.cc (queue_middle_tasks): Call identical code folding.
9200 * gold.h: Add defines for multimap.
9201 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9202 to the call of finalize_local_symbols.
9203 * main.cc (main): Create object of class Icf.
9204 * object.cc (Sized_relobj::do_layout): Allow this function to be
9205 called twice during icf.
9206 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9207 to sections marked as identical by icf.
9208 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9209 when available.
9210 (Sized_relobj::do_section_entsize): New function.
9211 * object.h (Object::section_entsize): New function.
9212 (Object::do_section_entsize): New pure virtual function.
9213 (Relobj::finalize_local_symbols): Add new parameter.
9214 (Relobj::do_section_entsize): New function.
9215 * options.h (General_options::icf): New option.
9216 (General_options::icf_iterations): New option.
9217 (General_options::print_icf_sections): New option.
9218 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9219 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9220 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9221 icf.
9222 * symtab.cc (Symbol_table::is_section_folded): New function.
9223 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9224 to sections marked as identical by icf.
9225 * symtab.h (Symbol_table::set_icf): New function.
9226 (Symbol_table::icf): New function.
9227 (Symbol_table::is_section_folded): New function.
9228 (Symbol_table::icf_): New data member.
9229 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9230 * testsuite/Makefile.am: Add commands to build icf_test.
9231 * testsuite/Makefile.in: Regenerate.
9232 * testsuite/icf_test.sh: New file.
9233 * testsuite/icf_test.cc: New file.
9234
c3b65ac4
CD
92352009-07-24 Chris Demetriou <cgd@google.com>
9236
9237 * layout.cc (is_compressible_debug_section): Fix incorrect
9238 comment about compressed section names.
9239
1caf2c51
ILT
92402009-07-20 Ian Lance Taylor <ian@airs.com>
9241
9242 PR 10419
9243 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9244
1ef4d87f
ILT
92452009-07-16 Ian Lance Taylor <iant@google.com>
9246
9247 PR 10400
9248 * layout.h: #include <map>.
9249 (class Kept_section): Change from struct to class. Add accessors
9250 and setters. Add section size to Comdat_group mapping. Change
9251 Comdat_group to std::map. Add is_comdat_ field. Add
9252 linkonce_size field in union.
9253 (class Layout): Update declaration of find_or_add_kept_section.
9254 Don't declare find_kept_object.
9255 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9256 parameter. Add object, shndx, is_comdat, and is_group_name
9257 parameters. Change all callers. Adjust for new Kept_section.
9258 (Layout::find_kept_object): Remove.
9259 * object.cc (Sized_relobj::include_section_group): Update use of
9260 Kept_section. Rename secnum to shndx. Only record
9261 Kept_comdat_section if sections are the same size.
9262 (Sized_relobj::include_linkonce_section): Update use of
9263 Kept_section. Only record Kept_comdat_section if sections are the
9264 same size. Set size of linkonce section.
9265 (Sized_relobj::map_to_kept_section): Update call to
9266 get_kept_comdat_section.
9267 * object.h (class Sized_relobj): Rename fields in
9268 Kept_comdat_section to drop trailing underscores; change object
9269 field to Relobj*. Change Kept_comdat_section_table to store
9270 struct rather than pointer.
9271 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9272 Add kept_object and kept_shndx parameters. Change all callers.
9273 (Sized_relobj::get_kept_comdat_section): Change return type to
9274 bool. Add kept_object and kept_shndx parameters. Change all
9275 callers.
9276 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9277 Layout::find_or_add_kept_section.
9278
37c3b7b0
ILT
92792009-07-09 Ian Lance Taylor <iant@google.com>
9280
9281 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9282 Reserve space in the hash table.
9283
98fa85cb
ILT
92842009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9285
9286 * fileread.cc (File_read::get_mtime): New method.
9287 * fileread.h (Timespec): New structure.
9288 (File_read::get_mtime): New method.
9289 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9290 Renamed from timestamp_nsec.
9291 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9292 Elf_Xword.
e1df38aa 9293 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9294 timestamp_nsec.
e1df38aa 9295 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9296 (Incremental_inputs::report_obejct): Save mtime; style fix.
9297 (Incremental_inputs::report_script): Save mtime; style fix.
9298 (Incremental_inputs::finalize_inputs): Style fix.
9299 (Incremental_inputs::finalize): Style fix.
9300 (Incremental_inputs::create_input_section_data): Store inputs
9301 mtime.
9302 * incremental.h (Incremental_inputs::report_script): Add mtime
9303 argument.
9304 (Incremental_inputs::Input_info::Input_info): Intialize only one
9305 union member.
9306 (Incremental_inputs::Input_info::archive): Move to nameless
9307 union.
9308 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9309 (Incremental_inputs::Input_info::script): Move to nameless union.
9310 (Incremental_inputs::mtime): New field.
9311 * script.cc (read_input_script): Pass file mtime to
9312 Incremental_input.
9313 * script.h (Script_info::inputs): Style fix.
9314
c9d70757
ILT
93152009-07-01 Ian Lance Taylor <ian@airs.com>
9316
9317 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9318 instead of 32.
9319
9c547ec3
ILT
93202009-06-24 Ian Lance Taylor <iant@google.com>
9321
9322 PR 10156
9323 * layout.cc (Layout::choose_output_section): If we find an
9324 existing section, update the flags.
9325 (Layout::create_notes): New function, broken out of
9326 Layout::finalize.
9327 (Layout::finalize): Don't create note sections.
9328 (Layout::create_note): Don't crash if linker script discards
9329 section.
9330 (Layout::create_gold_note): Likewise.
9331 (Layout::create_build_id): Likewise. Don't set
9332 after_input_sections on the section.
9333 (Layout::create_executable_stack_info): Remove target parameter.
9334 Change caller.
9335 * layout.h (class Layout): Declare create_notes. Update
9336 declaration of create_executable_stack_info.
9337 * gold.cc (queue_middle_tasks): Call create_notes.
9338 * output.cc (Output_section::update_flags_for_input_section): Move
9339 here from output.h. If SHF_ALLOC flag is newly set, mark address
9340 invalid.
9341 * output.h (Output_data::mark_address_invalid): New function.
9342 (class Output_section): Only declare, not define,
9343 update_flags_for_input_section. Remove set_flags.
9344
55458500
ILT
93452009-06-24 Ian Lance Taylor <iant@google.com>
9346
9347 * script-sections.cc (Output_section_definition::
9348 set_section_addresses): Rename shadowing local load_address to
9349 laddr.
9350
1307d6cd
ILT
93512009-06-24 Ian Lance Taylor <iant@google.com>
9352
9353 PR 10244
9354 * reloc.cc (relocate_sections): Skip empty relocation sections.
9355
ec3f783e
ILT
93562009-06-23 Ian Lance Taylor <iant@google.com>
9357
9358 PR 10156
9359 * layout.cc (Layout::create_note): Use choose_output_section
9360 rather than make_output_section.
9361
459c9f1c
ILT
93622009-06-23 Ian Lance Taylor <iant@google.com>
9363
9364 PR 10237
9365 * options.cc (General_options::parse_V): Set printed_version_.
9366 (General_options::General_options): Initialize printed_version_.
9367 * options.h (class General_options): Add printed_version_ field.
9368 * gold.cc (queue_initial_tasks): If there are no input files,
9369 don't give a fatal error if we printed the version information.
9370 (queue_middle_tasks): If using -r with a shared object, give a
9371 fatal error rather than an ordinary error.
9372
1518dc8f
ILT
93732009-06-23 Ian Lance Taylor <iant@google.com>
9374
9375 PR 10219
9376 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9377 (Layout::make_output_section): Set have_stabstr_section_ if we see
9378 a .stab*str section.
9379 (Layout::finalize): Call link_stabs_sections.
9380 (Layout::link_stabs_sections): New file.
9381 * layout.h (class Layout): Add have_stabstr_section_ field.
9382 Declare link_stabs_sections.
9383
3d857b98
DK
93842009-06-23 Doug Kwan <dougkwan@google.com>
9385
9386 * Makefile.am (libgold_a_LIBADD): New.
9387 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9388 * Makefile.in: Regenerate.
9389 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9390 * configure: Regenerate.
9391 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9392 * fileread.cc: Include sys/state.h
9393 * gold.h: Declare memmem and strndup if found missing.
9394 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9395
0639a6f6
ILT
93962009-06-23 Ian Lance Taylor <iant@google.com>
9397
9398 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9399 * configure: Rebuild.
9400
8d63875c
ILT
94012009-06-23 Ian Lance Taylor <iant@google.com>
9402
9403 PR 10147
9404 * object.cc (Object::section_contents): Don't try to get a view if
9405 the section has length zero.
9406 (Object::handle_gnu_warning_section): If the section is empty, use
9407 the name of the section as the warning.
9408
f7c8a183
ILT
94092009-06-23 Ian Lance Taylor <iant@google.com>
9410
9411 PR 10133
9412 * stringpool.h (class Stringpool_template): Add optimize_ field.
9413 (Stringpool_template::set_optimize): New function.
9414 * stringpool.cc (Stringpool_template::Stringpool_template):
9415 Initialize optimize_ field.
9416 (Stringpool_template::set_string_offsets): Test local optimize
9417 fild rather than parameter.
9418 * layout.cc (Layout::Layout): Call set_optimize on the section
9419 name stringpool.
9420
e6a307ba
ILT
94212009-06-22 Ian Lance Taylor <iant@google.com>
9422
9423 PR 10030
9424 * yyscript.y: Parse TARGET.
9425 * script.cc (script_set_target): New function.
9426 * script-c.h (script_set_target): Declare.
9427 * options.cc (General_options::string_to_object_format): Rename
9428 from string_to_object_format in anonymous namespace. Change
9429 callers.
9430 * options.h (class General_options): Declare
9431 string_to_object_format.
9432
3ee173de
ILT
94332009-06-22 Ian Lance Taylor <iant@google.com>
9434
9435 * script-sections.cc (Script_sections::create_segments): Don't put
9436 program headers in a PT_LOAD segment if -n or -N.
9437
94382009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9439
9440 PR 10141
9441 * options.h (class General_options): Add -z lazy and -z now. Sort
9442 -z options into alphabetical order.
9443 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9444
cd6739a1 94452009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9446
9447 * layout.cc (Layout::make_output_section): Call
9448 Target::new_output_section.
9449 (Layout::attach_allocated_section_to_segment): Put large section
9450 sections in a separate load segment with the large segment flag
9451 set.
9452 (Layout::segment_precedes): Sort large data segments after other
9453 load segments.
9454 (align_file_offset): New static function.
9455 (Layout::set_segment_offsets): Use align_file_offset.
9456 * output.h (class Output_section): Add is_small_section_ and
9457 is_large_section_ fields.
9458 (Output_section::is_small_section): New function.
9459 (Output_section::set_is_small_section): New function.
9460 (Output_section::is_large_section): New function.
9461 (Output_section::set_is_large_section): New function.
9462 (Output_section::is_large_data_section): New function.
9463 (class Output_segment): Add is_large_data_segment_ field.
9464 (Output_segment::is_large_data_segment): New function.
9465 (Output_segment::set_is_large_data_segment): New function.
9466 * output.cc (Output_section::Output_section): Initialize new
9467 fields.
9468 (Output_segment::Output_segment): Likewise.
9469 (Output_segment::add_output_section): Add assertion that large
9470 data sections always go in large data segments. Force small data
9471 sections to the end of the list of data sections. Force small BSS
9472 sections to the start of the list of BSS sections. For large BSS
9473 sections to the end of the list of BSS sections.
9474 * symtab.h (class Symbol): Declare is_common_shndx.
9475 (Symbol::is_defined): Check Symbol::is_common_shndx.
9476 (Symbol::is_common): Likewise.
9477 (class Symbol_table): Define enum Commons_section_type. Update
9478 declarations. Add small_commons_ and large_commons_ fields.
9479 * symtab.cc (Symbol::is_common_shndx): New function.
9480 (Symbol_table::Symbol_table): Initialize new fields.
9481 (Symbol_table::add_from_object): Put small and large common
9482 symbols in the right list.
9483 (Symbol_table::sized_finalized_symbol): Check
9484 Symbol::is_common_shndx.
9485 (Symbol_table::sized_write_globals): Likewise.
9486 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9487 common symbol lists. Don't call do_allocate_commons_list if the
9488 list is empty.
9489 (Symbol_table::do_allocate_commons_list): Remove is_tls
9490 parameter. Add comons_section_type parameter. Change all
9491 callers. Handle small and large common symbols.
9492 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9493 Symbol::is_common_shndx.
9494 * resolve.cc (symbol_to_bits): Likewise.
9495 * target.h (Target::small_common_shndx): New function.
9496 (Target::small_common_section_flags): New function.
9497 (Target::large_common_shndx): New function.
9498 (Target::large_common_section_flags): New function.
9499 (Target::new_output_section): New function.
9500 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9501 small_common_section_flags, and large_common_section_flags
9502 fields.
9503 (Target::do_new_output_section): New virtual function.
9504 * arm.cc (Target_arm::arm_info): Initialize new fields.
9505 * i386.cc (Target_i386::i386_info): Likewise.
9506 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9507 Likewise.
9508 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9509 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9510 (Target_x86_64::do_new_output_section): New function.
9511 * configure.ac: Define conditional MCMODEL_MEDIUM.
9512 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9513 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9514 (large_LDFLAGS): Define.
9515 * testsuite/large.c: New file.
9516 * testsuite/testfile.cc (Target_test::test_target_info):
9517 Initialize new fields.
9518 * configure, testsuite/Makefile.in: Rebuild.
9519
bb04269c
DK
95202009-06-05 Doug Kwan <dougkwan@google.com>
9521
9522 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9523 * Makefile.in: Regenerate.
bb04269c
DK
9524 * i386.cc (class Target_i386): Define new virtual method to
9525 override do_is_local_label_name in parent.
9526 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9527 local symbols if --discard-locals or -X is given.
9528 * options.h (class General_options): Declare new options
9529 '--discard-locals' and '-X' for discarding locals.
9530 * target.h (class Target): Define new methods is_local_label_name.
9531 Declare new virtual method do_is_local_label_name.
9532 * target.cc: New file.
9533 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9534 (check_SCRIPTS): Add discard_locals_test.sh.
9535 (check_DATA): Add discard_local_tests.syms.
9536 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9537 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9538 * testsuite/Makefile.in: Regenerate.
9539 * testsuite/discard_locals_test.c: New file.
9540 * testsuite/discard_locals_test.sh: Same.
9541
805bb01c
DK
95422009-06-05 Doug Kwan <dougkwan@google.com>
9543
9544 * object.cc (Sized_relobj::Sized_relobj): Initialize
9545 discarded_eh_frame_shndx_ to -1U.
9546 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9547 section.
9548 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9549 a discarded .eh_frame section.
9550 (Sized_relobj::do_finalize_local_symbols): Ditto.
9551 * object.h (class Sized_relobj): Declare new member
9552 discarded_eh_frame_shndx_.
9553 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9554 (local_labels_test.o, local_labels_test): New rules.
9555 * testsuite/Makefile.in: Regenerate.
9556
1dcd334d
DK
95572009-06-04 Doug Kwan <dougkwan@google.com>
9558
9559 * layout.cc (Layout::section_name_mapping): Add mapping for
9560 special ARM sections.
9561
96d49306
DK
95622009-06-03 Doug Kwan <dougkwan@google.com>
9563
9564 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9565 (utils::has_overflow): Same.
9566
dff16297
ILT
95672009-06-03 Ian Lance Taylor <iant@google.com>
9568
9569 * layout.cc (Layout::section_name_mapping): New array, replacing
9570 Layout::linkonce_mapping.
9571 (Layout::section_name_mapping_count): New variable, replacing
9572 Layout::linkonce_mapping_count.
9573 (Layout::linkonce_output_name): Remove.
9574 (Layout::output_section_name): Rewrite.
9575 * layout.h (class Layout): Rename Linkonce_mapping to
9576 Section_name_mapping, linkonce_mapping to section_name_mapping,
9577 linkonce_mapping_count to section_name_mapping_count. Don't
9578 declare linkonce_output_name.
9579
c121c671
DK
95802009-06-03 Doug Kwan <dougkwan@google.com>
9581
9582 * gold/arm.cc (namespace utils): New.
9583 (Target_arm::reloc_is_non_pic): Define new method.
9584 (class Arm_relocate_functions): New.
9585 (Target_arm::Relocate::relocate): Handle relocation types used by
9586 Android.
9587
07800fab
ILT
95882009-06-03 Ian Lance Taylor <iant@google.com>
9589
9590 * arm.cc (Target_arm::scan::global): Use || instead of |.
9591
c121c671
DK
95922009-06-02 Doug Kwan <dougkwan@google.com>
9593
9594 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9595 issued_non_pic_error_.
9596 (class Target_arm::Scan): Declare new method check_non_pic.
9597 Define new method symbol_needs_plt_entry.
9598 Declare new data member issued_non_pic_error_.
9599 (class Target_arm::Relocate): Declare new method
9600 should_apply_static_reloc.
9601 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9602 (Target_arm::Scan::check_non_pic): Define new method.
9603 (Target_arm::Scan::local): Handle a small subset of reloc types used
9604 by Android.
9605 (Target_arm::Scan::local): Same.
9606 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9607
b19b0c6d
ILT
96082009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9609
9610 * incremental.cc (Incremental_inputs::report_command_line): Filter
9611 out --incremental-* options.
9612
94cdfcff
DK
96132009-05-29 Doug Kwan <dougkwan@google.com>
9614
9615 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9616 template class.
9617 (class Target_arm): Update comment.
9618 (Target_arm::Target_arm): Initialize new data members GOT_,
9619 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9620 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9621 and Target_arm::rel_dyn_section.
9622 Declare new_enum Target_arm::Got_type.
9623 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9624 and DYNBSS_.
9625 Update commments for member do_dynsym_value.
9626 (Target_arm::got_size, Target_arm::plt_section,
9627 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9628 new methods inside class defintion.
9629 (Target_arm::got_section): Define new method.
9630 (Target_arm::rel_dyn_section): Same.
9631 (Output_data_plt_arm): New template class.
9632 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9633 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9634 (Output_data_plt_arm::add_entry): Same.
9635 (Output_data_plt_arm::first_plt_entry): Define new
9636 static data member for PLT instruction template.
9637 (Output_data_plt_arm::plt_entry): Same.
9638 (Output_data_plt_arm::do_write): Define new method.
9639 (Target_arm::make_plt_entry): Same.
9640 (Target_arm::do_finalize_sections): Same.
9641 (Target_arm::do_dynsym_value): Same.
9642
4a657b0d
DK
96432009-05-28 Doug Kwan <dougkwan@google.com>
9644
9645 * Makefile.am (TARGETSOURCES): Add arm.cc.
9646 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9647 * Makefile.in: Regenerate.
9648 * arm.cc: New file.
9649 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9650
e7ae8c36
DK
96512009-05-26 Doug Kwan <dougkwan@google.com>
9652
9653 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9654 (General_options::check_excluded_libs): Strip off directories in
9655 archive name before matching like GNU ld does.
9656 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9657 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9658 (exclude_libs_test_LDFLAGS): Add linker option
9659 -Wl,--exclude-libs,libexclude_libs_test_3
9660 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9661 an explicit archive without using -l.
9662 (alt/libexclude_libs_test_3.a): New make rule.
9663 * testsuite/Makefile.in: Regenerate.
9664 * testsuite/exclude_libs_test.c : Declare lib3_default().
9665 (main): Call it.
9666 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9667 * exclude_libs_test_3.c: New file.
9668
f12e7348
NC
96692009-05-26 Nick Clifton <nickc@redhat.com>
9670
9671 * po/id.po: New Indonesian translation.
9672 * po/gold.pot: Updated template file.
9673
4daadc0d
ST
96742009-05-22 Sriraman Tallam <tmsriram@google.com>
9675
e1df38aa 9676 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9677 gc_comdat_test files. Add -Wl,--gc-sections to build
9678 gc_comdat_test.
9679 * testsuite/Makefile.in: Regenerate.
9680 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9681
531813ad
ST
96822009-05-21 Sriraman Tallam <tmsriram@google.com>
9683
9684 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9685 kept comdat section was garbage collected.
9686 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9687 * testsuite/Makefile.in: Regenerate.
9688 * testsuite/gc_comdat_test.sh: New file.
9689 * testsuite/gc_comdat_test_1.cc: New file.
9690 * testsuite/gc_comdat_test_2.cc: New file.
9691
65514900
CC
96922009-05-19 Doug Kwan <dougkwan@google.com>
9693
9694 * archive.cc (Archive::Archive): Move constructor from archive.h
9695 to here. Initialize no_export_.
9696 (Archive::get_elf_object_for_member): Set no_export flag of object.
9697 * archive.h (Archive::Archive): Move constructor body to
9698 archive.cc.
9699 (Archive::no_export): New method.
9700 (Archive::no_export_): New field.
9701 * object.h (Object::Object): Initialize no_export_ to false.
9702 (Object::no_export, Object::set_no_export): New methods.
9703 (Object::no_export_): New field.
9704 * options.cc (General_options::parse_exclude_libs): New method.
9705 (General_options::check_excluded_libs) Same.
9706 * options.h (exclude_libs): New option.
9707 (General_options::check_excluded_libs): New method declaration.
9708 (General_options::excluded_libs_): New field.
9709 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9710 default or protected visibility if an object has no-export flag set.
9711 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9712 (check_SCRIPTS): Add exclude_libs_test.sh.
9713 (check_DATA): Add exclude_libs_test.syms.
9714 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9715 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9716 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9717 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9718 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9719 libexclude_libs_test_2.a): New rules.
9720 * testsuite/Makefile.in: Regenerate.
9721 * testsuite/exclude_libs_test.c: New file.
9722 * testsuite/exclude_libs_test.sh: Ditto.
9723 * testsuite/exclude_libs_test_1.c: Ditto.
9724 * testsuite/exclude_libs_test_2.c: Ditto.
9725
1b77ea50
ILT
97262009-05-15 Ian Lance Taylor <iant@google.com>
9727
9728 * configure.ac: Check for declarations for cases where libiberty.h
9729 checks HAVE_DECL_xxx.
9730 * configure, config.in: Rebuild.
9731
072fe7ce
ILT
97322009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9733
9734 * gold.h (Incremental_argument_list): Remove (invalid) forward
9735 declaration.
9736 * incremental.cc (Incremental_inputs::report_achive): New method.
9737 (Incremental_inputs::report_object): New method.
9738 (Incremental_inputs::report_script): New method.
9739 (Incremental_inputs::finalize_inputs): New method.
9740 (Incremental_inputs::finalize): Call finalize_inputs().
9741 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9742 Create inputs entries.
9743 * incremental.h (Incremental_input_type): New enum.
9744 (Incremental_inputs::Incremental_input): Initialize new fields.
9745 (Incremental_inputs::report_inputs): New method.
9746 (Incremental_inputs::report_achive): New method.
9747 (Incremental_inputs::report_object): New method.
9748 (Incremental_inputs::report_script): New method.
9749 (Incremental_inputs::finalize_inputs): New method.
9750 (Incremental_inputs::Input_info): New struct.
9751 (Incremental_inputs::Input_info_map): New typedef.
9752 (Incremental_inputs::lock_): New field.
9753 (Incremental_inputs::Inputs_): New field.
9754 (Incremental_inputs::Inputs_map): New field.
9755 * main.cc (main): Call Incremental_input::report_inputs.
9756 * options.h (Input_argument_list): Typedef moved from
9757 Input_arguments.
9758 (Input_file_group::Files): Remove, use ::Input_argument_list.
9759 (Input_file_group::Input_argument_list): Remove, use
9760 ::Input_argument_list.
9761 * plugin.cc (Plugin_manager::add_input_file): Add error in
9762 incremental build.
9763 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9764 functions.
9765 * script.cc (read_input_script): Call
9766 Incremental_input::report_script.
9767 * script.h (Script_info): New class.
9768
b0481b0b
ILT
97692009-04-27 Ian Lance Taylor <iant@google.com>
9770
9771 * x86_64.cc (do_adjust_output_section): Set entsize to
9772 plt_entry_size.
9773
b22a5a41 97742009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
9775
9776 * output.cc (Output_file::close): After short writes, continue
9777 writing from the correct offset in the buffer being written.
9778
40fde488
CD
97792009-04-23 Chris Demetriou <cgd@google.com>
9780
9781 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9782 * configure: Regenerate.
9783 * config.in: Regenerate.
9784 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9785 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9786
3ce2c28e
ILT
97872009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9788
9789 * incremental.cc (Incremental_inputs_header_data): Renamed from
9790 Incremental_input_header_data.
9791 (Incremental_inputs_header_data::data_size): New field.
9792 (Incremental_inputs_header_data::put_input_file_count): Renamed
9793 from input_file_count.
9794 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9795 from command_line_offset.
9796 (Incremental_inputs_header_data::put_reserved): Renamed from
9797 put_reserved.
9798 (Incremental_inputs_entry_data): Renamed from
9799 Incremental_input_entry_data.
9800 (Incremental_inputs_entry_data::data_size): New field.
9801 (Incremental_inputs::report_command_line): New method.
9802 (Incremental_inputs::finalize): New method.
9803 (Incremental_inputs::create_incremental_inputs_data): New method.
9804 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9805 * incremental.h: New file.
9806 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9807 (Layout::finalize): Create incremental inputs section in
9808 incremental builds.
9809 (Layout::create_incremental_info_sections): New method.
9810 * layout.h (Layout::incremental_inputs): New method.
9811 (Layout::create_incremental_info_sections): New method.
9812 (Layout::incremental_inputs_): New field.
9813 * main.cc (main): Notify Incremental_input of the command line.
9814
e55bde5e
ILT
98152009-04-01 Ian Lance Taylor <iant@google.com>
9816 Mikolaj Zalewski <mikolajz@google.com>
9817
9818 * gold.h (reserve_unordered_map): Define, three versions, one for
9819 each version of Unordered_map.
9820 * layout.cc (Layout::Layout): Remove options parameter. Add
9821 number_of_input_files parameter. Don't initialize options_.
9822 Initialize number_of_input_files_ and resized_signatures_. Move
9823 sections_are_attached_.
9824 (Layout::layout_group): Reserve space for group_signatures_.
9825 (Layout::find_or_add_kept_section): Change name parameter to be a
9826 reference. Resize signatures_ map when it gets large enough.
9827 (Layout::layout_eh_frame): Use parameters->options() instead of
9828 this->options_.
9829 (Layout::make_output_section): Likewise.
9830 (Layout::attach_allocated_section_to_segment): Likewise.
9831 (Layout::finalize, Layout::create_executable_stack): Likewise.
9832 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9833 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9834 * layout.h (class Layout): Update declarations. Remove options_
9835 field. Add number_of_input_files_ and resized_signatures_
9836 fields. Move sections_are_attached_ field.
9837 * main.cc (main): Pass number of input files to Layout
9838 constructor. Don't pass options.
9839
154b857c
ILT
98402009-03-30 Ian Lance Taylor <iant@google.com>
9841
9842 * ffsll.c (ffsll): Correct implementation.
9843
2f35ab9b
ILT
98442009-03-27 Ian Lance Taylor <iant@google.com>
9845
fd03461a
ILT
9846 * ffsll.c: New file.
9847 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9848 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9849 * ftruncate.c (ftruncate): Declare before definition.
9850 * mremap.c (mremap): Likewise.
9851 * pread.c (pread): Likewise.
9852 * configure, Makefile.in, config.in: Rebuild.
9853
2f35ab9b
ILT
9854 * mremap.c: New file.
9855 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9856 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9857 (mremap): Declare if HAVE_MREMAP is not defined.
9858 * configure, Makefile.in, config.in: Rebuild.
9859
33aea2fd
CC
98602009-03-27 Cary Coutant <ccoutant@google.com>
9861
9862 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9863 position independent.
9864 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9865 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9866
6d479619
CC
98672009-03-24 Cary Coutant <ccoutant@google.com>
9868
9869 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9870 an executable.
9871 (needs_dynamic_reloc): Likewise.
9872
afc06bb8
ILT
98732009-03-24 Ian Lance Taylor <iant@google.com>
9874
9875 * yyscript.y (file_cmd): Recognize EXTERN.
9876 (extern_name_list, extern_name_list_body): New nonterminals.
9877 * script.cc (script_add_extern): Define.
9878 * script-c.h (script_add_extern): Declare.
9879
f6060a4d
ILT
98802009-03-24 Rafael Avila de Espindola <espindola@google.com>
9881
9882 * object.cc (is_elf_object): Define.
9883 * object.h (is_elf_object): Declare.
9884 * archive.cc (Archive::get_elf_object_for_member): Call
9885 is_elf_object.
33aea2fd 9886 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9887
26736d8e
ILT
98882009-03-24 Elliott Hughes <enh@google.com>
9889
9890 * output.cc (Output_file::map_anonymous): Define.
9891 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9892 try an anonymous one. Report the size if the mmap fails.
9893 * output.h (class Output_file): Declare map_anonymous.
9894
22fd9730
ILT
98952009-03-24 Ian Lance Taylor <iant@google.com>
9896
9897 * target-select.cc (instantiate_target): Don't acquire the lock if
9898 the instantiated_target_ field has already been set.
9899
cb010894
ILT
99002009-03-23 Ian Lance Taylor <iant@google.com>
9901
7f055c20
ILT
9902 * gold-threads.h (class Initialize_lock): Define.
9903 * gold-threads.cc (class Initialize_lock_once): Define.
9904 (initialize_lock_control): New static variable.
9905 (initialize_lock_pointer): New static variable.
9906 (initialize_lock_once): New static function.
9907 (Initialize_lock::Initialize_lock): Define.
9908 (Initialize_lock::initialize): Define.
9909 * target-select.h: Include "gold-threads.h".
9910 (class Target_selector): Add lock_ and initialize_lock_ fields.
9911 Don't define instantiate_target, just declare it.
9912 * target-select.cc (Target_selector::Target_selector): Initialize
9913 new fields.
9914 (Target_selector::instantiate_target): Define.
9915 * descriptors.h: Include "gold-threads.h".
9916 (class Descriptors): Add initialize_lock_ field.
9917 * descriptors.cc (Descriptors::Descriptors): Initialize new
9918 field.
9919 (Descriptors::open): Use initialize_lock_ field
9920 * errors.h (class Errors): Add initialize_lock_ field.
9921 * errors.cc (Errors::Errors): Initialize new field.
9922 (Errors::initialize_lock): Use initialize_lock_ field.
9923 * powerpc.cc (class Target_selector_powerpc): Remove
9924 instantiated_target_ field. In do_recognize call
9925 instantiate_target rather than do_instantiate_target. In
9926 do_instantiate_target just allocate a new target.
9927 * sparc.cc (class Target_selector_sparc): Likewise.
9928
36959681
ILT
9929 * freebsd.h: New file.
9930 * i386.cc: Include "freebsd.h".
9931 (Target_i386): Derive from Target_freebsd rather than
9932 Sized_target.
9933 (Target_selector_i386): Derive from Target_selector_freebsd rather
9934 than Target_selector.
9935 * x86_64.cc: Include "freebsd.h".
9936 (Target_x86_64): Derive from Target_freebsd rather than
9937 Sized_target.
9938 (Target_selector_x86_64): Derive from Target_selector_freebsd
9939 rather than Target_selector.
9940 * target.h (class Target): Add adjust_elf_header and
9941 do_adjust_elf_header.
9942 * output.cc (Output_file_header:: do_sized_write): Call target
9943 adjust_elf_header routine.
9944 * configure.tgt: Set targ_osabi.
9945 * configure.ac: Define GOLD_DEFAULT_OSABI.
9946 * parameters.cc (Parameters::default_target): Pass
9947 GOLD_DEFAULT_OSABI to select_target.
9948 * target-select.h (class Target_selector): Make instantiate_target
9949 protected rather than private.
9950 * Makefile.am (HFILES): Add freebsd.h.
9951 * configure, Makefile.in, config.in: Rebuild.
9952
cb010894
ILT
9953 * merge.cc (do_add_input_section): Correct pend value. Change
9954 message about last entry not being null terminated from error to
9955 warning.
9956
0e879927
ILT
99572009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9958
9959 * incremental.cc: New file.
9960 * Makefile.am (CCFILES): Add incremental.cc.
9961 * Makefile.in: Rebuild.
9962
41105937
PP
99632009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9964
9965 * layout.cc (Layout::output_section_name): Preserve names
9966 of '.note.' sections.
e1df38aa 9967
60439920
ILT
99682009-03-19 Ian Lance Taylor <iant@google.com>
9969
9970 * descriptors.cc (Descriptors::open): Check that the options are
9971 valid before using them.
9972
0d371ad3
ILT
99732009-03-18 Ian Lance Taylor <iant@google.com>
9974
9975 * script-sections.h: Include <list>.
9976 (class Script_sections): Change Sections_elements from std::vector
9977 to std::list. Typedef public Elements_iterator. Add
9978 orphan_section_placement_, data_segment_align_start_, and
9979 saw_data_segment_align_ fields. Remove data_segment_align_index_
9980 field.
9981 * script-sections.cc (class Orphan_section_placement): New class.
9982 (class Sections_element): Add virtual functions is_relro and
9983 orphan_section_init. Remove virtual function place_orphan_here.
9984 (class Output_section_definition): Add is_relro and
9985 orphan_section_init. Remove place_orphan_here.
9986 (class Orphan_output_section): Likewise.
9987 (Script_sections::Script_sections): Update for field changes.
9988 (Script_sections::data_segment_align): Set saw_data_segment_align_
9989 and data_segment_align_start_, not data_segment_align_index.
9990 (Script_sections::data_segment_relro_end): Check
9991 saw_data_segment_align_. Use data_segment_align_start_ rather
9992 than data_segment_align_index_.
9993 (Script_sections::place_orphan): Rewrite to use
9994 Orphan_section_placement.
9995
9201d894
ILT
99962009-03-17 Ian Lance Taylor <iant@google.com>
9997
9c5b8369
ILT
9998 * archive.cc (Archive::add_symbols): Check for a version attached
9999 to the symbol name in the archive map.
10000 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10001 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10002 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10003 (ver_test_11.a): New target.
10004 * testsuite/Makefile.in: Rebuild.
10005
9201d894
ILT
10006 * configure.ac: Check for chsize and posix_fallocate. Replace
10007 ftruncate.
10008 * ftruncate.c: New file, from gnulib.
10009 * output.cc (posix_fallocate): Define dummy version if not
10010 HAVE_POSIX_FALLOCATE.
10011 (Output_file::map): Call posix_fallocate rather than lseek and
10012 write.
10013 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10014 * configure, Makefile.in, config.in: Rebuild.
10015
ef4ab7a8 100162009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10017
ef4ab7a8
PP
10018 * layout.h (Layout::create_note): Add section_name parameter.
10019 * layout.cc (Layout::create_note): Likewise.
10020 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10021
8c500701
ILT
100222009-03-17 Ian Lance Taylor <iant@google.com>
10023
e85b18e1
ILT
10024 * descriptors.cc: Include "options.h".
10025 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10026 (Descriptors::open): Always use O_CLOEXEC when opening a new
10027 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10028 then set FD_CLOEXEC.
10029
9efe6174
ILT
10030 * sparc.cc (class Target_sparc): Add has_got_section.
10031 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10032 make sure we have a GOT section.
10033
10034 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10035 (Target_sparc::Scan::local): Likewise.
10036 (Target_sparc::Scan::global): Likewise.
10037 (Target_sparc::Relocate::relocate): Likewise.
10038 (Target_sparc::Relocate::relocate_tls): Likewise.
10039
8c500701
ILT
10040 * symtab.cc (Symbol_table::define_default_version): New function,
10041 broken out of add_from_object.
10042 (Symbol_table::add_from_object): Call define_default_version.
10043 (Symbol_table::define_special_symbol): Add resolve_oldsym
10044 parameter. Change all callers. If the version for a symbol comes
10045 from a version script, resolve it with the symbol with the same
10046 name with no version. Also add the symbol without a version if
10047 appropriate.
10048 (do_define_in_output_data): If resolving with oldsym, don't delete
10049 sym.
10050 (do_define_in_output_segment): Likewise.
10051 (do_define_as_constant): Likewise.
10052 * symtab.h (class Symbol_table): Update declarations.
10053
f1ed28fb
ILT
100542009-03-13 Ian Lance Taylor <iant@google.com>
10055
15f8229b
ILT
10056 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10057 (Read_symbols::requeue): New function.
10058 (Read_symbols::do_read_symbols): If make_elf_object fails because
10059 the target type is not configured, and the file was searched for,
10060 issue a warning and retry with the next directory.
10061 (Add_symbols::run): If the file has an incompatible format, and
10062 it was searched for, requeue the Read_symbols task. On error,
10063 release the object.
10064 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10065 dirindex parameter to constructor. Change all callers. Declare
10066 incompatible_warning and requeue.
10067 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10068 input_argument_ and input_group_ fields. Add them to
10069 constructor. Change all callers.
10070 (class Read_script): Add dirindex_ field. Add it to constructor.
10071 Change all callers.
10072 * archive.cc (Archive::setup): Remove input_objects parameter.
10073 Change all callers.
10074 (Archive::get_file_and_offset): Likewise.
10075 (Archive::read_all_symbols): Likewise.
10076 (Archive::read_symbols): Likewise.
10077 (Archive::get_elf_object_for_member): Remove input_objects
10078 parameter. Add punconfigured parameter. Change all callers.
10079 (Archive::add_symbols): Change return type to bool. Check return
10080 value of include_member.
10081 (Archive::include_all_members): Likewise.
10082 (Archive::include_member): Change return type to bool. Return
10083 false if first included object has incompatible target. Set
10084 included_member_ field.
10085 (Add_archive_symbols::run): If add_symbols returns false, requeue
10086 Read_symbols task.
10087 * archive.h (class Archive): Add included_member_ field.
10088 Initialize it in constructor. Add input_file and searched_for
10089 methods. Update declarations.
10090 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10091 input_argument_ fields. Add them to constructor. Change all
10092 callers.
10093 * script.cc: Include "target-select.h".
10094 (class Parser_closure): Add skip_on_incompatible_target_ and
10095 found_incompatible_target_ fields. Add
10096 skip_on_incompatible_target parameter to constructor. Change all
10097 callers. Add methods skip_on_incompatible_target,
10098 clear_skip_on_incompatible_target, found_incompatible_target, and
10099 set_found_incompatible_target.
10100 (read_input_script): Add dirindex parameter. Change all callers.
10101 If parser finds an incompatible target, requeue Read_symbols
10102 task.
10103 (script_set_symbol): Clear skip_on_incompatible_target in
10104 closure.
10105 (script_add_assertion, script_parse_option): Likewise.
10106 (script_start_sections, script_add_phdr): Likewise.
10107 (script_check_output_format): New function.
10108 * script.h (read_input_script): Update declaration.
10109 * script-c.h (script_check_output_format): Declare.
10110 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10111 (ignore_cmd): Remove OUTPUT_FORMAT.
10112 * fileread.cc (Input_file::Input_file): Add explicit this.
10113 (Input_file::will_search_for): New function.
10114 (Input_file::open): Add pindex parameter. Change all callers.
10115 * fileread.h (class Input_file): Add input_file_argument method.
10116 Declare will_search_for. Update declarations.
10117 * object.cc (make_elf_object): Add punconfigured parameter.
10118 Change all callers.
10119 * object.h (class Object): Make input_file public. Add
10120 searched_for method.
10121 (make_elf_object): Update declaration.
10122 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10123 restart search.
10124 * dirsearch.h (class Dirsearch): Update declaration.
10125 * options.h (class General_options): Add --warn-search-mismatch.
10126 * parameters.cc (Parameters::is_compatible_target): New function.
10127 * parameters.h (class Parameters): Declare is_compatible_target.
10128 * workqueue.cc (Workqueue::add_blocker): New function.
10129 * workqueue.h (class Workqueue): Declare add_blocker.
10130
f1ed28fb
ILT
10131 * fileread.cc (Input_file::open): Remove options parameter.
10132 Change all callers.
10133 (Input_file::open_binary): Likewise.
10134 * script.cc (read_input_script): Likewise.
10135 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10136 options parameter from constructor. Change all callers.
10137 (class Read_script): Likewise.
10138 * fileread.h (class Input_file): Update declarations.
10139 * script.h (read_input_script): Update declaration.
10140
34dd024a
NC
101412009-03-10 Nick Clifton <nickc@redhat.com>
10142
10143 * po/es.po: New Spanish translation.
10144
6d71b17c
CC
101452009-03-06 Cary Coutant <ccoutant@google.com>
10146
10147 * options.cc (parse_short_option): Keep dash_z from registering itself.
10148
031cdbed
ILT
101492009-03-03 Ian Lance Taylor <iant@google.com>
10150
10151 PR 9918
10152 * target-reloc.h (relocate_section): Pass output_section to
10153 relocate.
10154 * i386.cc (Target_i386::should_apply_static_reloc): Add
10155 output_section parameter. Change all callers.
10156 (Target_i386::Relocate::relocate): Add output_section parameter.
10157 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10158 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10159 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10160 * testsuite/two_file_shared.sh: New script.
10161 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10162 (check_DATA): Add two_file_shared.dbg.
10163 (two_file_shared.dbg): New target.
10164 * testsuite/Makefile.in: Rebuild.
10165
15d5fa16
ILT
101662009-03-01 Ian Lance Taylor <iant@google.com>
10167
10168 * configure.ac: Check for byteswap.h.
10169 * configure: Rebuild.
10170 * config.in: Rebuild.
10171
8a4c0b0d
ILT
101722009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10173
10174 * layout.cc (Layout::find_or_add_kept_section): New function.
10175 (Layout::add_comdat): Removed.
10176 * layout.h (struct Kept_section): Move out of class Layout.
10177 Remove trailing underscores from field names. Add group_sections
10178 field. Rename group_ field to is_group. Change all uses.
10179 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10180 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10181 comdat_groups_ field.
10182 (Sized_relobj::include_section_group): Use
10183 find_or_add_kept_section and Kept_section::group_sections.
10184 (Sized_relobj::include_linkonce_section): Likewise.
10185 * object.cc (class Sized_relobj): Don't define Comdat_group or
10186 Comdat_group_table. Remove find_comdat_group and
10187 add_comdat_group. Remove comdat_groups_ field.
10188 * plugin.cc (include_comdat_group): Use
10189 Layout::find_or_add_kept_section.
10190
b4ecf66b
ILT
101912009-02-28 Ian Lance Taylor <iant@google.com>
10192
14359ca0
ILT
10193 * README: --gc-sections and map files are now supported. Document
10194 some build requirements.
10195
b4ecf66b
ILT
10196 PR 6992
10197 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10198 relocatable link set the value of the section symbol to zero.
10199 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10200 relocatable link don't include the section address in the local
10201 symbol value.
10202
0602e05a
ILT
102032009-02-27 Ian Lance Taylor <iant@google.com>
10204
fd9d194f
ILT
10205 PR 6811
10206 * options.h (class Search_directory): Add is_system_directory.
10207 (class General_options): Declare is_in_system_directory.
10208 * options.cc (get_relative_sysroot): Make static.
10209 (get_default_sysroot): Make static.
10210 (General_optoins::is_in_system_directory): New function.
10211 * fileread.cc (Input_file::is_in_system_directory): New function.
10212 * fileread.h (class Input_file): Declare is_in_system_directory.
10213 * object.h (class Object): Add is_in_system_directory.
10214 (class Input_objects): Remove system_library_directory_ field.
10215 * object.cc (Input_objects::add_object): Don't set
10216 system_library_directory_.
10217 (input_objects::found_in_system_library_directory): Remove.
10218 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10219 parameter. Change all callers.
10220 (Symbol_table::sized_write_globals): Likewise.
10221 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10222 Call Object::is_in_system_directory.
10223 * symtab.h (class Symbol_table): Update declarations.
10224
61edd21f
ILT
10225 PR 5990
10226 * descriptors.h (Open_descriptor): Add is_on_stack field.
10227 * descriptors.cc (Descriptors::open): If the descriptor is on the
10228 top of the stack, remove it. Initialize is_on_stack field.
10229 (Descriptors::release): Only add pod to stack if it is not on the
10230 stack already.
10231 (Descriptors::close_some_descriptor): Clear stack_next and
10232 is_on_stack fields.
10233
e29e076a
ILT
10234 PR 7091
10235 * output.cc (Output_section::find_starting_output_address): Rename
10236 from starting_output_address; add PADDR parameter; change return
10237 type.
10238 * output.h (class Output_section): Declare
10239 find_starting_output_address instead of starting_output_address.
10240 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10241 section symbol for which we can't find a merge section.
10242
0602e05a
ILT
10243 PR 9836
10244 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10245 hidden or internal, force the symbol to be local.
10246 * resolve.cc (Symbol::override_visibility): Define.
10247 (Symbol::override_base): Use override_visibility.
10248 (Symbol_table::resolve): Likewise.
10249 (Symbol::override_base_with_special): Likewise.
10250 (Symbol_table::override_with_special): If the visibility is hidden
10251 or internal, force the symbol to be local.
10252 * symtab.h (class Symbol): Add set_visibility and
10253 override_visibility.
10254 * testsuite/ver_test_1.sh: New file.
10255 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10256 (check_DATA): Add ver_test_1.syms.
10257 (ver_test_1.syms): New target.
10258 * testsuite/Makefile.in: Rebuild.
10259
401a9a73
CC
102602009-02-25 Cary Coutant <ccoutant@google.com>
10261
10262 * layout.cc (Layout::choose_output_section): Don't rename sections
10263 when using a linker script that has a SECTIONS clause.
10264 * Makefile.in: Regenerate.
10265
10266 * testsuite/Makefile.am (script_test_5.sh): New test case.
10267 * testsuite/Makefile.in: Regenerate.
10268 * testsuite/script_test_5.cc: New file.
10269 * testsuite/script_test_5.sh: New file.
10270 * testsuite/script_test_5.t: New file.
10271
f488e4b0
CC
102722009-02-13 Rafael Avila de Espindola <espindola@google.com>
10273
10274 * archive.cc (Archive::include_member): Update calls to add_symbols.
10275 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10276 the Layout argument.
10277 * dynobj.h (do_add_symbols): Add the Layout argument.
10278 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10279 Layout argument.
10280 * object.h (Object::add_symbols): Add the Layout argument.
10281 (Object::do_add_symbols): Add the Layout argument.
10282 (Sized_relobj::do_add_symbols): Add the Layout argument.
10283 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10284 Unify the two versions.
10285 (Add_plugin_symbols): Remove.
10286 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10287 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10288 (Add_plugin_symbols): Remove.
10289 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10290 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10291 (Add_symbols::run): Make it work with Pulginobj.
10292
89dd1680
ILT
102932009-02-06 Ian Lance Taylor <iant@google.com>
10294
10295 * object.cc (Sized_relobj::do_layout): Make info message start
10296 with lower case letter.
10297
266d0a74
ILT
102982009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10299
602b464e
ILT
10300 * binary.cc: Fix file comment.
10301
266d0a74
ILT
10302 * options.h (enum Incremental_disposition): Define.
10303 (class General_options): Add new options: --incremental,
10304 --incremental_changed, --incremental_unchanged,
10305 --incremental_unknown. Add incremental_disposition_ and
10306 implicit_incremental_ fields.
10307 (General_options::incremental_disposition): New function.
10308 (class Position_dependent_options): Add incremental_disposition
10309 option.
10310 (Position_dependent_options::copy_from_options): Set incremental
10311 dispositions.
10312 * options.cc (General_options::parse_incremental_changed): New
10313 function.
10314 (General_options::parse_incremental_unchanged): New function.
10315 (General_options::parse_incremental_unknown): New function.
10316 (General_options::General_options): Initialize new fields
10317 incremental_disposition_ and implicit_incremental_.
10318 (General_options::finalize): Check for uasge of --incremental-*
10319 without --incremental.
10320
f073bbf7
CD
103212009-02-06 Chris Demetriou <cgd@google.com>
10322
10323 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10324 pointer and to report location as the file name associated with
10325 the symbol.
10326 (gold_undefined_symbol_at_location): New function to replace the
10327 old gold_undefined_symbol functionality.
10328 * target-reloc.h (relocate_section): Update to use
10329 gold_undefined_symbol_at_location.
10330 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10331 Call gold_undefined_symbol function rather than gold_error.
10332 * errors.h (Errors::undefined_symbol): Take location as a
10333 string, rather than calculating it from a relocation.
10334 * errors.cc (Errors::fatal): Print "fatal error:" before the
10335 formatted message.
10336 (Errors::error, Errors::error_at_location): Print "error: "
10337 before the formatted message.
10338 (Errors::undefined_symbol): Take location as a string, rather
10339 than calculating it from a relocation.
10340 (gold_undefined_symbol_at_location): New function akin to
10341 old gold_undefined_symbol, calculates location from relocation.
10342 (gold_undefined_symbol): Change to take only a Symbol pointer
10343 and to report location as the file name associated with the symbol.
10344 * testsuite/debug_msg.sh: Update for changed error messages.
10345 * testsuite/undef_symbol.sh: Likewise.
10346
8e94a90c
ILT
103472009-02-04 Duncan Sands <baldrick@free.fr>
10348
10349 PR 9812
10350 * reduced_debug_output.h
10351 (Output_reduced_debug_abbrev_section::failed): Use format for
10352 gold_warning.
10353 (Output_reduced_debug_info_section::faild): Likewise.
10354
88a0e15b
ILT
103552009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10356
10357 * script.cc (Lazy_demangler): New class.
10358 (Version_script_info::get_symbol_version_helper): Demangle a
10359 symbol only once.
10360
5efc7cd2
CC
103612009-01-29 Cary Coutant <ccoutant@google.com>
10362
10363 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10364 to __tls_get_addr.
10365 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10366
e0ebcf42
ILT
103672009-01-28 Ian Lance Taylor <iant@google.com>
10368
5efc7cd2 10369 * version.cc (version_string): Bump to 1.9.
75fe7426 10370
e0ebcf42
ILT
10371 * gold.h: Include <cstring> and <stdint.h>.
10372 * version.cc: Include <cstdio>.
10373 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10374 warning.
10375 * reduced_debug_output.cc (insert_into_vector): Rename from
10376 Insert_into_vector; change all callers. Use Swap_unaligned to
10377 avoid aliasing issue; remove union since it is unnecessary.
10378
8e2813be 103792009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10380
10381 * Makefile.am (CCFILES): Add gc.cc.
10382 (HFILES): Add gc.h.
10383 * Makefile.in: Regenerate.
10384 * gold.cc (Gc_runner): New class.
10385 (queue_initial_tasks): Call garbage collection related tasks
10386 when corresponding options are invoked.
10387 (queue_middle_gc_tasks): New function.
10388 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10389 processed early before laying out sections during garbage collection.
10390 * gold.h (queue_middle_gc_tasks): New function.
10391 (is_prefix_of): Move from "layout.cc".
10392 * i386.cc (Target_i386::gc_process_relocs): New function.
10393 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10394 * main.cc (main): Create object of class "Garbage_collection".
10395 * object.cc (Relobj::copy_symbols_data): New function.
10396 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10397 (Sized_relobj::do_layout): Allow this function to be called twice
10398 during garbage collection and defer layout of section during the
6d03d481
ST
10399 first call.
10400 * object.h (Relobj::get_symbols_data): New function.
10401 (Relobj::is_section_name_included): New function.
10402 (Relobj::copy_symbols_data): New function.
10403 (Relobj::set_symbols_data): New function.
10404 (Relobj::get_relocs_data): New function.
10405 (Relobj::set_relocs_data): New function.
10406 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10407 (Relobj::gc_process_relocs): New function.
10408 (Relobj::do_gc_process_relocs): New pure virtual function.
10409 (Relobj::sd_): New data member.
10410 (Sized_relobj::is_output_section_offset_invalid): New function.
10411 (Sized_relobj::do_gc_process_relocs): New function.
10412 * options.h (General_options::gc_sections): Modify to not be a no-op.
10413 (General_options::print_gc_sections): New option.
10414 * plugin.cc (Plugin_finish::run): Remove function call to
10415 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10416 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10417 * reloc.cc (Read_relocs::run): Add task to process relocs and
10418 determine unreferenced sections when doing garbage collection.
10419 (Gc_process_relocs): New class.
10420 (Sized_relobj::do_gc_process_relocs): New function.
10421 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10422 sections that are garbage collected.
10423 * reloc.h (Gc_process_relocs): New class.
10424 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10425 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10426 symbols whose corresponding sections are garbage collected.
10427 (Symbol_table::Symbol_table): Add new parameter for the garbage
10428 collection object.
10429 (Symbol_table::gc_mark_undef_symbols): New function.
10430 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10431 (Symbol_table::gc_mark_dyn_syms): New function.
10432 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10433 as garbage.
10434 (Symbol_table::add_from_object): Likewise.
10435 (Symbol_table::add_from_relobj): When building shared objects, do not
10436 treat externally visible symbols as garbage.
10437 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10438 table information for static and relocatable links.
10439 * symtab.h (Symbol_table::set_gc): New function.
10440 (Symbol_table::gc): New function.
10441 (Symbol_table::gc_mark_undef_symbols): New function.
10442 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10443 (Symbol_table::gc_mark_dyn_syms): New function.
10444 (Symbol_table::gc_): New data member.
e1df38aa 10445 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10446 function.
10447 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10448 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10449
3b293544
CF
104502009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10451
10452 * options.h (General_options::gc_sections): Define as a no-op for now.
10453 (General_options::no_keep_memory): Ditto.
10454 (General_options::Bshareable): Define.
10455 * options.cc (General_options::finalize): Honor -Bshareable.
10456
83d22aa8
AS
104572009-01-20 Andreas Schwab <schwab@suse.de>
10458
10459 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10460 read the value in the contents, since we don't use it. Use the
10461 template endianness when writing.
10462 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10463
cd536b21
AS
104642009-01-19 Andreas Schwab <schwab@suse.de>
10465
10466 * configure.tgt (powerpc64-*): Fix targ_obj.
10467
99e9a495
ILT
104682009-01-15 Ian Lance Taylor <iant@google.com>
10469
10470 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10471 local symbols when stripping all symbols.
10472
bbbfea06
CC
104732009-01-14 Cary Coutant <ccoutant@google.com>
10474
99e9a495 10475 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10476
0f7c0701
CC
104772009-01-14 Cary Coutant <ccoutant@google.com>
10478
10479 * archive.cc (Archive::get_elf_object_for_member): Remove call
10480 to File_read::claim_for_plugin.
10481 * descriptors.cc (Descriptors::open): Remove reference to
10482 is_claimed.
10483 (Descriptors::claim_for_plugin): Remove.
10484 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10485 (Descriptors::is_claimed): Remove.
10486 (claim_descriptor_for_plugin): Remove.
10487 * fileread.cc (File_read::claim_for_plugin): Remove.
10488 * fileread.h (File_read::claim_for_plugin): Remove.
10489 (File_read::descriptor): Reopen descriptor if necessary.
10490 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10491 (Plugin_manager::all_symbols_read): Add task parameter. Change
10492 all callers.
10493 (Plugin_manager::get_input_file): New function.
10494 (Plugin_manager::release_input_file): New function.
10495 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10496 corresponding data member.
10497 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10498 and pass to base constructor. Change all callers.
10499 (get_input_file, release_input_file): New functions.
10500 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10501 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10502 (Plugin_manager::all_symbols_read): Add task parameter.
10503 (Plugin_manager::get_input_file): New function.
10504 (Plugin_manager::release_input_file): New function.
10505 (Plugin_manager::task_): New data member.
10506 (Pluginobj::Pluginobj): Add filesize parameter.
10507 (Pluginobj::filename): New function.
10508 (Pluginobj::descriptor): New function.
10509 (Pluginobj::filesize): New function.
10510 (Pluginobj::filesize_): New data member.
10511 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10512 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10513 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10514
10515 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10516 with archive libraries.
10517 * testsuite/Makefile.in: Regenerate.
10518 * testsuite/plugin_test.c (struct sym_info): New type.
10519 (get_input_file, release_input_file): New static variables.
10520 (onload): Capture new transfer vector entries.
10521 (claim_file_hook): Stop reading at end of file according to filesize.
10522 Factor out parsing of readelf output into separate function.
10523 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10524 APIs and get the source file name from the symbol table. Convert
10525 source file name to corresponding object file name. Print info
10526 message when adding new input files.
10527 (parse_readelf_line): New function.
10528 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10529 * testsuite/plugin_test_2.sh: Likewise.
10530 * testsuite/plugin_test_3.sh: Likewise.
10531 * testsuite/plugin_test_4.sh: New test case.
10532
62a6d109
ILT
105332009-01-07 Ian Lance Taylor <iant@google.com>
10534
10535 * version.cc (version_string): Bump to 1.8.
10536
483620e8
CC
105372008-12-23 Cary Coutant <ccoutant@google.com>
10538
10539 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10540 * plugin.cc (Plugin_manager::finish): Rename as
10541 layout_deferred_objects. Move cleanup to separate function.
10542 (Plugin_manager::cleanup): New function.
10543 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10544 separately.
10545 * plugin.h (Plugin_manager::finish): Rename as
10546 layout_deferred_objects.
10547 (Plugin_manager::cleanup): New function.
10548 (Plugin_manager::cleanup_done): New field.
10549
d66a9eb3
CC
105502008-12-23 Cary Coutant <ccoutant@google.com>
10551
10552 * plugin.cc (is_visible_from_outside): New function.
10553 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10554 so we don't return "IR only" status for exported symbols or -r links.
10555
10556 * testsuite/Makefile.am (plugin_test_3): New test case.
10557 * testsuite/Makefile.in: Regenerate.
10558 * testsuite/plugin_test_3.sh: New file.
10559
5995b570
CC
105602008-12-22 Cary Coutant <ccoutant@google.com>
10561
10562 * object.cc (Sized_relobj::layout_section): New function.
10563 (Sized_relobj::do_layout): Defer layout of input sections until after
10564 plugin has provided replacement files.
10565 (Sized_relobj::do_layout_deferred_sections): New function.
10566 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10567 (Relobj::layout_deferred_sections): New function.
10568 (Relobj::do_layout_deferred_sections): New function.
10569 (Sized_relobj::do_layout_deferred_sections): New function.
10570 (Sized_relobj::layout_section): New function.
10571 (Sized_relobj::Deferred_layout): New structure.
10572 (Sized_relobj::deferred_layout_): New field.
10573 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10574 Change all callers. Layout deferred sections.
10575 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10576 references.
10577 (Plugin_hook::run): Move code from do_plugin_hook inline.
10578 (Plugin_hook::do_plugin_hook): Remove.
10579 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10580 (Plugin_manager::finish): Renamed, was cleanup.
10581 (Plugin_manager::should_defer_layout): New function.
10582 (Plugin_manager::add_deferred_layout_object): New function.
10583 (Plugin_manager::Deferred_layout_list): New type.
10584 (Plugin_manager::deferred_layout_objects_): New field.
10585 (Plugin_hook::do_plugin_hook): Remove.
10586
ee769c88
ILT
105872008-12-17 Ian Lance Taylor <iant@google.com>
10588
10589 * options.h (class General_options): Add --no case for
10590 --export-dynamic.
10591
abc8dcba
CC
105922008-12-16 Cary Coutant <ccoutant@google.com>
10593
10594 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10595 vector.
10596 (Plugin_manager::claim_file): Create plugin object even if
10597 plugin did not call the add_symbols callback.
10598 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10599 asking for more symbols than were added.
10600 * testsuite/Makefile.am (plugin_test_1): Add test case with
10601 no global symbols.
10602 (empty.syms): New target.
10603 * testsuite/Makefile.in: Regenerate.
10604 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10605 message. Don't call add_symbols if no globals.
10606 (all_symbols_read_hook): Don't provide replacement for empty
10607 claimed file.
10608
b0074644
ILT
106092008-12-12 Ian Lance Taylor <iant@google.com>
10610
68943102
ILT
10611 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10612 r_type == 0 for a local symbol with r_sym == 0.
10613 (scan_relocatable_relocs): Pass r_sym to
10614 local_non_section_strategy.
10615 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10616 r_sym parameter.
10617
b0074644
ILT
10618 * configure.ac: Update test for TLS descriptors: they are
10619 supported as of glibc 2.9.
10620 * configure: Rebuild.
10621
c2508178
ILT
106222008-12-11 Ian Lance Taylor <iant@google.com>
10623
10624 PR 7091
10625 * target-reloc.h (Default_scan_relocatable_relocs): For each
10626 function, map r_type == 0 to RELOC_DISCARD.
10627
2756a258
CC
106282008-12-10 Cary Coutant <ccoutant@google.com>
10629
10630 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10631 object to override a kept COMDAT group from a plugin object.
10632
bb6f53d3
ILT
106332008-12-09 Ian Lance Taylor <iant@google.com>
10634
fbc558e1
ILT
10635 PR 7088
10636 * yyscript.y (file_cmd): Handle INPUT.
10637
bb6f53d3
ILT
10638 * testsuite/initpri1.c: Change all declarations to be full
10639 prototypes by adding void, to avoid compiler warnings.
10640
4674ecfc
CC
106412008-12-05 Rafael Avila de Espindola <espindola@google.com>
10642
10643 * options.cc (General_options::parse_plugin_opt): New.
10644 (General_options::add_plugin): The argument now is just the filename.
10645 (General_options::add_plugin_option): New.
10646 * options.h (plugin_opt): New.
10647 (add_plugin): Change argument name.
10648 (add_plugin_option): New.
10649 * plugin.cc (Plugin::load): Don't parse the plugin option.
10650 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10651 (Plugin::add_option): New.
10652 (Plugin::args_): Change type.
10653 (Plugin::filename_): New.
10654 (Plugin_manager::add_plugin_option): New.
10655 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10656 * testsuite/Makefile.in: Regenerate.
10657
fd06b4aa
CC
106582008-12-05 Cary Coutant <ccoutant@google.com>
10659
10660 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10661 Handle --strip-lto-sections option.
10662 * options.h (strip_lto_sections): New option.
10663
6c52134c
CC
106642008-12-01 Cary Coutant <ccoutant@google.com>
10665
10666 * plugin.cc (ld_plugin_message): Change format parameter to const.
10667 Fix mismatch between new[] and delete.
10668
a45248e0
CC
106692008-11-14 Cary Coutant <ccoutant@google.com>
10670
10671 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10672 instead of -1U.
10673
c82fbeee
CS
106742008-11-05 Craig Silverstein <csilvers@google.com>
10675
10676 * options.cc (General_options::parse_dynamic_list): New function.
10677 * options.h (General_options): New flags dynamic_list,
10678 dynamic_list_data, dynamic_list_cpp_new, and
10679 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10680 (General_options::in_dynamic_list): New function.
10681 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10682 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10683 (Lex::can_continue_name): Likewise.
10684 (yylex): Likewise.
10685 (read_script_file): New parameter script_options.
10686 (read_dynamic_list): New function.
10687 (Script_options::define_dynamic_list): New function.
10688 (dynamic_list_keyword_parsecodes): New variable.
10689 (dynamic_list_keywords): New variable.
10690 * script.h (Script_options::define_dynamic_list): New function
10691 prototype.
10692 (read_dynamic_list): New function prototype.
10693 * symtab.cc (strprefix): New macro.
10694 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10695 dynamic_list_data, dynamic_list_cpp_new, and
10696 dynamic_list_cpp_typeinfo.
10697 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10698 (dynamic_list_expr): New rule.
10699 (dynamic_list_nodes): Likewise.
10700 (dynamic_list_node): Likewise.
10701 * testsuite/Makefile.am (dynamic_list): New test.
10702 * testsuite/Makefile.in: Regenerated.
10703 * testsuite/dynamic_list.t: New file.
10704 * testsuite/dynamic_list.sh: New file.
10705
e0bb29a5
CS
107062008-11-05 Craig Silverstein <csilvers@google.com>
10707
10708 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10709 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10710 (t11_last): Likewise.
10711 * testsuite/ver_test_6.c (main): Likewise.
10712
4e1e25e0
CC
107132008-10-07 Cary Coutant <ccoutant@google.com>
10714
10715 * options.c (General_options::finalize): Add check for -static and
10716 -shared.
10717 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10718 is not empty.
10719
92f03fcb
CC
107202008-10-02 Cary Coutant <ccoutant@google.com>
10721
10722 * plugin.cc (make_sized_plugin_object): Fix conditional
10723 compilation to work when not all targets are enabled.
10724
fbd8a257
CC
107252008-09-29 Cary Coutant <ccoutant@google.com>
10726
10727 * archive.cc (Archive::get_file_and_offset): Use filename instead
10728 of name to get library path.
10729 (Archive::include_member): Unlock external member of a thin archive.
10730
10731 * testsuite/Makefile.am (TEST_AR): New variable.
10732 (thin_archive_test_1): New test.
10733 (thin_archive_test_2): New test.
81636b3f
CC
10734 * testsuite/Makefile.in: Regenerate.
10735 * testsuite/thin_archive_main.cc: New file.
10736 * testsuite/thin_archive_test_1.cc: New file.
10737 * testsuite/thin_archive_test_2.cc: New file.
10738 * testsuite/thin_archive_test_3.cc: New file.
10739 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 10740
eff45813
CC
107412008-09-29 Cary Coutant <ccoutant@google.com>
10742
10743 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10744 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10745 instead of -1U.
10746 (Sized_relobj::do_finalize_local_symbols): Likewise.
10747 (Sized_relobj::map_to_kept_section): Likewise.
10748 * object.h (Sized_relobj::invalid_address): New constant.
10749 (Sized_relobj::do_output_section_offset): Check for invalid_address
10750 and return -1ULL.
10751 * output.cc (Output_reloc::local_section_offset): Use constant
10752 invalid_address instead of -1U.
10753 (Output_reloc::get_address): Likewise.
10754 (Output_section::output_address): Change -1U to -1ULL.
10755 * output.h (Output_reloc::invalid_address): New constant.
10756 * reloc.cc (Sized_relobj::write_sections): Use constant
10757 invalid_address instead of -1U.
10758 (Sized_relobj::relocate_sections): Likewise.
10759 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10760 values for merge sections.
10761 * target-reloc.h (relocate_for_relocatable): Use constant
10762 invalid_address instead of -1U.
10763
89fc3421
CC
107642008-09-19 Cary Coutant <ccoutant@google.com>
10765
10766 Add plugin functionality for link-time optimization (LTO).
10767 * configure.ac (plugins): Add --enable-plugins option.
10768 * configure: Regenerate.
10769 * config.in: Regenerate.
10770 * Makefile.am (LIBDL): New variable.
10771 (CCFILES): Add plugin.cc.
10772 (HFILES): Add plugin.h.
10773 (ldadd_var): Add LIBDL.
10774 * Makefile.in: Regenerate.
10775
10776 * archive.cc: Include "plugin.h".
10777 (Archive::setup): Don't preread archive symbols when using a plugin.
10778 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10779 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10780 files.
10781 (Archive::include_member): Add symbols from plugin objects.
10782 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10783 * descriptors.cc (Descriptors::open): Check for file descriptors
10784 abandoned by plugins.
10785 (Descriptors::claim_for_plugin): New function.
10786 * descriptors.h (Descriptors::claim_for_plugin): New function.
10787 (Open_descriptor::is_claimed): New field.
10788 (claim_descriptor_for_plugin): New function.
10789 * fileread.cc (File_read::claim_for_plugin): New function.
10790 * fileread.h (File_read::claim_for_plugin): New function.
10791 (File_read::descriptor): New function.
10792 * gold.cc: Include "plugin.h".
10793 (queue_initial_tasks): Add task to call plugin hooks for generating
10794 new object files.
10795 * main.cc: Include "plugin.h".
10796 (main): Load plugin libraries.
10797 * object.h (Pluginobj): Declare.
10798 (Object::pluginobj): New function.
10799 (Object::do_pluginobj): New function.
10800 (Object::set_target): New function.
10801 * options.cc: Include "plugin.h".
10802 (General_options::parse_plugin): New function.
10803 (General_options::General_options): Initialize plugins_ field.
10804 (General_options::add_plugin): New function.
10805 * options.h (Plugin_manager): Declare.
10806 (General_options): Add --plugin option.
10807 (General_options::has_plugins): New function.
10808 (General_options::plugins): New function.
10809 (General_options::add_plugin): New function.
10810 (General_options::plugins_): New field.
10811 * plugin.cc: New file.
10812 * plugin.h: New file.
10813 * readsyms.cc: Include "plugin.h".
10814 (Read_symbols::do_read_symbols): Check for archive before checking
10815 for ELF file. Call plugin hooks to claim files.
10816 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10817 from a real object file; force override when processing replacement
10818 files.
10819 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10820 (Symbol::init_base_object): Likewise.
10821 (Symbol::init_base_output_data): Likewise.
10822 (Symbol::init_base_output_segment): Likewise.
10823 (Symbol::init_base_constant): Likewise.
10824 (Symbol::init_base_undefined): Likewise.
10825 (Symbol::output_section): Assert that object is not a plugin.
10826 (Symbol_table::add_from_pluginobj): New function.
10827 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10828 undefined.
10829 (Symbol_table::sized_write_globals): Likewise.
10830 (Symbol_table::add_from_pluginobj): Instantiate template.
10831 * symtab.h (Sized_pluginobj): Declare.
10832 (Symbol::in_real_elf): New function.
10833 (Symbol::set_in_real_elf): New function.
10834 (Symbol::in_real_elf_): New field.
10835 (Symbol_table::add_from_pluginobj): New function.
10836
10837 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10838 (LIBDL): New variable.
10839 (LDADD): Add LIBDL.
10840 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10841 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10842 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10843 (MOSTLYCLEANFILES): Likewise.
10844 * testsuite/Makefile.in: Regenerate.
10845 * testsuite/plugin_test.c: New file.
10846 * testsuite/plugin_test_1.sh: New file.
10847 * testsuite/plugin_test_2.sh: New file.
10848
de31bda5
ILT
108492008-09-16 Ian Lance Taylor <iant@google.com>
10850
9c2d0ef9
ILT
10851 * target-reloc.h (relocate_section): Check whether a symbol is
10852 defined by the ABI before reporting an undefined symbol error.
10853 * target.h (Target::is_defined_by_abi): Make parameter const.
10854 (Target::do_is_defined_by_abi): Likewise.
10855 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10856 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10857 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10858 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10859 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10860 * testsuite/Makefile.in: Rebuild.
10861
de31bda5
ILT
10862 * fileread.cc (make_view): Add casts to avoid warning.
10863
9fa33bee
AO
108642008-09-16 Alexandre Oliva <aoliva@redhat.com>
10865
10866 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10867 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10868
183fd0e3
AO
108692008-09-16 Alexandre Oliva <aoliva@redhat.com>
10870
10871 * options.h (General_options::output_is_executable): New.
10872 (General_options::output_is_pie): New.
10873 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10874 for shared libraries.
10875 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10876
7be8330a
CD
108772008-09-11 Chris Demetriou <cgd@google.com>
10878
10879 * options.h (origin): New -z option.
10880 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10881 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10882 in DT_FLAGS_1.
10883
a9caad02
CC
108842008-09-05 Cary Coutant <ccoutant@google.com>
10885
10886 * fileread.cc (File_read::make_view): Add check for attempt to map
10887 beyond end of file.
10888
ae6dce4d
CC
108892008-09-05 Cary Coutant <ccoutant@google.com>
10890
10891 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10892 explicit instantiations.
10893
d7ab2a47
KVH
108942008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10895
10896 PR gold/6858
10897 * options.cc (General_options::finalize): Allow undefined symbols
10898 in shlibs if linking -shared.
10899
10900 PR gold/6859
10901 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10902 symbols as not needing a dynsym entry.
10903
1e52a9c1
CS
109042008-08-20 Craig Silverstein <csilvers@google.com>
10905
10906 * fileread.cc (File_read::open): Do not lock the file unless it
10907 was successfully opened.
10908
d85c80a3
CC
109092008-08-14 Cary Coutant <ccoutant@google.com>
10910
10911 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10912 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10913 * testsuite/tls_test.cc (struct int128): 128-bit struct
10914 for testing TLS relocs with non-zero addend.
10915 (v12): New TLS variable.
10916 (t12): New test.
10917 (t_last): Add check for v12.
10918 * testsuite/tls_test.h (t12): New function.
10919 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10920
2d924fd9
ILT
109212008-08-13 Ian Lance Taylor <iant@google.com>
10922
10923 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10924 set tls_segment_ or relro_segment_.
10925 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10926 when appropriate.
10927 * output.h (Output_section::clear_is_relro): New function.
10928 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10929 sections specially even when output_data_ is empty.
10930 (Output_segment::maximum_alignment): When first section is relro,
10931 only force alignment for PT_LOAD segments.
10932 * script.cc (script_data_segment_align): New function.
10933 (script_data_segment_relro_end): New function.
10934 * script-c.h (script_data_segment_align): Declare.
10935 (script_data_segment_relro_end): Declare.
10936 * script-sections.h (class Script_sections): Declare
10937 data_segment_align and data_segment_relro_end. Add fields
10938 segment_align_index_ and saw_relro_end_.
10939 * script-sections.cc (class Sections_element): Add set_is_relro
10940 virtual function. Add new bool* parameter to place_orphan_here.
10941 Add get_output_section virtual function.
10942 (class Output_section_definition): Add set_is_relro. Add new
10943 bool* parameter to place_orphan_here. Add get_output_section.
10944 Add is_relro_ field.
10945 (Output_section_definition::Output_section_definition): Initialize
10946 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10947 and is_relro_ fields.
10948 (Output_section_definition::place_orphan_here): Add is_relro
10949 parameter.
10950 (Output_section_definition::set_section_addresses): Set relro for
10951 output section.
10952 (Output_section_definition::alternate_constraint): Likewise.
10953 (class Orphan_output_section): Add new bool* parameter to
10954 place_orphan_here. Add get_output_section.
10955 (Orphan_output_section::place_orphan_here): Add is_relro
10956 parameter.
10957 (Script_sections::Script_sections): Initialize
10958 data_segment_align_index_ and saw_relro_end_.
10959 (Script_sections::data_segment_align): New function.
10960 (Script_sections::data_segment_relro_end): New function.
10961 (Script_sections::place_orphan): Set or clear is_relro.
10962 (Script_sections::set_section_addresses): Force alignment of first
10963 TLS section.
10964 * yyscript.y (exp): Call script_data_segment_align and
10965 script_data_segment_relro_end.
10966 * testsuite/relro_script_test.t: New file.
10967 * testsuite/relro_test.cc (using_script): Declare.
10968 (t1, t2): Test using_script.
10969 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10970 (relro_script_test_SOURCES): Define.
10971 (relro_script_test_DEPENDENCIES): Define.
10972 (relro_script_test_LDFLAGS): Define.
10973 (relro_script_test_LDADD): Define.
10974 (relro_script_test.so): New target.
10975 * testsuite/Makefile.in: Rebuild.
10976
f827c9a9
CC
109772008-08-06 Cary Coutant <ccoutant@google.com>
10978
10979 * archive.cc (Archive::total_archives, Archive::total_members)
10980 (Archive::total_members_loaded): New variables.
10981 (Archive::setup): Add parameter. Add option to preread
10982 archive symbols.
10983 (Archive::read_armap): Add counter.
10984 (Archive::get_file_and_offset): New function.
10985 (Archive::get_elf_object_for_member): New function.
10986 (Archive::read_all_symbols): New function.
10987 (Archive::read_symbols): New function.
10988 (Archive::add_symbols): Add counters.
10989 (Archive::include_all_members): Use armap to find members if it's
10990 already built.
10991 (Archive::include_member): Skip reading symbols if already read.
10992 Factored code into Archive::get_file_and_offset and
10993 Archive::get_elf_object_for_member. Changed call to
10994 Mapfile::report_include_archive_member.
10995 (Archive::print_stats): New function.
10996 * archive.h: Declare Object and Read_symbols_data classes.
10997 (Archive::Archive): Add initializers for new members.
10998 (Archive::setup): Add parameter.
10999 (Archive::print_stats): New function.
11000 (Archive::total_archives, Archive::total_members)
11001 (Archive::total_members_loaded): New variables.
11002 (Archive::get_file_and_offset): New function.
11003 (Archive::get_elf_object_for_member): New function.
11004 (Archive::read_all_symbols): New function.
11005 (Archive::read_symbols): New function.
11006 (Archive::Archive_member): New class.
11007 (Archive::members_): New member.
11008 (Archive::num_members_): New member.
11009 * main.cc: Include archive.h.
11010 (main): Call Archive::print_stats.
11011 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11012 archive parameter; member_name is now the fully-decorated name.
11013 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11014 * options.h: (General_options): Add --preread-archive-symbols option.
11015 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11016 Archive::setup.
11017
de4c45bd
ILT
110182008-08-04 Ian Lance Taylor <iant@google.com>
11019
11020 * symtab.h (Symbol::use_plt_offset): New function.
11021 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11022 * powerpc.cc (Relocate::relocate): Likewise.
11023 * sparc.cc (Relocate::relocate): Likewise.
11024 * x86_64.cc (Relocate::relocate): Likewise.
11025 * testsuite/weak_plt.sh: New test.
11026 * testsuite/weak_plt_main.cc: New test.
11027 * testsuite/weak_plt_shared.cc: New test.
11028 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11029 (check_PROGRAMS): Add weak_plt.
11030 (check_DATA): Add weak_plt_shared.so.
11031 (weak_plt_main_pic.o, weak_plt): New targets.
11032 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11033 * testsuite/Makefile.in: Rebuild.
11034
11035 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11036 gcctestdir/ld.
11037 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11038 * testsuite/Makefile.in: Rebuild.
11039
323ee3f4
AM
110402008-08-04 Alan Modra <amodra@bigpond.net.au>
11041
11042 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11043 * Makefile.in: Regenerate.
11044 * po/POTFILES.in: Regenerate.
11045
7c07ecec
ILT
110462008-07-29 Ian Lance Taylor <iant@google.com>
11047
11048 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11049 symbols before other symbols.
11050 * testsuite/script_test_2.cc (test_addr): Declare.
11051 (test_addr_alias): Declare.
11052 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11053 values.
7c07ecec
ILT
11054 * testsuite/script_test_2.t: Define test_addr_alias and
11055 test_addr.
11056
5778530e
ILT
110572008-07-24 Ian Lance Taylor <iant@google.com>
11058
2a00e4fb
ILT
11059 PR 5990
11060 * descriptors.cc: New file.
11061 * descriptors.h: New file.
11062 * gold-threads.h (class Hold_optional_lock): New class.
11063 * fileread.cc: Include "descriptors.h".
11064 (File_read::~File_read): Release descriptor rather than closing
11065 it.
11066 (File_read::open) [file]: Call open_descriptor rather than open.
11067 Set is_descriptor_opened_.
11068 (File_read::open) [memory]: Assert that descriptor is not open.
11069 (File_read::reopen_descriptor): New function.
11070 (File_read::release): Release descriptor.
11071 (File_read::do_read): Make non-const. Reopen descriptor.
11072 (File_read::read): Make non-const.
11073 (File_read::make_view): Reopen descriptor.
11074 (File_read::do_readv): Likewise.
11075 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11076 Update declarations.
11077 * layout.cc: Include "descriptors.h".
11078 (Layout::create_build_id): Use open_descriptor rather than open.
11079 * output.cc: Include "descriptors.h".
11080 (Output_file::open): Use open_descriptor rather than open.
11081 * archive.cc (Archive::const_iterator): Change Archive to be
11082 non-const.
11083 (Archive::begin, Archive::end): Make non-const.
11084 (Archive::count_members): Likewise.
11085 * archive.h (class Archive): Update declarations.
11086 * object.h (Object::read): Make non-const.
11087 * Makefile.am (CCFILES): Add descriptors.cc.
11088 (HFILES): Add descriptors.h.
11089 * Makefile.in: Rebuild.
11090
801647d1
ILT
11091 PR 6716
11092 * gold.h: Always include <clocale>. Add Solaris workarounds
11093 following code in binutils/sysdep.h.
11094
5edd166e
ILT
11095 PR 6048
11096 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11097 this->eh_frame_hdr_ is NULL before using it.
11098
c89ad728
ILT
11099 * dynobj.cc (Versions::Versions): Update comment.
11100
aa86f06b
ILT
11101 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11102 the base version name.
11103
5778530e
ILT
11104 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11105 array size plus one.
11106 (Stringpool_template::set_string_offsets): Subtract one from key
11107 before using it as an array index.
11108 (Stringpool_template::get_offset_with_length): Likewise.
11109 (Stringpool_template::write_to_buffer): Likewise.
11110 * stringpool.h (Stringpool_template::get_offset_from_key):
11111 Likewise.
11112
057ead22
ILT
111132008-07-23 Ian Lance Taylor <iant@google.com>
11114
7f649c59
ILT
11115 PR 6658
11116 * object.h (Merged_symbol_value::value): Do our best to handle a
11117 negative addend.
11118
057ead22
ILT
11119 PR 6647
11120 * script.cc (Version_script_info::get_versions): Don't add empty
11121 version tag to return value.
11122 (Version_script_info::get_symbol_version_helper): Change return
11123 type to bool. Add pversion parameter. Change all callers.
11124 (script_register_vers_node): Don't require a non-NULL tag.
11125 * script.h (class Version_script_info): Update declarations.
11126 (Version_script_info::get_symbol_version): Change return type to
11127 bool. Add version parameter. Change all callers.
11128 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11129 handling. Handle an empty version from a version script.
11130 (Symbol_table::define_special_symbol): Likewise.
11131 * testsuite/ver_test_10.script: New file.
11132 * testsuite/ver_test_10.sh: New file.
11133 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11134 (check_DATA): Add ver_test_10.syms.
11135 (ver_test_10.syms, ver_test_10.so): New target.
11136 * testsuite/Makefile.in: Rebuild.
11137
58e54ac2
CD
111382008-07-23 Simon Baldwin <simonb@google.com>
11139
11140 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11141 to zero for undefined symbols from dynamic libraries.
11142
95d14cd3
ILT
111432008-07-23 Ian Lance Taylor <iant@google.com>
11144
11145 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11146 Change all callers.
11147 * symtab.h (class Symbol_table): Update declaration.
11148 * testsuite/ver_test_9.cc: New file.
11149 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11150 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11151 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11152 (ver_test_9.so, ver_test_9.o): New targets.
11153 * testsuite/Makefile.in: Rebuild.
11154
92de84a6
ILT
111552008-07-22 Ian Lance Taylor <iant@google.com>
11156
34810851
ILT
11157 * options.h (class General_options): Define --check-sections.
11158 * layout.cc (Layout::set_segment_offsets): Handle
11159 --check-sections.
11160
af6156ef
ILT
11161 * options.h (class General_options): Define -n/--nmagic and
11162 -N/--omagic.
11163 * options.cc (General_options::finalize): For -n/--nmagic or
11164 -N/--omagic, set -static.
11165 * layout.cc (Layout::attach_allocated_section_to_segment): If
11166 -N/--omagic, don't put read-only and read-write sections in
11167 different segments.
11168 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11169 finding a read-only segment.
11170 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11171 don't set the minimum segment alignment to the common page size,
11172 and don't set the file offset to the address modulo the page size.
11173 * script-sections.cc (Script_sections::create_segments): If
11174 -n/--omagic, don't put read-only and read-write sections in
11175 different segments.
11176
92de84a6
ILT
11177 * cref.cc: New file.
11178 * cref.h: New file.
11179 * options.h (class General_options): Add --print-symbol-counts.
11180 * main.cc (main): Issue defined symbol report if requested.
11181 * archive.cc (Archive::interpret_header): Make into a const member
11182 function.
11183 (Archive::add_symbols): Call Input_objects::archive_start and
11184 archive_stop.
11185 (Archive::const_iterator): Define new class.
11186 (Archive::begin, Archive::end): New functions.
11187 (Archive::include_all_members): Rewrite to use iterator.
11188 (Archive::count_members): New function.
11189 * archive.h (class Archive): Update declarations.
11190 (Archive::filename): New function.
11191 * object.cc: Include "cref.h".
11192 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11193 (Sized_relobj::do_get_global_symbol_counts): New function.
11194 (Input_objects::add_object): Add object to cross-referencer.
11195 (Input_objects::archive_start): New function.
11196 (Input_objects::archive_stop): New function.
11197 (Input_objects::print_symbol_counts): New function.
11198 * object.h: Declare Cref and Archive.
11199 (Object::get_global_symbol_counts): New function.
11200 (Object::do_get_global_symbol_counts): New pure virtual function.
11201 (class Sized_relobj): Add defined_count_ field. Update
11202 declarations.
11203 (class Input_objects): Add cref_ field. Update constructor.
11204 Update declarations.
11205 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11206 defined_count_.
11207 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11208 symbol counts.
11209 (Sized_dynobj::do_get_global_symbol_counts): New function.
11210 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11211 defined_count_. Update declarations. Define Symbols typedef.
11212 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11213 parameter. Change all callers.
11214 (Symbol_table::add_from_dynobj): Add sympointers and defined
11215 parameters. Change all callers.
11216 * symtab.h (class Symbol_table): Update declarations.
11217 * Makefile.am (CCFILES): Add cref.cc.
11218 (HFILES): Add cref.h.
11219 * Makefile.in: Rebuild.
11220
3f7c5e1d
CD
112212008-07-22 Simon Baldwin <simonb@google.com>
11222
11223 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11224 to zero when writing undefined symbols.
11225
e0b64032
ILT
112262008-07-22 Ian Lance Taylor <iant@google.com>
11227
11228 * output.cc (Output_section::add_input_section): Don't try to
11229 merge empty merge sections.
11230
096b02cf
CS
112312008-07-21 Craig Silverstein <csilvers@google.com>
11232
11233 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11234 Include symbol version in error message.
cd536b21 11235
1d1f116d
CD
112362008-07-20 Chris Demetriou <cgd@google.com>
11237
cd536b21 11238 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11239 (RANDOM_SEED_CFLAGS): New substituted variable.
11240 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11241 * configure: Rebuild.
11242 * Makefile.in: Likewise.
11243 * testsuite/Makefile.in: Likewise.
11244
a18f591e
ILT
112452008-07-18 Ian Lance Taylor <iant@google.com>
11246
11247 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11248 where we see NAME/NULL and NAME/VERSION as separate symbols.
11249 * testsuite/ver_test_main.cc (main): Call t4.
11250 (t4, t4_2a): Define.
11251 * testsuite/ver_test_2.cc (t4_2): Define.
11252 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11253 * testsuite/ver_test_4.cc (t4_2a): Define.
11254 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11255 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11256
c6e3f6ed
ILT
112572008-07-17 Ian Lance Taylor <iant@google.com>
11258
11259 * dynobj.cc (Versions::add_def): If we give an error about a
11260 missing version, go ahead and create the version anyhow.
11261
ef9beddf
ILT
112622008-07-10 Ian Lance Taylor <iant@google.com>
11263
11264 Handle output sections with more than 0x7fffffff bytes.
11265 * object.h (class Relobj): Change map_to_output_ to
11266 output_sections_, and just keep a section pointer. Change all
11267 uses. Move comdat group support to Sized_relobj.
11268 (Relobj::is_section_specially_mapped): Remove.
11269 (Relobj::output_section): Remove poff parameter. Change all
11270 callers.
11271 (Relobj::output_section_offset): New function.
11272 (Relobj::set_section_offset): Rewrite.
11273 (Relobj::map_to_output): Remove.
11274 (Relobj::output_sections): New function.
11275 (Relobj::do_output_section_offset): New pure virtual function.
11276 (Relobj::do_set_section_offset): Likewise.
11277 (class Sized_relobj): Add section_offsets_ field. Add comdat
11278 group support from Relobj. Update declarations.
11279 (Sized_relobj::get_output_section_offset): New function.
11280 (Sized_relobj::do_output_section_offset): New function.
11281 (Sized_relobj::do_set_section_offset): New function.
11282 * object.cc (Relobj::output_section_address): Remove.
11283 (Sized_relobj::Sized_relobj): Initialize new fields.
11284 (Sized_relobj::include_section_group): Cast find_kept_object to
11285 Sized_relobj.
11286 (Sized_relobj::include_linkonce_section): Likewise.
11287 (Sized_relobj::do_layout): Use separate arrays for output section
11288 and output offset.
11289 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11290 output_sections.
11291 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11292 output_sections and section_offsets.
11293 (Sized_relobj::write_local_symbols): Likewise.
11294 (map_to_kept_section): Compute output address directly.
11295 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11296 output_sections and section_offsets.
11297 (Sized_relobj::write_sections): Likewise.
11298 (Sized_relobj::relocate_sections): Likewise.
11299 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11300 * output.h (class Output_reloc): Update declarations. Change
11301 u2_.relobj to Sized_relobj*.
11302 (class Output_data_reloc): Change add functions to use
11303 Sized_relobj*.
11304 * output.cc (Output_reloc::Output_reloc): Change relobj to
11305 Sized_relobj*.
11306 (Output_reloc::local_section_offset): Change return type to
11307 Elf_Addr. Use get_output_section_offset.
11308 (Output_reloc::get_address): Likewise.
11309 (Output_section::is_input_address_mapped): Don't call
11310 is_section_specially_mapped.
11311 (Output_section::output_offset): Likewise.
11312 (Output_section::output_address): Likewise.
11313 (Output_section::starting_output_address): Likewise.
11314 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11315 parameter to Sized_relobj*.
11316 (Copy_relocs::need_copy_reloc): Likewise.
11317 (Copy_relocs::save): Likewise.
11318 * copy-relocs.h (class Copy_relocs): Update declarations.
11319 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11320 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11321 * target-reloc.h (relocate_for_relocatable): Change
11322 offset_in_output_section type to Elf_Addr. Change code that uses
11323 it as well.
11324 * layout.cc (Layout::layout): Always set *off.
11325 * mapfile.cc (Mapfile::print_input_section): Use
11326 output_section_offset.
11327 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11328 Sized_relobj*.
11329 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11330 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11331 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11332
5cb66f97
ILT
113332008-07-03 Ian Lance Taylor <iant@google.com>
11334
11335 * layout.cc (Layout::include_section): Do not discard unrecognized
11336 SHT_STRTAB sections.
11337
afe47622
CS
113382008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11339
11340 * script.cc (Lex::can_continue_name): Make '?' allowable in
11341 version-script names.
11342 * testsuite/version_script.map: Change glob pattern to use '?'
11343
5adf9721
ILT
113442008-06-30 Manish Singh <yosh@gimp.org>
11345
11346 PR 6585
11347 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11348 Correct typo.
11349
e6fde208
ILT
113502008-06-30 Ian Lance Taylor <iant@google.com>
11351
11352 PR 6660
11353 PR 6682
11354 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11355 versions]: Don't try to read the value in the contents, since we
11356 don't use it. Use the template endianness when writing.
11357
3f2e6a2d
CC
113582008-06-25 Cary Coutant <ccoutant@google.com>
11359
11360 * fileread.cc (File_read::make_view): Assert on zero-length view.
11361 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11362 symbol table when there are no symbols to read.
11363
c43d3a48
CS
113642008-06-23 Craig Silverstein <csilvers@google.com>
11365
11366 * version.cc (version_string): Bump to 1.7
11367
5f494ea0
CS
113682008-06-18 Craig Silverstein <csilvers@google.com>
11369
11370 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11371 constant 0xFFFF to type Valtype.
11372 (Powerpc_relocate_functions::rel16_ha): Likewise.
11373
c42e122e
ILT
113742008-06-17 Ian Lance Taylor <iant@google.com>
11375
f34787f8
ILT
11376 * output.h (Output_section::Input_section): Initialize p2align_ to
11377 zero for Output_section_data constructors.
11378 (Output_section::Input_section::addralign): If not an input
11379 section, return the alignment of the Output_section_data.
11380 * testsuite/copy_test.cc: New file.
11381 * testsuite/copy_test_1.cc: New file.
11382 * testsuite/copy_test_2.cc: New file.
11383 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11384 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11385 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11386 (copy_test_1_pic.o, copy_test_1.so): New targets.
11387 (copy_test_2_pic.o, copy_test_2.so): New targets.
11388 * testsuite/Makefile.in: Rebuild.
11389
c42e122e
ILT
11390 * script-sections.cc (Script_sections::place_orphan): Initialize
11391 local variable exact.
11392
ce3ac18a
DE
113932008-06-13 David Edelsohn <edelsohn@gnu.org>
11394
11395 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11396
42cacb20
DE
113972008-06-12 David Edelsohn <edelsohn@gnu.org>
11398 David S. Miller <davem@davemloft.net>
11399
11400 * powerpc.cc: New file.
11401 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11402 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11403 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11404 * Makefile.in: Rebuild.
11405
7b308235
ILT
114062008-06-09 Ian Lance Taylor <iant@google.com>
11407
11408 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11409 <exception>.
11410 (throwing, orig_terminate): New static variables.
11411 (terminate_handler): New static function.
11412 (t2): Set terminate handler.
11413
f0b886e3
ILT
114142008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11415
11416 PR 6584
cd536b21 11417 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11418 alignment.
11419
3e90f135
CC
114202008-05-30 Cary Coutant <ccoutant@google.com>
11421
11422 * archive.cc (Archive::include_all_members) Correct to step
11423 over symbol table and extended name table in thin archives.
11424
e09ad04a
ILT
114252008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11426
11427 PR 6407
11428 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11429 calculation.
11430
62b01cb5
ILT
114312008-05-28 Caleb Howe <cshowe@google.com>
11432
11433 * reduced_debug_output.cc: New file.
11434 * reduced_debug_output.h: New file.
92de84a6 11435 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11436 * options.cc (General_options::finalize): Add strip_debug_non_line
11437 to the strip heirarchy.
11438 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11439 fields.
11440 * layout.cc: Include "reduced_debug_output.h".
11441 (Layout::Layout): Initialize new fields.
11442 (line_only_debug_sections): New static array.
11443 (is_lines_only_debug_sections): New static inline function.
11444 (Layout::include_section): Handle --strip-debug-non-line.
11445 (Layout::make_output_section): If --strip-debug-non-line, build
11446 new output sections for .debug_abbrev and .debug_info.
11447 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11448 gold. Warn about possible overflow.
11449 (read_signed_LEB_128): Likewise.
11450 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11451 (read_signed_LEB_128): Declare.
11452 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11453 (HFILES): Add reduced_debug_output.h.
11454 * Makefile.in: Rebuild.
11455
7d9e3d98
ILT
114562008-05-21 Ian Lance Taylor <iant@google.com>
11457
11458 * mapfile.cc: New file.
11459 * mapfile.h: New file.
11460 * options.h (class General_options): Add -M/--print-map and -Map.
11461 * options.cc (General_options::finalize): Make -M equivalent to
11462 -Map -.
11463 * main.cc: Include <cstdio> and "mapfile.h".
11464 (main): Open mapfile if requested.
11465 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11466 constructor. Change caller.
11467 (queue_initial_tasks): Add mapfile parameter. Change caller.
11468 (queue_middle_tasks): Likewise.
11469 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11470 declarations.
11471 * archive.cc: Include "mapfile.h".
11472 (Archive::add_symbols): Add mapfile parameter. Change all
11473 callers. Pass mapfile, symbol, and reason to include_member.
11474 (Archive::include_all_members): Add mapfile parameter. Change all
11475 callers.
11476 (Archive::include_member): Add mapfile, sym, and why parameters.
11477 Change all callers. Report inclusion to map file.
11478 * archive.h: Include "fileread.h".
11479 (class Archive): Update declarations.
11480 (Archive::file): New const method.
11481 (class Add_archive_symbols): Add mapfile_ field. Update
11482 constructor. Change all callers.
11483 * readsyms.h (class Read_symbols): Likewise.
11484 (class Finish_group): Likewise.
11485 (class Read_script): Likewise.
11486 * common.cc: Include "mapfile.h".
11487 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11488 all callers.
11489 (Symbol_table::do_allocate_commons): Likewise.
11490 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11491 symbol allocation to mapfile.
11492 * common.h (class Allocate_commons_task): Add mapfile_ field.
11493 Update constructor. Change all callers.
11494 * symtab.h (class Symbol_table): Update declarations.
11495 * layout.cc: Include "mapfile.h".
11496 (Layout_task_runner::run): Print information to mapfile.
11497 (Layout::create_gold_note): Change Output_data_fixed_space to
11498 Output_data_zero_fill.
11499 (Layout::create_build_id): Likewise.
11500 (Layout::print_to_mapfile): New function.
11501 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11502 constructor. Change caller.
11503 (class Layout): Declare print_to_mapfile.
11504 * output.cc (Output_section::Input_section::print_to_mapfile): New
11505 function.
11506 (Output_section::add_input_section): If producing a map, always
11507 add to input_sections_ list.
11508 (Output_section::do_print_to_mapfile): New function.
11509 (Output_segment::print_sections_to_mapfile): New function.
11510 (Output_segment::print_section_list_to_mapfile): New function.
11511 * output.h: Include "mapfile.h".
11512 (Output_data::print_to_mapfile): New function.
11513 (Output_data::do_print_to_mapfile): New virtual function.
11514 (Output_segment_headers::do_print_to_mapfile): New function.
11515 (Output_file_header::do_print_to_mapfile): New function.
11516 (Output_data_const::do_print_to_mapfile): New function.
11517 (class Output_data_const_buffer): Add map_name_ field. Update
11518 constructor. Change all callers. Add do_print_to_mapfile
11519 function.
11520 (class Output_data_fixed_space): Likewise.
11521 (class Output_data_space): Likewise.
11522 (class Output_data_zero_fill): New class.
11523 (Output_data_strtab::do_print_to_mapfile): New function.
11524 (Output_data_reloc_base::do_print_to_mapfile): New function.
11525 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11526 (Output_data_group::do_print_to_mapfile): New function.
11527 (Output_data_got::do_print_to_mapfile): New function.
11528 (Output_data_dynamic::do_print_to_mapfile): New function.
11529 (Output_symtab_xindex::do_print_to_mapfile): New function.
11530 (class Output_section): Declare do_print_to_mapflie. Declare
11531 print_to_mapfile in Input_section.
11532 (class Output_segment): Declare new functions.
11533 * object.h (Sized_relobj::symbol_count): New function.
11534 * script-sections.cc
11535 (Output_section_element_dot_assignment::set_section_addresses):
11536 Change Output_data_fixed_space to Output_data_zero_fill.
11537 (Output_data_expression::do_print_to_mapfile): New function.
11538 * script.cc (read_input_script): Add mapfile parameter. Change
11539 all callers.
11540 * script.h (read_input_script): Update declaration.
11541 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11542 (Eh_frame::do_print_to_mapfile): New function.
11543 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11544 (Output_merge_string::do_print_to_mapfile): New function.
11545 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11546 function.
11547 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11548 function.
11549 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11550 function.
11551 * Makefile.am (CCFILES): Add mapfile.cc.
11552 (HFILES): Add mapfile.h.
11553 * Makefile.in: Rebuild.
11554
9f1d377b
ILT
115552008-05-19 Ian Lance Taylor <iant@google.com>
11556
11557 * options.h (class General_options): Add -z relro.
11558 * layout.cc (Layout::Layout): Initialize relro_segment_.
11559 (Layout::add_output_section_data): Return the output section.
11560 (Layout::make_output_section): Rcognize relro sections and mark
11561 them appropriately.
11562 (Layout::attach_allocated_section_to_segment): Put relro sections
11563 in a PT_GNU_RELRO segment.
11564 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11565 section as relro.
11566 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11567 PT_TLS segments.
11568 (Layout::linkonce_mapping): Map d.rel.ro.local to
11569 .data.rel.ro.local.
11570 (Layout::output_section_name): Us .data.rel.ro.local for any
11571 section which begins with that.
11572 * layout.h (class Layout): Update add_output_section_data
11573 declaration. Add relro_segment_ field.
11574 * output.cc (Output_section::Output_section): Initialize is_relro_
11575 and is_relro_local_ fields.
11576 (Output_segment::add_output_section): Group relro sections.
11577 (Output_segment::is_first_section_relro): New function.
11578 (Output_segment::maximum_alignment): If there is a relro section,
11579 align the segment to the common page size.
11580 (Output_segment::set_section_addresses): Track whether we are
11581 looking at relro sections. If the last section is a relro
11582 section, align to the common page size.
11583 (Output_segment::set_section_list_addresses): Add in_relro
11584 parameter. Change all callers. Align to the page size when
11585 moving from relro to non-relro section.
11586 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11587 segment.
11588 * output.h (class Output_section): Add is_relro_ and
11589 is_relro_local_ fields.
11590 (Output_section::is_relro): New function.
11591 (Output_section::set_is_relro): New function.
11592 (Output_section::is_relro_local): New function.
11593 (Output_section::set_is_relro_local): New function.
11594 (class Output_segment): Update declarations.
11595 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11596 * sparc.cc (Target_sparc::got_section): Likewise.
11597 * x86_64.cc (Target_x86_64::got_section): Likewise.
11598 * testsuite/relro_test_main.cc: New file.
11599 * testsuite/relro_test.cc: New file.
11600 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11601 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11602 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11603 (relro_test.so, relro_test_pic.o): New targets.
11604 * testsuite/Makefile.in: Rebuild.
11605
a984ee1d
ILT
116062008-05-16 Ian Lance Taylor <iant@google.com>
11607
01676dcd
ILT
11608 * output.cc (Output_segment::add_output_section): Remove front
11609 parameter.
11610 * output.h (class Output_segment): Remove
11611 add_initial_output_section and overloaded add_output_section.
11612 Update declaration of remaining add_output_section.
11613 * layout.cc (Layout::create_interp): Call add_output_section
11614 rather than add_initial_output_section.
11615 (Layout::finish_dynamic_section): Likewise.
11616
497897f9
ILT
11617 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11618 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11619 know the dynamic type.
11620 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11621 field. Initialize it in constructor.
11622 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11623 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11624 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11625 reloc.
11626
a984ee1d
ILT
11627 * output.cc (Output_reloc::get_address): Change return type to
11628 Elf_Addr.
11629 * output.h (class Output_reloc): Update get_address declaration.
11630 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11631 for section addresses.
11632
55ba0940
ILT
116332008-05-09 Ian Lance Taylor <iant@google.com>
11634
11635 PR 6493
11636 * gold.cc (gold_nomem): Use return value of write.
11637
75517b77
ILT
116382008-05-08 Ian Lance Taylor <iant@google.com>
11639
11640 * symtab.c (Symbol::init_base_output_data): Add version
11641 parameter. Change all callers.
11642 (Symbol::init_base_output_segment): Likewise.
11643 (Symbol::init_base_constant): Likewise.
11644 (Symbol::init_base_undefined): Likewise.
11645 (Sized_symbol::init_output_data): Likewise.
11646 (Sized_symbol::init_output_segment): Likewise.
11647 (Sized_symbol::init_constant): Likewise.
11648 (Sized_symbol::init_undefined): Likewise.
11649 (Symbol_table::do_define_in_output_data): If the new symbol has a
11650 version, mark it as the default.
11651 (Symbol_table::do_define_in_output_segment): Likewise.
11652 (Symbol_table::do_define_as_constant): Likewise.
11653 * symtab.h (class Symbol): Update declarations.
11654 (class Sized_symbol): Likewise.
11655 * resolve.cc (Symbol::override_version): New function.
c42e122e 11656 (Symbol::override_base): Call override_version.
75517b77
ILT
11657 (Symbol::override_base_with_special): Likewise.
11658 * testsuite/ver_script_8.script: New file.
11659 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11660 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11661 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11662 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11663
f1f70eae
ILT
116642008-05-06 Ian Lance Taylor <iant@google.com>
11665
f3e9c5c5
ILT
11666 PR 6049
11667 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11668 functions.
11669 (class General_options): Remove existing --undefined, and add
11670 --no-undefined instead. Add new --undefined as synonym for -u.
11671 * archive.cc (Archive::add_symbols): Check whether symbol was
11672 named with -u.
11673 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11674 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11675 all uses. Add IS_UNDEFINED. Update declarations to split
11676 different versions of init_base. Declare init_base_undefined.
11677 (Symbol::is_defined): Handle IS_UNDEFINED.
11678 (Symbol::is_undefined): Likewise.
11679 (Symbol::is_weak_undefined): Call is_undefined.
11680 (Symbol::is_absolute): Handle IS_CONSTANT.
11681 (class Sized_symbol): Update declarations to split different
11682 versions of init. Declare init_undefined.
11683 (class Symbol_table): Declare new functions.
11684 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11685 Change all callers.
11686 (Symbol::init_base_output_data): Likewise.
11687 (Symbol::init_base_output_segment): Likewise.
11688 (Symbol::init_base_constant): Likewise.
11689 (Symbol::init_base_undefined): New function.
11690 (Sized_symbol::init_object): Rename from init. Change all
11691 callers.
11692 (Sized_symbol::init_output_data): Likewise.
11693 (Sized_symbol::init_output_segment): Likewise.
11694 (Sized_symbol::init_constant): Likewise.
11695 (Sized_symbol::init_undefined): New function.
11696 (Symbol_table::add_undefined_symbols_from_command_line): New
11697 function.
11698 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11699 function.
11700 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11701 (Symbol::output_section): Likewise.
11702 (Symbol::set_output_section): Likewise.
11703 (Symbol_table::sized_finalize_symbol): Likewise.
11704 (Symbol_table::sized_write_globals): Likewise.
11705 * resolve.cc (Symbol_table::should_override): Likewise.
11706 (Symbol::override_base_with_special): Likewise.
11707
8bdcdf2c
ILT
11708 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11709 symbol, change it to have default visibility.
11710 * testsuite/protected_1.cc: New file.
11711 * testsuite/protected_2.cc: New file.
11712 * testsuite/protected_3.cc: New file.
11713 * testsuite/protected_main_1.cc: New file.
11714 * testsuite/protected_main_2.cc: New file.
11715 * testsuite/protected_main_3.cc: New file.
11716 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11717 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11718 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11719 (protected_1.so): New target.
11720 (protected_1_pic.o, protected_2_pic.o): New targets.
11721 (protected_3_pic.o): New target.
11722 (check_PROGRAMS): Add protected_2.
11723 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11724 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11725 * testsuite/Makefile.in: Rebuild.
11726
2b706932
ILT
11727 * options.h (DEFINE_var): Add set_user_set_##varname__.
11728 (DEFINE_bool_alias): New macro.
11729 (class General_options): Define -Bstatic using DEFINE_bool_alias
11730 rather than DEFINE_special. Add --undefined as an alias for -z
11731 defs.
11732 * options.cc (General_options::parse_Bstatic): Remove.
11733
d82a5bcc
ILT
11734 * options.h (class General_options): Add --fatal-warnings.
11735 * main.cc (main): Implement --fatal-warnings.
11736 * errors.h (Errors::warning_count): New function.
11737
f1f70eae
ILT
11738 * options.h (class General_options): Add -Bsymbolic-functions.
11739 * symtab.h (Symbol::is_preemptible): Check for
11740 -Bsymbolic-functions.
11741
8825ac63
ILT
117422008-05-05 Ian Lance Taylor <iant@google.com>
11743
d98bc257
ILT
11744 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11745 as noVARNAME rather than no-VARNAME.
11746 (class General_options): Add option -z combreloc.
11747 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11748 get_address.
11749 (Output_reloc::sort_before) [SHT_REL]: New function.
11750 (Output_reloc::sort_before) [SHT_RELA]: New function.
11751 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11752 Sort_relocs_comparison.
11753 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11754 parameter. Change all callers.
11755 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11756 sort_relocs parameter. Change all callers.
11757 * output.cc (Output_reloc::get_address): New function, broken out
11758 of write_rel.
11759 (Output_reloc::write_rel): Call it.
11760 (Output_reloc::compare): New function.
11761 (Output_data_reloc_base::do_write): Optionally sort relocs.
11762
60b2b4e7
ILT
11763 * configure.ac: If targ_extra_obj is set, link it in.
11764 * configure.tgt: Initialize all variables.
11765 (x86_64*): Set targ_extra_obj and targ_extra_size.
11766 * configure: Rebuild.
11767
8825ac63
ILT
11768 * object.cc (Sized_relobj::include_section_group): Adjust section
11769 indexes read from group data. Build vector to pass to
11770 layout_group.
11771 * layout.cc (Layout::layout_group): Add flags and shndxes
11772 parameters. Remove contents parameter. Change caller. Update
11773 explicit instantiations.
11774 * layout.h (class Layout): Update layout_group declaration.
11775 * output.cc (Output_data_group::Output_data_group): Add flags and
11776 input_shndxes parameters. Remove contents parameter. Change
11777 caller.
11778 (Output_data_group::do_write): Change input_sections_ to
11779 input_shndxes_.
11780 * output.h (class Output_data_group): Update constructor
11781 declaration. Rename input_sections_ to input_shndxes_.
11782 * testsuite/many_sections_test.cc: Add template.
11783
e94cf127
CC
117842008-04-30 Cary Coutant <ccoutant@google.com>
11785
4418b2d5
CC
11786 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11787
e94cf127
CC
11788 * layout.cc (Layout::include_section): Refactored check for debug
11789 info section.
11790 (Layout::add_comdat): Add new parameters. Change type
11791 of signature parameter. Add object and shndx to signatures table.
11792 (Layout::find_kept_object): New function.
11793 * layout.h: Include <cstring>.
11794 (Layout::is_debug_info_section): New function.
11795 (Layout::add_comdat): Add new parameters.
11796 (Layout::find_kept_object): New function.
11797 (Layout::Kept_section): New struct.
11798 (Layout::Signatures): Change type of map range.
11799 * object.cc (Relobj::output_section_address): New function.
11800 (Sized_relobj::include_section_group): Add new parameters. Change
11801 calls to Layout::add_comdat. Change to build table of kept comdat
11802 groups and table mapping discarded sections to kept sections.
11803 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11804 (Sized_relobj::do_layout): Change calls to include_section_group and
11805 include_linkonce_section.
11806 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11807 value to zero when section is discarded.
11808 (Sized_relobj::map_to_kept_section): New function.
11809 * object.h (Relobj::output_section_address): New function.
11810 (Relobj::Comdat_group): New type.
11811 (Relobj::find_comdat_group): New function.
11812 (Relobj::Comdat_group_table): New type.
11813 (Relobj::Kept_comdat_section): New type.
11814 (Relobj::Kept_comdat_section_table): New type.
11815 (Relobj::add_comdat_group): New function.
11816 (Relobj::set_kept_comdat_section): New function.
11817 (Relobj::get_kept_comdat_section): New function.
11818 (Relobj::comdat_groups_): New field.
11819 (Relobj::kept_comdat_sections_): New field.
11820 (Symbol_value::input_value): Update comment.
11821 (Sized_relobj::map_to_kept_section) New function.
11822 (Sized_relobj::include_linkonce_section): Add new parameter.
11823 * target-reloc.h (Comdat_behavior): New type.
11824 (get_comdat_behavior): New function.
11825 (relocate_section): Add code to map a discarded section to the
11826 corresponding kept section when applying a relocation.
11827
e4e5049b
CS
118282008-04-30 Craig Silverstein <csilvers@google.com>
11829
11830 * dwarf_reader.cc (next_generation_count): New static var.
11831 (Addr2line_cache_entry): New struct.
11832 (addr2line_cache): New static var.
11833 (Dwarf_line_info::one_addr2line): Added caching.
11834 (Dwarf_line_info::clear_addr2line_cache): New function.
11835 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11836 cache-size parameter.
11837 (Dwarf_line_info::one_addr2line_cache): New function.
11838 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11839 new cache-size argument to one_addr2line(), and clear cache.
11840
d09e9154
CC
118412008-04-28 Cary Coutant <ccoutant@google.com>
11842
11843 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11844 R_386_PC8 relocations.
11845
7ef73768
ILT
118462008-04-23 Ian Lance Taylor <iant@google.com>
11847
55438702
ILT
11848 * object.cc (Sized_relobj::include_section_group): Check for
11849 invalid section group.
11850
c165fb93
ILT
11851 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11852 header size.
11853
7ef73768
ILT
11854 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11855 than read for file header.
11856 * archive.cc (Archive::include_member): Likewise.
11857
6194aaab
L
118582008-04-23 Paolo Bonzini <bonzini@gnu.org>
11859
11860 * aclocal.m4: Regenerate.
11861 * configure: Regenerate.
11862
d491d34e
ILT
118632008-04-19 Ian Lance Taylor <iant@google.com>
11864
5ea2bac6
ILT
11865 * version.cc (version_string): Bump to 1.6.
11866
7bc3e21a
ILT
11867 * testsuite/Makefile.am (many_sections_r_test): New target.
11868 (many_sections_r_test_SOURCES): Remove.
11869 (many_sections_r_test_DEPENDENCIES): Remove.
11870 (many_sections_r_test_LDFLAGS): Remove.
11871 (many_sections_r_test_LDADD): Remove.
11872
7fcd3aa9
ILT
11873 * object.cc (Sized_relobj::do_add_symbols): Always pass
11874 local_symbol_count_ to add_from_relobj.
11875
4c94d6ae
ILT
11876 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11877 every thousand variables.
11878 * testsuite/Makefile.in: Rebuild.
11879
d491d34e
ILT
11880 * object.cc (Xindex::initialize_symtab_xindex): New function.
11881 (Xindex::read_symtab_xindex): New function.
11882 (Xindex::sym_xindex_to_shndx): New function.
11883 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11884 available.
11885 (Sized_relobj::do_initialize_xindex): New function.
11886 (Sized_relobj::do_read_symbols): Adjust section links.
11887 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11888 parameter. Change all callers.
11889 (Sized_relobj::include_section_group): Adjust section links and
11890 symbol section indexes.
11891 (Sized_relobj::do_layout): Adjust section links.
11892 (Sized_relobj::do_count_local_symbols): Adjust section links and
11893 symbol section indexes.
11894 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11895 ordinary and special symbols.
11896 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11897 dynsym_xindex parameters. Change all callers. Adjust section
11898 links. Use SHN_XINDEX when needed.
11899 (Sized_relobj::get_symbol_location_info): Adjust section links.
11900 Don't get fooled by special symbols.
11901 * object.h (class Xindex): Define.
11902 (class Object): Add xindex_ parameter. Declare virtual functoin
11903 do_initialize_xindex.
11904 (Object::adjust_sym_shndx): New function.
11905 (Object::set_xindex): New protected function.
11906 (class Symbol_value): Add is_ordinary_shndx_ field.
11907 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11908 (Symbol_value::value): Assert ordinary section.
11909 (Symbol_value::initialize_input_to_output_map): Likewise.
11910 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11911 Change all callers.
11912 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11913 all callers.
11914 (class Sized_relobj): Update declarations.
11915 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11916 parameter. Change all callers.
11917 (Sized_relobj::adjust_shndx): New function.
11918 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11919 field.
11920 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11921 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11922 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11923 (Sized_dynobj::read_dynsym_section): Adjust section links.
11924 (Sized_dynobj::read_dynamic): Likewise.
11925 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11926 section links.
11927 (Sized_dynobj::do_initialize_xindex): New function.
11928 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11929 do_initialize_xindex.
11930 (Sized_dynobj::adjust_shndx): New function.
11931 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11932 dynsym_xindex_ fields.
11933 (Layout::finalize): Add a call to set_section_indexes before
11934 creating the symtab sections.
11935 (Layout::set_section_indexes): Don't do anything if the section
11936 already has a section index.
11937 (Layout::create_symtab_sections): Add shnum parameter. Change
11938 caller. Create .symtab_shndx section if needed.
11939 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11940 caller.
11941 (Layout::allocated_output_section_count): New function.
11942 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11943 needed.
11944 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11945 fields. Update declarations.
11946 (Layout::symtab_xindex): New function.
11947 (Layout::dynsym_xindex): New function.
11948 (class Write_symbols_task): Add layout_ field.
11949 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11950 Change caller.
11951 * output.cc (Output_section_headers::Output_section_headers): Add
11952 shstrtab_section parameter. Change all callers.
11953 (Output_section_headers::do_sized_write): Store overflow values
11954 for section count and section string table section index in
11955 section header zero.
11956 (Output_file_header::do_sized_write): Check for overflow of
11957 section count and section string table section index.
11958 (Output_symtab_xindex::do_write): New function.
11959 (Output_symtab_xindex::endian_do_write): New function.
11960 * output.h (class Output_section_headers): Add shstrtab_section_.
11961 Update declarations.
11962 (class Output_symtab_xindex): Define.
11963 (Output_section::has_out_shndx): New function.
11964 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11965 field.
11966 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11967 Change all callers.
11968 (Sized_symbol::init): Likewise.
11969 (Symbol::output_section): Check for ordinary symbol.
11970 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11971 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11972 callers.
11973 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11974 Change all callers. Simplify handling of symbols from sections
11975 not included in the link.
11976 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11977 distinction.
11978 (Weak_alias_sorter::operator()): Assert that symbols are
11979 ordinary.
11980 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11981 distinction.
11982 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11983 parameters. Change all callers.
11984 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11985 symbol distinction. Use SHN_XINDEX when needed.
11986 (Symbol_table::write_section_symbol): Add symtab_xindex
11987 parameter. Change all callers.
11988 (Symbol_table::sized_write_section_symbol): Likewise. Use
11989 SHN_XINDEX when needed.
11990 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11991 declarations.
11992 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11993 (Symbol::is_defined): Check is_ordinary.
11994 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11995 (Symbol::is_absolute, Symbol::is_common): Likewise.
11996 (class Sized_symbol): Update declarations.
11997 (class Symbol_table): Update declarations.
11998 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11999 parameters. Change all callers.
12000 (Sized_symbol::override): Likewise.
12001 (Symbol_table::override): Likewise.
12002 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12003 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12004 is_ordinary, and orig_st_shndx parameters. Change all callers.
12005 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12006 to be in an ordinary section.
12007 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12008 object and is_ordinary parameters. Change all callers.
12009 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12010 Change all callers. Don't add undefined or non-ordinary symbols
12011 to reloc_map_.
12012 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12013 Change all callers.
12014 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12015 declarations.
12016 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12017 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12018 (Sized_relobj::relocate_sections): Likewise.
12019 * target-reloc.h (scan_relocs): Adjust section symbol index.
12020 (scan_relocatable_relocs): Likewise.
12021 * i386.cc (Scan::local): Check for ordinary symbols.
12022 * sparc.cc (Scan::local): Likewise.
12023 * x86_64.cc (Scan::local): Likewise.
12024 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12025 to symbol_section_and_value.
12026 * testsuite/many_sections_test.cc: New file.
12027 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12028 (check_PROGRAMS): Add many_sections_test.
12029 (many_sections_test_SOURCES): Define.
12030 (many_sections_test_DEPENDENCIES): Define.
12031 (many_sections_test_LDFLAGS): Define.
12032 (BUILT_SOURCES): Add many_sections_define.h.
12033 (many_sections_define.h): New target.
12034 (BUILT_SOURCES): Add many_sections_check.h.
12035 (many_sections_check.h): New target.
12036 (check_PROGRAMS): Add many_sections_r_test.
12037 (many_sections_r_test_SOURCES): Define.
12038 (many_sections_r_test_DEPENDENCIES): Define.
12039 (many_sections_r_test_LDFLAGS): Define.
12040 (many_sections_r_test_LDADD): Define.
12041 (many_sections_r_test.o): New target.
12042 * testsuite/Makefile.in: Rebuild.
12043
c5818ff1
CC
120442008-04-17 Cary Coutant <ccoutant@google.com>
12045
12046 * errors.cc (Errors::info): New function.
12047 (gold_info): New function.
12048 * errors.h (Errors::info): New function.
12049 * gold.h (gold_info): New function.
12050 * object.cc (Input_objects::add_object): Print trace output.
12051 * options.cc (options::parse_set): New function.
12052 (General_options::parse_wrap): Deleted.
12053 (General_options::General_options): Deleted initializer.
12054 * options.h (options::String_set): New typedef.
12055 (options::parse_set): New function.
12056 (DEFINE_set): New macro.
12057 (General_options::wrap): Changed to use DEFINE_set. Changed
12058 callers of any_wrap_symbols and is_wrap_symbol.
12059 (General_options::trace, General_options::trace_symbol):
12060 New options.
12061 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12062 (General_options::wrap_symbols_): Deleted.
12063 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12064
b5be4a7c
DM
120652008-04-17 David S. Miller <davem@davemloft.net>
12066
12067 * options.cc (General_options::parse_V): New function.
12068 * options.h: Add entries for -V and -Qy.
12069
155a0dd7
ILT
120702008-04-17 Ian Lance Taylor <iant@google.com>
12071
12072 * common.cc (Symbol_table::allocate_commons): Remove options
12073 parameter. Change caller.
12074 (Symbol_table::do_allocate_commons): Remove options parameter.
12075 Change caller. Just call do_allocate_commons_list twice.
12076 (Symbol_table::do_allocate_commons_list): New function, broken out
12077 of do_allocate_commons.
12078 * common.h (class Allocate_commons_task): Remove options_ field.
12079 Update constructor.
12080 * symtab.cc (Symbol_table::Symbol_table): Initialize
12081 tls_commons_.
12082 (Symbol_table::add_from_object): Put TLS common symbols on
12083 tls_commons_ list.
12084 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12085 which are IN_OUTPUT_DATA.
12086 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12087 allocate_commons and do_allocate_commons declarations. Declare
12088 do_allocate_commons_list.
12089 * gold.cc (queue_middle_tasks): Update creation of
12090 Allocate_commons_task to not pass options.
12091 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12092 (TLS_TEST_C_FLAGS): New variable.
12093 (tls_test_c_pic.o): New target.
12094 (tls_test_shared.so): Link in tls_test_c_pic.o.
12095 (tls_test_c_pic_ie.o): New target.
12096 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12097 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12098 (tls_test_c.o): New target.
12099 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12100 (tls_pic_test_LDADD): Likewise.
12101 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12102 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12103 (tls_test_c_gnu2.o): New target.
12104 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12105 tls_test_c_gnu2.o.
12106 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12107 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12108 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12109 * testsuite/tls_test.cc: Include "config.h".
12110 (t_last): Call t11_last.
12111 * testsuite/tls_test.h (t11, t11_last): Declare.
12112 * testsuite/tls_test_c.c: New file.
12113 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12114 * configure.ac: Check for OpenMP support.
12115 * configure, config.in, Makefile.in: Rebuild.
12116 * testsuite/Makefile.in: Rebuild.
12117
edfbb029
CC
121182008-04-16 Cary Coutant <ccoutant@google.com>
12119
12120 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12121 (Target_i386::tls_base_symbol_defined_): New field.
12122 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12123 (Target_i386::Scan::global): Likewise.
12124 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12125 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12126 (Target_x86_64::tls_base_symbol_defined_): New field.
12127 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12128 (Target_x86_64::Scan::global): Likewise.
12129
f3c69fca
CC
121302008-04-16 Cary Coutant <ccoutant@google.com>
12131
12132 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12133 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12134 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12135 building shared libraries.
12136 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12137 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12138 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12139 * testsuite/Makefile.in: Rebuild.
12140 * testsuite/weak_undef.h: New file.
12141 * testsuite/weak_undef_file1.cc: Add extra test cases.
12142 * testsuite/weak_undef_file2.cc: Likewise.
12143 * testsuite/weak_undef_test.cc: Likewise.
12144
7c414435
DM
121452008-04-16 David S. Miller <davem@davemloft.net>
12146
32b769e1
DM
12147 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12148 Add issued_non_pic_error_ field. Declare check_non_pic.
12149 (Target_sparc::Scan::check_non_pic): New function.
12150 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12151 (Target_sparc::Scan::global): Likewise.
12152
11936fb1
DM
12153 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12154 * configure: Rebuild.
12155
7c414435
DM
12156 * options.h (DEFINE_enable): New macro.
12157 (new_dtags): New enable option.
12158 (initfirst, interpose, loadfltr, nodefaultlib,
12159 nodelete, nodlopen, nodump): New -z options.
12160 * layout.cc (Layout:finish_dynamic_section): If new
12161 dtags enabled, emit DT_RUNPATH. Also, emit a
12162 DT_FLAGS_1 containing any specified -z flags.
12163
85c7bf8b
ILT
121642008-04-16 Ian Lance Taylor <iant@google.com>
12165
12c0daef
ILT
12166 * copy-relocs.cc: New file.
12167 * copy-relocs.h: New file.
12168 * reloc.cc: Remove Copy_relocs code.
12169 * reloc.h: Likewise.
12170 * reloc-types.h (struct Reloc_types) [both versions]: Add
12171 get_reloc_addend_noerror.
12172 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12173 variants of add_global which take an addend which must be zero.
12174 * i386.cc: Include "copy-relocs.h".
12175 (class Target_i386): Change type of copy_relocs_ to variable,
12176 update initializer.
12177 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12178 Change all callers.
12179 (Target_i386::do_finalize_sections): Change handling of
12180 copy_relocs_.
12181 * sparc.cc: Include "copy-relocs.h".
12182 (class Target_sparc): Change type of copy_relocs_ to variable,
12183 update initializer.
12184 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12185 Change all callers.
12186 (Target_sparc::do_finalize_sections): Change handling of
12187 copy_relocs_.
12188 * x86_64.cc: Include "copy-relocs.h".
12189 (class Target_x86_64): Change type of copy_relocs_ to variable,
12190 update initializer.
12191 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12192 class. Change all callers.
12193 (Target_x86_64::do_finalize_sections): Change handling of
12194 copy_relocs_.
12195 * Makefile.am (CCFILES): Add copy-relocs.cc.
12196 (HFILES): Add copy-relocs.h.
12197
4f4995b6
ILT
12198 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12199
85c7bf8b
ILT
12200 * testsuite/script_test_4.sh: Permit leading zeroes.
12201
4f2a9edd
ILT
122022008-04-15 Ian Lance Taylor <iant@google.com>
12203
e6188289
ILT
12204 * script-sections.cc (Script_sections::create_segments): Use
12205 header_size_adjustment even when there is enough room for the
12206 headers.
12207 * testsuite/script_test_4.sh: New file.
12208 * testsuite/script_test_4.t: New file.
12209 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12210 (check_DATA): Add script_test_4.stdout.
12211 (MOSTLYCLEANFILES): Likewise.
12212 (script_test_4): New target.
12213 (script_test_4.stdout): New target.
12214 * testsuite/Makefile.in: Rebuild.
12215
4f2a9edd
ILT
12216 * sparc.cc: Add definitions for Output_data_plt_sparc class
12217 constants.
12218
f5314dd5
DM
122192008-04-14 David S. Miller <davem@davemloft.net>
12220
12221 * sparc.cc: New file.
12222 * Makefile.am (TARGETSOURCES): Add sparc.cc
12223 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12224 * configure.tgt: Document targ_extra_size and
12225 targ_extra_big_endian. Add entries for sparc-* and
12226 sparc64-*.
12227 * configure.ac: Handle targ_extra_size and
12228 targ_extra_big_endian.
12229 * Makefile.in: Rebuild.
12230 * configure: Likewise.
12231 * po/POTFILES.in: Likewise.
12232 * po/gold.pot: Likewise.
12233
154e0e9a
ILT
122342008-04-14 Ian Lance Taylor <iant@google.com>
12235
12236 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12237 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12238 in the name/type/flags to section mapping. Don't call
12239 allocate_output_section.
12240 (Layout::choose_output_section): Change parameter from adjust_name
12241 to is_input_section. Don't permit input sections after sections
12242 are attached to segments. Don't call allocate_output_section.
12243 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12244 not write_enable_output_section.
12245 (Layout::make_output_section): Don't push to
12246 unattached_section_list_ nor call attach_to_segment. Call
12247 attach_section_to_segment if sections are attached.
12248 (Layout::attach_sections_to_segments): New function.
12249 (Layout::attach_section_to_segment): New function.
12250 (Layout::attach_allocated_section_to_segment): Rename from
12251 attach_to_segment. Remove flags parameter.
12252 (Layout::allocate_output_section): Remove function.
12253 (Layout::write_enable_output_section): Remove function.
12254 * layout.h (class Layout): Update for above changes. Add new
12255 field sections_are_attached_.
12256 * output.h (Output_section::update_flags_for_input_section): New
12257 function.
12258 * output.cc (Output_section::add_input_section): Call
12259 update_flags_for_input_section.
12260 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12261
009a67a2
CC
122622008-04-11 Cary Coutant <ccoutant@google.com>
12263
12264 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12265 thought unnecessary.
12266 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12267
759b1a24
ILT
122682008-04-11 Ian Lance Taylor <iant@google.com>
12269
12270 * output.h (class Output_section_data): Remove inline definition
12271 of set_addralign.
12272 * output.cc (Output_section_data::set_addralign): New function.
12273
c2b45e22
CC
122742008-04-11 Cary Coutant <ccoutant@google.com>
12275
12276 Add support for TLS descriptors for i386 and x86_64.
12277 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12278 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12279 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12280 GOT_TYPE_TLS_DESC.
12281 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12282 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12283 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12284 relocations.
12285 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12286 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12287 Fix problem with initial-exec relocations.
12288 (Target_i386::Relocate::relocate_tls): Likewise.
12289 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12290 relaxation.
12291 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12292 support for section-plus-offset dynamic table entries.
12293 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12294 (Output_data_dynamic::Dynamic_entry): Add support for
12295 section-plus-offset dynamic table entries.
12296 (Output_data_dynamic::Classification): Likewise.
12297 (Output_data_dynamic::classification_): Renamed offset_.
12298 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12299 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12300 (Target_x86_64::make_plt_section): New function.
12301 (Target_x86_64::reserve_tlsdesc_entries): New function.
12302 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12303 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12304 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12305 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12306 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12307 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12308 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12309 add extra PLT entry for TLS descriptors.
12310 (Output_data_plt_x86_64::got_): New field.
12311 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12312 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12313 fields.
12314 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12315 descriptors.
12316 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12317 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12318 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12319 R_386_TLS_DESC_CALL relocations.
12320 (Target_x86_64::Scan::global): Likewise.
12321 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12322 for TLS descriptors.
12323 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12324 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12325 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12326 GD-to-IE relaxation.
12327 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12328 and TLS_DESCRIPTORS.
12329 * Makefile.in: Rebuild.
12330 * configure: Rebuild.
12331 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12332 (tls_test_shared2.so): New target.
12333 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12334 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12335 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12336 (tls_shared_gd_to_ie_test_LDADD): New variable.
12337 (tls_shared_gnu2_gd_to_ie_test): New target.
12338 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12339 New targets.
12340 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12341 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12342 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12343 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12344 (tls_shared_gnu2_test): New target.
12345 (tls_test_gnu2_shared.so): New target.
12346 (tls_shared_gnu2_test_SOURCES): New variable.
12347 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12348 (tls_shared_gnu2_test_LDFLAGS): New variable.
12349 (tls_shared_gnu2_test_LDADD): New variable.
12350 * testsuite/Makefile.in: Rebuild.
12351 * testsuite/Makefile.
12352
83bfb6b7
ILT
123532008-04-11 Ian Lance Taylor <iant@google.com>
12354
12355 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12356 justsyms.t.
12357 * testsuite/Makefile.in: Rebuild.
12358
12359 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12360 long.
12361 * testsuite/script_test_2.cc (main): Adjust test.
12362
706e1f5e
ILT
123632008-04-11 David S. Miller <davem@davemloft.net>
12364 Ian Lance Taylor <iant@google.com>
12365
12366 * options.h (General_options): Add entries for '-Y' and
12367 '-relax'.
12368 * options.cc (General_options:finalize): If -Y was used, add those
12369 entries to the library path instead of the default "/lib" and
12370 "/usr/lib".
12371
7c98e6bb
DM
123722008-04-11 David S. Miller <davem@davemloft.net>
12373
12374 * testsuite/justsyms.t: Start at 0x100.
12375 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12376 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12377 long.
12378 * testsuite/script_test_2.cc: Adjust string and section length
12379 checks.
7c98e6bb 12380
99a37bfd
ILT
123812008-04-09 Ian Lance Taylor <iant@google.com>
12382
2cefc357
ILT
12383 PR gold/5996
12384 * script-sections.cc (Sections_element::allocate_to_segment): Add
12385 orphan parameter.
12386 (Output_section_definition::allocate_to_segment): Likewise.
12387 (Orphan_output_section::allocate_to_segment): Likewise.
12388 (Script_sections::attach_sections_using_phdrs_clause): Don't
12389 propagate non-PT_LOAD segments to orphan sections.
12390 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12391 readelf rather than objdump.
12392 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12393 .interp section and PT_INTERP segment are the same size.
12394 * testsuite/Makefile.in: Rebuild.
12395
99a37bfd
ILT
12396 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12397 aliases for symbols defined in the same object.
12398 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12399 (weak_alias_test_SOURCES): New variable.
12400 (weak_alias_test_DEPENDENCIES): New variable.
12401 (weak_alias_test_LDFLAGS): New variable.
12402 (weak_alias_test_LDADD): New variable.
12403 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12404 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12405 (weak_alias_test_3.o): New target.
12406 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12407 * testsuite/weak_alias_test_main.cc: New file.
12408 * testsuite/weak_alias_test_1.cc: New file.
12409 * testsuite/weak_alias_test_2.cc: New file.
12410 * testsuite/weak_alias_test_3.cc: New file.
12411
780e49c5
ILT
124122008-04-08 Ian Lance Taylor <iant@google.com>
12413
cdb0b8f5
ILT
12414 * options.h (class General_options): Add --noinhibit-exec option.
12415 * main.cc (main): Check --noinhibit-exec.
12416
0864d551
ILT
12417 * options.h (class General_options): Define --wrap as a special
12418 option. Add wrap_symbols_ field.
12419 (General_options::any_wrap_symbols): New function.
12420 (General_options::is_wrap_symbol): New function.
12421 * options.cc (General_options::parse_wrap): New function.
12422 (General_options::General_options): Initialize wrap_symbols_.
12423 * symtab.cc (Symbol_table::wrap_symbol): New function.
12424 (Symbol_table::add_from_object): Handle --wrap.
12425 * symtab.h (class Symbol_table): Declare wrap_symbol.
12426 * target.h (Target::wrap_char): New function.
12427 (Target::Target_info): Add wrap_char field.
12428 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12429 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12430 * testsuite/testfile.cc (Target_test::test_target_info):
12431 Likewise.
12432
789aa6de
ILT
12433 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12434 there is one.
12435
2c38906f
ILT
12436 * layout.h (class Layout): Add added_eh_frame_data_ field.
12437 * layout.cc (Layout::Layout): Initialize new field.
12438 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12439 output section until we find a section we merged successfully.
12440 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12441 that the size be non-zero.
12442
780e49c5
ILT
12443 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12444 qualifier.
12445
7fcd0256
ILT
124462008-04-08 Craig Silverstein <csilvers@google.com>
12447
12448 * configure.ac: Export new conditional variable HAVE_ZLIB.
12449 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12450 on HAVE_ZLIB.
12451 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12452 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12453
6835af53
ILT
124542008-04-07 Ian Lance Taylor <iant@google.com>
12455
e24f324c
ILT
12456 * version.cc (version_string): Set to "1.5".
12457
a036edd8
ILT
12458 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12459 Add issued_non_pic_error_ field. Declare check_non_pic.
12460 (Target_x86_64::Scan::check_non_pic): New function.
12461 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12462 (Target_x86_64::Scan::global): Likewise.
12463
624f8810
ILT
12464 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12465 addend parameter. Change caller. Handle merge sections.
12466 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12467 Address to Addend. Don't add in the result of
12468 local_section_offset, pass down the addend and use the returned
12469 value.
12470 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12471 Update declarations of local_section_offset and symbol_value.
12472 * testsuite/two_file_test_1.cc (t18): New function.
12473 * testsuite/two_file_test_2.cc (f18): New function.
12474 * testsuite/two_file_test_main.cc (main): Call t18.
12475 * testsuite/two_file_test.h (t18, f18): Declare.
12476
6835af53
ILT
12477 * configure.ac: Don't test for objdump, c++filt, or readelf.
12478 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12479 conditionals.
12480 (TEST_READELF): New variable.
12481 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12482 (check_PROGRAMS): Add two_file_strip_test.
12483 (two_file_strip_test): New target.
12484 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12485 (two_file_same_shared_strip_test_SOURCES): New variable.
12486 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12487 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12488 (two_file_same_shared_strip_test_LDADD): New variable.
12489 (two_file_shared_strip.so): New target.
12490 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12491 (ver_test_5.syms, ver_test_7.syms): Likewise.
12492 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12493 (strip_test_3.stdout): Use TEST_OBJDUMP.
12494 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12495
86925eef
CC
124962008-04-04 Cary Coutant <ccoutant@google.com>
12497
12498 * symtab.h (Symbol::is_weak_undefined): New function.
12499 (Symbol::is_strong_undefined): New function.
12500 (Symbol::is_absolute): New function.
12501 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12502 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12503 absolute symbols.
12504 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12505 (weak_undef_test): New target.
12506 * testsuite/Makefile.in: Rebuild.
12507 * testsuite/weak_undef_file1.cc: New file.
12508 * testsuite/weak_undef_file2.cc: New file.
12509 * testsuite/weak_undef_test.cc: New file.
12510
126f3ece
ILT
125112008-04-03 Craig Silverstein <csilvers@google.com>
12512
12513 * compressed_output.h (class Output_compressed_section): Use
12514 unsigned buffer.
12515 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12516 add zlib header.
12517 (zlib_compressed_suffix): Removed.
12518 (Output_compressed_section::set_final_data_size): Use unsigned
12519 buffers.
12520 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12521 Fix linker invocation.
12522 (flagstest_o_specialfile_and_compress_debug_sections):
12523 Likewise.
12524 * testsuite/Makefile.in: Regenerated.
12525
deae2a14
DM
125262008-04-02 David S. Miller <davem@davemloft.net>
12527
12528 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12529 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12530
70752818
ILT
125312008-04-02 Craig Silverstein <csilvers@google.com>
12532
12533 * TODO: New file.
12534
39d0cb0e
ILT
125352008-04-02 Ian Lance Taylor <iant@google.com>
12536
12537 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12538 parameters. Update for new key type to views_. Change all
12539 callers.
12540 (File_read::read): Adjust for byteshift in returned view.
12541 (File_read::add_view): New function, broken out of
12542 find_and_make_view.
12543 (File_read::make_view): New function, broken out of
12544 find_and_make_view.
12545 (File_read::find_or_make_view): Add offset and aligned
12546 parameters. Rewrite accordingly. Change all callers.
12547 (File_read::get_view): Add offset and aligned parameters. Adjust
12548 for byteshift in return value.
12549 (File_read::get_lasting_view): Likewise.
12550 * fileread.h (class File_read): Update declarations.
12551 (class File_read::View): Add byteshift_ field. Add byteshift to
12552 constructor. Add byteshift method.
12553 * archive.h (Archive::clear_uncached_views): New function.
12554 (Archive::get_view): Add aligned parameter. Change all callers.
12555 * object.h (Object::get_view): Add aligned parameter. Change all
12556 callers.
12557 (Object::get_lasting_view): Likewise.
12558
12559 * fileread.cc (File_read::release): Don't call clear_views if
12560 there are multiple objects.
12561 * fileread.h (File_read::clear_uncached_views): New function.
12562 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12563 on the archive.
12564
a1207466
CC
125652008-03-31 Cary Coutant <ccoutant@google.com>
12566
12567 Add thin archive support.
12568 * archive.cc (Archive::armagt): New const.
12569 (Archive::setup): Remove task parameter and calls to unlock.
12570 (Archive::unlock_nested_archives): New function.
12571 (Archive::read_header): Add nested_off parameter. Change
12572 all callers.
12573 (Archive::interpret_header): Likewise.
12574 (Archive::include_all_members): Change to handle thin
12575 archives.
12576 (Archive::include_member): Likewise.
12577 * archive.h (Archive::Archive): Add new parameters and
12578 initializers.
12579 (Archive::armagt): New const.
12580 (Archive::setup): Remove task parameter.
12581 (Archive::unlock_nested_archives): New function.
12582 (Archive::read_header): Add nested_off parameter.
12583 (Archive::interpret_header): Likewise.
12584 (Archive::Nested_archive_table): New typedef.
12585 (Archive::is_thin_archive_): New field.
12586 (Archive::nested_archives_): New field.
12587 (Archive::options_): New field.
12588 (Archive::dirpath_): New field.
12589 (Archive::task_): New field.
12590 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12591 for thin archives. Pass additional parameters to
12592 Archive::Archive. Unlock the archive file after calling
12593 Archive::setup.
cd536b21 12594
479f6503
ILT
125952008-03-29 Ian Lance Taylor <iant@google.com>
12596
686c8caf
ILT
12597 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12598 version symbol to be local.
12599 * testsuite/ver_test_4.sh: New file.
12600 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12601 (check_DATA): Add ver_test_4.syms.
12602 (ver_test_4.syms): New target.
12603 * testsuite/Makefile.in: Rebuild.
12604
ab794b6b
ILT
12605 * output.cc
12606 (Output_section::Input_section_sort_entry::has_priority): New
12607 function.
12608 (Output_section::Input_section_sort_entry::match_file_name): New
12609 function.
12610 (Output_section::Input_section_sort_entry::match_section_name):
12611 Remove.
12612 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12613 Remove.
12614 (Output_section::Input_section_sort_entry::match_section_file):
12615 Remove.
12616 (Output_section::Input_section_sort_compare::operator()): Rewrite
12617 using new Input_section_sort_entry functions. Sort crtbegin and
12618 crtend first. Sort sections with no priority before sections with
12619 a priority.
12620 * testsuite/initpri1.c (d3): Check j != 4.
12621 (cd5): New constructor/destructor function.
12622 (main): Check j != 2.
12623
479f6503
ILT
12624 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12625 new symbol when resolving, don't call set_is_default.
12626 * testsuite/ver_test_7.cc: New file.
12627 * testsuite/ver_test_7.sh: New file.
12628 * testsuite/Makefile.am (ver_test_7.so): New target.
12629 (ver_test_7.o): New target.
12630 (check_SCRIPTS): Add ver_test_7.sh.
12631 (check_DATA): Add ver_test_7.syms.
12632 (ver_test_7.syms): New target.
12633
2fd32231
ILT
126342008-03-28 Ian Lance Taylor <iant@google.com>
12635
12636 * layout.cc (Layout::layout): If we see an input section with a
12637 name that needs sorting, set the must_sort flag for the output
12638 section.
12639 (Layout::make_output_section): If the name of the output section
12640 indicates that it might require sorting, set the may_sort flag.
12641 * output.h (Output_section::may_sort_attached_input_sections): New
12642 function.
12643 (Output_section::set_may_sort_attached_input_sections): New
12644 function.
12645 (Output_section::must_sort_attached_input_sections): New
12646 function.
12647 (Output_section::set_must_sort_attached_input_sections): New
12648 function.
12649 (class Output_section): Declare Input_section_sort_entry. Define
12650 Input_section_sort_compare. Declare
12651 sort_attached_input_sections. Add new fields:
12652 may_sort_attached_input_sections_,
12653 must_sort_attached_input_sections_,
12654 attached_input_sections_are_sorted_.
12655 * output.cc (Output_section::Output_section): Initialize new
12656 fields.
12657 (Output_section::add_input_section): Add an entry to
12658 input_sections_ if may_sort or must_sort are true.
12659 (Output_section::set_final_data_size): Call
12660 sort_attached_input_sections if necessary.
12661 (Output_section::Input_section_sort_entry): Define new class.
12662 (Output_section::Input_section_sort_compare::operator()): New
12663 function.
12664 (Output_section::sort_attached_input_sections): New function.
12665 * configure.ac: Check whether the compiler supports constructor
12666 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12667 * testsuite/initpri1.c: New file.
12668 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12669 CONSTRUCTOR_PRIORITY.
12670 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12671 (initpri1_LDFLAGS): New variable.
12672 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12673
18e6b24e
ILT
126742008-03-27 Ian Lance Taylor <iant@google.com>
12675
49bdd526
ILT
12676 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12677 * testsuite/common_test_1.c: New file.
12678 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12679 (common_test_1_SOURCES): New variable.
12680 (common_test_1_DEPENDENCIES): New variable.
12681 (common_test_1_LDFLAGS): New variable.
12682
18e6b24e
ILT
12683 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12684 and commons_ correctly when NAME/VERSION does not override
12685 NAME/NULL.
12686 * testsuite/ver_test_6.c: New file.
12687 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12688 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12689 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12690
04bf7072
ILT
126912008-03-26 Ian Lance Taylor <iant@google.com>
12692
5871526f
ILT
12693 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12694 of an undefined symbol from a version script.
12695 * testsuite/Makefile.am (ver_test_5.so): New target.
12696 (ver_test_5.o): New target.
12697 (check_SCRIPTS): Add ver_test_5.sh.
12698 (check_DATA): Add ver_test_5.syms.
12699 (ver_test_5.syms): New target.
12700 * testsuite/ver_test_5.cc: New file.
12701 * testsuite/ver_test_5.script: New file.
12702 * testsuite/ver_test_5.sh: New file.
12703 * Makefile.in, testsuite/Makefile.in: Rebuild.
12704
04bf7072
ILT
12705 PR gold/5986
12706 Fix problems building gold with gcc 4.3.0.
12707 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12708 (gold_error_at_location, gold_warning_at_location): Use it.
12709 * configure.ac: Check whether we can compile and use a template
12710 function with a printf attribute.
12711 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12712 when jumping over bytes.
12713 * object.cc: Instantiate Object::read_section_data.
12714 * debug.h: Include <cstring>
12715 * dwarf_reader.cc: Include <algorithm>
12716 * main.cc: Include <cstring>.
12717 * options.cc: Include <cstring>.
12718 * output.cc: Include <cstring>.
12719 * script.cc: Include <cstring>.
12720 * script.h: Include <string>.
12721 * symtab.cc: Include <cstring> and <algorithm>.
12722 * target-select.cc: Include <cstring>.
12723 * version.cc: Include <string>.
12724 * testsuite/testmain.cc: Include <cstdlib>.
12725 * configure, config.in: Rebuild.
12726
874c5b28
ILT
127272008-03-25 Ian Lance Taylor <iant@google.com>
12728
819d6c3a
ILT
12729 * options.cc: Include "../bfd/bfdver.h".
12730 (options::help): Print bug reporting address.
12731
f4b2c6f5
ILT
12732 * version.cc (print_version): Adjust output for current value of
12733 BFD_VERSION_STRING.
12734
12735 * NEWS: New file.
12736
e96caa79
ILT
12737 * options.cc (options::help): Print list of supported targets.
12738 * target-select.h: Include <vector>.
12739 (class Target_selector): Make machine_, size_, and is_big_endian_
12740 fields const. Add bfd_name_ and instantiated_target_ fields.
12741 (Target_selector::Target_selector): Add bfd_name parameter.
12742 (Target_selector::recognize): Make non-virtual, call
12743 do_recognize.
12744 (Target_selector::recognize_by_name): Make non-virtual, call
12745 do_recognize_by_name.
12746 (Target_selector::supported_names): New function.
12747 (Target_selector::bfd_name): New function.
12748 (Target_selector::do_instantiate_target): New pure virtual
12749 function.
12750 (Target_selector::do_recognize): New virtual function.
12751 (Target_selector::do_recognize_by_name): New virtual function.
12752 (Target_selector::instantiate_target): New private function.
12753 (supported_target_names): Declare.
12754 * target-select.cc (Target_selector::Target_selector): Update for
12755 new parameter and fields.
12756 (select_target_by_name): Check that the name matches before
12757 calling recognize_by_name.
12758 (supported_target_names): New function.
12759 * i386.cc (class Target_selector_i386): Update Target_selector
12760 constructor call. Remove recognize and recognize_by_name. Add
12761 do_instantiate_target.
12762 * x86_64.cc (class Target_selector_x86_64): Likewise.
12763 * testsuite/testfile.cc (class Target_selector_test): Update for
12764 changes to Target_selector.
12765
874c5b28
ILT
12766 * README: Rewrite, with some notes on unsupported features.
12767
0a65a3a7
CC
127682008-03-24 Cary Coutant <ccoutant@google.com>
12769
12770 * i386.cc (Target_i386::Got_type): New enum declaration.
12771 (Target_i386::Scan::local): Updated callers of Output_data_got
12772 member functions.
12773 (Target_i386::Scan::global): Likewise.
12774 (Target_i386::Relocate::relocate): Likewise.
12775 (Target_i386::Relocate::relocate_tls): Likewise.
12776 * object.h (Got_offset_list): New class.
12777 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12778 (Sized_relobj::local_got_offset): Likewise.
12779 (Sized_relobj::set_local_got_offset): Likewise.
12780 (Sized_relobj::local_has_tls_got_offset): Removed.
12781 (Sized_relobj::local_tls_got_offset): Removed.
12782 (Sized_relobj::set_local_tls_got_offset): Removed.
12783 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12784 * output.cc (Output_data_got::add_global): Added got_type parameter.
12785 (Output_data_got::add_global_with_rel): Likewise.
12786 (Output_data_got::add_global_with_rela): Likewise.
12787 (Output_data_got::add_global_pair_with_rel): New function.
12788 (Output_data_got::add_global_pair_with_rela): New function.
12789 (Output_data_got::add_local): Added got_type parameter.
12790 (Output_data_got::add_local_with_rel): Likewise.
12791 (Output_data_got::add_local_with_rela): Likewise.
12792 (Output_data_got::add_local_pair_with_rel): New function.
12793 (Output_data_got::add_local_pair_with_rela): New function.
12794 (Output_data_got::add_global_tls): Removed.
12795 (Output_data_got::add_global_tls_with_rel): Removed.
12796 (Output_data_got::add_global_tls_with_rela): Removed.
12797 (Output_data_got::add_local_tls): Removed.
12798 (Output_data_got::add_local_tls_with_rel): Removed.
12799 (Output_data_got::add_local_tls_with_rela): Removed.
12800 * output.h (Output_data_got::add_global): Added got_type parameter.
12801 (Output_data_got::add_global_with_rel): Likewise.
12802 (Output_data_got::add_global_with_rela): Likewise.
12803 (Output_data_got::add_global_pair_with_rel): New function.
12804 (Output_data_got::add_global_pair_with_rela): New function.
12805 (Output_data_got::add_local): Added got_type parameter.
12806 (Output_data_got::add_local_with_rel): Likewise.
12807 (Output_data_got::add_local_with_rela): Likewise.
12808 (Output_data_got::add_local_pair_with_rel): New function.
12809 (Output_data_got::add_local_pair_with_rela): New function.
12810 (Output_data_got::add_global_tls): Removed.
12811 (Output_data_got::add_global_tls_with_rel): Removed.
12812 (Output_data_got::add_global_tls_with_rela): Removed.
12813 (Output_data_got::add_local_tls): Removed.
12814 (Output_data_got::add_local_tls_with_rel): Removed.
12815 (Output_data_got::add_local_tls_with_rela): Removed.
12816 * resolve.cc (Symbol::override_base_with_special): Removed
12817 reference to has_got_offset_ field.
12818 * symtab.cc (Symbol::init_fields): Replaced initialization
12819 of got_offset_ with got_offsets_. Removed initialization
12820 of has_got_offset_
53fcba31 12821 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
12822 (Symbol::got_offset): Likewise.
12823 (Symbol::set_got_offset): Likewise.
12824 (Symbol::has_tls_got_offset): Removed.
12825 (Symbol::tls_got_offset): Removed.
12826 (Symbol::set_tls_got_offset): Removed.
12827 (Symbol::got_offset_): Removed.
12828 (Symbol::tls_mod_got_offset_): Removed.
12829 (Symbol::tls_pair_got_offset_): Removed.
12830 (Symbol::got_offsets_): New field.
12831 (Symbol::has_got_offset): Removed.
12832 (Symbol::has_tls_mod_got_offset): Removed.
12833 (Symbol::has_tls_pair_got_offset): Removed.
12834 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12835 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12836 member functions.
12837 (Target_x86_64::Scan::global): Likewise.
12838 (Target_x86_64::Relocate::relocate): Likewise.
12839 (Target_x86_64::Relocate::relocate_tls): Likewise.
12840
bd52eafb
BE
128412008-03-25 Ben Elliston <bje@au.ibm.com>
12842
12843 * yyscript.y: Fix spelling error in comment.
12844
8b105e34
ILT
128452008-03-24 Ian Lance Taylor <iant@google.com>
12846
8ed814a9
ILT
12847 * options.h (class General_options): Define build_id option.
12848 * layout.h (class Layout): Declare write_build_id, create_note,
12849 create_build_id. Add build_id_note_ member.
12850 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12851 "libiberty.h", "md5.h", "sha1.h".
12852 (Layout::Layout): Initialize eh_frame_data_,
12853 eh_frame_hdr_section_, and build_id_note_.
12854 (Layout::finalize): Call create_build_id.
12855 (Layout::create_note): New function, broken out of
12856 Layout::create_gold_note.
12857 (Layout::create_gold_note): Call create_note.
12858 (Layout::create_build_id): New function.
12859 (Layout::write_build_id): New function.
12860 (Close_task_runner::run): Call write_build_id.
12861
8b105e34
ILT
12862 * x86_64.cc: Correct license to GPLv3.
12863
086a1841
ILT
128642008-03-23 Ian Lance Taylor <iant@google.com>
12865
12866 * options.cc: Include "demangle.h".
12867 (parse_optional_string): New function.
12868 (parse_long_option): Handle takes_optional_argument.
12869 (parse_short_option): Update dash_z initializer. Handle
12870 takes_optional_argument.
12871 (General_options::General_options): Initialize do_demangle_.
12872 (General_options::finalize): Set do_demangle_. Handle demangling
12873 style.
12874 * options.h (parse_optional_string): Declare.
12875 (struct One_option): Add optional_arg field. Update constructor.
12876 Update call constructor calls. Add takes_optional_argument
12877 function.
12878 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12879 (DEFINE_optional_string): Define.
12880 (General_options::demangle): Change from DEFINE_bool to
12881 DEFINE_optional_string.
12882 (General_options::no_demangle): New function.
12883 (General_options::do_demangle): New function.
12884 (General_options::set_do_demangle): New function.
12885 (General_options::execstack_status_): Move definition to end of
12886 class definition.
12887 (General_options::static_): Likewise.
12888 (General_options::do_demangle_): New field.
12889 * object.cc (big_endian>::get_symbol_location_info): Call
12890 Options::do_demangle, not Options::demangle.
12891 * symtab.cc (demangle): Likewise.
12892
cbb93e63
ILT
128932008-03-22 Ian Lance Taylor <iant@google.com>
12894
12895 * gold.h: Include <cstddef> and <sys/types.h>
12896 * options.h: Include <cstring>.
12897
ec531623
ILT
128982008-03-21 Ian Lance Taylor <iant@google.com>
12899
12900 * Added source code to GNU binutils.
This page took 0.777096 seconds and 4 git commands to generate.