gold/
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2012-06-06 Cary Coutant <ccoutant@google.com>
2
3 * configure.ac: Add check for fallocate.
4 * configure: Regenerate.
5 * config.in: Regenerate.
6
7 * options.h (class General_options): Add --mmap-output-file and
8 --posix-fallocate options.
9 * output.cc: (posix_fallocate): Remove; replace with...
10 (gold_fallocate): New function.
11 (Output_file::map_no_anonymous): Call gold_fallocate.
12 (Output_file::map): Check --mmap-output-file option.
13
14 2012-06-05 Jing Yu <jingyu@google.com>
15
16 * gold.h (textdomain): Add do {} to empty while(0).
17 (bindtextdomain): Likewise.
18
19 2012-06-04 Cary Coutant <ccoutant@google.com>
20
21 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
22 has_dynsym_index.
23
24 2012-05-25 Sriraman Tallam <tmsriram@google.com>
25
26 * symtab.cc (Symbol_table::define_special_symbol):
27 Initialize *poldsym to prevent uninitialized variable errors.
28
29 2012-05-23 Cary Coutant <ccoutant@google.com>
30
31 * layout.cc (Layout::section_name_mapping): Add rules to handle
32 exact match on .data.rel.ro.local or .data.rel.ro.
33 (Layout::output_section_name): Check for exact matches.
34
35 2012-05-23 Cary Coutant <ccoutant@google.com>
36
37 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
38 more carefully.
39
40 2012-05-22 Cary Coutant <ccoutant@google.com>
41
42 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
43 object before exporting symbol.
44
45 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
46
47 * testsuite/tls_test.cc: Include "config.h" first.
48 * testsuite/tls_test_c.c: Likewise.
49
50 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
51 Nick Clifton <nickc@redhat.com>
52
53 PR 14072
54 * configure.in: Add check that sysdep.h has been included before
55 any system header files.
56 * configure: Regenerate.
57 * config.in: Regenerate.
58
59 2012-05-14 Cary Coutant <ccoutant@google.com>
60
61 * layout.cc (Layout::make_output_section): Mark .tdata section
62 as RELRO.
63 * testsuite/relro_test.cc: Add a TLS variable.
64
65 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
66
67 PR gold/14091
68 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
69 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
70 R_X86_64_64.
71
72 2012-05-08 Cary Coutant <ccoutant@google.com>
73
74 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
75 (lines_only_debug_sections): Likewise.
76
77 2012-05-02 Roland McGrath <mcgrathr@google.com>
78
79 * nacl.cc: New file.
80 * nacl.h: New file.
81 * Makefile.am (CCFILES, HFILES): Add them.
82 * Makefile.in: Regenerate.
83 * i386.cc (Output_data_plt_i386_nacl): New class.
84 (Output_data_plt_i386_nacl_exec): New class.
85 (Output_data_plt_i386_nacl_dyn): New class.
86 (Target_i386_nacl): New class.
87 (Target_selector_i386_nacl): New class.
88 (target_selector_i386): Use it instead of Target_selector_i386.
89 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
90 (Target_x86_64_nacl): New class.
91 (Target_selector_x86_64_nacl): New class.
92 (target_selector_x86_64, target_selector_x32): Use it instead of
93 Target_selector_x86_64.
94 * arm.cc (Output_data_plt_arm_nacl): New class.
95 (Target_arm_nacl): New class.
96 (Target_selector_arm_nacl): New class.
97 (target_selector_arm, target_selector_armbe): Use it instead of
98 Target_selector_arm.
99
100 * target-select.cc (select_target): Take new Input_file* and off_t
101 arguments, pass them on to recognize method of selector.
102 * object.cc (make_elf_sized_object): Update caller.
103 * parameters.cc (parameters_force_valid_target): Likewise.
104 * incremental.cc (make_sized_incremental_binary): Likewise.
105 * target-select.h: Update decl.
106 (Target_selector::recognize): Take new Input_file* argument,
107 pass it on to do_recognize.
108 (Target_selector::do_recognize): Take new Input_file* argument.
109 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
110 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
111 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
112 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
113
114 * target.h (Target::Target_info): New members isolate_execinstr
115 and rosegment_gap.
116 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
117 * arm.cc (Target_arm::arm_info): Update initializer.
118 * i386.cc (Target_i386::i386_info): Likewise.
119 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
120 * sparc.cc (Target_sparc::sparc_info): Likewise.
121 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
122 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
123 * layout.cc (Layout::attach_allocated_section_to_segment):
124 Take new const Target* argument. If target->isolate_execinstr(), act
125 like --rosegment.
126 (Layout::find_first_load_seg): Take new const Target* argument;
127 if target->isolate_execinstr(), reject PF_X segments.
128 (Layout::relaxation_loop_body): Update caller.
129 (Layout::set_segment_offsets): If target->isolate_execinstr(),
130 reset file offset to zero when we hit LOAD_SEG, and then do a second
131 loop over the segments before LOAD_SEG to reassign offsets after
132 addresses have been determined. Handle target->rosegment_gap().
133 (Layout::attach_section_to_segment): Take new const Target* argument;
134 pass it to attach_allocated_section_to_segment.
135 (Layout::make_output_section): Update caller.
136 (Layout::attach_sections_to_segments): Take new const Target* argument;
137 pass it to attach_section_to_segment.
138 * gold.cc (queue_middle_tasks): Update caller.
139 * layout.h (Layout): Update method decls with new arguments.
140
141 * arm.cc (Target_arm::Target_arm): Take optional argument for the
142 Target_info pointer to use.
143 (Target_arm::do_make_data_plt): New virtual method.
144 (Target_arm::make_data_plt): New method that calls it.
145 (Target_arm::make_plt_entry): Use it.
146 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
147 for the section alignment.
148 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
149 method.
150 (Output_data_plt_arm::first_plt_entry_offset): Call it.
151 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
152 method.
153 (Output_data_plt_arm::get_plt_entry_size): Call it.
154 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
155 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
156 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
157 method.
158 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
159 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
160 method instead of sizeof(plt_entry).
161 (Output_data_plt_arm::add_entry): Likewise.
162 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
163 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
164 than static method.
165 (Target_arm::plt_entry_size): Likewise.
166 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
167 Move to ...
168 (Output_data_plt_arm_standard): ... here, new class.
169 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
170 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
171 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
172
173 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
174 Take additional argument for the PLT entry size.
175 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
176 Use get_plt_entry_size method rather than plt_entry_size variable.
177 (Output_data_plt_x86_64::reserve_slot): Likewise.
178 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
179 (Output_data_plt_x86_64::add_entry): Likewise.
180 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
181 (Output_data_plt_x86_64::address_for_global): Likewise.
182 (Output_data_plt_x86_64::address_for_local): Likewise.
183 (Output_data_plt_x86_64::set_final_data_size): Likewise.
184 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
185 Make method non-static.
186 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
187 method.
188 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
189 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
190 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
191 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
192 virtual method.
193 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
194 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
195 virtual method.
196 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
197 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
198 virtual method.
199 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
200 (Output_data_plt_x86_64::plt_entry_size)
201 (Output_data_plt_x86_64::first_plt_entry)
202 (Output_data_plt_x86_64::plt_entry)
203 (Output_data_plt_x86_64::tlsdesc_plt_entry)
204 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
205 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
206 (Output_data_plt_x86_64_standard): ... here, new class.
207 (Target_x86_64::Target_x86_64): Take optional argument for the
208 Target_info pointer to use.
209 (Target_x86_64::do_make_data_plt): New virtual method.
210 (Target_x86_64::make_data_plt): New method to call it.
211 (Target_x86_64::init_got_plt_for_update): Use that.
212 Call this->plt_->add_eh_frame method here.
213 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
214 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
215 rather than static method.
216 (Target_x86_64::plt_entry_size): Likewise.
217 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
218 rather than plt_entry_size variable. Move guts of PLT filling to...
219 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
220 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
221 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
222
223 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
224 additional argument for the section alignment.
225 Don't do add_eh_frame_for_plt here.
226 (Output_data_plt_i386::first_plt_entry_offset): Make the method
227 non-static. Use get_plt_entry_size method rather than plt_entry_size
228 variable.
229 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
230 method.
231 (Output_data_plt_i386::get_plt_entry_size): Call it.
232 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
233 (Output_data_plt_i386::add_eh_frame): New method to call it.
234 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
235 method.
236 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
237 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
238 method.
239 (Output_data_plt_i386::fill_plt_entry): New method to call it.
240 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
241 method instead of plt_entry_size.
242 (Output_data_plt_i386::plt_entry_size)
243 (Output_data_plt_i386::plt_eh_frame_fde_size)
244 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
245 (Output_data_plt_i386_standard): ... here, new class.
246 (Output_data_plt_i386_exec): New class.
247 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
248 (Output_data_plt_i386_exec::first_plt_entry): ... here.
249 (Output_data_plt_i386::exec_plt_entry): Move to ...
250 (Output_data_plt_i386_exec::plt_entry): ... here.
251 (Output_data_plt_i386_dyn): New class.
252 (Output_data_plt_i386::first_plt_entry): Move to ...
253 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
254 (Output_data_plt_i386::dyn_plt_entry): Move to ...
255 (Output_data_plt_i386_dyn::plt_entry): ... here.
256 (Target_i386::Target_i386): Take optional argument for the Target_info
257 pointer to use.
258 (Target_i386::do_make_data_plt): New virtual method.
259 (Target_i386::make_data_plt): New method to call it.
260 (Target_i386::make_plt_section): Use that.
261 Call this->plt_->add_eh_frame method here.
262 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
263 rather than plt_entry_size variable.
264 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
265 (Output_data_plt_i386::address_for_local): Likewise.
266 (Output_data_plt_i386::do_write): Likewise.
267 Move guts of PLT filling to...
268 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
269 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
270 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
271 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
272
273 2012-05-01 Cary Coutant <ccoutant@google.com>
274
275 * dwarf_reader.cc (Dwarf_die::read_attributes)
276 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
277 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
278 * reduced_debug_output.cc
279 (Output_reduced_debug_info_section::get_die_end): Remove
280 DW_FORM_GNU_ref_index. Add default case.
281
282 2012-04-26 Mark Wielaard <mjw@redhat.com>
283
284 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
285 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
286 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
287 DW_AT_high_pc as offset from DW_AT_low_pc.
288
289 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
290 * testsuite/Makefile.in: Regenerate.
291 * testsuite/gdb_index_test_3.c: New test source file.
292 * testsuite/gdb_index_test_3.sh: New test source file.
293
294 2012-04-25 Ian Lance Taylor <iant@google.com>
295
296 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
297 pointer.
298 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
299 as a class, not a struct.
300 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
301 (Target_arm::apply_cortex_a8_workaround): Likewise.
302 * gc.h: Declare Reloc_types as a struct, not a class.
303 * object.h: Declare Symbols_data as a struct.
304 * reloc.h: Declare Read_relocs_data as a struct.
305 * target.h: Declare Relocate_info as a struct.
306
307 2012-04-24 David S. Miller <davem@davemloft.net>
308
309 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
310 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
311 and R_SPARC_WPLT30.
312
313 2012-04-24 Cary Coutant <ccoutant@google.com>
314
315 * incremental-dump.cc (find_input_containing_global): Replace
316 magic number with symbolic constant.
317 (dump_incremental_inputs): Update version number.
318 * incremental.cc (Output_section_incremental_inputs): Update version
319 number; import symbolic constants from Incremental_inputs_reader.
320 (Incremental_inputs::create_data_sections): Align relocations
321 section correctly for 64-bit targets.
322 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
323 constants; add padding.
324 (Output_section_incremental_inputs::write_header): Add assert for
325 header_size.
326 (Output_section_incremental_inputs::write_input_files): Add assert
327 for input_entry_size.
328 (Output_section_incremental_inputs::write_info_blocks): Add padding;
329 add assert for object_info_size, input_section_entry_size,
330 global_sym_entry_size.
331 * incremental.h (Incremental_inputs_reader): Add symbolic constants
332 for data structure sizes; use them.
333 (Incremental_input_entry_reader): Import symbolic constants from
334 Incremental_inputs_reader; use them.
335
336 2012-04-23 David S. Miller <davem@davemloft.net>
337
338 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
339 and elf_flags_set_.
340 (Target_sparc::Target_sparc): Initialize new fields.
341 (Target_sparc::do_make_elf_object): New function.
342 (Target_sparc::do_adjust_elf_header): New function.
343
344 2012-04-23 Cary Coutant <ccoutant@google.com>
345
346 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
347 CU range table of gdb index.
348
349 2012-04-20 David S. Miller <davem@davemloft.net>
350
351 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
352 instead of false.
353
354 2012-04-16 David S. Miller <davem@davemloft.net>
355
356 * sparc.cc (Target_sparc::got_address): New function.
357 (Sparc_relocate_functions::gdop_hix22): New function.
358 (Sparc_relocate_functions::gdop_lox10): New function.
359 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
360 relocs.
361 (Target_sparc::Scan::local): Likewise if the global symbol is not
362 preemptible and is not IFUNC.
363 (Target_sparc::Relocate::relocate): Perform GOTDATA code
364 transformations for local and non-preemptible non-IFUNC global
365 symbols.
366
367 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
368 writing out 64-bit part of ranges.
369
370 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
371 -fpic and -fpie respectively.
372 * Makefile.in: Regenerate.
373
374 * sparc.cc (class Target_sparc): Add rela_ifunc_.
375 (Target_sparc::Target_sparc): Initialize new field.
376 (Target_sparc::do_plt_section_for_global): New function.
377 (Target_sparc::do_plt_section_for_local): New function.
378 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
379 (Target_sparc::make_plt_section): New function, broken out of
380 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
381 (Target_sparc::make_plt_entry): Call make_plt_section.
382 (Target_sparc::make_local_ifunc_plt_entry): New function.
383 (Target_sparc::rela_ifunc_section): New function.
384 (Target_sparc::plt_section): Remove const.
385 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
386 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
387 and ifunc_count_ fields.
388 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
389 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
390 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
391 (Output_data_plt_sparc::rela_ifunc): New function.
392 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
393 (Output_data_plt_sparc::has_ifunc_section): New function.
394 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
395 (Output_data_plt_sparc::address_for_global): New function.
396 (Output_data_plt_sparc::address_for_local): New function.
397 (Output_data_plt_sparc::plt_index_to_offset): New function.
398 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
399 and entry_count.
400 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
401 entry_count.
402 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
403 R_SPARC_JMP_IREL to switch.
404 (Target_sparc::Scan::check_non_pic): Likewise.
405 (Target_sparc::Scan::local): Handle IFUNC symbols.
406 (Target_sparc::Scan::local): Likewise.
407 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
408 and plt_address_for_local.
409 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
410 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
411
412 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
413 (class Output_data_reloc): Adjust calls to Output_reloc_type.
414 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
415 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
416 global relocs too.
417 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
418 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
419 calls.
420 * sparc.cc (Target_sparc::Scan::global): Likewise.
421 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
422
423 2012-04-16 Cary Coutant <ccoutant@google.com>
424
425 * archive.cc (Library_base::should_include_member): Check for
426 --export-dynamic-symbol.
427 * options.h (class General_options): Add --export-dynamic-symbol.
428 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
429 --export-dynamic-symbol.
430 (Symbol_table::gc_mark_undef_symbols): Likewise.
431 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
432
433 2012-04-12 David S. Miller <davem@davemloft.net>
434
435 * sparc.cc (Reloc::wdisp10): New relocation method.
436 (Reloc::h34): Likewise.
437 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
438 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
439 R_SPARC_WDISP10.
440 (Target_sparc::Scan::local): Likewise.
441 (Target_sparc::Scan::global): Likewise.
442 (Target_sparc::Relocate::relocate): Likewise.
443
444 2012-04-09 Cary Coutant <ccoutant@google.com>
445
446 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
447 low_pc == 0.
448
449 2012-04-06 Ian Lance Taylor <iant@google.com>
450
451 * timer.cc: #include <unistd.h>.
452
453 2012-04-06 Roland McGrath <mcgrathr@google.com>
454
455 * configure.in (AC_CHECK_HEADERS): Add locale.h.
456 * config.in: Regenerate.
457 * configure: Regenerate.
458
459 2012-04-05 Nick Clifton <nickc@redhat.com>
460
461 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
462 (AM_LC_MESSAGES): Add.
463 * aclocal.m4: Regenerate.
464 * config.in: Regenerate.
465 * configure: Regenerate.
466
467 2012-03-21 Cary Coutant <ccoutant@google.com>
468
469 * Makefile.am: Add gdb-index.cc, gdb-index.h.
470 * Makefile.in: Regenerate.
471 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
472 (Sized_elf_reloc_mapper::symbol_section): New function.
473 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
474 (make_elf_reloc_mapper): New function.
475 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
476 (Dwarf_abbrev_table::do_read_abbrevs): New function.
477 (Dwarf_abbrev_table::do_get_abbrev): New function.
478 (Dwarf_ranges_table::read_ranges_table): New function.
479 (Dwarf_ranges_table::read_range_list): New function.
480 (Dwarf_pubnames_table::read_section): New function.
481 (Dwarf_pubnames_table::read_header): New function.
482 (Dwarf_pubnames_table::next_name): New function.
483 (Dwarf_die::Dwarf_die): New function.
484 (Dwarf_die::read_attributes): New function.
485 (Dwarf_die::skip_attributes): New function.
486 (Dwarf_die::set_name): New function.
487 (Dwarf_die::set_linkage_name): New function.
488 (Dwarf_die::attribute): New function.
489 (Dwarf_die::string_attribute): New function.
490 (Dwarf_die::int_attribute): New function.
491 (Dwarf_die::uint_attribute): New function.
492 (Dwarf_die::ref_attribute): New function.
493 (Dwarf_die::child_offset): New function.
494 (Dwarf_die::sibling_offset): New function.
495 (Dwarf_info_reader::check_buffer): New function.
496 (Dwarf_info_reader::parse): New function.
497 (Dwarf_info_reader::do_parse): New function.
498 (Dwarf_info_reader::do_read_string_table): New function.
499 (Dwarf_info_reader::lookup_reloc): New function.
500 (Dwarf_info_reader::get_string): New function.
501 (Dwarf_info_reader::visit_compilation_unit): New function.
502 (Dwarf_info_reader::visit_type_unit): New function.
503 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
504 Sized_elf_reloc_mapper.
505 (Sized_dwarf_line_info::symbol_section): Remove function.
506 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
507 (Sized_dwarf_line_info::read_line_mappings): Remove object
508 parameter, adjust callers.
509 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
510 * dwarf_reader.h: Include <sys/types.h>.
511 (class Track_relocs): Remove forward declaration.
512 (class Elf_reloc_mapper): New class.
513 (class Sized_elf_reloc_mapper): New class.
514 (class Dwarf_abbrev_table): New class.
515 (class Dwarf_range_list): New class.
516 (class Dwarf_ranges_table): New class.
517 (class Dwarf_pubnames_table): New class.
518 (class Dwarf_die): New class.
519 (class Dwarf_info_reader): New class.
520 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
521 (Sized_dwarf_line_info::symbol_section): Remove member function.
522 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
523 base class.
524 * gdb-index.cc: New source file.
525 * gdb-index.h: New source file.
526 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
527 and .debug_types sections, call Layout::add_to_gdb_index.
528 (Sized_relobj_incr::do_section_name): Implement.
529 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
530 return type; Implement.
531 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
532 return type.
533 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
534 parameter list and return type.
535 (Sized_incr_dynobj::do_section_contents): Likewise.
536 * layout.cc: Include gdb-index.h.
537 (Layout::Layout): Initialize gdb_index_data_.
538 (Layout::init_fixed_output_section): Check for .gdb_index section.
539 (Layout::add_to_gdb_index): New function. Instantiate.
540 * layout.h: Add forward declaration for class Gdb_index.
541 (Layout::add_to_gdb_index): New member function.
542 (Layout::gdb_index_data_): New data member.
543 * main.cc: Include gdb-index.h.
544 (main): Print statistics for gdb index.
545 * object.cc (Object::section_contents): Move code into
546 do_section_contents.
547 (need_decompressed_section): Check for sections needed when building
548 gdb index.
549 (build_compressed_section_map): Likewise.
550 (Sized_relobj_file::do_read_symbols): Need local symbols when building
551 gdb index.
552 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
553 sections; call Layout::add_to_gdb_index.
554 (Sized_relobj_file::do_decompressed_section_contents): Call
555 do_section_contents directly.
556 * object.h (Object::do_section_contents): Adjust parameter list and
557 return type.
558 (Object::do_decompressed_section_contents): Call do_section_contents
559 directly.
560 (Sized_relobj_file::do_section_contents): Adjust parameter list and
561 return type.
562 * options.h (class General_options): Add --gdb-index option.
563 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
564 list and return type.
565 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
566 * reloc.h (Track_relocs::checkpoint): New function.
567 (Track_relocs::reset): New function.
568
569 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
570 New test cases.
571 * testsuite/Makefile.in: Regenerate.
572 * testsuite/gdb_index_test.cc: New test source file.
573 * testsuite/gdb_index_test_1.sh: New test source file.
574 * testsuite/gdb_index_test_2.sh: New test source file.
575
576 2012-03-19 Doug Kwan <dougkwan@google.com>
577
578 * arm.cc (Target_arm::do_define_standard_symbols): New method.
579 (Target_arm::do_finalize_sections): Remove code which defines
580 __exidx_start and __exidx_end. Make symbol table parameter
581 anonymous as it is not used.
582 * gold.cc (queue_middle_tasks): Call target hook to define any
583 target-specific symbols.
584 * target.h (Target::define_standard_symbols): New method.
585 (Target::do_define_standard_symbols): Same.
586 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
587 * testsuite/Makefile.in: Regenerate.
588 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
589 and __exidx_end.
590 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
591 relocations are generated for __exidx_start and __exidx_end.
592
593 2012-03-16 Doug Kwan <dougkwan@google.com>
594
595 * testsuite/Makefile.am: Disable test initpri3b.
596 * testsuite/Makefile.in: Regenerate.
597
598 2012-03-15 Doug Kwan <dougkwan@google.com>
599
600 * arm.cc (Target_arm::got_section): Make .got section read-only
601 if -z now is given.
602
603 2012-03-15 Ian Lance Taylor <iant@google.com>
604
605 PR gold/13850
606 * layout.cc (Layout::make_output_section): Correctly mark
607 SHT_INIT_ARRAY, et. al., as relro.
608
609 2012-03-14 Doug Kwan <dougkwan@google.com>
610
611 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
612 dynamic relocations for protected symbols in shared objects.
613
614 2012-03-13 Ian Lance Taylor <iant@google.com>
615
616 * resolve.cc (Symbol_table::resolve): When merging common symbols,
617 keep the larger alignment.
618
619 2012-03-12 Cary Coutant <ccoutant@google.com>
620
621 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
622 handling of DW_LNE_define_file.
623
624 2012-03-12 Cary Coutant <ccoutant@google.com>
625
626 * reduced_debug_output.cc
627 (Output_reduced_debug_info_section::get_die_end): Add new FORM
628 codes to switch.
629
630 2012-02-29 Cary Coutant <ccoutant@google.com>
631
632 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
633
634 2012-02-29 Cary Coutant <ccoutant@google.com>
635
636 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
637 Call Object::decompressed_section_contents.
638 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
639 New dtor.
640 (Sized_dwarf_line_info::buffer_start_): New data member.
641 * merge.cc (Output_merge_data::do_add_input_section): Call
642 Object::decompressed_section_contents.
643 (Output_merge_string::do_add_input_section): Likewise.
644 * object.cc (need_decompressed_section): New function.
645 (build_compressed_section_map): Decompress sections needed later.
646 (Sized_relobj_file::do_decompressed_section_contents): New function.
647 (Sized_relobj_file::do_discard_decompressed_sections): New function.
648 * object.h (Object::decompressed_section_contents): New function.
649 (Object::discard_decompressed_sections): New function.
650 (Object::do_decompressed_section_contents): New function.
651 (Object::do_discard_decompressed_sections): New function.
652 (Compressed_section_info): New type.
653 (Compressed_section_map): Include decompressed section contents.
654 (Sized_relobj_file::do_decompressed_section_contents): New function.
655 (Sized_relobj_file::do_discard_decompressed_sections): New function.
656
657 2012-02-16 Cary Coutant <ccoutant@google.com>
658
659 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
660 * testsuite/Makefile.in: Regenerate.
661
662 2012-02-14 Cary Coutant <ccoutant@google.com>
663
664 * options.cc (General_options::finalize): Disallow -pie and -static.
665
666 2012-02-03 Doug Kwan <dougkwan@google.com>
667
668 * arm.cc (Arm_relocate_functions::abs8,
669 Arm_relocate_functions::abs16): Use
670 Bits::has_signed_unsigned_overflow32.
671 (Arm_relocate_functions::thm_abs8): Correct range of
672 overflow check.
673 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
674 in assertions.
675
676 2012-02-02 Doug Kwan <dougkwan@google.com>
677
678 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
679 position independent outputs, not just shared objects.
680
681 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
682
683 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
684 * configure: Regenerated.
685
686 2012-01-27 Ian Lance Taylor <iant@google.com>
687
688 * reloc.h (Bits): New class with static functions, copied from
689 namespace utils in arm.cc.
690 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
691 instead.
692
693 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
694
695 * incremental.cc (write_info_blocks): Correct relocation offset.
696
697 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
698
699 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
700 (Relocate::tls_gd_to_le): Likewise.
701
702 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
703
704 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
705
706 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
707
708 * configure.ac: Check if -mcmodel=medium works.
709 * configure: Regenerated.
710
711 2012-01-24 Cary Coutant <ccoutant@google.com>
712
713 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
714 definition and ...
715 (read_unsigned_LEB_128_x): ... this new function.
716 (read_signed_LEB_128): Replaced with inline definition and ...
717 (read_signed_LEB_128_x): ... this new function.
718 * int_encoding.h (read_unsigned_LEB_128_x): New function.
719 (read_unsigned_LEB_128): Add inline definition.
720 (read_signed_LEB_128_x): New function.
721 (read_signed_LEB_128): Add inline definition.
722 * testsuite/Makefile.am (leb128_unittest): New unit test.
723 * testsuite/Makefile.in: Regenerate.
724 * testsuite/leb128_unittest.cc: New unit test.
725
726 2012-01-23 Ian Lance Taylor <iant@google.com>
727
728 PR gold/13617
729 * i386.cc (Target_i386::do_code_fill): When using a jmp
730 instruction, pad with nop instructions.
731 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
732
733 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
734
735 * x86_64.cc (gc_process_relocs): Add typename on types used in
736 template.
737 (scan_relocs): Likewise.
738 (relocate_section): Likewise.
739 (apply_relocation): Likewise.
740
741 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
742
743 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
744 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
745 under x32.
746
747 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
748
749 * x86_64.cc: Initial support for x32.
750
751 2012-01-03 Cary Coutant <ccoutant@google.com>
752
753 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
754 Use abstract base class for GOT.
755 * gold/output.h (class Output_data_got_base): New abstract base class.
756 (class Output_data_got): Derive from new base class, adjust ctors.
757 (Output_data_got::reserve_slot): Make virtual; rename to
758 do_reserve_slot; Adjust callers.
759 * gold/target.h (Sized_target::init_got_plt_for_update): Return
760 pointer to abstract base class.
761 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
762
763 2011-12-18 Ian Lance Taylor <iant@google.com>
764
765 * object.h (Relobj::local_symbol_value): New function.
766 (Relobj::local_plt_offset): New function.
767 (Relobj::local_has_got_offset): New function.
768 (Relobj::local_got_offset): New function.
769 (Relobj::set_local_got_offset): New function.
770 (Relobj::do_local_symbol_value): New pure virtual function.
771 (Relobj::do_local_plt_offset): Likewise.
772 (Relobj::do_local_has_got_offset): Likewise.
773 (Relobj::do_local_got_offset): Likewise.
774 (Relobj::do_set_local_got_offset): Likewise.
775 (Sized_relobj::do_local_has_got_offset): Rename from
776 local_has_got_offset.
777 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
778 (Sized_relobj::do_set_local_got_offset): Rename from
779 set_local_got_offset.
780 (Sized_relobj_file::do_local_plt_offset): Rename from
781 local_plt_offset.
782 (Sized_relobj_file::do_local_symbol_value): New function.
783 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
784 local_plt_offset.
785 * output.cc (Output_data_got::Got_entry::write): Change object to
786 Relobj. Use local_symbol_value.
787 (Output_data_got::add_global_with_rel): Change rel_dyn to
788 Output_data_reloc_generic*. Use add_global_generic.
789 (Output_data_got::add_global_with_rela): Remove. Change all
790 callers to use add_global_with_rel.
791 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
792 Output_data_reloc_generic*. Use add_global_generic.
793 (Output_data_got::add_global_pair_with_rela): Remove. Change all
794 callers to use add_global_pair_with_rel.
795 (Output_data_got::add_local): Change object to Relobj*.
796 (Output_data_got::add_local_plt): Likewise.
797 (Output_data_got::add_local_with_rel): Change object to Relobj*,
798 change rel_dyn to Output_data_reloc_generic*. Use
799 add_local_generic.
800 (Output_data_got::add_local_with_rela): Remove. Change all
801 callers to use all_local_with_rel.
802 (Output_data_got::add_local_pair_with_rel): Change object to
803 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
804 add_output_section_generic.
805 (Output_data_got::add_local_pair_with_rela): Remove. Change all
806 callers to use add_local_pair_with_rel.
807 (Output_data_got::reserve_local): Change object to Relobj*.
808 * output.h: (class Output_data_reloc_generic): Add pure virtual
809 declarations for add_global_generic, add_local_generic,
810 add_output_section_generic.
811 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
812 functions for Output_data_reloc_generic. Update declarations for
813 changes listed in output.cc.
814 (class Output_data_got): Change template parameter to got_size.
815 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
816 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
817 function.
818 (Sized_relobj_incr::do_local_plt_offset): New function.
819 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
820 add_global_generic.
821
822 2011-12-17 Cary Coutant <ccoutant@google.com>
823
824 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
825 * resolve.cc (Symbol_table::resolve): Likewise.
826 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
827 arrays.
828 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
829
830 2011-12-16 Ian Lance Taylor <iant@google.com>
831
832 * output.h (Output_data_reloc_generic::add): Only call
833 add_dynamic_reloc if this is a dynamic reloc section.
834
835 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
836
837 PR gold/13505
838 * target-reloc.h (apply_relocation): Replace <64, false> with
839 <size, big_endian>.
840
841 2011-11-25 Nick Clifton <nickc@redhat.com>
842
843 * po/it.po: New Italian translation.
844
845 2011-11-17 Sterling Augustine <saugustine@google.com>
846
847 * script.cc (script_include_directive): Implement.
848 (read_script_file): New local variables name and search_path. Update
849 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
850 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
851 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
852
853 2011-11-11 Sterling Augustine <saugustine@google.com>
854
855 * yyscript.y (section_cmd): Add support for INCLUDE directive.
856 (file_or_sections_cmd): Likewise.
857
858 2011-11-11 Doug Kwan <dougkwan@google.com>
859
860 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
861 if --just-symbols is given.
862
863 2011-11-10 Doug Kwan <dougkwan@google.com>
864
865 PR gold/13362
866 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
867 when processing data relocs.
868 * reloc.h (Relocate_functions::rel_unaligned): New method.
869 (Relocate_functions::pcrel_unaligned): Ditto.
870 (Relocate_functions::rel32_unaligned): Ditto.
871 (Relocate_functions::pcrel32_unaligned): Ditto.
872
873 2011-11-09 Doug Kwan <dougkwan@google.com>
874
875 PR gold/13362
876 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
877 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
878 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
879 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
880 (Relocate_functions::rel_unaligned): New.
881 (Relocate_functions::rel32_unaligned): New.
882 * target-reloc.h (relocate_for_relocatable): Add code to handle
883 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
884 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
885 arm_unaligned_reloc_r): New targets.
886 * testsuite/Makefile.in: Regenerate.
887 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
888 linking.
889
890 2011-11-02 Ian Lance Taylor <iant@google.com>
891
892 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
893 NATIVE_LINKER.
894 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
895 * options.cc (General_options::finalize): Use library search path
896 from configure script if specified. If not native and no sysroot,
897 only search TOOLLIBDIR.
898 * options.h (Search_directory::Search_directory): Change name to
899 const std::string&.
900 (General_options::add_to_library_path_with_sysroot): Change arg to
901 const std::string&.
902 * configure, Makefile.in, config.in: Rebuild.
903
904 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
905
906 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
907 we are working around the ARM1176 Erratum.
908 * options.h (General_options::fix_arm1176): Add option.
909 * testsuite/Makefile.am: Add testcases, and keep current ones
910 working.
911 * testsuite/Makefile.in: Regenerate.
912 * testsuite/arm_fix_1176.s: New file.
913 * testsuite/arm_fix_1176.sh: Likewise.
914
915 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
916
917 * arm.cc (Target_arm::Target_arm): Remove initialisation of
918 may_use_blx_.
919 (Target_arm::may_use_blx): Remove method.
920 (Target_arm::set_may_use_blx): Likewise.
921 (Target_arm::may_use_v4t_interworking): New method.
922 (Target_arm::may_use_v5t_interworking): Likewise.
923 (Target_arm::may_use_blx_): Remove member variable.
924 (Arm_relocate_functions::arm_branch_common): Check for v5T
925 interworking.
926 (Arm_relocate_functions::thumb_branch_common): Likewise.
927 (Reloc_stub::stub_type_for_reloc): Likewise.
928 (Target_arm::do_finalize_sections): Correct interworking checks.
929 * testsuite/Makefile.am: Add new tests.
930 * testsuite/Makefile.in: Regenerate.
931 * testsuite/arm_farcall_arm_arm.s: New test.
932 * testsuite/arm_farcall_arm_arm.sh: Likewise.
933 * testsuite/arm_farcall_arm_thumb.s: Likewise.
934 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
935 * testsuite/arm_farcall_thumb_arm.s: Likewise.
936 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
937 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
938 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
939
940 2011-10-31 Cary Coutant <ccoutant@google.com>
941
942 PR gold/13023
943 * expression.cc (Expression::eval_with_dot): Add
944 is_section_dot_assignment parameter.
945 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
946 absolute and assigning to dot within a section.
947 * script-sections.cc
948 (Output_section_element_assignment::set_section_addresses): Pass
949 dot_section to set_if_absolute.
950 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
951 as is_section_dot_assignment flag to eval_with_dot.
952 (Output_section_element_dot_assignment::set_section_addresses):
953 Likewise.
954 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
955 parameter. Also set value if relative to dot_section; set the
956 symbol's output_section.
957 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
958 parameter. Adjust all callers.
959 (Expression::eval_maybe_dot): Likewise.
960 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
961 Adjust all callers.
962 * testsuite/script_test_2.t: Test assignment of an absolute value
963 to dot within an output section element.
964
965 2011-10-31 Cary Coutant <ccoutant@google.com>
966
967 * options.h (class General_options): Add --[no-]gnu-unique options.
968 * symtab.cc (Symbol_table::sized_write_globals): Convert
969 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
970
971 2011-10-31 Cary Coutant <ccoutant@google.com>
972
973 PR gold/13359
974 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
975 unnecessary assertion.
976 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
977
978 2011-10-31 Sriraman Tallam <tmsriram@google.com>
979
980 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
981 gc_mark_symbol.
982 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
983 gc_mark_symbol.
984 Change to just keep the section associated with symbol.
985 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
986 they are externally visible and --export-dynamic is turned on.
987 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
988
989 2011-10-19 Ian Lance Taylor <iant@google.com>
990
991 PR gold/13163
992 * script-sections.cc
993 (Output_section_element_dot_assignment::needs_output_section): New
994 function.
995
996 2011-10-19 Ian Lance Taylor <iant@google.com>
997
998 PR gold/13204
999 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1000 --section-start option was seen.
1001 * options.h (General_options::any_section_start): New function.
1002
1003 2011-10-18 David S. Miller <davem@davemloft.net>
1004
1005 PR binutils/13301
1006 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1007 member to track relocation locations that have moved during TLS
1008 reloc optimizations.
1009 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1010 (Target_sparc::Relocate::relocate): Adjust view down by 4
1011 bytes if it matches reloc_adjust_addr_.
1012 (Target_sparc::Relocate::relocate_tls): Always move the
1013 __tls_get_addr call delay slot instruction forward 4 bytes when
1014 performing relaxation.
1015
1016 2011-10-18 Cary Coutant <ccoutant@google.com>
1017
1018 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1019 (Output_file::map_no_anonymous): Check for non-zero
1020 return code from posix_fallocate.
1021
1022 2011-10-17 Cary Coutant <ccoutant@google.com>
1023
1024 PR gold/13245
1025 * plugin.cc (is_visible_from_outside): Check for symbols
1026 referenced from dynamic objects.
1027 * resolve.cc (Symbol_table::resolve): Don't count references
1028 from dynamic objects as references from real ELF files.
1029 * testsuite/plugin_test_2.sh: Adjust expected result.
1030
1031 2011-10-17 Cary Coutant <ccoutant@google.com>
1032
1033 * gold.cc: Include timer.h.
1034 (queue_middle_tasks): Stamp time.
1035 (queue_final_tasks): Likewise.
1036 * main.cc (main): Store timer in parameters. Print timers
1037 for each pass.
1038 * parameters.cc (Parameters::Parameters): Initialize timer_.
1039 (Parameters::set_timer): New function.
1040 (set_parameters_timer): New function.
1041 * parameters.h (Parameters::set_timer): New function.
1042 (Parameters::timer): New function.
1043 (Parameters::timer_): New data member.
1044 (set_parameters_timer): New function.
1045 * timer.cc (Timer::stamp): New function.
1046 (Timer::get_pass_time): New function.
1047 * timer.h (Timer::stamp): New function.
1048 (Timer::get_pass_time): New function.
1049 (Timer::pass_times_): New data member.
1050
1051 2011-10-17 Cary Coutant <ccoutant@google.com>
1052
1053 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1054 task for members of lib groups.
1055
1056 2011-10-17 Cary Coutant <ccoutant@google.com>
1057
1058 PR gold/13288
1059 * fileread.cc (File_read::find_view): Add assert.
1060 (File_read::make_view): Move bounds check (replace with assert)...
1061 (File_read::find_or_make_view): ... to here.
1062
1063 2011-10-12 Cary Coutant <ccoutant@google.com>
1064
1065 * output.cc (Output_file::open_base_file): Handle case where
1066 ::read returns less than requested size.
1067
1068 2011-10-10 Cary Coutant <ccoutant@google.com>
1069
1070 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1071 Initialize defined_count_.
1072 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1073 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1074 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1075 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1076 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1077 * incremental.h (Sized_relobj_incr::defined_count_): New data
1078 member.
1079 (Sized_incr_dynobj::defined_count_): New data member.
1080 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1081 Return zeroes instead of internal error.
1082
1083 2011-10-10 Cary Coutant <ccoutant@google.com>
1084
1085 PR gold/13249
1086 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1087 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1088 * output.h (class Output_reloc): Add use_plt_offset flag.
1089 (Output_reloc::type_): Adjust size of bit field.
1090 (Output_reloc::use_plt_offset_): New bit field.
1091 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1092 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1093 flag. Adjust all callers.
1094 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1095 creating RELATIVE relocations.
1096
1097 2011-10-10 Nick Clifton <nickc@redhat.com>
1098
1099 * po/es.po: Updated Spanish translation.
1100 * po/fi.po: Updated Finnish translation.
1101
1102 2011-10-03 Diego Novillo <dnovillo@google.com>
1103
1104 * options.cc (parse_uint): Fix dereference of RETVAL.
1105
1106 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1107
1108 * layout.h (section_order_map_): New member.
1109 (get_section_order_map): New member function.
1110 * output.cc (Output_section::add_input_section): Check for patterns
1111 only when --section-ordering-file is specified.
1112 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1113 output_sections have been formed.
1114 * layout.cc (Layout_Layout): Initialize section_order_map_.
1115 * plugin.cc (update_section_order): Store order in order_map. Do not
1116 update the order.
1117 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1118 * testsuite/Makefile.in: Regenerate.
1119 * testsuite/plugin_section_order.c: New file.
1120 * testsuite/plugin_final_layout.cc: New file.
1121 * testsuite/plugin_final_layout.sh: New file.
1122
1123 2011-09-29 Cary Coutant <ccoutant@google.com>
1124
1125 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1126 Check for NULL.
1127 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1128 symbols during incremental update.
1129 (Symbol_table::add_from_dynobj): Likewise.
1130
1131 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1132 Ian Lance Taylor <iant@google.com>
1133
1134 * symtab.cc (Symbol_table::define_special_symbol): Always
1135 canonicalize version string.
1136
1137 2011-09-26 Cary Coutant <ccoutant@google.com>
1138
1139 * gold.cc (queue_initial_tasks): Move option checks ...
1140 * options.cc (General_options::finalize): ... to here. Disable
1141 some options; make others fatal.
1142
1143 2011-09-26 Cary Coutant <ccoutant@google.com>
1144
1145 gcc PR lto/47247
1146 * plugin.cc (get_symbols_v2): New function.
1147 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1148 (is_referenced_from_outside): New function.
1149 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1150 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1151 (get_symbols): Pass version parameter.
1152 (get_symbols_v2): New function.
1153 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1154 parameter.
1155 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1156 (onload): Add LDPT_GET_SYMBOLS_V2.
1157 (all_symbols_read_hook): Use get_symbols_v2; check for
1158 LDPR_PREVAILING_DEF_IRONLY_EXP.
1159 * testsuite/plugin_test_3.sh: Update expected results.
1160
1161 2011-09-23 Simon Baldwin <simonb@google.com>
1162
1163 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1164 configuration options.
1165 * configure: Regenerate.
1166 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1167 * Makefile.in: Regenerate.
1168 * testsuite/Makefile.in: Regenerate.
1169
1170 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1171
1172 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1173
1174 2011-09-19 Cary Coutant <ccoutant@google.com>
1175
1176 * incremental.cc (can_incremental_update): Fix typo in comment.
1177 * incremental.h (can_incremental_update): Likewise.
1178
1179 2011-09-18 Cary Coutant <ccoutant@google.com>
1180
1181 * incremental.cc (can_incremental_update): New function.
1182 * incremental.h (can_incremental_update): New function.
1183 * layout.cc (Layout::init_fixed_output_section): Call it.
1184 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1185 * object.cc (Sized_relobj_file::do_layout): Call
1186 can_incremental_update.
1187
1188 2011-09-13 Cary Coutant <ccoutant@google.com>
1189
1190 * configure.ac: Check for glibc support for gnu_indirect_function
1191 support with static linking, setting automake conditional
1192 IFUNC_STATIC.
1193 * Makefile.in: Regenerate.
1194 * configure: Regenerate.
1195
1196 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1197 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1198 for IFUNC_STATIC.
1199 * testsuite/Makefile.in: Regenerate.
1200
1201 2011-09-13 Cary Coutant <ccoutant@google.com>
1202
1203 * incremental.cc (Sized_relobj_incr::do_layout): Call
1204 report_comdat_group for kept comdat sections.
1205 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1206 * testsuite/Makefile.in: Regenerate.
1207 * testsuite/incr_comdat_test_1.cc: New source file.
1208 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1209 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1210 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1211
1212 2011-09-13 Ian Lance Taylor <iant@google.com>
1213
1214 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1215 variable external_symbols_offset.
1216
1217 2011-09-12 Ian Lance Taylor <iant@google.com>
1218
1219 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1220 triggered if object has no symbols.
1221
1222 2011-09-09 David S. Miller <davem@davemloft.net>
1223
1224 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1225 (Output_fill_debug_line::do_write): Likewise.
1226
1227 2011-08-29 Cary Coutant <ccoutant@google.com>
1228
1229 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1230 casts to match formatting specs.
1231 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1232
1233 2011-08-26 Cary Coutant <ccoutant@google.com>
1234
1235 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1236 remaining hole size when allocating.
1237 (Layout::make_output_section): Set fill methods for debug sections.
1238 * layout.h (Free_list::Free_list_node): Move from private to
1239 public.
1240 (Free_list::set_min_hole_size): New function.
1241 (Free_list::begin, Free_list::end): New functions.
1242 (Free_list::min_hole_): New data member.
1243 * output.cc: Include dwarf.h.
1244 (Output_fill_debug_info::do_minimum_hole_size): New function.
1245 (Output_fill_debug_info::do_write): New function.
1246 (Output_fill_debug_line::do_minimum_hole_size): New function.
1247 (Output_fill_debug_line::do_write): New function.
1248 (Output_section::Output_section): Initialize new data member.
1249 (Output_section::set_final_data_size): Ensure patch space is larger
1250 than minimum hole size.
1251 (Output_section::do_write): Fill holes in debug sections.
1252 * output.h (Output_fill): New class.
1253 (Output_fill_debug_info): New class.
1254 (Output_fill_debug_line): New class.
1255 (Output_section::set_free_space_fill): New function.
1256 (Output_section::free_space_fill_): New data member.
1257 * testsuite/Makefile.am (incremental_test_3): Add
1258 --incremental-patch option.
1259 (incremental_test_4): Likewise.
1260 (incremental_test_5): Likewise.
1261 (incremental_test_6): Likewise.
1262 (incremental_copy_test): Likewise.
1263 (incremental_common_test_1): Likewise.
1264 * testsuite/Makefile.in: Regenerate.
1265
1266 2011-08-26 Nick Clifton <nickc@redhat.com>
1267
1268 * po/es.po: Updated Spanish translation.
1269
1270 2011-08-01 Cary Coutant <ccoutant@google.com>
1271
1272 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1273 * gold/testsuite/Makefile.in: Regenerate.
1274 * gold/testsuite/justsyms_exec.c: New source file.
1275 * gold/testsuite/justsyms_lib.c: New source file.
1276
1277 2011-08-01 Cary Coutant <ccoutant@google.com>
1278
1279 * layout.cc (Layout::set_segment_offsets): Don't realign text
1280 segment if -Ttext was specified.
1281 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1282 file type.
1283 * object.h (Sized_relobj_file::e_type): New function.
1284 (Sized_relobj_file::e_type_): New data member.
1285 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1286 base address for ET_EXEC files.
1287 * target.cc (Target::do_make_elf_object_implementation): Allow
1288 ET_EXEC files with --just-symbols option.
1289
1290 2011-07-28 Cary Coutant <ccoutant@google.com>
1291
1292 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1293 Add thread_number parameter.
1294 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1295 * workqueue-threads.cc
1296 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1297 current thread if its thread number is greater than desired thread
1298 count.
1299 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1300 Add thread_number parameter.
1301 (Workqueue::should_cancel_thread): Likewise.
1302 (Workqueue::find_runnable_or_wait): Pass thread_number to
1303 should_cancel_thread.
1304 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1305 parameter.
1306
1307 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1308
1309 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1310 only after checking if it cannot be forced local.
1311 * symtab.h (is_externally_visible): Check if the symbol is not forced
1312 local.
1313
1314 2011-07-15 Ian Lance Taylor <iant@google.com>
1315
1316 * options.h (class General_options): Add --print-output-format.
1317 Move -EL next to -EB, for better --help output.
1318 * target-select.cc: Include <cstdio>, "options.h", and
1319 "parameters.h".
1320 (Target_selector::do_target_bfd_name): New function.
1321 (print_output_format): New function.
1322 * target-select.h (class Target_selector): Update declarations.
1323 (Target_selector::target_bfd_name): New function.
1324 (print_output_format): Declare.
1325 * main.cc: Include "target-select.h".
1326 (main): Handle --print-output-format.
1327 * gold.cc: Include "target-select.h".
1328 (queue_initial_tasks): Handle --print-output-format when there are
1329 no input files.
1330 * parameters.cc (parameters_force_valid_target): Give a better
1331 error message if -EB/-EL does not match target.
1332 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1333 function.
1334
1335 2011-07-15 Ian Lance Taylor <iant@google.com>
1336
1337 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1338 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1339 (Output_data_plt_i386::do_write): Write address of .dynamic
1340 section to first entry in .got.plt section.
1341 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1342 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1343 Initialize layout_.
1344 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1345 section to first entry in .got.plt section.
1346 * layout.h (Layout::dynamic_section): New function.
1347
1348 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1349
1350 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1351 to claim_file call.
1352 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1353 input_section_position_, and input_section_glob_.
1354 (read_layout_from_file): Call function section_ordering_specified.
1355 * layout.h (is_section_ordering_specified): New function.
1356 (section_ordering_specified): New function.
1357 (section_ordering_specified_): New boolean member.
1358 * main.cc(main): Call load_plugins after layout object is defined.
1359 * output.cc (Output_section::add_input_section): Use
1360 function section_ordering_specified to check if section ordering is
1361 needed.
1362 * output.cc (Output_section::add_relaxed_input_section): Use
1363 function section_ordering_specified to check if section ordering is
1364 needed.
1365 (Output_section::update_section_layout): New function.
1366 (Output_section::sort_attached_input_sections): Check if input section
1367 must be reordered.
1368 * output.h (Output_section::update_section_layout): New function.
1369 * plugin.cc (get_section_count): New function.
1370 (get_section_type): New function.
1371 (get_section_name): New function.
1372 (get_section_contents): New function.
1373 (update_section_order): New function.
1374 (allow_section_ordering): New function.
1375 (Plugin::load): Add the new interfaces to the transfer vector.
1376 (Plugin_manager::load_plugins): New parameter.
1377 (Plugin_manager::all_symbols_read): New parameter.
1378 (Plugin_manager::claim_file): New parameter. Save the elf object for
1379 unclaimed objects.
1380 (Plugin_manager::get_elf_object): New function.
1381 (Plugin_manager::get_view): Change to directly use the bool to check
1382 if get_view is called from claim_file_hook.
1383 * plugin.h (input_objects): New function
1384 (Plugin__manager::load_plugins): New parameter.
1385 (Plugin_manager::claim_file): New parameter.
1386 (Plugin_manager::get_elf_object): New function.
1387 (Plugin_manager::in_claim_file_handler): New function.
1388 (Plugin_manager::in_claim_file_handler_): New member.
1389 (layout): New function.
1390 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1391 handler with an extra parameter. Make the elf object before calling
1392 claim_file handler.
1393 * testsuite/plugin_test.c (get_section_count): New function pointer.
1394 (get_section_type): New function pointer.
1395 (get_section_name): New function pointer.
1396 (get_section_contents): New function pointer.
1397 (update_section_order): New function pointer.
1398 (allow_section_ordering): New function pointer.
1399 (onload): Check if the new interfaces exist.
1400
1401 2011-07-13 Ian Lance Taylor <iant@google.com>
1402
1403 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1404 relro section.
1405 * x86_64.cc (Target_x86_64::got_section): Likewise.
1406 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1407 (relro_now_test_SOURCES): New variable.
1408 (relro_now_test_DEPENDENCIES): New variable.
1409 (relro_now_test_LDFLAGS): New variable.
1410 (relro_now_test_LDADD): New variable.
1411 (relro_now_test.so): New target.
1412 * testsuite/Makefile.in: Rebuild.
1413
1414 2011-07-12 Ian Lance Taylor <iant@google.com>
1415
1416 PR gold/12980
1417 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1418 GLOB_DAT relocation rather than a RELATIVE relocation for a
1419 protected symbol when creating a shared library.
1420 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1421 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1422 * testsuite/protected_main_1.cc (main): Test that protected
1423 function has same address.
1424
1425 2011-07-11 Ian Lance Taylor <iant@google.com>
1426
1427 PR gold/12979
1428 * options.h (class General_options): Add -Bgroup.
1429 * options.cc (General_options::finalize): If -Bgroup is set,
1430 default to --unresolved-symbols=report-all.
1431 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1432 * target-reloc.h (issue_undefined_symbol_error): Handle
1433 --unresolved-symbols=report-all.
1434
1435 2011-07-08 Ian Lance Taylor <iant@google.com>
1436
1437 PR gold/11985
1438 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1439 if linker script discards key sections.
1440 (Layout::create_dynamic_symtab): Likewise.
1441 (Layout::assign_local_dynsym_offsets): Likewise.
1442 (Layout::sized_create_version_sections): Likewise.
1443 (Layout::create_interp): Likewise.
1444 (Layout::finish_dynamic_section): Likewise.
1445 (Layout::set_dynamic_symbol_size): Likewise.
1446
1447 2011-07-08 Ian Lance Taylor <iant@google.com>
1448
1449 PR gold/12386
1450 * options.h (class General_options): Add --unresolved-symbols.
1451 * target-reloc.h (issue_undefined_symbol_error): Check
1452 --unresolved-symbols. Add comments.
1453
1454 2011-07-08 Ian Lance Taylor <iant@google.com>
1455
1456 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1457 expression more complex.
1458
1459 2011-07-08 Ian Lance Taylor <iant@google.com>
1460
1461 PR gold/11317
1462 * target-reloc.h (issue_undefined_symbol_error): New inline
1463 function, broken out of relocate_section.
1464 (relocate_section): Call issue_undefined_symbol_error.
1465 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1466 there is no TLS segment if we are about to issue an undefined
1467 symbol error.
1468 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1469
1470 2011-07-08 Ian Lance Taylor <iant@google.com>
1471
1472 PR gold/12279
1473 * resolve.cc (Symbol_table::should_override): Add fromtype
1474 parameter. Change all callers. Give error when linking together
1475 TLS and non-TLS symbol.
1476 (Symbol_table::should_override_with_special): Add fromtype
1477 parameter. Change all callers.
1478 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1479 there is no TLS segment if we have reported some errors.
1480 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1481
1482 2011-07-08 Ian Lance Taylor <iant@google.com>
1483
1484 PR gold/12372
1485 * target.h (Target::plt_address_for_global): New function.
1486 (Target::plt_address_for_local): New function.
1487 (Target::plt_section_for_global): Remove.
1488 (Target::plt_section_for_local): Remove.
1489 (Target::do_plt_address_for_global): New virtual function.
1490 (Target::do_plt_address_for_local): New virtual function.
1491 (Target::do_plt_section_for_global): Remove.
1492 (Target::do_plt_section_for_local): Remove.
1493 (Target::register_global_plt_entry): Add Symbol_table and Layout
1494 parameters.
1495 * output.cc (Output_data_got::Got_entry::write): Use
1496 plt_address_for_global and plt_address_for_local.
1497 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1498 address of output section.
1499 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1500 got_irelative_, and irelative_count_ fields. Update
1501 declarations.
1502 (Output_data_plt_i386::has_irelative_section): New function.
1503 (Output_data_plt_i386::entry_count): Add irelative_count_.
1504 (Output_data_plt_i386::set_final_data_size): Likewise.
1505 (class Target_i386): Add got_irelative_ and rel_irelative_
1506 fields. Update declarations.
1507 (Target_i386::Target_i386): Initialize new fields.
1508 (Target_i386::do_plt_address_for_global): New function replacing
1509 do_plt_section_for_global.
1510 (Target_i386::do_plt_address_for_local): New function replacing
1511 do_plt_section_for_local.
1512 (Target_i386::got_section): Create got_irelative_.
1513 (Target_i386::rel_irelative_section): New function.
1514 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1515 fields. Don't define __rel_iplt_{start,end}.
1516 (Output_data_plt_i386::add_entry): Add symtab and layout
1517 parameters. Change all callers. Use different PLT and GOT for
1518 IFUNC symbols.
1519 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1520 layout parameters. Change all callers. Use different PLT and
1521 GOT.
1522 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1523 (Output_data_plt_i386::rel_irelative): New function.
1524 (Output_data_plt_i386::address_for_global): New function.
1525 (Output_data_plt_i386::address_for_local): New function.
1526 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1527 IRELATIVE GOT when changing IFUNC GOT entries.
1528 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1529 reloc.
1530 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1531 if we didn't create an IRELATIVE GOT.
1532 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1533 plt_address_for_local.
1534 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1535 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1536 got_irelative_, and irelative_count_ fields. Update
1537 declarations.
1538 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1539 Initialize new fields. Remove symtab parameter. Change all
1540 callers.
1541 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1542 irelative_count_.
1543 (Output_data_plt_x86_64::has_irelative_section): New function.
1544 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1545 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1546 fields. Update declarations.
1547 (Target_x86_64::Target_x86_64): Initialize new fields.
1548 (Target_x86_64::do_plt_address_for_global): New function replacing
1549 do_plt_section_for_global.
1550 (Target_x86_64::do_plt_address_for_local): New function replacing
1551 do_plt_section_for_local.
1552 (Target_x86_64::got_section): Create got_irelative_.
1553 (Target_x86_64::rela_irelative_section): New function.
1554 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1555 all callers. Don't create __rel_iplt_{start,end}.
1556 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1557 parameters. Change all callers. Use different PLT and GOT for
1558 IFUNC symbols.
1559 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1560 layout parameters. Change all callers. Use different PLT and
1561 GOT.
1562 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1563 parameters. Change all callers. Use different PLT and GOT for
1564 IFUNC symbols.
1565 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1566 (Output_data_plt_x86_64::rela_irelative): New function.
1567 (Output_data_plt_x86_64::address_for_global): New function.
1568 (Output_data_plt_x86_64::address_for_local): New function.
1569 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1570 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1571 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1572 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1573 parameters.
1574 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1575 reloc.
1576 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1577 symbols if we didn't create an IRELATIVE GOT.
1578 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1579 plt_address_for_local.
1580 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1581 * testsuite/ifuncvar1.c: New test file.
1582 * testsuite/ifuncvar2.c: New test file.
1583 * testsuite/ifuncvar3.c: New test file.
1584 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1585 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1586 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1587 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1588 * testsuite/Makefile.in: Rebuild.
1589
1590 2011-07-07 Cary Coutant <ccoutant@google.com>
1591
1592 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1593 (two_file_test_1_ndebug.o): Likewise.
1594 (two_file_test_1b_ndebug.o): Likewise.
1595 (two_file_test_2_ndebug.o): Likewise.
1596 (two_file_test_main_ndebug.o): Likewise.
1597 (incremental_test_2): Link with no-debug versions.
1598
1599 2011-07-06 Cary Coutant <ccoutant@google.com>
1600
1601 * gold/incremental.cc
1602 (Output_section_incremental_inputs::write_info_blocks): Check for
1603 hidden and internal symbols.
1604
1605 2011-07-06 Cary Coutant <ccoutant@google.com>
1606
1607 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1608 Check disposition for startup file.
1609 (Incremental_inputs::report_command_line): Ignore
1610 --incremental-startup-unchanged option.
1611 * options.cc (General_options::parse_incremental_startup_unchanged):
1612 New function.
1613 (General_options::General_options): Initialize new data member.
1614 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1615 (General_options): Add --incremental-startup-unchanged option.
1616 (General_options::incremental_startup_disposition): New function.
1617 (General_options::incremental_startup_disposition_): New data member.
1618
1619 2011-07-06 Cary Coutant <ccoutant@google.com>
1620
1621 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1622 input file index to Script_info ctor.
1623 (Sized_incremental_binary::do_file_has_changed): Find the
1624 command-line argument for files named in scripts.
1625 * incremental.h (Script_info::Script_info): New ctor
1626 with input file index.
1627 (Script_info::input_file_index): New function.
1628 (Script_info::input_file_index_): New data member.
1629 (Incremental_binary::get_library): Add const.
1630 (Incremental_binary::get_script_info): Add const.
1631 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1632 * testsuite/Makefile.am (incremental_test_5): New test case.
1633 (incremental_test_6): New test case.
1634 * testsuite/Makefile.in: Regenerate.
1635
1636 2011-07-06 Cary Coutant <ccoutant@google.com>
1637
1638 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1639 debug output when command lines differ.
1640
1641 2011-07-06 Cary Coutant <ccoutant@google.com>
1642
1643 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1644 --incremental-patch option.
1645 * layout.cc (Free_list::allocate): Extend allocation beyond original
1646 end if enabled.
1647 (Layout::make_output_section): Mark sections that should get
1648 patch space.
1649 * options.cc (parse_percent): New function.
1650 * options.h (parse_percent): New function.
1651 (DEFINE_percent): New macro.
1652 (General_options): Add --incremental-patch option.
1653 * output.cc (Output_section::Output_section): Initialize new data
1654 members.
1655 (Output_section::add_input_section): Print section name when out
1656 of patch space.
1657 (Output_section::add_output_section_data): Likewise.
1658 (Output_section::set_final_data_size): Add patch space when
1659 doing --incremental-full.
1660 (Output_section::do_reset_address_and_file_offset): Remove patch
1661 space.
1662 (Output_segment::set_section_list_addresses): Print debug output
1663 only if --incremental-update.
1664 * output.h (Output_section::set_is_patch_space_allowed): New function.
1665 (Output_section::is_patch_space_allowed_): New data member.
1666 (Output_section::patch_space_): New data member.
1667 * parameters.cc (Parameters::incremental_full): New function.
1668 * parameters.h (Parameters::incremental_full): New function
1669 * testsuite/Makefile.am (incremental_test_2): Add test for
1670 --incremental-patch option.
1671 * testsuite/Makefile.in: Regenerate.
1672 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1673 (t18): Remove function body.
1674
1675 2011-07-05 Doug Kwan <dougkwan@google.com>
1676
1677 PR gold/12771
1678 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1679 Arm_Address type for relocation result.
1680 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1681 overflow check.
1682 (Arm_relocate_functions::abs32): Use unaligned access.
1683 (Arm_relocate_functions::rel32): Ditto.
1684 (Arm_relocate_functions::prel31): Ditto.
1685 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1686 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1687 static data relocations.
1688 * testsuite/Makefile.in: Regnerate.
1689 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1690
1691 2011-07-05 Ian Lance Taylor <iant@google.com>
1692
1693 PR gold/12392
1694 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1695 symbols if necessary.
1696 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1697
1698 2011-07-05 Ian Lance Taylor <iant@google.com>
1699
1700 PR gold/12952
1701 * resolve.cc (Symbol::override_base_with_special): Simply override
1702 version with special symbol version, ignoring previous version.
1703
1704 2011-07-05 Ian Lance Taylor <iant@google.com>
1705
1706 * object.cc (Sized_relobj_file::include_section_group): Add
1707 information to comment about signature location.
1708
1709 2011-07-02 Ian Lance Taylor <iant@google.com>
1710
1711 PR gold/12957
1712 * options.h (class General_options): Add -f and -F.
1713 * options.cc (General_options::finalize): Fatal error if -f/-F
1714 are used without -shared.
1715 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1716
1717 2011-07-02 Ian Lance Taylor <iant@google.com>
1718
1719 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1720
1721 2011-07-01 Ian Lance Taylor <iant@google.com>
1722
1723 PR gold/12525
1724 PR gold/12952
1725 * resolve.cc (Symbol::override_base_with_special): Don't override
1726 the version if the overriding symbol has a different name.
1727 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1728 all callers. If we give an error about an undefined version,
1729 define the base version if necessary.
1730 * dynobj.h (class Versions): Update declaration.
1731 * testsuite/weak_alias_test_5.cc: New file.
1732 * testsuite/weak_alias_test.script: New file.
1733 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1734 and versioned_alias have the right value, and call t2.
1735 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1736 weak_alias_test_5.so.
1737 (weak_alias_test_LDADD): Likewise.
1738 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1739 * testsuite/Makefile.in: Rebuild.
1740
1741 2011-07-01 Ian Lance Taylor <iant@google.com>
1742
1743 PR gold/12525
1744 * options.h (class General_options): Support -z notext.
1745 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1746 -Wl,-z,notext.
1747 (two_file_shared_nonpic.so): Likewise.
1748 (two_file_shared_mixed.so): Likewise.
1749 (two_file_shared_mixed_1.so): Likewise.
1750 (weak_undef_lib_nonpic.so): Likewise.
1751 (alt/weak_undef_lib_nonpic.so): Likewise.
1752 (tls_test_shared_nonpic.so): Likewise.
1753 * testsuite/Makefile.in: Rebuild.
1754
1755 2011-07-01 Ian Lance Taylor <iant@google.com>
1756
1757 PR gold/12525
1758 * configure.ac: Test whether static linking works, setting
1759 the automake conditional HAVE_STATIC.
1760 * testsuite/Makefile.am: Disable tests using -static if
1761 HAVE_STATIC is not true.
1762 * configure, testsuite/Makefile.in: Rebuild.
1763
1764 2011-07-01 Ian Lance Taylor <iant@google.com>
1765
1766 PR gold/12525
1767 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1768 Assert if we see DW_EH_PE_indirect.
1769 * target.h (Target::ehframe_datarel_base): New function.
1770 (Target::do_ehframe_datarel_base): New target function.
1771 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1772 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1773 function.
1774
1775 2011-07-01 Ian Lance Taylor <iant@google.com>
1776
1777 PR gold/12571
1778 * options.h (class General_options): Add
1779 --ld-generated-unwind-info.
1780 * ehframe.cc (Fde::write): Add address parameter. Change all
1781 callers. If associated with PLT, fill in address and size.
1782 (Cie::set_output_offset): Only add merge mapping if there is an
1783 object.
1784 (Cie::write): Add address parameter. Change all callers.
1785 (Eh_frame::add_ehframe_for_plt): New function.
1786 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1787 input_offset_ fields into union u_, with new plt field.
1788 (Fde::Fde): Adjust for new union field.
1789 (Fde::Fde) [Output_data version]: New constructor.
1790 (Fde::add_mapping): Only add merge mapping if there is an object.
1791 (class Cie): Update declarations.
1792 (class Eh_frame): Declare add_ehframe_for_plt.
1793 * layout.cc (Layout::layout_eh_frame): Break out code into
1794 make_eh_frame_section, and call it.
1795 (Layout::make_eh_frame_section): New function.
1796 (Layout::add_eh_frame_for_plt): New function.
1797 * layout.h (class Layout): Update declarations.
1798 * merge.cc (Merge_map::add_mapping): Add assertion.
1799 * i386.cc: Include "dwarf.h".
1800 (class Output_data_plt_i386): Make first_plt_entry,
1801 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1802 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1803 and plt_eh_frame_fde.
1804 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1805 boundary. Call add_eh_frame_for_plt if appropriate.
1806 * x86_64.cc: Include "dwarf.h".
1807 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1808 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1809 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1810 and plt_eh_frame_fde.
1811 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1812 appropriate.
1813
1814 2011-06-29 Ian Lance Taylor <iant@google.com>
1815
1816 PR gold/12629
1817 * object.cc (Sized_relobj_file::layout_section): Change shdr
1818 parameter to be const.
1819 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1820 out of do_layout.
1821 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1822 appropriate. Call layout_eh_frame_section.
1823 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1824 sections.
1825 * object.h (class Sized_relobj_file): Update declarations.
1826
1827 2011-06-29 Ian Lance Taylor <iant@google.com>
1828
1829 PR gold/12652
1830 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1831 modifier.
1832 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1833
1834 2011-06-29 Ian Lance Taylor <iant@google.com>
1835
1836 PR gold/12675
1837 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1838 SHT_X86_64_UNWIND.
1839 * layout.cc (Layout::layout_eh_frame): Likewise.
1840
1841 2011-06-29 Ian Lance Taylor <iant@google.com>
1842
1843 PR gold/12695
1844 * layout.cc (Layout::symtab_section_shndx): New function.
1845 * layout.h (class Layout): Declare symtab_section_shndx.
1846 * output.cc (Output_section::write_header): Call it.
1847
1848 2011-06-29 Ian Lance Taylor <iant@google.com>
1849
1850 PR gold/12818
1851 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1852 symbols which are not used in a relocation.
1853
1854 2011-06-28 Ian Lance Taylor <iant@google.com>
1855
1856 PR gold/12898
1857 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1858 script create indistinguishable segments.
1859 (Layout::set_segment_offsets): Use stable_sort when sorting
1860 segments. Pass this to Compare_segments constructor.
1861 * layout.h (class Layout): Make segment_precedes non-static.
1862 (class Compare_segments): Change from struct to class. Add
1863 layout_ field. Add constructor.
1864 * script-sections.cc
1865 (Script_sections::attach_sections_using_phdrs_clause): Rename
1866 local orphan to is_orphan. Don't report failure to put empty
1867 section in segment. On attachment failure, report name of
1868 section, and attach to first PT_LOAD segment.
1869
1870 2011-06-28 Ian Lance Taylor <iant@google.com>
1871
1872 PR gold/12934
1873 * target-select.cc (Target_selector::Target_selector): Add
1874 emulation parameter. Change all callers.
1875 (select_target_by_bfd_name): Rename from select_target_by_name.
1876 Change all callers.
1877 (select_target_by_emulation): New function.
1878 (supported_emulation_names): New function.
1879 * target-select.h (class Target_selector): Add emulation_ field.
1880 Update declarations.
1881 (Target_selector::recognize_by_bfd_name): Rename from
1882 recognize_by_name. Change all callers.
1883 (Target_selector::supported_bfd_names): Rename from
1884 supported_names. Change all callers.
1885 (Target_selector::recognize_by_emulation): New function.
1886 (Target_selector::supported_emulations): New function.
1887 (Target_selector::emulation): New function.
1888 (Target_selector::do_recognize_by_bfd_name): Rename from
1889 do_recognize_by_name. Change all callers.
1890 (Target_selector::do_supported_bfd_names): Rename from
1891 do_supported_names. Change all callers.
1892 (Target_selector::do_recognize_by_emulation): New function.
1893 (Target_selector::do_supported_emulations): New function.
1894 (select_target_by_bfd_name): Change name in declaration.
1895 (select_target_by_emulation): Declare.
1896 (supported_emulation_names): Declare.
1897 * parameters.cc (parameters_force_valid_target): Try to find
1898 target based on emulation from -m option.
1899 * options.h (class General_options): Change doc string for -m.
1900 * options.cc (help): Print emulations.
1901 (General_options::parse_V): Likewise.
1902 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1903 Add emulation parameter. Change all callers.
1904
1905 2011-06-28 Ian Lance Taylor <iant@google.com>
1906
1907 * target.h (class Target): Add osabi_ field.
1908 (Target::osabi): New function.
1909 (Target::set_osabi): New function.
1910 (Target::Target): Initialize osabi_.
1911 (Target::do_adjust_elf_header): Make pure virtual.
1912 (Sized_target::do_adjust_elf_header): Declare.
1913 * target.cc (Sized_target::do_adjust_elf_header): New function.
1914 (class Sized_target): Instantiate all versions.
1915 * freebsd.h (class Target_freebsd): Remove.
1916 (Target_selector_freebsd::do_recognize): Call set_osabi on
1917 Target.
1918 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1919 (Target_selector_freebsd::set_osabi): Remove.
1920 * i386.cc (class Target_i386): Inherit from Sized_target rather
1921 than Target_freebsd.
1922 * x86_64.cc (class Target_x86_64): Likewise.
1923
1924 2011-06-28 Ian Lance Taylor <iant@google.com>
1925
1926 * target.h (Target::can_check_for_function_pointers): Rewrite.
1927 Make non-virtual.
1928 (Target::can_icf_inline_merge_sections): Likewise.
1929 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1930 (Target::Target_info): Add can_icf_inline_merge_sections field.
1931 (Target::do_can_check_for_function_pointers): New virtual
1932 function.
1933 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1934 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1935 from can_check_for_function_pointers, move in file.
1936 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1937 section_may_have_icf_unsafe_poineters, move in file.
1938 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1939 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1940 Rename from can_check_for_function_pointers, move in file.
1941 (Target_i386::can_icf_inline_merge_sections): Remove.
1942 (Target_i386::i386_info): Initialize
1943 can_icf_inline_merge_sections.
1944 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1945 Initialize can_icf_inline_merge_sections.
1946 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1947 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1948 Rename from can_check_for_function_pointers, move in file.
1949 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1950 (Target_x86_64::x86_64_info): Initialize
1951 can_icf_inline_merge_sections.
1952 * testsuite/testfile.cc (Target_test::test_target_info):
1953 Likewise.
1954 * icf.cc (get_section_contents): Correct formatting.
1955
1956 2011-06-27 Ian Lance Taylor <iant@google.com>
1957
1958 * symtab.cc (Symbol::versioned_name): New function.
1959 (Symbol_table::add_to_final_symtab): Use versioned_name when
1960 appropriate.
1961 (Symbol_table::sized_write_symbol): Likewise.
1962 * symtab.h (class Symbol): Declare versioned_name.
1963 * stringpool.h (class Stringpool_template): Add variant of add
1964 which takes a std::basic_string.
1965 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1966 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1967 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1968 (ver_test_12.o): New target.
1969 * testsuite/Makefile.in: Rebuild.
1970
1971 2011-06-27 Doug Kwan <dougkwan@google.com>
1972
1973 * arm.cc (Arm_relocate_functions::thm_jump8,
1974 Arm_relocate_functions::thm_jump11): Use a wider signed
1975 type to compute offset.
1976 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1977 arm_thm_jump8.
1978 * testsuite/Makefile.in: Regenerate.
1979 * testsuite/arm_branch_in_range.sh: Check test results of
1980 arm_thm_jump11 and arm_thm_jump8.
1981 * testsuite/arm_thm_jump11.s: New test source file.
1982 * testsuite/arm_thm_jump11.t: New linker script.
1983 * testsuite/arm_thm_jump8.s: New test source file.
1984 * testsuite/arm_thm_jump8.t: New linker script.
1985
1986 2011-06-24 Ian Lance Taylor <iant@google.com>
1987
1988 * layout.cc: Include "object.h".
1989 (ctors_sections_in_init_array): New static variable.
1990 (Layout::is_ctors_in_init_array): New function.
1991 (Layout::layout): Add entry to ctors_sections_in_init_array if
1992 appropriate.
1993 * layout.h (class Layout): Declare is_ctors_in_init_array.
1994 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1995 is_ctors_reverse_view is set.
1996 (Sized_relobj_file::write_sections): Add layout parameter. Change
1997 all callers. Set is_ctors_reverse_view field of View_size.
1998 (Sized_relobj_file::reverse_words): New function.
1999 * object.h (Sized_relobj_file::View_size): Add
2000 is_ctors_reverse_view field.
2001 (class Sized_relobj_file): Update declarations.
2002 * testsuite/initpri3.c: New test.
2003 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2004 initpri3b.
2005 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2006 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2007 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2008 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2009 * testsuite/Makefile.in: Rebuild.
2010
2011 2011-06-24 Cary Coutant <ccoutant@google.com>
2012
2013 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2014 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2015 (debug_msg_cdebug.err): New targets.
2016 * testsuite/Makefile.in: Regenerate.
2017 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2018 Fix checks for link with shared library.
2019
2020 2011-06-24 Doug Kwan <dougkwan@google.com>
2021
2022 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2023 skip empty text sections.
2024 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2025
2026 2011-06-22 Ian Lance Taylor <iant@google.com>
2027
2028 PR gold/12910
2029 * options.h (class General_options): Add --ctors-in-init-array.
2030 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2031 friends as SHT_PROGBITS for merging sections.
2032 (Layout::layout): Remove special handling of .init_array and
2033 friends. Don't sort if doing relocatable link. Sort for .ctors
2034 and .dtors if ctors_in_init_array.
2035 (Layout::make_output_section): Force correct section types for
2036 .init_array and friends. Don't sort if doing relocatable link,
2037 Don't sort .ctors and .dtors if ctors_in_init_array.
2038 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2039 (Layout::output_section_name): Add relobj parameter. Change all
2040 callers. Handle .ctors. and .dtors. in code rather than table.
2041 Handle .ctors and .dtors if ctors_in_init_array.
2042 (Layout::match_file_name): New function, moved from output.cc.
2043 * layout.h (class Layout): Update declarations.
2044 * output.cc: Include "layout.h".
2045 (Input_section_sort_entry::get_priority): New function.
2046 (Input_section_sort_entry::match_file_name): Just call
2047 Layout::match_file_name.
2048 (Output_section::Input_section_sort_init_fini_compare::operator()):
2049 Handle .ctors and .dtors. Sort by explicit priority rather than
2050 by name.
2051 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2052 * testsuite/initpri2.c: New test.
2053 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2054 (check_PROGRAMS): Add initpri2.
2055 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2056 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2057 * configure, testsuite/Makefile.in: Rebuild.
2058
2059 2011-06-19 Ian Lance Taylor <iant@google.com>
2060
2061 PR gold/12880
2062 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2063 .interp section to a PT_INTERP segment even if we have seen a
2064 --dynamic-linker option. Don't do it if we have seen a PHDRS
2065 clause in a linker script.
2066 (Layout::finalize): Don't create a .interp section if we've
2067 already create a PT_INTERP segment.
2068 (Layout::create_interp): Always call choose_output_section (revert
2069 patch of 2011-06-17). Don't create PT_INTERP segment.
2070 * script-sections.cc
2071 (Script_sections::create_note_and_tls_segments): Add a .interp
2072 section to a PT_INTERP segment even if we have seen a
2073 --dynamic-linker option.
2074
2075 2011-06-18 Ian Lance Taylor <iant@google.com>
2076
2077 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2078 merely because a non-PT_LOAD segment has a dynamic reloc.
2079
2080 2011-06-18 Ian Lance Taylor <iant@google.com>
2081
2082 * layout.cc (Layout::finish_dynamic_section): Don't create
2083 DT_FLAGS entry if not needed.
2084
2085 2011-06-18 Ian Lance Taylor <iant@google.com>
2086
2087 PR gold/12745
2088 * layout.cc (Layout::layout_eh_frame): Correct handling of
2089 writable .eh_frame section.
2090
2091 2011-06-17 Ian Lance Taylor <iant@google.com>
2092
2093 PR gold/12893
2094 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2095 symbol is redefined with the exact same object and value.
2096
2097 2011-06-17 Ian Lance Taylor <iant@google.com>
2098
2099 PR gold/12880
2100 * layout.h (class Layout): Add interp_segment_ field.
2101 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2102 (Layout::attach_allocated_section_to_segment): If making shared
2103 library, put .interp section in PT_INTERP segment.
2104 (Layout::finalize): Also call create_interp if -dynamic-linker
2105 option was used.
2106 (Layout::create_interp): Assert that there is no PT_INTERP
2107 segment. If not using a SECTIONS clause, use make_output_section.
2108 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2109 * script-sections.cc
2110 (Script_sections::create_note_and_tls_segments): If making shared
2111 library, put .interp section in PT_INTERP segment.
2112
2113 2011-06-17 Ian Lance Taylor <iant@google.com>
2114
2115 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2116 when making a shared library.
2117
2118 2011-06-17 Ian Lance Taylor <iant@google.com>
2119
2120 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2121 parameter. Change all callers. Don't issue warning about PC32
2122 against locally defined symbol.
2123
2124 2011-06-16 Ian Lance Taylor <iant@google.com>
2125
2126 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2127 occurs in same object.
2128
2129 2011-06-14 Alan Modra <amodra@gmail.com>
2130
2131 * po/POTFILES.in: Regenerate.
2132
2133 2011-06-09 Ian Lance Taylor <iant@google.com>
2134
2135 * script-sections.cc
2136 (Orphan_output_section::set_section_addresses): For a relocatable
2137 link set address to 0.
2138
2139 2011-06-09 Cary Coutant <ccoutant@google.com>
2140
2141 PR gold/12804
2142 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2143 used with --compress-debug-sections.
2144 * gold/object.cc (Sized_relobj_file::do_layout): Report
2145 uncompressed size of compressed input sections.
2146
2147 2011-06-08 Cary Coutant <ccoutant@google.com>
2148
2149 PR gold/12804
2150 * testsuite/two_file_test_2_v1.cc: Change initialization of
2151 v2 to keep it in .data.
2152
2153 2011-06-07 Cary Coutant <ccoutant@google.com>
2154
2155 * common.cc (Symbol_table::do_allocate_commons_list): Call
2156 gold_fallback.
2157 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2158 (Errors::fallback): New function.
2159 (gold_fallback): New function.
2160 * errors.h (Errors::fallback): New function.
2161 * gold.cc (gold_exit): Change status parameter to enum; adjust
2162 all callers.
2163 (queue_initial_tasks): Call gold_fallback.
2164 * gold.h: Include cstdlib.
2165 (Exit_status): New enum type.
2166 (gold_exit): Change status parameter to enum.
2167 (gold_fallback): New function.
2168 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2169 (Layout::create_symtab_sections): Likewise.
2170 (Layout::create_shdrs): Likewise.
2171 * main.cc (main): Adjust call to gold_exit.
2172 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2173 (Output_data_got::add_got_entry_pair): Likewise.
2174 (Output_section::add_input_section): Likewise.
2175 (Output_section::add_output_section_data): Likewise.
2176 (Output_segment::set_section_list_addresses): Likewise.
2177 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2178
2179 2011-06-07 Cary Coutant <ccoutant@google.com>
2180
2181 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2182 for incremental links.
2183 * output.cc (Output_segment::set_section_list_addresses): Remove
2184 FIXME and test for TLS or BSS.
2185
2186 2011-06-07 Cary Coutant <ccoutant@google.com>
2187
2188 * testsuite/Makefile.am: Add incremental_copy_test,
2189 incremental_common_test_1.
2190 * testsuite/Makefile.in: Regenerate.
2191 * testsuite/common_test_1_v1.c: New source file.
2192 * testsuite/common_test_1_v2.c: New source file.
2193 * testsuite/copy_test_v1.cc: New source file.
2194
2195 2011-06-07 Cary Coutant <ccoutant@google.com>
2196
2197 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2198 update, allocate common from bss section's free list.
2199 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2200 linker-defined symbols.
2201 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2202 Skip GOT and PLT entries that are no longer referenced.
2203 (Output_section_incremental_inputs::write_info_blocks): Mark
2204 linker-defined symbols.
2205 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2206 * output.cc (Output_section::allocate): New function.
2207 * output.h (Output_section::allocate): New function.
2208 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2209 linker-defined symbols.
2210 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2211 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2212 (Symbol::init_base_output_data): Likewise.
2213 (Symbol::init_base_output_segment): Likewise.
2214 (Symbol::init_base_constant): Likewise.
2215 (Sized_symbol::init_output_data): Likewise.
2216 (Sized_symbol::init_output_segment): Likewise.
2217 (Sized_symbol::init_constant): Likewise.
2218 (Symbol_table::do_define_in_output_data): Likewise.
2219 (Symbol_table::do_define_in_output_segment): Likewise.
2220 (Symbol_table::do_define_as_constant): Likewise.
2221 * symtab.h (Symbol::is_predefined): New function.
2222 (Symbol::init_base_output_data): Add is_predefined parameter.
2223 (Symbol::init_base_output_segment): Likewise.
2224 (Symbol::init_base_constant): Likewise.
2225 (Symbol::is_predefined_): New data member.
2226 (Sized_symbol::init_output_data): Add is_predefined parameter.
2227 (Sized_symbol::init_output_segment): Likewise.
2228 (Sized_symbol::init_constant): Likewise.
2229 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2230
2231 2011-06-07 Cary Coutant <ccoutant@google.com>
2232
2233 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2234 instead of emit_copy_reloc.
2235 (Copy_relocs::emit_copy_reloc): Refactor.
2236 (Copy_relocs::make_copy_reloc): New function.
2237 (Copy_relocs::add_copy_reloc): Remove.
2238 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2239 section.
2240 (Copy_relocs::make_copy_reloc): New function.
2241 (Copy_relocs::add_copy_reloc): Remove.
2242 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2243 unchanged input files.
2244 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2245 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2246 Reserve BSS space for COPY relocations.
2247 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2248 (Output_section_incremental_inputs::write_info_blocks): Record
2249 whether a symbol is copied from a shared object.
2250 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2251 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2252 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2253 (Incremental_input_entry_reader::get_output_symbol_index): Add
2254 is_copy parameter.
2255 (Incremental_binary::emit_copy_relocs): New function.
2256 (Incremental_binary::do_emit_copy_relocs): New function.
2257 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2258 new data member.
2259 (Sized_incremental_binary::add_copy_reloc): New function.
2260 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2261 (Sized_incremental_binary::Copy_reloc): New struct.
2262 (Sized_incremental_binary::Copy_relocs): New typedef.
2263 (Sized_incremental_binary::copy_relocs_): New data member.
2264 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2265 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2266 * target.h (Sized_target::emit_copy_reloc): New function.
2267 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2268
2269 2011-06-02 Cary Coutant <ccoutant@google.com>
2270
2271 PR gold/12163
2272 * gold/archive.cc (Archive::Archive): Initialize new data member.
2273 (Archive::include_all_members): Return if archive has already been
2274 included.
2275 * gold/archive.h (Archive::include_all_members_): New data member.
2276
2277 2011-06-02 Nick Clifton <nickc@redhat.com>
2278
2279 * dynobj.h: Fix spelling mistake in comment.
2280 * output.cc: Likewise.
2281
2282 2011-05-31 Doug Kwan <dougkwan@google.com>
2283 Asier Llano
2284
2285 PR gold/12826
2286 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2287 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2288 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2289 redundant arm_exidx_test.so.
2290 * testsuite/Makefile.in: Regenerate.
2291 (check_SCRIPTS): Add pr12826.sh
2292 (check_DATA): Add pr12826.stdout
2293 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2294 * testsuite/pr12826.sh: New file.
2295 * testsuite/pr12826_1.s: Ditto.
2296 * testsuite/pr12826_1.s: Ditto.
2297
2298 2011-05-30 Ian Lance Taylor <iant@google.com>
2299
2300 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2301 sections.
2302
2303 2011-05-29 Ian Lance Taylor <iant@google.com>
2304
2305 PR gold/12804
2306 * testsuite/Makefile.am: Use different file name for two_file_test
2307 temporary file for each incremental test.
2308 * testsuite/Makefile.in: Rebuild.
2309
2310 2011-05-29 Ian Lance Taylor <iant@google.com>
2311
2312 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2313 binary input file is empty.
2314
2315 2011-05-27 Ian Lance Taylor <iant@google.com>
2316
2317 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2318 (ver_test_9.so): Likewise.
2319 * testsuite/Makefile.in: Rebuild.
2320
2321 2011-05-26 Cary Coutant <ccoutant@google.com>
2322
2323 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2324 * incremental.cc (Incremental_inputs::report_input_section): Fix
2325 comment, indentation.
2326 (Incremental_inputs::report_comdat_group): New function.
2327 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2328 of data for incremental input file entry.
2329 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2330 group count, COMDAT group signatures.
2331 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2332 an unchanged input file.
2333 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2334 Initialize new data member.
2335 (Incremental_object_entry::add_comdat_group): New function.
2336 (Incremental_object_entry::get_comdat_group_count): New function.
2337 (Incremental_object_entry::get_comdat_signature_key): New function.
2338 (Incremental_object_entry::groups_): New data member.
2339 (Incremental_inputs::report_comdat_group): New function.
2340 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2341 data for incremental input file entry.
2342 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2343 (Incremental_input_entry_reader::get_input_section): Adjust size of
2344 data for incremental input file entry.
2345 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2346 (Incremental_input_entry_reader::get_comdat_group_signature): New
2347 function.
2348 * object.cc (Sized_relobj::include_section_group): Report kept
2349 COMDAT groups for incremental links.
2350
2351 2011-05-24 David Meyer <pdox@google.com>
2352
2353 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2354 with name parameter. Add found_name parameter.
2355 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2356 * dirsearch.h (class Dirsearch): Update declaration.
2357
2358 2011-05-24 Ian Lance Taylor <iant@google.com>
2359
2360 * archive.cc (Library_base::should_include_member): Pull in object
2361 from archive if it defines the entry symbol.
2362 * parameters.cc (Parameters::entry): New function.
2363 * parameters.h (class Parameters): Declare entry.
2364 * output.h (class Output_file_header): Remove entry_ field.
2365 * output.cc (Output_file_header::Output_file_header): Remove entry
2366 parameter. Change all callers.
2367 (Output_file_header::entry): Use parameters->entry.
2368 * gold.cc (queue_middle_tasks): Likewise.
2369 * plugin.cc (Plugin_hook::run): Likewise.
2370
2371 2011-05-24 Cary Coutant <ccoutant@google.com>
2372
2373 * gold.cc (queue_initial_tasks): Pass incremental base filename
2374 to Output_file::open_base_file; don't print error message.
2375 * incremental-dump.cc (main): Adjust call to
2376 Output_file::open_for_modification.
2377 * incremental-dump.cc (main): Likewise.
2378 * incremental.cc (Incremental_inputs::report_command_line):
2379 Ignore --incremental-base option when comparing command lines.
2380 Ignore parameter when given as separate argument.
2381 * options.h (class General_options): Add --incremental-base.
2382 * output.cc (Output_file::Output_file):
2383 (Output_file::open_base_file): Add base_name and writable parameters;
2384 read base file into new file; print error message here.
2385 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2386 callers.
2387 * output.h (Output_file::open_for_modification): Rename to...
2388 (Output_file::open_base_file): ...this; add base_name and
2389 writable parameters; adjust all callers.
2390 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2391 callers.
2392 * testsuite/Makefile.am (incremental_test_4): Test
2393 --incremental-base.
2394 * testsuite/Makefile.in: Regenerate.
2395
2396 2011-05-24 Cary Coutant <ccoutant@google.com>
2397
2398 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2399 incremental_test_4.
2400 * testsuite/Makefile.in: Regenerate.
2401 * testsuite/two_file_test_1_v1.cc: New test source file.
2402 * testsuite/two_file_test_1b_v1.cc: New test source file.
2403 * testsuite/two_file_test_2_v1.cc: New test source file.
2404
2405 2011-05-24 Cary Coutant <ccoutant@google.com>
2406
2407 * dynobj.h (Dynobj::do_dynobj): New function.
2408 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2409 flag and soname for shared objects.
2410 * incremental.cc (Incremental_inputs::report_object): Make
2411 either Incremental_object_entry or Incremental_dynobj_entry; add
2412 soname to string table.
2413 (Incremental_inputs::report_input_section): Add assertion.
2414 (Output_section_incremental_inputs::set_final_data_size): Adjust
2415 type of input file entry for shared libraries; adjust size of
2416 shared library info entry.
2417 (Output_section_incremental_inputs::write_input_files): Write
2418 as_needed flag for shared libraries.
2419 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2420 of input file entry for shared libraries; write soname.
2421 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2422 soname from incremental info.
2423 * incremental.h (enum Incremental_input_flags): Add
2424 INCREMENTAL_INPUT_AS_NEEDED.
2425 (Incremental_input_entry::Incremental_input_entry): Initialize new
2426 data member.
2427 (Incremental_input_entry::set_as_needed): New function.
2428 (Incremental_input_entry::as_needed): New function.
2429 (Incremental_input_entry::do_dynobj_entry): New function.
2430 (Incremental_input_entry::as_needed_): New data member.
2431 (Incremental_object_entry::Incremental_object_entry): Don't check
2432 for shared library.
2433 (Incremental_object_entry::do_type): Likewise.
2434 (class Incremental_dynobj_entry): New class.
2435 (Incremental_input_entry_reader::as_needed): New function.
2436 (Incremental_input_entry_reader::get_soname): New function.
2437 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2438 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2439 size of shared library info entry.
2440 * layout.cc (Layout::finish_dynamic_section): Don't test for
2441 incremental link when adding DT_NEEDED entries.
2442 * object.h (Object::Object): Initialize new data member.
2443 (Object::dynobj): New function.
2444 (Object::set_as_needed): New function.
2445 (Object::as_needed): New function.
2446 (Object::do_dynobj): New function.
2447 (Object::as_needed_): New data member.
2448
2449 2011-05-24 Cary Coutant <ccoutant@google.com>
2450
2451 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2452 info; adjust display of GOT entries.
2453 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2454 vector of input objects; remove file_status_.
2455 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2456 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2457 got_plt reader; call target hooks to reserve GOT entries.
2458 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2459 of input file info header and GOT info entry.
2460 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2461 relocation info.
2462 (Got_plt_view_info::got_descriptor): Remove.
2463 (Got_plt_view_info::sym_index): New data member.
2464 (Got_plt_view_info::input_index): New data member.
2465 (Local_got_offset_visitor::visit): Write input file index.
2466 (Global_got_offset_visitor::visit): Write 0 for input file index.
2467 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2468 with sym_index and input_index.
2469 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2470 incremental info GOT entry; replace got_descriptor with input_index.
2471 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2472 map from input file index to object.
2473 (Sized_relobj_incr::do_layout): Replace direct data member reference
2474 with accessor function.
2475 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2476 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2477 Adjust size of input file info header.
2478 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2479 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2480 (Incremental_input_entry_reader::get_input_section): Adjust size of
2481 input file info header.
2482 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2483 of incremental info GOT entry.
2484 (Incremental_got_plt_reader::get_got_desc): Remove.
2485 (Incremental_got_plt_reader::get_got_symndx): New function.
2486 (Incremental_got_plt_reader::get_got_input_index): New function.
2487 (Sized_incremental_binary::Sized_incremental_binary): Remove
2488 file_status_; add input_objects_.
2489 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2490 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2491 (Sized_incremental_binary::file_is_unchanged): Remove.
2492 (Sized_incremental_binary::set_input_object): New function.
2493 (Sized_incremental_binary::input_object): New function.
2494 (Sized_incremental_binary::file_status_): Remove.
2495 (Sized_incremental_binary::input_objects_): New data member.
2496 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2497 references.
2498 (Sized_relobj_incr::invalid_address): Move to base class.
2499 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2500 class.
2501 (Sized_relobj_incr::do_output_section_offset): Likewise.
2502 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2503 (Sized_relobj_incr::section_offsets_): Likewise.
2504 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2505 function.
2506 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2507 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2508 with accessor function.
2509 (Sized_relobj_file::do_layout): Likewise.
2510 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2511 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2512 (Sized_relobj_file::compute_final_local_value): Replace refs to
2513 section_offsets_ with accessor function.
2514 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2515 * object.h (Relobj::Relobj): Initialize new data members.
2516 (Relobj::add_dyn_reloc): New function.
2517 (Relobj::first_dyn_reloc): New function.
2518 (Relobj::dyn_reloc_count): New function.
2519 (Relobj::first_dyn_reloc_): New data member.
2520 (Relobj::dyn_reloc_count_): New data member.
2521 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2522 references.
2523 (Sized_relobj::Address): New typedef.
2524 (Sized_relobj::invalid_address): Move here from child class.
2525 (Sized_relobj::Sized_relobj): Initialize new data members.
2526 (Sized_relobj::sized_relobj): New function.
2527 (Sized_relobj::is_output_section_offset_invalid): Move here from
2528 child class.
2529 (Sized_relobj::get_output_section_offset): Likewise.
2530 (Sized_relobj::local_has_got_offset): Likewise.
2531 (Sized_relobj::local_got_offset): Likewise.
2532 (Sized_relobj::set_local_got_offset): Likewise.
2533 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2534 (Sized_relobj::clear_got_offsets): New function.
2535 (Sized_relobj::section_offsets): Move here from child class.
2536 (Sized_relobj::do_output_section_offset): Likewise.
2537 (Sized_relobj::do_set_section_offset): Likewise.
2538 (Sized_relobj::Local_got_offsets): Likewise.
2539 (Sized_relobj::local_got_offsets_): Likewise.
2540 (Sized_relobj::section_offsets_): Likewise.
2541 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2542 references.
2543 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2544 class.
2545 (Sized_relobj_file::sized_relobj): New function
2546 (Sized_relobj_file::local_has_got_offset): Move to base class.
2547 (Sized_relobj_file::local_got_offset): Likewise.
2548 (Sized_relobj_file::set_local_got_offset): Likewise.
2549 (Sized_relobj_file::get_output_section_offset): Likewise.
2550 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2551 (Sized_relobj_file::do_output_section_offset): Likewise.
2552 (Sized_relobj_file::do_set_section_offset): Likewise.
2553 (Sized_relobj_file::Local_got_offsets): Likewise.
2554 (Sized_relobj_file::local_got_offsets_): Likewise.
2555 (Sized_relobj_file::section_offsets_): Likewise.
2556 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2557 (all constructors).
2558 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2559 (Output_reloc::get_symbol_index): Likewise.
2560 (Output_reloc::local_section_offset): Likewise.
2561 (Output_reloc::get_address): Likewise.
2562 (Output_reloc::symbol_value): Likewise.
2563 (Output_data_got::reserve_slot): Move to class definition.
2564 (Output_data_got::reserve_local): New function.
2565 (Output_data_got::reserve_slot_for_global): Remove.
2566 (Output_data_got::reserve_global): New function.
2567 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2568 (all constructors, two instantiations).
2569 (Output_reloc::get_relobj): New function (two instantiations).
2570 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2571 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2572 (Output_data_reloc::add_global): Adjust type of relobj.
2573 (Output_data_reloc::add_global_relative): Likewise.
2574 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2575 (Output_data_reloc::add_local): Likewise.
2576 (Output_data_reloc::add_local_relative): Likewise.
2577 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2578 (Output_data_reloc::add_local_section): Likewise.
2579 (Output_data_reloc::add_output_section): Likewise.
2580 (Output_data_reloc::add_absolute): Likewise.
2581 (Output_data_reloc::add_target_specific): Likewise.
2582 (Output_data_got::reserve_slot): Move definition here.
2583 (Output_data_got::reserve_local): New function.
2584 (Output_data_got::reserve_global): New function.
2585 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2586 section_offsets_ with accessor function.
2587 (Sized_relobj_file::write_sections): Likewise.
2588 (Sized_relobj_file::do_relocate_sections): Likewise.
2589 * target.h (Sized_target::reserve_local_got_entry): New function.
2590 (Sized_target::reserve_global_got_entry): New function.
2591 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2592 (Target_x86_64::reserve_global_got_entry): New function.
2593 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2594
2595 2011-05-23 Cary Coutant <ccoutant@google.com>
2596
2597 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2598 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2599 bit when checking got_type.
2600 * incremental.cc (Sized_incremental_binary::setup_readers):
2601 Store symbol table and string table locations; initialize bit vector
2602 of file status flags.
2603 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2604 unchanged files.
2605 (Sized_incremental_binary::do_process_got_plt): New function.
2606 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2607 (Output_section_incremental_inputs::set_final_data_size): Record
2608 file index for each input file.
2609 (Output_section_incremental_inputs::write_got_plt): Store file index
2610 instead of input entry offset for each GOT entry.
2611 * incremental.h
2612 (Incremental_input_entry::Incremental_input_entry): Initialize new
2613 data member.
2614 (Incremental_input_entry::set_offset): Store file index.
2615 (Incremental_input_entry::get_file_index): New function.
2616 (Incremental_input_entry::file_index_): New data member.
2617 (Incremental_binary::process_got_plt): New function.
2618 (Incremental_binary::do_process_got_plt): New function.
2619 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2620 data members.
2621 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2622 (Sized_incremental_binary::set_file_is_unchanged): New function.
2623 (Sized_incremental_binary::file_is_unchanged): New function.
2624 (Sized_incremental_binary::do_process_got_plt): New function.
2625 (Sized_incremental_binary::file_status_): New data member.
2626 (Sized_incremental_binary::main_symtab_loc_): New data member.
2627 (Sized_incremental_binary::main_strtab_loc_): New data member.
2628 * output.cc (Output_data_got::Got_entry::write): Add case
2629 RESERVED_CODE.
2630 (Output_data_got::add_global): Call add_got_entry.
2631 (Output_data_got::add_global_plt): Likewise.
2632 (Output_data_got::add_global_with_rel): Likewise.
2633 (Output_data_got::add_global_with_rela): Likewise.
2634 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2635 (Output_data_got::add_global_pair_with_rela): Likewise.
2636 (Output_data_got::add_local): Call add_got_entry.
2637 (Output_data_got::add_local_plt): Likewise.
2638 (Output_data_got::add_local_with_rel): Likewise.
2639 (Output_data_got::add_local_with_rela): Likewise.
2640 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2641 (Output_data_got::add_local_pair_with_rela): Likewise.
2642 (Output_data_got::reserve_slot): New function.
2643 (Output_data_got::reserve_slot_for_global): New function.
2644 (Output_data_got::add_got_entry): New function.
2645 (Output_data_got::add_got_entry_pair): New function.
2646 (Output_section::add_output_section_data): Edit FIXME.
2647 * output.h
2648 (Output_section_data_build::Output_section_data_build): New
2649 constructor with size parameter.
2650 (Output_data_space::Output_data_space): Likewise.
2651 (Output_data_got::Output_data_got): Initialize new data member; new
2652 constructor with size parameter.
2653 (Output_data_got::add_constant): Call add_got_entry.
2654 (Output_data_got::reserve_slot): New function.
2655 (Output_data_got::reserve_slot_for_global): New function.
2656 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2657 (Output_data_got::add_got_entry): New function.
2658 (Output_data_got::add_got_entry_pair): New function.
2659 (Output_data_got::free_list_): New data member.
2660 * target.h (Sized_target::init_got_plt_for_update): New function.
2661 (Sized_target::register_global_plt_entry): New function.
2662 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2663 Initialize new data member; call init; add constructor with PLT count.
2664 (Output_data_plt_x86_64::init): New function.
2665 (Output_data_plt_x86_64::add_relocation): New function.
2666 (Output_data_plt_x86_64::reserve_slot): New function.
2667 (Output_data_plt_x86_64::free_list_): New data member.
2668 (Target_x86_64::init_got_plt_for_update): New function.
2669 (Target_x86_64::register_global_plt_entry): New function.
2670 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2671 incremental updates.
2672 (Output_data_plt_x86_64::add_relocation): New function.
2673 * testsuite/object_unittest.cc (Object_test): Set default options.
2674
2675 2011-05-16 Ian Lance Taylor <iant@google.com>
2676
2677 * options.h (class General_options): Make -i a synonym for -r.
2678
2679 2011-05-16 Ian Lance Taylor <iant@google.com>
2680
2681 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2682
2683 2011-05-10 Cary Coutant <ccoutant@google.com>
2684
2685 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2686 strip_all (-s).
2687
2688 2011-05-06 Ian Lance Taylor <iant@google.com>
2689
2690 * layout.cc (Layout::layout): If the output section flags change,
2691 update the ordering.
2692
2693 2011-04-25 Cary Coutant <ccoutant@google.com>
2694
2695 * incremental-dump.cc (dump_incremental_inputs): Print local
2696 symbol info for each input file.
2697 * incremental.cc
2698 (Output_section_incremental_inputs::set_final_data_size): Add local
2699 symbol info to input file entries in incremental info.
2700 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2701 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2702 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2703 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2704 implementation.
2705 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2706 (Sized_incr_relobj::do_relocate): Write the local symbols.
2707 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2708 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2709 Adjust size of input file header.
2710 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2711 (Incremental_inputs_reader::get_local_symbol_count): New function.
2712 (Incremental_inputs_reader::get_input_section): Adjust size of input
2713 file header.
2714 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2715 (Sized_incr_relobj::This): New typedef.
2716 (Sized_incr_relobj::sym_size): New const data member.
2717 (Sized_incr_relobj::Local_symbol): New struct.
2718 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2719 (Sized_incr_relobj::do_local_symbol_offset): New function.
2720 (Sized_incr_relobj::local_symbol_count_): New data member.
2721 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2722 (Sized_incr_relobj::local_symbol_index_): New data member.
2723 (Sized_incr_relobj::local_symbol_offset_): New data member.
2724 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2725 (Sized_incr_relobj::local_symbols_): New data member.
2726 * object.h (Relobj::output_local_symbol_count): New function.
2727 (Relobj::local_symbol_offset): New function.
2728 (Relobj::do_output_local_symbol_count): New function.
2729 (Relobj::do_local_symbol_offset): New function.
2730 (Sized_relobj::do_output_local_symbol_count): New function.
2731 (Sized_relobj::do_local_symbol_offset): New function.
2732
2733 2011-04-22 Vladimir Simonov <sv@sw.ru>
2734
2735 * descriptors.cc (set_close_on_exec): New function.
2736 (Descriptors::open): Use set_close_on_exec.
2737 * output.cc (S_ISLNK): Define if not defined.
2738
2739 2011-04-22 Cary Coutant <ccoutant@google.com>
2740
2741 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2742 global symbol map.
2743 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2744 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2745 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2746 relocations.
2747 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2748 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2749 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2750 * incremental.h
2751 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2752 function.
2753 (Incremental_binary::apply_incremental_relocs): New function.
2754 (Incremental_binary::do_apply_incremental_relocs): New function.
2755 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2756 data member.
2757 (Sized_incremental_binary::add_global_symbol): New function.
2758 (Sized_incremental_binary::global_symbol): New function.
2759 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2760 (Sized_incremental_binary::symbol_map_): New data member.
2761 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2762 * target.h (Sized_target::apply_relocation): New function.
2763 * target-reloc.h (apply_relocation): New function.
2764 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2765
2766 2011-04-22 Doug Kwan <dougkwan@google.com>
2767
2768 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2769 flag of a SHT_ARM_EXIDX section.
2770 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2771 * testsuite/Makefile.in: Regenerate.
2772 * testsuite/arm_exidx_test.s: New file.
2773 * testsuite/arm_exidx_test.sh: Same.
2774
2775 2011-04-20 Cary Coutant <ccoutant@google.com>
2776
2777 PR gold/12689
2778 * archive.h (Incremental_archive_entry::Archive_member):
2779 Initialize arg_serial_ (second constructor).
2780
2781 2011-04-17 Ian Lance Taylor <iant@google.com>
2782
2783 * object.cc (Relocate_info::location): Simplify location string.
2784 * errors.cc (Errors::error_at_location): Don't print program
2785 name.
2786 (Errors::warning_at_location): Likewise.
2787 (Errors::undefined_symbol): Likewise.
2788 * testsuite/debug_msg.sh: Update accordingly.
2789
2790 2011-04-14 Cary Coutant <ccoutant@google.com>
2791
2792 * gold/layout.cc (Layout::symtab_section_offset): New function.
2793 * gold/layout.h (Layout::symtab_section_offset): New function.
2794 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2795
2796 2011-04-12 Ian Lance Taylor <iant@google.com>
2797
2798 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2799 with MREMAP_MAYMOVE.
2800 * output.h (class Output_file): Add map_is_allocated_ field.
2801 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2802 not available, provide stubs. If mremap is not available, #define
2803 it to gold_mremap.
2804 (MREMAP_MAYMOVE): Define if not defined.
2805 (Output_file::Output_file): Initialize map_is_allocated_.
2806 (Output_file::resize): Check map_is_allocated_.
2807 (Output_file::map_anonymous): If mmap fails, use malloc.
2808 (Output_file::unmap): Don't do anything for an anonymous map.
2809 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2810 is not available, provide stubs.
2811 (File_read::View::~View): Use free rather than delete[].
2812 (File_read::make_view): Use malloc rather than new[]. If mmap
2813 fails, use malloc.
2814 (File_read::find_or_make_view): Use malloc rather than new[].
2815 * gold.h: Remove HAVE_REMAP code.
2816 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2817 exists. Rename mremap to gold_mremap. If mmap is not available
2818 don't do anything.
2819 * configure, config.in: Rebuild.
2820
2821 2011-04-11 Ian Lance Taylor <iant@google.com>
2822
2823 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2824 initialize local variable v.
2825
2826 2011-04-11 Cary Coutant <ccoutant@google.com>
2827
2828 * archive.cc (Archive::include_member): Adjust call to
2829 report_object.
2830 (Add_archive_symbols::run): Track argument serial numbers.
2831 (Lib_group::include_member): Likewise.
2832 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2833 * archive.h (Incremental_archive_entry::Archive_member):
2834 Initialize arg_serial_.
2835 (Archive_member::arg_serial_): New data member.
2836 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2837 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2838 incremental link.
2839 (Sized_dynobj::do_for_all_local_got_entries): New function.
2840 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2841 function.
2842 * fileread.cc (get_mtime): New function.
2843 * fileread.h (get_mtime): New function.
2844 * gold.cc (queue_initial_tasks): Check for incremental update.
2845 (process_incremental_input): New function.
2846 (queue_middle_tasks): Don't force valid target for incremental
2847 update.
2848 * incremental-dump.cc (find_input_containing_global): Adjust
2849 size of symbol info entry.
2850 (dump_incremental_inputs): Dump argument serial number and
2851 in_system_directory flag; bias shndx by 1; print symbol names
2852 when dumping per-file symbol lists; use new symbol info readers.
2853 * incremental.cc
2854 (Output_section_incremental_inputs:update_data_size): New function.
2855 (Sized_incremental_binary::setup_readers): Setup input readers
2856 for each input file; build maps for files added from libraries
2857 and scripts.
2858 (Sized_incremental_binary::check_input_args): New function.
2859 (Sized_incremental_binary::do_check_inputs): Build map of argument
2860 serial numbers to input arguments.
2861 (Sized_incremental_binary::do_file_has_changed): Rename
2862 do_file_is_unchanged to this; compare file modification times.
2863 (Sized_incremental_binary::do_init_layout): New function.
2864 (Sized_incremental_binary::do_reserve_layout): New function.
2865 (Sized_incremental_binary::do_get_input_reader): Remove.
2866 (Sized_incremental_binary::get_symtab_view): New function.
2867 (Incremental_checker::can_incrementally_link_output_file): Remove.
2868 (Incremental_inputs::report_command_line): Exclude --debug options.
2869 (Incremental_inputs::report_archive_begin): Add parameter; track
2870 argument serial numbers; don't put input file entry for archive
2871 before archive members.
2872 (Incremental_inputs::report_archive_end): Put input file entry
2873 for archive after archive members.
2874 (Incremental_inputs::report_object): Add parameter; track argument
2875 serial numbers and in_system_directory flag.
2876 (Incremental_inputs::report_script): Add parameter; track argument
2877 serial numbers.
2878 (Output_section_incremental_inputs::set_final_data_size): Adjust
2879 size of symbol info entry; check for forwarding symbols.
2880 (Output_section_incremental_inputs::write_input_files): Write
2881 in_system_directory flag and argument serial number.
2882 (Output_section_incremental_inputs::write_info_blocks): Map section
2883 indices between incremental info and original input file; store
2884 input section index for each symbol.
2885 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2886 change operator() to visit().
2887 (class Global_got_offset_visitor): Likewise.
2888 (class Global_symbol_visitor_got_plt):
2889 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2890 classes.
2891 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2892 (Sized_incr_relobj::do_read_symbols): New function.
2893 (Sized_incr_relobj::do_layout): New function.
2894 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2895 (Sized_incr_relobj::do_add_symbols): New function.
2896 (Sized_incr_relobj::do_should_include_member): New function.
2897 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2898 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2899 (Sized_incr_relobj::do_section_size): New function.
2900 (Sized_incr_relobj::do_section_name): New function.
2901 (Sized_incr_relobj::do_section_contents): New function.
2902 (Sized_incr_relobj::do_section_flags): New function.
2903 (Sized_incr_relobj::do_section_entsize): New function.
2904 (Sized_incr_relobj::do_section_address): New function.
2905 (Sized_incr_relobj::do_section_type): New function.
2906 (Sized_incr_relobj::do_section_link): New function.
2907 (Sized_incr_relobj::do_section_info): New function.
2908 (Sized_incr_relobj::do_section_addralign): New function.
2909 (Sized_incr_relobj::do_initialize_xindex): New function.
2910 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2911 (Sized_incr_relobj::do_read_relocs): New function.
2912 (Sized_incr_relobj::do_gc_process_relocs): New function.
2913 (Sized_incr_relobj::do_scan_relocs): New function.
2914 (Sized_incr_relobj::do_count_local_symbols): New function.
2915 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2916 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2917 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2918 (Sized_incr_relobj::do_relocate): New function.
2919 (Sized_incr_relobj::do_set_section_offset): New function.
2920 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2921 (Sized_incr_dynobj::do_read_symbols): New function.
2922 (Sized_incr_dynobj::do_layout): New function.
2923 (Sized_incr_dynobj::do_add_symbols): New function.
2924 (Sized_incr_dynobj::do_should_include_member): New function.
2925 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2926 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2927 (Sized_incr_dynobj::do_section_size): New function.
2928 (Sized_incr_dynobj::do_section_name): New function.
2929 (Sized_incr_dynobj::do_section_contents): New function.
2930 (Sized_incr_dynobj::do_section_flags): New function.
2931 (Sized_incr_dynobj::do_section_entsize): New function.
2932 (Sized_incr_dynobj::do_section_address): New function.
2933 (Sized_incr_dynobj::do_section_type): New function.
2934 (Sized_incr_dynobj::do_section_link): New function.
2935 (Sized_incr_dynobj::do_section_info): New function.
2936 (Sized_incr_dynobj::do_section_addralign): New function.
2937 (Sized_incr_dynobj::do_initialize_xindex): New function.
2938 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2939 (make_sized_incremental_object): New function.
2940 (Incremental_library::copy_unused_symbols): New function.
2941 (Incremental_library::do_for_all_unused_symbols): New function.
2942 * incremental.h (enum Incremental_input_flags): New type.
2943 (class Incremental_checker): Remove.
2944 (Incremental_input_entry::Incremental_input_entry): Add argument
2945 serial number.
2946 (Incremental_input_entry::arg_serial): New function.
2947 (Incremental_input_entry::set_is_in_system_directory): New function.
2948 (Incremental_input_entry::is_in_system_directory): New function.
2949 (Incremental_input_entry::arg_serial_): New data member.
2950 (Incremental_input_entry::is_in_system_directory_): New data member.
2951 (class Script_info): Move here from script.h.
2952 (Script_info::Script_info): Add filename parameter.
2953 (Script_info::filename): New function.
2954 (Script_info::filename_): New data member.
2955 (Incremental_script_entry::Incremental_script_entry): Add argument
2956 serial number.
2957 (Incremental_object_entry::Incremental_object_entry): Likewise.
2958 (Incremental_object_entry::add_input_section): Build list of input
2959 sections with map to original shndx.
2960 (Incremental_object_entry::get_input_section_index): New function.
2961 (Incremental_object_entry::shndx_): New data member.
2962 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2963 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2964 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2965 serial number.
2966 (Incremental_inputs::report_archive_begin): Likewise.
2967 (Incremental_inputs::report_object): Likewise.
2968 (Incremental_inputs::report_script): Likewise.
2969 (class Incremental_global_symbol_reader): New class.
2970 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2971 and store flags and input file type.
2972 (Incremental_input_entry_reader::arg_serial): New function.
2973 (Incremental_input_entry_reader::type): Extract type from flags.
2974 (Incremental_input_entry_reader::is_in_system_directory): New function.
2975 (Incremental_input_entry_reader::get_input_section_count): Call
2976 accessor function for type.
2977 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2978 function for type; adjust size of global symbol entry.
2979 (Incremental_input_entry_reader::get_global_symbol_count): Call
2980 accessor function for type.
2981 (Incremental_input_entry_reader::get_object_count): Likewise.
2982 (Incremental_input_entry_reader::get_object_offset): Likewise.
2983 (Incremental_input_entry_reader::get_member_count): Likewise.
2984 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2985 (Incremental_input_entry_reader::get_member_offset): Likewise.
2986 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2987 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2988 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2989 (Incremental_input_entry_reader::get_global_symbol_reader): New
2990 function.
2991 (Incremental_input_entry_reader::get_output_symbol_index): New
2992 function.
2993 (Incremental_input_entry_reader::type_): Remove.
2994 (Incremental_input_entry_reader::flags_): New data member.
2995 (Incremental_inputs_reader::input_file_offset): New function.
2996 (Incremental_inputs_reader::input_file_index): New function.
2997 (Incremental_inputs_reader::input_file): Call input_file_offset.
2998 (Incremental_inputs_reader::input_file_at_offset): New function.
2999 (Incremental_relocs_reader::get_r_type): Reformat.
3000 (Incremental_relocs_reader::get_r_shndx): Reformat.
3001 (Incremental_relocs_reader::get_r_offset): Reformat.
3002 (Incremental_relocs_reader::data): New function.
3003 (Incremental_binary::Incremental_binary): Initialize new data members.
3004 (Incremental_binary::check_inputs): Add cmdline parameter.
3005 (Incremental_binary::file_is_unchanged): Remove.
3006 (Input_reader::arg_serial): New function.
3007 (Input_reader::get_unused_symbol_count): New function.
3008 (Input_reader::get_unused_symbol): New function.
3009 (Input_reader::do_arg_serial): New function.
3010 (Input_reader::do_get_unused_symbol_count): New function.
3011 (Input_reader::do_get_unused_symbol): New function.
3012 (Incremental_binary::input_file_count): New function.
3013 (Incremental_binary::get_input_reader): Change signature to use
3014 index instead of filename.
3015 (Incremental_binary::file_has_changed): New function.
3016 (Incremental_binary::get_input_argument): New function.
3017 (Incremental_binary::get_library): New function.
3018 (Incremental_binary::get_script_info): New function.
3019 (Incremental_binary::init_layout): New function.
3020 (Incremental_binary::reserve_layout): New function.
3021 (Incremental_binary::output_file): New function.
3022 (Incremental_binary::do_check_inputs): New function.
3023 (Incremental_binary::do_file_is_unchanged): Remove.
3024 (Incremental_binary::do_file_has_changed): New function.
3025 (Incremental_binary::do_init_layout): New function.
3026 (Incremental_binary::do_reserve_layout): New function.
3027 (Incremental_binary::do_input_file_count): New function.
3028 (Incremental_binary::do_get_input_reader): Change signature.
3029 (Incremental_binary::input_args_map_): New data member.
3030 (Incremental_binary::library_map_): New data member.
3031 (Incremental_binary::script_map_): New data member.
3032 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3033 new data members.
3034 (Sized_incremental_binary::output_section): New function.
3035 (Sized_incremental_binary::inputs_reader): Add const.
3036 (Sized_incremental_binary::symtab_reader): Add const.
3037 (Sized_incremental_binary::relocs_reader): Add const.
3038 (Sized_incremental_binary::got_plt_reader): Add const.
3039 (Sized_incremental_binary::get_symtab_view): New function.
3040 (Sized_incremental_binary::Inputs_reader): New typedef.
3041 (Sized_incremental_binary::Input_entry_reader): New typedef.
3042 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3043 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3044 (Sized_incremental_binary::do_file_has_changed): New function.
3045 (Sized_incremental_binary::do_init_layout): New function.
3046 (Sized_incremental_binary::do_reserve_layout): New function.
3047 (Sized_input_reader::Inputs_reader): Remove.
3048 (Sized_input_reader::Input_entry_reader): Remove.
3049 (Sized_input_reader::do_arg_serial): New function.
3050 (Sized_input_reader::do_get_unused_symbol_count): New function.
3051 (Sized_input_reader::do_get_unused_symbol): New function.
3052 (Sized_incremental_binary::do_input_file_count): New function.
3053 (Sized_incremental_binary::do_get_input_reader): Change signature;
3054 use index instead of filename.
3055 (Sized_incremental_binary::section_map_): New data member.
3056 (Sized_incremental_binary::input_entry_readers_): New data member.
3057 (class Sized_incr_relobj): New class.
3058 (class Sized_incr_dynobj): New class.
3059 (make_sized_incremental_object): New function.
3060 (class Incremental_library): New class.
3061 * layout.cc (Free_list::num_lists): New static data member.
3062 (Free_list::num_nodes): New static data member.
3063 (Free_list::num_removes): New static data member.
3064 (Free_list::num_remove_visits): New static data member.
3065 (Free_list::num_allocates): New static data member.
3066 (Free_list::num_allocate_visits): New static data member.
3067 (Free_list::init): New function.
3068 (Free_list::remove): New function.
3069 (Free_list::allocate): New function.
3070 (Free_list::dump): New function.
3071 (Free_list::print_stats): New function.
3072 (Layout_task_runner::run): Resize output file for incremental updates.
3073 (Layout::Layout): Initialize new data members.
3074 (Layout::set_incremental_base): New function.
3075 (Layout::init_fixed_output_section): New function.
3076 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3077 incremental updates.
3078 (Layout::create_gold_note): Do not create gold note section for
3079 incremental updates.
3080 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3081 for incremental updates.
3082 (Layout::set_section_offsets): For incremental updates, allocate space
3083 from free list.
3084 (Layout::create_symtab_sections): Layout with offsets relative to
3085 start of section; for incremental updates, allocate space from free
3086 list.
3087 (Layout::create_shdrs): For incremental updates, allocate space from
3088 free list.
3089 (Layout::finish_dynamic_section): For incremental updates, do not
3090 check --as-needed (fixed in subsequent patch).
3091 * layout.h (class Free_list): New class.
3092 (Layout::set_incremental_base): New function.
3093 (Layout::incremental_base): New function.
3094 (Layout::init_fixed_output_section): New function.
3095 (Layout::allocate): New function.
3096 (Layout::incremental_base_): New data member.
3097 (Layout::free_list_): New data member.
3098 * main.cc (main): Print Free_list statistics.
3099 * object.cc (Relobj::finalize_incremental_relocs): Add
3100 clear_counts parameter; clear counts only when clear_counts is set.
3101 (Sized_relobj::Sized_relobj): Initialize new base class.
3102 (Sized_relobj::do_layout): Don't report special sections.
3103 (Sized_relobj::do_for_all_local_got_entries): New function.
3104 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3105 symtab_off to all symbol table offsets.
3106 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3107 * object.h (class Got_offset_list): Move to top of file.
3108 (Object::Object): Allow case where input_file == NULL.
3109 (Object::~Object): Likewise.
3110 (Object::input_file): Assert that input_file != NULL.
3111 (Object::lock): Allow case where input_file == NULL.
3112 (Object::unlock): Likewise.
3113 (Object::is_locked): Likewise.
3114 (Object::token): Likewise.
3115 (Object::release): Likewise.
3116 (Object::is_incremental): New function.
3117 (Object::get_mtime): New function.
3118 (Object::for_all_local_got_entries): New function.
3119 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3120 (Object::set_is_in_system_directory): New function.
3121 (Object::is_in_system_directory): New function.
3122 (Object::do_is_incremental): New function.
3123 (Object::do_get_mtime): New function.
3124 (Object::do_for_all_local_got_entries): New function.
3125 (Object::is_in_system_directory_): New data member.
3126 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3127 (class Sized_relobj_base): New class.
3128 (class Sized_relobj): Derive from Sized_relobj_base.
3129 (class Sized_relobj::Symbols): Redeclare from base class.
3130 (class Sized_relobj::local_got_offset_list): Remove.
3131 (class Sized_relobj::Output_sections): Redeclare from base class.
3132 (class Sized_relobj::do_for_all_local_got_entries): New function.
3133 (class Sized_relobj::write_local_symbols): Add offset parameter.
3134 (class Sized_relobj::local_symbol_offset_): Update comment.
3135 (class Sized_relobj::local_dynsym_offset_): Update comment.
3136 * options.cc (Input_arguments::add_file): Remove const.
3137 * options.h (Input_file_argument::Input_file_argument):
3138 Initialize arg_serial_ (all constructors).
3139 (Input_file_argument::set_arg_serial): New function.
3140 (Input_file_argument::arg_serial): New function.
3141 (Input_file_argument::arg_serial_): New data member.
3142 (Input_arguments::Input_arguments): Initialize file_count_.
3143 (Input_arguments::add_file): Remove const.
3144 (Input_arguments::number_of_input_files): New function.
3145 (Input_arguments::file_count_): New data member.
3146 (Command_line::number_of_input_files): Call
3147 Input_arguments::number_of_input_files.
3148 * output.cc (Output_segment_headers::Output_segment_headers):
3149 Set current size.
3150 (Output_section::Input_section::current_data_size): New function.
3151 (Output_section::Output_section): Initialize new data members.
3152 (Output_section::add_input_section): Don't do merge sections for
3153 an incremental link; allocate space from free list for an
3154 incremental update.
3155 (Output_section::add_output_section_data): Allocate space from
3156 free list for an incremental update.
3157 (Output_section::update_data_size): New function.
3158 (Output_section::set_fixed_layout): New function.
3159 (Output_section::reserve): New function.
3160 (Output_segment::set_section_addresses): Remove const.
3161 (Output_segment::set_section_list_addresses): Remove const; allocate
3162 space from free list for an incremental update.
3163 (Output_segment::set_offset): Adjust size of RELRO segment for an
3164 incremental update.
3165 * output.h (Output_data::current_data_size): Move here from
3166 child classes.
3167 (Output_data::pre_finalize_data_size): New function.
3168 (Output_data::update_data_size): New function.
3169 (Output_section_headers::update_data_size): new function.
3170 (Output_section_data_build::current_data_size): Move to Output_data.
3171 (Output_data_strtab::update_data_size): New function.
3172 (Output_section::current_data_size): Move to Output_data.
3173 (Output_section::set_fixed_layout): New function.
3174 (Output_section::has_fixed_layout): New function.
3175 (Output_section::reserve): New function.
3176 (Output_section::update_data_size): New function.
3177 (Output_section::has_fixed_layout_): New data member.
3178 (Output_section::free_list_): New data member.
3179 (Output_segment::set_section_addresses): Remove const.
3180 (Output_segment::set_section_list_addresses): Remove const.
3181 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3182 New function.
3183 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3184 New function.
3185 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3186 parameter when calling Add_symbols constructor; store argument
3187 serial number for members of a lib group.
3188 (Add_symbols::locks): Allow case where token == NULL.
3189 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3190 (Read_member::~Read_member): New function.
3191 (Read_member::is_runnable): New function.
3192 (Read_member::locks): New function.
3193 (Read_member::run): New function.
3194 (Check_script::~Check_script): New function.
3195 (Check_script::is_runnable): New function.
3196 (Check_script::locks): New function.
3197 (Check_script::run): New function.
3198 (Check_library::~Check_library): New function.
3199 (Check_library::is_runnable): New function.
3200 (Check_library::locks): New function.
3201 (Check_library::run): New function.
3202 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3203 (Add_symbols::library_): New data member.
3204 (class Read_member): New class.
3205 (class Check_script): New class.
3206 (class Check_library): New class.
3207 * reloc.cc (Read_relocs::is_runnable): Allow case where
3208 token == NULL.
3209 (Read_relocs::locks): Likewise.
3210 (Scan_relocs::locks): Likewise.
3211 (Relocate_task::locks): Likewise.
3212 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3213 to clear counters.
3214 (Sized_relobj::incremental_relocs_scan): Fix comment.
3215 (Sized_relobj::do_relocate): Pass output file offset to
3216 write_local_symbols.
3217 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3218 from class declaration.
3219 * script.cc (read_input_script): Allocate Script_info; pass
3220 argument serial number to report_script.
3221 * script.h (class Script_info): Move to incremental.h.
3222 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3223 * symtab.h (Symbol_table::add_from_incrobj): New function.
3224 (Symbol_table::set_file_offset): New function.
3225
3226 2011-04-05 Cary Coutant <ccoutant@google.com>
3227
3228 * incremental-dump.cc (dump_incremental_inputs): Change signature
3229 to take a Sized_incremental_binary; change caller. Use readers
3230 in Sized_incremental_binary.
3231 * incremental.cc
3232 (Sized_incremental_binary::find_incremental_inputs_sections):
3233 Rename do_find_incremental_inputs_sections to this.
3234 (Sized_incremental_binary::setup_readers): New function.
3235 (Sized_incremental_binary::do_check_inputs): Check
3236 has_incremental_info_ flag; move setup code to setup_readers;
3237 use input readers.
3238 (Sized_incremental_binary::do_file_is_unchanged): New function.
3239 (Sized_incremental_binary::do_get_input_reader): New function.
3240 * incremental.h (class Incremental_binary): Move to end of file.
3241 (Incremental_binary::file_is_unchanged): New function.
3242 (Incremental_binary::do_file_is_unchanged): New function.
3243 (Incremental_binary::Input_reader): New class.
3244 (Incremental_binary::get_input_reader): New function.
3245 (class Sized_incremental_binary): Move to end of file.
3246 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3247 input section reader classes.
3248 (Sized_incremental_binary::has_incremental_info): New function.
3249 (Sized_incremental_binary::inputs_reader): New function.
3250 (Sized_incremental_binary::symtab_reader): New function.
3251 (Sized_incremental_binary::relocs_reader): New function.
3252 (Sized_incremental_binary::got_plt_reader): New function.
3253 (Sized_incremental_binary::do_file_is_unchanged): New function.
3254 (Sized_incremental_binary::Sized_input_reader): New class.
3255 (Sized_incremental_binary::get_input_reader): New function.
3256 (Sized_incremental_binary::find_incremental_inputs_sections):
3257 Rename do_find_incremental_inputs_sections to this.
3258 (Sized_incremental_binary::setup_readers): New function.
3259 (Sized_incremental_binary::has_incremental_info_): New data member.
3260 (Sized_incremental_binary::inputs_reader_): New data member.
3261 (Sized_incremental_binary::symtab_reader_): New data member.
3262 (Sized_incremental_binary::relocs_reader_): New data member.
3263 (Sized_incremental_binary::got_plt_reader_): New data member.
3264 (Sized_incremental_binary::current_input_file_): New data member.
3265
3266 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3267
3268 PR gold/12640
3269 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3270 violation.
3271
3272 2011-03-30 Cary Coutant <ccoutant@google.com>
3273
3274 * archive.cc (Archive::include_member): Adjust call to report_object.
3275 (Add_archive_symbols::run): Add script_info to call to
3276 report_archive_begin.
3277 (Lib_group::include_member): Adjust call to report_object.
3278 (Add_lib_group_symbols::run): Adjust call to report_object.
3279 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3280 blocks. Add object count for script input files.
3281 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3282 script_info parameter; change all callers.
3283 (Incremental_inputs::report_object): Add script_info parameter;
3284 change all callers.
3285 (Incremental_inputs::report_script): Store backpointer to
3286 incremental info entry.
3287 (Output_section_incremental_inputs::set_final_data_size): Record
3288 additional information for scripts.
3289 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3290 * incremental.h (Incremental_script_entry::add_object): New function.
3291 (Incremental_script_entry::get_object_count): New function.
3292 (Incremental_script_entry::get_object): New function.
3293 (Incremental_script_entry::objects_): New data member; adjust
3294 constructor.
3295 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3296 (Incremental_inputs::report_object): Add script_info parameter.
3297 (Incremental_inputs_reader::get_object_count): New function.
3298 (Incremental_inputs_reader::get_object_offset): New function.
3299 * options.cc (Input_arguments::add_file): Return reference to
3300 new input argument.
3301 * options.h (Input_argument::set_script_info): New function.
3302 (Input_argument::script_info): New function.
3303 (Input_argument::script_info_): New data member; adjust all
3304 constructors.
3305 (Input_file_group::add_file): Return reference to new input argument.
3306 (Input_file_lib::add_file): Likewise.
3307 (Input_arguments::add_file): Likewise.
3308 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3309 * script.cc (Parser_closure::Parser_closure): Add script_info
3310 parameter; adjust all callers.
3311 (Parser_closure::script_info): New function.
3312 (Parser_closure::script_info_): New data member.
3313 (read_input_script): Report scripts earlier to incremental info.
3314 (script_add_file): Set script_info in Input_argument.
3315 (script_add_library): Likewise.
3316 * script.h (Script_options::Script_info): Rewrite class.
3317
3318 2011-03-29 Cary Coutant <ccoutant@google.com>
3319
3320 * archive.cc (Library_base::should_include_member): Move
3321 method here from class Archive.
3322 (Archive::Archive): Initialize base class.
3323 (Archive::should_include_member): Move to base class.
3324 (Archive::do_for_all_unused_symbols): New function.
3325 (Add_archive_symbols::run): Remove redundant access to
3326 incremental_inputs.
3327 (Lib_group::Lib_group): Initialize base class.
3328 (Lib_group::do_filename): New function.
3329 (Lib_group::include_member): Pass pointer to Lib_group to
3330 report_object.
3331 (Lib_group::do_for_all_unused_symbols): New function.
3332 (Add_lib_group_symbols::run): Report archive information for
3333 incremental links.
3334 * archive.h (class Library_base): New base class.
3335 (class Archive): Derive from Library_base.
3336 (Archive::filename): Move to base class.
3337 (Archive::set_incremental_info): Likewise.
3338 (Archive::incremental_info): Likewise.
3339 (Archive::Should_include): Likewise.
3340 (Archive::should_include_member): Likewise.
3341 (Archive::Armap_entry): Remove.
3342 (Archive::Unused_symbol_iterator): Remove.
3343 (Archive::unused_symbols_begin): Remove.
3344 (Archive::unused_symbols_end): Remove.
3345 (Archive::do_filename): New function.
3346 (Archive::do_get_mtime): New function.
3347 (Archive::do_for_all_unused_symbols): New function.
3348 (Archive::task_): Move to base class.
3349 (Archive::incremental_info_): Likewise.
3350 (class Lib_group): Derive from Library_base.
3351 (Lib_group::do_filename): New function.
3352 (Lib_group::do_get_mtime): New function.
3353 (Lib_group::do_for_all_unused_symbols): New function.
3354 (Lib_group::task_): Move to base class.
3355 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3356 function.
3357 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3358 function.
3359 * incremental.cc (Incremental_inputs::report_archive_begin):
3360 Use Library_base; call library's get_mtime; add incremental inputs
3361 entry before members.
3362 (class Unused_symbol_visitor): New class.
3363 (Incremental_inputs::report_archive_end): Use Library_base; use
3364 visitor class to record unused symbols; don't add incremental inputs
3365 entry after members.
3366 (Incremental_inputs::report_object): Use Library_base.
3367 * incremental.h
3368 (Incremental_archive_entry::Incremental_archive_entry): Remove
3369 unused Archive parameter.
3370 (Incremental_inputs::report_archive_begin): Use Library_base.
3371 (Incremental_inputs::report_archive_end): Likewise.
3372 (Incremental_inputs::report_object): Likewise.
3373 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3374 function.
3375 * object.h (Object::for_all_global_symbols): New function.
3376 (Object::do_for_all_global_symbols): New function.
3377 (Sized_relobj::do_for_all_global_symbols): New function.
3378 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3379 function.
3380 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3381 function.
3382
3383 2011-03-27 Ian Lance Taylor <iant@google.com>
3384
3385 * archive.cc (Archive::interpret_header): Return -1 if something
3386 goes wrong. Change callers accordingly.
3387
3388 2011-03-25 Cary Coutant <ccoutant@google.com>
3389
3390 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3391 * testsuite/Makefile.in: Regenerate.
3392
3393 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3394
3395 * plugin.cc (get_view): New.
3396 (Plugin::load): Pass get_view to the plugin.
3397 (Plugin_manager::get_view): New.
3398
3399 2011-03-21 Ian Lance Taylor <iant@google.com>
3400
3401 * testsuite/final_layout.sh: Rewrite to not use dc.
3402 * testsuite/relro_test.sh: Fail if dc is not present.
3403
3404 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3405
3406 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3407 Change == to -eq.
3408 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3409 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3410 Change == to -eq.
3411 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3412 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3413
3414 2011-03-14 Ian Lance Taylor <iant@google.com>
3415
3416 * script-sections.cc (Sort_output_sections::script_compare):
3417 Rename from is_before, change return type.
3418 (Sort_output_sections::operator()): Adjust accordingly.
3419
3420 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3421
3422 PR gold/12572
3423 * testsuite/odr_violation2.cc: Add comment to make all error line
3424 numbers double digits.
3425 * testsuite/debug_msg.sh: Adjust expected errors.
3426
3427 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3428
3429 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3430 but mark earlier ones as non-canonical
3431 (offset_to_iterator): Update search target and example
3432 (do_addr2line): Return extra lines in a vector*
3433 (format_file_lineno): Extract from do_addr2line
3434 (one_addr2line): Add vector* out-param
3435 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3436 when a lineno entry appeared last for its instruction
3437 (Dwarf_line_info): Add vector* out-param
3438 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3439 * symtab.cc (Odr_violation_compare): Include the lineno in the
3440 comparison again.
3441 (linenos_from_loc): New. Combine the canonical line for an
3442 address with its other lines.
3443 (True_if_intersect): New. Helper functor to make
3444 std::set_intersection a query.
3445 (detect_odr_violations): Compare sets of lines instead of just
3446 one line for each function. This became less deterministic, but
3447 has fewer false positives.
3448 * symtab.h: Declarations.
3449 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3450 mix an optimized and non-optimized object in the same binary
3451 (odr_violation2.so): Same.
3452 * testsuite/Makefile.in: Regenerate from Makefile.am.
3453 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3454 * testsuite/debug_msg.sh: Update line numbers and add
3455 assertions.
3456 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3457 non-optimized context.
3458 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3459 isn't inlined, and use OdrDerived in an optimized context.
3460 * testsuite/odr_header1.h: Defines OdrDerived, where
3461 optimization will change the
3462 first-instruction-in-the-destructor's file and line number.
3463 * testsuite/odr_header2.h: Defines OdrBase.
3464
3465 2011-03-09 Ian Lance Taylor <iant@google.com>
3466
3467 * fileread.cc (File_read::clear_views): Don't delete the whole
3468 file view.
3469
3470 2011-03-08 Ian Lance Taylor <iant@google.com>
3471
3472 PR gold/12525
3473 * fileread.cc: #include <climits>.
3474 (GOLD_IOV_MAX): Define.
3475 (File_read::read_multiple): Limit number of entries by iov_max.
3476 * fileread.h (class File_read): Always set max_readv_entries to
3477 128.
3478
3479 2011-03-07 Ian Lance Taylor <iant@google.com>
3480
3481 PR gold/12525
3482 * options.h (class General_options): Add -dy and -dn.
3483
3484 2011-03-02 Cary Coutant <ccoutant@google.com>
3485
3486 * testsuite/script_test_9.t: Add TLS segment.
3487
3488 2011-03-02 Simon Baldwin <simonb@google.com>
3489
3490 * configure.ac: Add check for gnu_indirect_function support in
3491 the toolchain building binutils.
3492 * configure: Rebuild.
3493
3494 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3495
3496 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3497 plugin only symbols.
3498 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3499 in plugin files as not needed in the symbol table.
3500
3501 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3502
3503 * output.cc (Output_section::add_input_section): Delay fill
3504 generation for section ordering.
3505
3506 2011-02-09 Ian Lance Taylor <iant@google.com>
3507
3508 PR gold/12316
3509 * object.h (class Sized_relobj): Remove clear_local_symbols.
3510 * reloc.cc (Sized_relobj::do_relocate): Don't call
3511 clear_local_symbols.
3512
3513 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3514
3515 * plugin.cc (is_visible_from_outside): Return true for symbols
3516 in the -u option.
3517
3518 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3519
3520 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3521 filename.
3522
3523 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3524
3525 * icf.h (is_section_foldable_candidate): Change type of parameter
3526 to std::string.
3527 * icf.cc (Icf::find_identical_sections): Change type of local variable
3528 section_name to be std::string.
3529 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3530
3531 2011-01-25 Ian Lance Taylor <iant@google.com>
3532
3533 * script.cc (script_add_extern): Rewrite to use
3534 add_symbol_reference.
3535
3536 2011-01-25 Doug Kwan <dougkwan@google.com>
3537
3538 * icf.cc (get_section_contents): Always lock section's object.
3539
3540 2011-01-24 Ian Lance Taylor <iant@google.com>
3541
3542 * options.h (class General_options): Accept
3543 --no-detect-odr-violations.
3544
3545 2011-01-24 Ian Lance Taylor <iant@google.com>
3546
3547 * version.cc (version_string): Bump to 1.11.
3548
3549 2011-01-24 Ian Lance Taylor <iant@google.com>
3550
3551 * plugin.cc (class Plugin_rescan): Define new class.
3552 (Plugin_manager::claim_file): Set any_claimed_.
3553 (Plugin_manager::save_archive): New function.
3554 (Plugin_manager::save_input_group): New function.
3555 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3556 necessary.
3557 (Plugin_manager::new_undefined_symbol): New function.
3558 (Plugin_manager::rescan): New function.
3559 (Plugin_manager::rescannable_defines): New function.
3560 (Plugin_manager::add_input_file): Set any_added_.
3561 * plugin.h (class Plugin_manager): define new fields rescannable_,
3562 undefined_symbols_, any_claimed_, and any_added_. Declare
3563 Plugin_rescan as friend. Declare new functions.
3564 (Plugin_manager::Rescannable): Define type.
3565 (Plugin_manager::Rescannable_list): Define type.
3566 (Plugin_manager::Undefined_symbol_list): Define type.
3567 (Plugin_manager::Plugin_manager): Initialize new fields.
3568 * archive.cc (Archive::defines_symbol): New function.
3569 (Add_archive_symbols::run): Pass archive to plugins if any.
3570 * archive.h (class Archive): Declare defines_symbol.
3571 * readsyms.cc (Input_group::~Input_group): New function.
3572 (Finish_group::run): Pass input_group to plugins if any.
3573 * readsyms.h (class Input_group): Declare destructor.
3574 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3575 any.
3576
3577 2011-01-10 Ian Lance Taylor <iant@google.com>
3578
3579 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3580 section as relro.
3581 (Layout::set_segment_offsets): Reset increase_relro before calling
3582 set_section_addresses a second time.
3583
3584 2011-01-04 Cary Coutant <ccoutant@google.com>
3585
3586 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3587 sections before NOBITS sections.
3588
3589 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3590
3591 * version.cc (print_version): Update copyright to 2011.
3592
3593 2010-12-23 Cary Coutant <ccoutant@google.com>
3594
3595 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3596 of OS to this->add. Add OD parameter to second form of the function.
3597
3598 2010-12-20 Ian Lance Taylor <iant@google.com>
3599
3600 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3601 second of two consecutive entries with same offset.
3602
3603 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3604
3605 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3606 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3607 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3608 to avoid unneeded links against $(LDADD).
3609 * testsuite/Makefile.in: Regenerate.
3610
3611 2010-12-15 Ian Lance Taylor <iant@google.com>
3612
3613 PR gold/12324
3614 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3615 for R_X86_64_32 and R_X86_64_PC32.
3616 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3617 ver_matching_def_pic.o.
3618 (ver_matching_def_pic.o): New target.
3619
3620 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3621
3622 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3623 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3624 Move definition before File_read::View member definitions.
3625 (File_read::View::~View): Initialize and hold lock before
3626 updating current_mapped_bytes.
3627
3628 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3629
3630 * dwarf_reader.cc: Remove outdated comment.
3631 * gold-threads.cc: Fix typo in error message.
3632 * archive.cc: Fix typos in comments.
3633 * archive.h: Likewise.
3634 * arm-reloc-property.cc: Likewise.
3635 * arm-reloc-property.h: Likewise.
3636 * arm-reloc.def: Likewise.
3637 * arm.cc: Likewise.
3638 * attributes.h: Likewise.
3639 * cref.cc: Likewise.
3640 * ehframe.cc: Likewise.
3641 * fileread.h: Likewise.
3642 * gold.h: Likewise.
3643 * i386.cc: Likewise.
3644 * icf.cc: Likewise.
3645 * incremental.h: Likewise.
3646 * int_encoding.cc: Likewise.
3647 * layout.h: Likewise.
3648 * main.cc: Likewise.
3649 * merge.h: Likewise.
3650 * object.cc: Likewise.
3651 * object.h: Likewise.
3652 * options.cc: Likewise.
3653 * readsyms.cc: Likewise.
3654 * reduced_debug_output.cc: Likewise.
3655 * reloc.cc: Likewise.
3656 * script-sections.cc: Likewise.
3657 * sparc.cc: Likewise.
3658 * symtab.h: Likewise.
3659 * target-reloc.h: Likewise.
3660 * target.cc: Likewise.
3661 * target.h: Likewise.
3662 * timer.cc: Likewise.
3663 * timer.h: Likewise.
3664 * x86_64.cc: Likewise.
3665
3666 2010-12-09 Cary Coutant <ccoutant@google.com>
3667
3668 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3669 stack.
3670 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3671 parameter; change all callers.
3672 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3673 * options.h (warn_execstack): New option.
3674
3675 2010-12-07 Doug Kwan <dougkwan@google.com>
3676
3677 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3678 like function call relocations.
3679
3680 2010-12-07 Ian Lance Taylor <iant@google.com>
3681
3682 * archive.cc (Archive::get_elf_object_for_member): Permit
3683 punconfigured to be NULL.
3684 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3685 (Archive::include_member): Pass NULL to get_elf_object_for_member
3686 if we searched for the archive and this is the first included
3687 object.
3688
3689 2010-12-01 Ian Lance Taylor <iant@google.com>
3690
3691 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3692 track_relocs_type_ field.
3693 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3694 Set track_relocs_type_.
3695 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3696 contents when using RELA relocs.
3697 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3698 reloc_map_.
3699 * reloc.cc (Track_relocs::next_addend): New function.
3700 * reloc.h (class Track_relocs): Declare next_addend.
3701
3702 2010-12-01 Ian Lance Taylor <iant@google.com>
3703
3704 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3705 virtual destructor.
3706
3707 2010-12-01 Ian Lance Taylor <iant@google.com>
3708
3709 * README: Update compilers known to work and fail.
3710
3711 2010-11-23 Matthias Klose <doko@ubuntu.com>
3712
3713 * configure.in: For --enable-gold, handle value `default' instead of
3714 `both*'. Always install ld as ld.bfd, install as ld if gold is
3715 not the default.
3716 * configure: Regenerate.
3717
3718 2010-11-18 Doug Kwan <dougkwan@google.com>
3719
3720 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3721 and right_alignment to be zero. Store result alignment only if it is
3722 greater than existing alignment.
3723
3724 2010-11-16 Cary Coutant <ccoutant@google.com>
3725
3726 PR gold/12220
3727 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3728 Check for ".zdebug_line".
3729
3730 2010-11-16 Doug Kwan <dougkwan@google.com>
3731 Cary Coutant <ccoutant@google.com>
3732
3733 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3734 by reference; adjust all callers.
3735 * output.cc (Output_segment::set_section_addresses): Adjust references
3736 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3737 list is empty.
3738 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3739 end at page boundary.
3740
3741 2010-11-16 Cary Coutant <ccoutant@google.com>
3742
3743 PR gold/12220
3744 * layout.cc (Layout::choose_output_section): Transform names of
3745 compressed sections even when using a script with a SECTIONS clause.
3746 (Layout::output_section_name): Remove code to transform
3747 compressed debug section names.
3748 * output.cc (Output_section::add_input_section): Use uncompressed
3749 section size when tracking input sections.
3750
3751 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3752
3753 * symtab.h (Symbol::NON_PIC_REF): Remove.
3754 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3755 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3756 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3757 (Symbol::use_plt_offset): Take a flags argument and pass it
3758 directly to needs_dynamic_reloc. Restrict check for undefined
3759 weak symbols to function calls.
3760 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3761 (Target_arm::Scan::global): Use it.
3762 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3763 (Target_arm::Relocate::relocate): Likewise.
3764 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3765 parameter with an r_type parameter. Use get_reference_flags
3766 to get the flags.
3767 (Target_arm::Relocate::relocate): Update accordingly.
3768 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3769 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3770 (Target_i386::Scan::global): Likewise.
3771 (Target_i386::Relocate::relocate): Likewise.
3772 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3773 parameter with an r_type parameter. Use get_reference_flags
3774 to get the flags.
3775 (Target_i386::Relocate::relocate): Update accordingly.
3776 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3777 (Target_powerpc::Scan::global): Use it.
3778 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3779 (Target_powerpc::Relocate::relocate): Likewise.
3780 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3781 (Target_sparc::Scan::global): Use it.
3782 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3783 (Target_sparc::Relocate::relocate): Likewise.
3784 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3785 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3786 (Target_x86_64::Scan::global): Likewise.
3787 (Target_x86_64::Relocate::relocate): Likewise.
3788
3789 2010-11-08 Doug Kwan <dougkwan@google.com>
3790 Cary Coutant <ccoutant@google.com>
3791
3792 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3793 (Arm_exidx_merge_section::section_contents_): New data member.
3794 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3795 (Arm_input_section::~Arm_input_section): De-allocate memory.
3796 (Arm_input_section::original_contents_): New data member.
3797 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3798 in parameters instead of calling Object::section_contents without
3799 locking.
3800 (Arm_output_section::group_section): New parameter TASK. Pass it
3801 to callees that need locking objects.
3802 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3803 to lock EXIDX input sections. Fix a formatting issue. Call
3804 Arm_exidx_merged_section::build_contents to create merged section
3805 contents.
3806 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3807 to lock object of stub table owner.
3808 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3809 TEXT_SIZE to initialize data member TEXT_SIZE_.
3810 (Arm_exidx_input_section::addralign): Fix typo in comment.
3811 (Arm_exidx_input_section::text_size): New method.
3812 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3813 that require locking objects. Lock objects before scanning for stubs
3814 and updating local symbols.
3815 (Arm_input_section<big_endian>::init): Copy contents of original
3816 input section.
3817 (Arm_input_section<big_endian>::do_write): Use saved contents of
3818 original input section instead of calling Object::section_contents
3819 without locking.
3820 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3821 size without calling Object::section_size().
3822 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3823 for size. Allocate a buffer for merged EXIDX entries.
3824 (Arm_exidx_merged_section::build_contents): New method.
3825 (Arm_exidx_merged_section::do_write): Move merge section contents
3826 building code to Arm_exidx_merged_section::build_contetns. Write
3827 out contetns in buffer instead of building it on the fly.
3828 (Arm_relobj::make_exidx_input_section): Also pass text section size
3829 to Arm_exidx_input_section constructor.
3830 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3831 (Arm_dynobj::do_read_symbols): Fix memory leak.
3832 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3833 * target.h: (class Task): Add forward declaration.
3834 (Target::relax): Add new parameter TASK and pass it to
3835 Target::do_relax().
3836 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3837
3838 2010-11-05 Cary Coutant <ccoutant@google.com>
3839
3840 PR gold/10708
3841 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3842 object when reading from the file.
3843 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3844 second layout pass.
3845 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3846 when reading section contents.
3847 (get_section_contents): Likewise.
3848 (icf::find_identical_sections): Likewise.
3849 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3850 object when reading from the file.
3851 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3852 the object when doing deferred section layout.
3853
3854 2010-11-03 Nick Clifton <nickc@redhat.com>
3855
3856 PR gold/12001
3857 * script.h (class Symbol_assignment: name): New member. Returns
3858 the name of the symbol.
3859 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3860 Returns true if the given symbol name is on the list of
3861 assignments wating to be processed.
3862 * archive.cc (should_incldue_member): If the symbol is undefined,
3863 check to see if it is on the list of symbols pending assignment.
3864
3865 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3866
3867 * script-sections.cc (Script_sections::find_memory_region): Check
3868 for a NULL output section pointer.
3869
3870 2010-10-29 Doug Kwan <dougkwan@google.com>
3871
3872 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3873 Output_section::add_relaxed_input_section.
3874 * output.cc (Output_section::add_relaxed_input_section): Add new
3875 arguments LAYOUT and NAME. Set section order index.
3876 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3877 Copy section order index.
3878 * output.h (Output_section::add_relaxed_input_section): Add new
3879 arguments LAYOUT and NAME.
3880
3881 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3882
3883 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3884 NATIVE_OR_CROSS_LINKER.
3885 * testsuite/Makefile.in: Regenerate.
3886
3887 2010-10-20 Doug Kwan <dougkwan@google.com>
3888
3889 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3890 without SHF_LINK_ORDER flags.
3891 * layout.cc (Layout::choose_output_section): Do not filter
3892 SHF_LINK_ORDER flag in a relocatable link.
3893
3894 2010-10-17 Cary Coutant <ccoutant@google.com>
3895
3896 * output.h (Output_segment::set_section_addresses): Change function
3897 signature. Update all callers.
3898 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3899 sections.
3900 (Output_segment::set_section_addresses): Align after last TLS
3901 section. Add padding before last relro section instead of after.
3902
3903 2010-10-17 Doug Kwan <dougkwan@google.com>
3904
3905 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3906 GOT output section to be writable.
3907
3908 2010-10-14 Cary Coutant <ccoutant@google.com>
3909
3910 * debug.h (DEBUG_INCREMENTAL): New flag.
3911 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3912 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3913 mode.
3914 * incremental.cc (report_command_line): Ignore all forms of
3915 --incremental.
3916 * layout.cc (Layout::Layout): Check parameters for incremental link
3917 mode.
3918 * options.cc (General_options::parse_incremental): New function.
3919 (General_options::parse_no_incremental): New function.
3920 (General_options::parse_incremental_full): New function.
3921 (General_options::parse_incremental_update): New function.
3922 (General_options::incremental_mode_): New data member.
3923 (General_options::finalize): Check incremental_mode_.
3924 * options.h (General_options): Update help text for --incremental.
3925 Add --no-incremental, --incremental-full, --incremental-update.
3926 (General_options::Incremental_mode): New enum type.
3927 (General_options::incremental_mode): New function.
3928 (General_options::incremental_mode_): New data member.
3929 * parameters.cc (Parameters::incremental_mode_): New data member.
3930 (Parameters::set_options): Set incremental_mode_.
3931 (Parameters::set_incremental_full): New function.
3932 (Parameters::incremental): New function.
3933 (Parameters::incremental_update): New function.
3934 (set_parameters_incremental_full): New function.
3935 * parameters.h (Parameters::set_incremental_full): New function.
3936 (Parameters::incremental): New function.
3937 (Parameters::incremental_update): New function.
3938 (Parameters::incremental_mode_): New data member.
3939 (set_parameters_incremental_full): New function.
3940 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3941 incremental link mode.
3942 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3943 (Sized_relobj::do_relocate_sections): Likewise.
3944 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3945 option.
3946 * testsuite/Makefile.in: Regenerate.
3947 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3948
3949 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3950
3951 * script-sections.h (class Script_sections): Make
3952 Sections_elements typedef public.
3953 * script-sections.cc (class Sort_output_sections): Add elements_
3954 field. Add constructor which sets it; change all callers.
3955 (Sort_output_sections::is_before): New function.
3956 (Sort_output_sections::operator()): Call is_before.
3957 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3958 conditional.
3959 * testsuite/script_test_10.sh: New test. Test script section
3960 order.
3961 * testsuite/script_test_10.t: Likewise.
3962 * testsuite/script_test_10.s: Likewise.
3963 * testsuite/Makefile.am: Wrap the cross linker tests and the
3964 common tests into NATIVE_OR_CROSS_LINKER.
3965 (check_SCRIPTS): Add script_test_10.sh.
3966 (check_DATA): Add script_test_10.stdout.
3967 (script_test_10.o, script_test_10): New targets.
3968 (script_test_10.stdout): New target.
3969 * configure, testsuite/Makefile.in: Regenerate.
3970
3971 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3972
3973 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3974 error for the deprecated relocations.
3975 (Target_arm::Scan::global): Likewise.
3976 (Target_arm::Relocate::relocate): Likewise.
3977
3978 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3979
3980 * fileread.cc (Input_file::find_file): Initialize *found_name
3981 and *namep when using the fallback search for case 4.
3982
3983 2010-10-11 Cary Coutant <ccoutant@google.com>
3984
3985 * options.h (class General_options): Redefine -z lazy as an alias for
3986 the negation of -z now.
3987
3988 2010-10-11 Ian Lance Taylor <iant@google.com>
3989
3990 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3991 binding.
3992
3993 2010-10-06 Nick Clifton <nickc@redhat.com>
3994
3995 * script-sections.cc(class Memory_region): Remove
3996 current_lma_offset_ field. Rename current_vma_offset_ to
3997 current_offset_. Add last_section_ field.
3998 (Memory_region::get_current_vma_address): Rename to
3999 get_current_address.
4000 (Memory_region::get_current_lma_address): Delete.
4001 (Memory_region::increment_vma_offset): Rename to
4002 increment_offset.
4003 (Memory_region::increment_lma_offset): Delete.
4004 (Memory_region::attributes_compatible): New method. Returns
4005 true if the provided section is compatible with the region.
4006 (Memory_region::get_last_section): New method. Returns the last
4007 section to use the region.
4008 (Memory_region::set_last_section): New method. Stores the last
4009 section to use the region.
4010 (Script_sections::block_in_region): New method. Returns true if
4011 a block of memory is contained within a region.
4012 (Script_sections::find_memory_region): New method. Locates a
4013 memory region to be used to set a VMA or LMA address.
4014 (Output_section_definition::set_section_addresses): Add code to
4015 check for addresses set by memory regions.
4016 (Output_segment::set_section_addresses): Remove memory region
4017 walking code.
4018 (Script_sections::create_segment): Add a warning if a header
4019 segment is created outside of any region.
4020 * script-sections.h (class Script_sections): Add prototypes for
4021 find_memory_region and block_in_region methods.
4022 * testsuite/memory_test.s: Use .long instead of .word.
4023 * testsuite/memory_test.t: Add some more output sections.
4024 * testsuite/memory_test.sh: Update expected output.
4025
4026 2010-10-02 Doug Kwan <dougkwan@google.com>
4027
4028 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4029 defintion to symtab.h
4030 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4031 declaration to defintion.
4032
4033 2010-10-01 Nick Clifton <nickc@redhat.com>
4034
4035 * expression.cc (eval): Replace dummy argument with NULL.
4036 (eval_maybe_dot): Check for a NULL result section pointer.
4037 (Symbol_expression::value): Likewise.
4038 (Dot_expression::value): Likewise.
4039 (BINARY_EXPRESSION): Likewise.
4040 (Max_expression::value): Likewise.
4041 (Min_expression::value): Likewise.
4042 (Absolute_expression::value): Likewise.
4043 (Addr_expression::value_from_output_section): Likewise.
4044 (Loaddddr_expression::value_from_output_section): Likewise.
4045 (Segment_start_expression::value): Likewise.
4046 * script-sections.cc
4047 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4048 argument with NULL.
4049 (Sections_elememt_dot_assignment::set_section_addresses):
4050 Likewise.
4051 (Output_data_expression::do_write_to_buffer): Likewise.
4052 (Output_section_definition::finalize_symbols): Likewise.
4053 (Output_section_definition::set_section_addresses): Likewise.
4054
4055 2010-09-30 Doug Kwan <dougkwan@google.com>
4056
4057 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4058
4059 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4060
4061 * target.h (Target::can_icf_inline_merge_sections): New virtual
4062 function.
4063 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4064 virtual function.
4065 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4066 virtual function.
4067 * icf.cc (get_section_contents): Inline merge sections only when
4068 target allows it.
4069
4070 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4071
4072 * configure: Regenerate.
4073
4074 2010-09-17 Ian Lance Taylor <iant@google.com>
4075
4076 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4077 * testsuite/Makefile.am (memory_test.o): New target.
4078 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4079 memory_test.t.
4080 * testsuite/Makefile.in: Rebuild.
4081
4082 2010-09-17 Doug Kwan <dougkwan@google.com>
4083
4084 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4085 defintion if relocation uses GOT entries of the symbol.
4086 * testsuite/icf_safe_test.sh: Fix test.
4087 * testsuite/icf_safe_so_test.sh: Fix test.
4088
4089 2010-09-16 Cary Coutant <ccoutant@google.com>
4090
4091 * script_sections.cc (class Memory_region): Remove "NULL" from
4092 vector initializations.
4093
4094 2010-09-15 Cary Coutant <ccoutant@google.com>
4095
4096 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4097 Resolve forwarding symbols.
4098
4099 2010-09-15 Doug Kwan <dougkwan@google.com>
4100
4101 * gold/testsuite/script_test_3.t: Add ARM special sections.
4102 * gold/testsuite/script_test_4.t: Same.
4103 * gold/testsuite/script_test_5.t: Same.
4104 * gold/testsuite/script_test_6.t: Same.
4105 * gold/testsuite/script_test_7.t: Same.
4106 * gold/testsuite/script_test_7.t: Same.
4107 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4108
4109 2010-09-14 Cary Coutant <ccoutant@google.com>
4110
4111 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4112 (Target_x86_64::Relocate::relocate_tls): Replace check for
4113 saw_tls_block_reloc_ with test for executable section.
4114
4115 2010-09-12 Cary Coutant <ccoutant@google.com>
4116
4117 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4118 position-independent executables to shared libraries need dynamic
4119 relocations.
4120 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4121 position-independent executables.
4122 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4123 * testsuite/Makefile.in: Regenerate.
4124
4125 2010-09-10 Nick Clifton <nickc@redhat.com>
4126
4127 PR gold/11997
4128 * testsuite/memory_test.t: Discard any sections that are not
4129 needed.
4130
4131 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4132
4133 PR gold/11996
4134 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4135 "This::" to work around a bug in gcc 4.2.
4136
4137 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4138
4139 2010-09-09 Rafael Espindola <espindola@google.com>
4140
4141 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4142 sections with different PF_X flags in the same segment.
4143 (Layout::find_first_load_seg): Search all segments to find the first
4144 one.
4145 * options.h (rosegment): New.
4146
4147 2010-09-08 Rafael Espindola <espindola@google.com>
4148
4149 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4150
4151 2010-09-08 Doug Kwan <dougkwan@google.com>
4152
4153 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4154 (Arm_relobj::do_relocate_sections): Add new parameter for output
4155 file to match the parent.
4156 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4157 of local symbols instead of input values. Update code to track
4158 changes in gold::relocate_section.
4159 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4160 (Sized_relobj::compute_final_local_value_internal): New methods.
4161 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4162 body into private version of Sized_relobj::compute_final_local_value.
4163 Call the inline method.
4164 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4165 merged symbol value if there is one.
4166 (Symbol_value::has_output_value): New method defintiion.
4167 (Sized_relobj::Compute_final_local_value_status): New enum type.
4168 (Sized_relobj::compute_final_local_value): New methods.
4169 (Sized_relobj::compute_final_local_value_internal): New methods.
4170 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4171 and arm_cortex_a8.sh.
4172 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4173 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4174 New tests.
4175 * Makefile.in: Regenerate.
4176 * testsuite/arm_bl_out_of_range.s: Update test.
4177 * testsuite/thumb_bl_out_of_range.s: Ditto.
4178 * testsuite/thumb_blx_out_of_range.s: Ditto.
4179 * testsuite/arm_branch_out_of_range.sh: New file.
4180 * testsuite/arm_cortex_a8.sh: Ditto.
4181 * testsuite/arm_cortex_a8_b.s: Ditto.
4182 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4183 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4184 * testsuite/arm_cortex_a8_bl.s: Ditto.
4185 * testsuite/arm_cortex_a8_blx.s: Ditto.
4186 * testsuite/arm_cortex_a8_local.s: Ditto.
4187 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4188 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4189
4190 2010-09-08 Rafael Espindola <espindola@google.com>
4191
4192 * Makefile.am (memory_test.stdout): Run readelf with -W.
4193 * Makefile.in: Regenerate.
4194 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4195 64 bit output.
4196
4197 2010-09-08 Rafael Espindola <espindola@google.com>
4198
4199 * script-sections.cc (Script_sections::add_memory_region): Convert
4200 field precision to int.
4201 * script.cc (script_set_section_region, script_set_section_region):
4202 Convert field precision to int.
4203
4204 2010-09-08 Rafael Espindola <espindola@google.com>
4205
4206 * arm.cc (do_finalize_sections): Create the __exidx_start and
4207 __exdix_end symbols even when the section is missing.
4208
4209 2010-09-08 Nick Clifton <nickc@redhat.com>
4210
4211 * README: Remove claim that MEMORY is not supported.
4212 * expression.cc (script_exp_function_origin)
4213 (script_exp_function_length): Move from here to ...
4214 * script.cc: ... here.
4215 (script_set_section_region, script_add_memory)
4216 (script_parse_memory_attr, script_include_directive): New
4217 functions.
4218 * script-sections.cc
4219 (class Memory_region): New class.
4220 (class Output_section_definition): Add set_memory_region,
4221 set_section_vma, set_section_lma and get_section_name methods.
4222 (class Script_Sections): Add add_memory_region,
4223 find_memory_region, find_memory_region_origin,
4224 find_memory_region_length and set_memory_region methods.
4225 Have set_section_addresses method walk the list of set memory
4226 regions.
4227 Extend the print methos to display memory regions.
4228 * script-sections.h: Add prototypes for new methods.
4229 Add enum for MEMORY region attributes.
4230 * yyscript.y: Add support for parsing MEMORY regions.
4231 * script-c.h: Add prototypes for new functions.
4232 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4233 * testsuite/Makefile.in: Regenerate.
4234 * testsuite/memory_test.sh: New script.
4235 * testsuite/memory_test.s: New assembler source file.
4236 * testsuite/memory_test.t: New linker script.
4237
4238 2010-08-27 Doug Kwan <dougkwan@google.com>
4239
4240 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4241 reference override an existing dynamic weak reference.
4242 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4243 * testsuite/Makefile.in: Regenerate.
4244 * testsuite/dyn_weak_ref.sh: New file.
4245 * testsuite/dyn_weak_ref_1.c: Ditto.
4246 * testsuite/dyn_weak_ref_2.c: Ditto.
4247
4248 2010-08-27 Ian Lance Taylor <iant@google.com>
4249
4250 * incremental.h (class Incremental_input_entry): Add virtual
4251 destructor.
4252
4253 2010-08-27 Ian Lance Taylor <iant@google.com>
4254
4255 * testsuite/start_lib_test_3.c: Mark t3 as used.
4256
4257 2010-08-27 Nick Clifton <nickc@redhat.com>
4258
4259 * options.cc (version_script): Fix small typo in previous
4260 whitespace tidyup.
4261
4262 2010-08-25 Nick Clifton <nickc@redhat.com>
4263
4264 * archive.cc: Formatting fixes: Remove whitespace between
4265 typename and following asterisk. Remove whitespace between
4266 function name and opening parenthesis.
4267 * archive.h: Likewise.
4268 * arm.cc: Likewise.
4269 * attributes.cc: Likewise.
4270 * attributes.h: Likewise.
4271 * common.cc: Likewise.
4272 * copy-relocs.cc: Likewise.
4273 * dirsearch.h: Likewise.
4274 * dynobj.cc: Likewise.
4275 * ehframe.cc: Likewise.
4276 * ehframe.h: Likewise.
4277 * expression.cc: Likewise.
4278 * fileread.cc: Likewise.
4279 * fileread.h: Likewise.
4280 * gc.h: Likewise.
4281 * gold-threads.cc: Likewise.
4282 * gold.cc: Likewise.
4283 * i386.cc: Likewise.
4284 * icf.h: Likewise.
4285 * incremental-dump.cc: Likewise.
4286 * incremental.cc: Likewise.
4287 * layout.cc: Likewise.
4288 * layout.h: Likewise.
4289 * main.cc: Likewise.
4290 * merge.cc: Likewise.
4291 * merge.h: Likewise.
4292 * object.cc: Likewise.
4293 * object.h: Likewise.
4294 * options.cc: Likewise.
4295 * options.h: Likewise.
4296 * output.cc: Likewise.
4297 * output.h: Likewise.
4298 * plugin.cc: Likewise.
4299 * plugin.h: Likewise.
4300 * powerpc.cc: Likewise.
4301 * reloc.cc: Likewise.
4302 * script-c.h: Likewise.
4303 * script-sections.cc: Likewise.
4304 * script.cc: Likewise.
4305 * stringpool.cc: Likewise.
4306 * symtab.cc: Likewise.
4307 * symtab.h: Likewise.
4308 * target.cc: Likewise.
4309 * timer.cc: Likewise.
4310 * timer.h: Likewise.
4311 * version.cc: Likewise.
4312 * x86_64.cc: Likewise.
4313
4314 2010-08-24 Nick Clifton <nickc@redhat.com>
4315
4316 PR 11899
4317 * layout.cc (segment_precedes): Sort segments by their physical
4318 addresses, if they have been set.
4319
4320 2010-08-23 Cary Coutant <ccoutant@google.com>
4321
4322 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4323 symbols data.
4324 (Lib_group::include_member): Unlock object after deleting its
4325 symbols data.
4326 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4327 the bug fixed here.
4328
4329 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4330 Cary Coutant <ccoutant@google.com>
4331
4332 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4333 constructor, and set_blocker.
4334 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4335 readsyms_blocker_.
4336 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4337 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4338 * testsuite/Makefile.am (start_lib_test): New test case.
4339 * testsuite/Makefile.in: Regenerate.
4340 * testsuite/start_lib_test_main.c: New file.
4341 * testsuite/start_lib_test_1.c: New file.
4342 * testsuite/start_lib_test_2.c: New file.
4343 * testsuite/start_lib_test_3.c: New file.
4344
4345 2010-08-19 Ian Lance Taylor <iant@google.com>
4346
4347 * Makefile.in: Rebuild with automake 1.11.1.
4348 * aclocal.m4: Likewise.
4349 * testsuite/Makefile.in: Likewise.
4350
4351 2010-08-19 Ian Lance Taylor <iant@google.com>
4352
4353 PR 10893
4354 * i386.cc (class Output_data_plt_i386): Update declarations.
4355 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4356 local_ifuncs_ fields.
4357 (Target_i386::do_plt_section_for_global): New function.
4358 (Target_i386::do_plt_section_for_local): New function.
4359 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4360 parameter; change all callers. Initialize global_ifuncs_ and
4361 local_ifuncs_. If doing a static link define __rel_iplt_start and
4362 __rel_iplt_end.
4363 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4364 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4365 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4366 symbols.
4367 (Target_i386::make_plt_section): New function, broken out of
4368 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4369 (Target_i386::make_plt_entry): Call make_plt_section.
4370 (Target_i386::make_local_ifunc_plt_entry): New function.
4371 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4372 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4373 R_386_IRELATIVE to switch.
4374 (Target_i386::Scan::global): Likewise.
4375 (Target_i386::Relocate::relocate): Likewise.
4376 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4377 switch.
4378 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4379 (Target_x86_64::do_plt_section_for_global): New function.
4380 (Target_x86_64::do_plt_section_for_local): New function.
4381 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4382 parameter; change all callers. If doing a static link define
4383 __rela_iplt_start and __rela_iplt_end.
4384 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4385 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4386 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4387 to point to .plt.
4388 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4389 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4390 switch.
4391 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4392 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4393 R_X86_64_IRELATIVE to switch.
4394 (Target_x86_64::Scan::global): Likewise.
4395 (Target_x86_64::Relocate::relocate): Likewise.
4396 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4397 switch.
4398 * target.h (class Target): Add plt_section_for_global and
4399 plt_section_for_local functions. Add do_plt_section_for_global
4400 and do_plt_section_for_local virtual functions.
4401 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4402 clarifying comments.
4403 (Symbol::use_plt_offset): Handle IFUNC symbol.
4404 * object.cc (Sized_relobj::Sized_relobj): Initialize
4405 local_plt_offsets_.
4406 (Sized_relobj::local_has_plt_offset): New function.
4407 (Sized_relobj::local_plt_offset): New function.
4408 (Sized_relobj::set_local_plt_offset): New function.
4409 (Sized_relobj::do_count): Handle IFUNC symbol.
4410 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4411 a bit away from input_shndx_ field. Add set_is_func_symbol and
4412 is_ifunc_symbol functions.
4413 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4414 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4415 local_plt_offsets_ field.
4416 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4417 * output.h (class Output_section_data): Add non-const
4418 output_section function.
4419 (class Output_data_got): Update declarations.
4420 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4421 Add use_plt_offset parameter to global and local constructors.
4422 Change all callers. Change local_sym_index_ field to 31 bits.
4423 Change GSYM_CODE and CONSTANT_CODE accordingly.
4424 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4425 doing a static link don't set sh_link field.
4426 (Output_data_got::Got_entry::write): Use PLT offset if
4427 appropriate.
4428 (Output_data_got::add_global_plt): New function.
4429 (Output_data_got::add_local_plt): New function.
4430 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4431 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4432 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4433 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4434 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4435 IFUNC conditional.
4436 * testsuite/ifunc-sel.h: New file.
4437 * testsuite/ifuncmain1.c: New file.
4438 * testsuite/ifuncmain1vis.c: New file.
4439 * testsuite/ifuncmod1.c: New file.
4440 * testsuite/ifuncdep2.c: New file.
4441 * testsuite/ifuncmain2.c: New file.
4442 * testsuite/ifuncmain3.c: New file.
4443 * testsuite/ifuncmod3.c: New file.
4444 * testsuite/ifuncmain4.c: New file.
4445 * testsuite/ifuncmain5.c: New file.
4446 * testsuite/ifuncmod5.c: New file.
4447 * testsuite/ifuncmain6pie.c: New file.
4448 * testsuite/ifuncmod6.c: New file.
4449 * testsuite/ifuncmain7.c: New file.
4450 * configure, testsuite/Makefile.in: Rebuild.
4451
4452 2010-08-18 Ian Lance Taylor <iant@google.com>
4453
4454 * incremental.cc
4455 (Output_section_incremental_inputs::write_input_files): Add cast
4456 to avoid signed/unsigned comparison warning.
4457 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4458
4459 2010-08-12 Cary Coutant <ccoutant@google.com>
4460
4461 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4462
4463 2010-08-13 Ian Lance Taylor <iant@google.com>
4464
4465 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4466
4467 2010-08-12 Cary Coutant <ccoutant@google.com>
4468 Doug Kwan <dougkwan@google.com>
4469
4470 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4471 defintion overrides non-weak undef, remember that the original undef
4472 is not weak.
4473 * symtab.cc (Symbol_table::sized_write_global): For undef without
4474 an original weak binding, set binding to global in output.
4475 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4476 * testsuite/Makefile.in: Regenerate.
4477 * testsuite/strong_ref_weak_def.sh: New file.
4478 * testsuite/strong_ref_weak_def_1.c: Ditto.
4479 * testsuite/strong_ref_weak_def_2.c: Ditto.
4480
4481 2010-08-12 Cary Coutant <ccoutant@google.com>
4482
4483 * testsuite/incremental_test.sh: Rewrite.
4484 * testsuite/incremental_test_1.c: Rewrite.
4485 * testsuite/incremental_test_2.c: Rewrite.
4486
4487 2010-08-12 Cary Coutant <ccoutant@google.com>
4488
4489 * arm.cc (Target_arm::got_size): Add const.
4490 (Target_arm::got_entry_count): New function.
4491 (Target_arm::plt_entry_count): New function.
4492 (Target_arm::first_plt_entry_offset): New function.
4493 (Target_arm::plt_entry_size): New function.
4494 (Output_data_plt_arm::entry_count): New function.
4495 (Output_data_plt_arm::first_plt_entry_offset): New function.
4496 (Output_data_plt_arm::get_plt_entry_size): New function.
4497 * i386.cc (Target_i386::got_size): Add const.
4498 (Target_i386::got_entry_count): New function.
4499 (Target_i386::plt_entry_count): New function.
4500 (Target_i386::first_plt_entry_offset): New function.
4501 (Target_i386::plt_entry_size): New function.
4502 (Output_data_plt_i386::entry_count): New function.
4503 (Output_data_plt_i386::first_plt_entry_offset): New function.
4504 (Output_data_plt_i386::get_plt_entry_size): New function.
4505 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4506 find_incremental_inputs_sections. Dump incremental_got_plt section.
4507 * incremental.cc: Include target.h.
4508 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4509 parameter. Adjust all callers. Find incremental_got_plt section.
4510 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4511 section.
4512 (Output_section_incremental_inputs::set_final_data_size): Calculate
4513 size of incremental_got_plt section.
4514 (Output_section_incremental_inputs::do_write): Write the
4515 incremental_got_plt section.
4516 (Got_plt_view_info): New struct.
4517 (Local_got_offset_visitor): New class.
4518 (Global_got_offset_visitor): New class.
4519 (Global_symbol_visitor_got_plt): New class.
4520 (Output_section_incremental_inputs::write_got_plt): New function.
4521 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4522 Add parameter. Adjust all callers.
4523 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4524 (Incremental_inputs::got_plt_section): New function.
4525 (Incremental_inputs::got_plt_section_): New data member.
4526 (Incremental_got_plt_reader): New class.
4527 * layout.cc (Layout::create_incremental_info_sections): Add the
4528 incremental_got_plt section.
4529 * object.h (Got_offset_list::get_list): New function.
4530 (Got offset_list::for_all_got_offsets): New function.
4531 (Sized_relobj::local_got_offset_list): New function.
4532 * powerpc.cc (Target_powerpc::got_size): Add const.
4533 (Target_powerpc::got_entry_count): New function.
4534 (Target_powerpc::plt_entry_count): New function.
4535 (Target_powerpc::first_plt_entry_offset): New function.
4536 (Target_powerpc::plt_entry_size): New function.
4537 (Output_data_plt_powerpc::entry_count): New function.
4538 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4539 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4540 * sparc.cc (Target_sparc::got_size): Add const.
4541 (Target_sparc::got_entry_count): New function.
4542 (Target_sparc::plt_entry_count): New function.
4543 (Target_sparc::first_plt_entry_offset): New function.
4544 (Target_sparc::plt_entry_size): New function.
4545 (Output_data_plt_sparc::entry_count): New function.
4546 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4547 (Output_data_plt_sparc::get_plt_entry_size): New function.
4548 * symtab.h (Symbol::got_offset_list): New function.
4549 (Symbol_table::for_all_symbols): New function.
4550 * target.h (Sized_target::got_entry_count): New function.
4551 (Sized_target::plt_entry_count): New function.
4552 (Sized_target::plt_entry_size): New function.
4553 * x86_64.cc (Target_x86_64::got_size): Add const.
4554 (Target_x86_64::got_entry_count): New function.
4555 (Target_x86_64::plt_entry_count): New function.
4556 (Target_x86_64::first_plt_entry_offset): New function.
4557 (Target_x86_64::plt_entry_size): New function.
4558 (Output_data_plt_x86_64::entry_count): New function.
4559 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4560 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4561
4562 2010-08-12 Cary Coutant <ccoutant@google.com>
4563
4564 * archive.cc: Include incremental.h.
4565 (Archive::Archive): Initialize incremental_info_.
4566 (Archive::include_member): Record archive members in incremental info.
4567 (Add_archive_symbols::run): Record begin and end of an archive in
4568 incremental info.
4569 (Lib_group::include_member): Record objects in incremental info.
4570 * archive.h (Incremental_archive_entry): Forward declaration.
4571 (Archive::set_incremental_info): New member function.
4572 (Archive::incremental_info): New member function.
4573 (Archive::Unused_symbol_iterator): New class.
4574 (Archive::unused_symbols_begin): New member function.
4575 (Archive::unused_symbols_end): New member function.
4576 (Archive::incremental_info_): New data member.
4577 * incremental-dump.cc (find_input_containing_global): New function.
4578 (dump_incremental_inputs): Dump new incremental info sections.
4579 * incremental.cc: Include symtab.h.
4580 (Output_section_incremental_inputs): New class.
4581 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4582 new incremental info sections.
4583 (Sized_incremental_binary::do_check_inputs): Likewise.
4584 (Incremental_inputs::report_archive): Remove.
4585 (Incremental_inputs::report_archive_begin): New function.
4586 (Incremental_inputs::report_archive_end): New function.
4587 (Incremental_inputs::report_object): New function.
4588 (Incremental_inputs::finalize_inputs): Remove.
4589 (Incremental_inputs::report_input_section): New function.
4590 (Incremental_inputs::report_script): Rewrite.
4591 (Incremental_inputs::finalize): Do nothing but finalize string table.
4592 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4593 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4594 (Incremental_inputs::create_data_sections): New function.
4595 (Incremental_inputs::relocs_entsize): New function.
4596 (Output_section_incremental_inputs::set_final_data_size): New function.
4597 (Output_section_incremental_inputs::do_write): New function.
4598 (Output_section_incremental_inputs::write_header): New function.
4599 (Output_section_incremental_inputs::write_input_files): New function.
4600 (Output_section_incremental_inputs::write_info_blocks): New function.
4601 (Output_section_incremental_inputs::write_symtab): New function.
4602 * incremental.h (Incremental_script_entry): Forward declaration.
4603 (Incremental_object_entry): Forward declaration.
4604 (Incremental_archive_entry): Forward declaration.
4605 (Incremental_inputs): Forward declaration.
4606 (Incremental_inputs_header_data): Remove.
4607 (Incremental_inputs_header): Remove.
4608 (Incremental_inputs_header_write): Remove.
4609 (Incremental_inputs_entry_data): Remove.
4610 (Incremental_inputs_entry): Remove.
4611 (Incremental_inputs_entry_write): Remove.
4612 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4613 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4614 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4615 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4616 Likewise.
4617 (Incremental_input_entry): New class.
4618 (Incremental_script_entry): New class.
4619 (Incremental_object_entry): New class.
4620 (Incremental_archive_entry): New class.
4621 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4622 (Incremental_inputs::report_inputs): Remove.
4623 (Incremental_inputs::report_archive): Remove.
4624 (Incremental_inputs::report_archive_begin): New function.
4625 (Incremental_inputs::report_archive_end): New function.
4626 (Incremental_inputs::report_object): Change prototype.
4627 (Incremental_inputs::report_input_section): New function.
4628 (Incremental_inputs::report_script): Change prototype.
4629 (Incremental_inputs::get_reloc_count): New function.
4630 (Incremental_inputs::set_reloc_count): New function.
4631 (Incremental_inputs::create_data_sections): New function.
4632 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4633 (Incremental_inputs::inputs_section): New function.
4634 (Incremental_inputs::symtab_section): New function.
4635 (Incremental_inputs::relocs_section): New function.
4636 (Incremental_inputs::get_stringpool): Add const.
4637 (Incremental_inputs::command_line): Add const.
4638 (Incremental_inputs::inputs): Remove.
4639 (Incremental_inputs::command_line_key): New function.
4640 (Incremental_inputs::input_file_count): New function.
4641 (Incremental_inputs::input_files): New function.
4642 (Incremental_inputs::relocs_entsize): New function.
4643 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4644 (Incremental_inputs::finalize_inputs): Remove.
4645 (Incremental_inputs::Input_info): Remove.
4646 (Incremental_inputs::lock_): Remove.
4647 (Incremental_inputs::inputs_): Change type.
4648 (Incremental_inputs::inputs_map_): Remove.
4649 (Incremental_inputs::current_object_entry_): New data member.
4650 (Incremental_inputs::inputs_section_): New data member.
4651 (Incremental_inputs::symtab_section_): New data member.
4652 (Incremental_inputs::relocs_section_): New data member.
4653 (Incremental_inputs::reloc_count_): New data member.
4654 (Incremental_inputs_reader): New class.
4655 (Incremental_symtab_reader): New class.
4656 (Incremental_relocs_reader): New class.
4657 * layout.cc (Layout::finalize): Move finalization of incremental info
4658 and creation of incremental info sections to follow finalization of
4659 symbol table. Set offsets for postprocessing sections.
4660 (Layout::create_incremental_info_sections): Call
4661 Incremental_inputs::create_data_sections. Add incremental symtab
4662 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4663 sections to layout after input sections.
4664 * layout.h (struct Timespec): Forward declaration.
4665 (Layout::incremental_inputs): Add const.
4666 (Layout::create_incremental_info_sections): Add parameter.
4667 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4668 * object.cc: Include incremental.h.
4669 (Relobj::finalize_incremental_relocs): New function.
4670 (Sized_relobj::do_layout): Record input sections in incremental info.
4671 * object.h (Object::output_section): New function.
4672 (Object::output_section_offset): Moved from Relobj.
4673 (Object::get_incremental_reloc_base): New function.
4674 (Object::get_incremental_reloc_count): New function.
4675 (Object::do_output_section): New function.
4676 (Object::do_output_section_offset): Moved from Relobj.
4677 (Object::do_get_incremental_reloc_base): New function.
4678 (Object::do_get_incremental_reloc_count): New function.
4679 (Object::Object): Initialize new data members.
4680 (Relobj::output_section): Renamed do_output_section and moved to
4681 protected.
4682 (Relobj::output_section_offset): Moved to Object.
4683 (Relobj::do_get_incremental_reloc_base): New function.
4684 (Relobj::do_get_incremental_reloc_count): New function.
4685 (Relobj::allocate_incremental_reloc_counts): New function.
4686 (Relobj::count_incremental_reloc): New function.
4687 (Relobj::finalize_incremental_relocs): New function.
4688 (Relobj::next_incremental_reloc_index): New function.
4689 (Relobj::reloc_counts_): New data member.
4690 (Relobj::reloc_bases_): New data member.
4691 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4692 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4693 (Sized_relobj::incremental_relocs_scan): New function.
4694 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4695 (Sized_relobj::incremental_relocs_write): New function.
4696 (Sized_relobj::incremental_relocs_write_reltype): New function.
4697 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4698 incremental link.
4699 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4700 archives and object files elsewhere.
4701 (Add_symbols::run): Report object files here.
4702 (Finish_group::run): Report end of archive at end of group.
4703 * reloc.cc: Include layout.h, incremental.h.
4704 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4705 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4706 (Sized_relobj::incremental_relocs_scan): New function.
4707 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4708 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4709 (Sized_relobj::incremental_relocs_write): New function.
4710 (Sized_relobj::incremental_relocs_write_reltype): New function.
4711 * script.cc (read_input_script): Rewrite test for incremental link.
4712 Change call to Incremental_inputs::report_script.
4713 * symtab.h (Symbol_table::first_global_index): New function.
4714 (Symbol_table::output_count): New function.
4715
4716 2010-08-12 Doug Kwan <dougkwan@google.com>
4717
4718 * arm.cc (Target_arm::merge_object_attributes): Check command line
4719 options --no-wchar-size-warning and --no-enum-size-warning.
4720 * options.h (General_options): Add ld-compatible options
4721 --no-enum-size-warning and --no-wchar-size-warning.
4722
4723 2010-08-04 Ian Lance Taylor <iant@google.com>
4724
4725 * x86_64.cc (Target_x86_64::Scan::local): Use
4726 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4727 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4728 (Target_x86_64::Scan::global): Likewise.
4729 (Target_x86_64::Relocate::relocate): Likewise.
4730 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4731 Likewise.
4732
4733 2010-08-03 Cary Coutant <ccoutant@google.com>
4734
4735 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4736 to reserve space in merged_strings vector. Keep total input size
4737 for stats.
4738 (Output_merge_string::do_print_merge_stats): Print total input size.
4739 * merge.h (Output_merge_string): Add input_size_ field.
4740 * stringpool.cc (Stringpool_template::string_length): Move
4741 implementations out of Stringpool_template class and place in
4742 stringpool.h.
4743 * stringpool.h (string_length): Move out of Stringpool_template.
4744
4745 2010-08-03 Ian Lance Taylor <iant@google.com>
4746
4747 PR 11712
4748 * layout.cc (relaxation_loop_body): If address of load segment is
4749 set, adjust address to include headers if possible.
4750
4751 2010-08-03 Ian Lance Taylor <iant@google.com>
4752
4753 * version.cc (version_string): Bump to 1.10.
4754
4755 2010-08-03 Ian Lance Taylor <iant@google.com>
4756
4757 PR 11805
4758 * layout.h (enum Output_section_order): Define.
4759 (class Layout): Update declarations.
4760 * layout.cc (Layout::get_output_section): Add order parameter.
4761 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4762 is_first_non_relro parameters. Change all callers.
4763 (Layout::choose_output_section): Likewise.
4764 (Layout::add_output_section_data): Likewise.
4765 (Layout::make_output_section): Likewise. Set order.
4766 (Layout::default_section_order): New function.
4767 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4768 * output.cc (Output_section::Output_section): Initialize order_.
4769 Don't initialize deleted fields.
4770 (Output_segment::Output_segment): Don't initialize deleted
4771 fields.
4772 (Output_segment::add_output_section_to_load): New function
4773 replacing add_output_section. Change all callers to call this or
4774 add_output_section_to_nonload.
4775 (Output_segment::add_output_section_to_nonload): New function.
4776 (Output_segment::remove_output_section): Rewrite.
4777 (Output_segment::add_initial_output_data): Likewise.
4778 (Output_segment::has_any_data_sections): Likewise.
4779 (Output_segment::is_first_section_relro): Likewise.
4780 (Output_segment::maximum_alignment): Likewise.
4781 (Output_segment::has_dynamic_reloc): New function replacing
4782 dynamic_reloc_count. Change all callers.
4783 (Output_segment::has_dynamic_reloc_list): New function replacing
4784 dynamic_reloc_count_list. Change all callers.
4785 (Output_segment::set_section_addresses): Rewrite.
4786 (Output_segment::set_offset): Rewrite.
4787 (Output_segment::find_first_and_last_list): Remove.
4788 (Output_segment::set_tls_offsets): Rewrite.
4789 (Output_segment::first_section_load_address): Likewise.
4790 (Output_segment::output_section_count): Likewise.
4791 (Output_segment::section_with_lowest_load_address): Likewise.
4792 (Output_segment::write_section_headers): Likewise.
4793 (Output_segment::print_sections_to_map): Likewise.
4794 * output.h (class Output_data): Remove dynamic_reloc_count_
4795 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4796 (Output_data::add_dynamic_reloc): Rewrite.
4797 (Output_data::has_dynamic_reloc): New function.
4798 (Output_data::dynamic_reloc_count): Remove.
4799 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4800 is_last_relro_, is_first_non_relro_, is_interp_,
4801 is_dynamic_linker_section_ fields. Add order and set_order
4802 functions. Remove is_relro_local, set_is_relro_local,
4803 is_last_relro, set_is_last_relro, is_first_non_relro,
4804 set_is_first_non_relro functions, is_interp, set_is_interp,
4805 is_dynamic_linker_section, and set_is_dynamic_linker_section
4806 functions.
4807 (class Output_segment): Change Output_data_list from std::list to
4808 std:;vector. Add output_lists_ field. Remove output_data_ and
4809 output_bss_ fields. Update declarations.
4810
4811 2010-08-02 Ian Lance Taylor <iant@google.com>
4812
4813 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4814 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4815 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4816
4817 2010-08-02 Ian Lance Taylor <iant@google.com>
4818
4819 PR 11855
4820 * script.cc (Script_options::Script_options): Initialize
4821 symbol_definitions_ and symbol_references_.
4822 (Script_options::add_symbol_assignment): Update
4823 symbol_definitions_ and symbol_references_.
4824 (Script_options::add_symbol_reference): New function.
4825 (script_symbol): New function.
4826 * script.h (class Script_options): Add symbol_definitions_ and
4827 symbol_references_ fields.
4828 (Script_options::referenced_const_iterator): New type.
4829 (Script_options::referenced_begin): New function.
4830 (Script_options::referenced_end): New function.
4831 (Script_options::is_referenced): New function.
4832 (Script_options::any_unreferenced): New function.
4833 * script-c.h (script_symbol): Declare.
4834 * yyscript.y (exp): Call script_symbol.
4835 * symtab.cc: Include "script.h".
4836 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4837 Change all callers. Check symbols referenced by scripts.
4838 (Symbol_table::add_undefined_symbols_from_command_line): Add
4839 layout parameter. Change all callers.
4840 (Symbol_table::do_add_undefined_symbols_from_command_line):
4841 Likewise. Break out loop body. Check symbols referenced by
4842 scripts.
4843 (Symbol_table::add_undefined_symbol_from_command_line): New
4844 function broken out of
4845 do_add_undefined_symbols_from_command_line.
4846 * symtab.h (class Symbol_table): Update declarations.
4847 * archive.cc: Include "layout.h".
4848 (Archive::should_include_member): Add layout parameter. Change
4849 all callers. Check for symbol mentioned in expression.
4850 * archive.h (class Archive): Update declaration.
4851 * object.cc (Sized_relobj::do_should_include_member): Add layout
4852 parameter.
4853 * object.h (Object::should_include_member): Add layout parameter.
4854 Change all callers.
4855 (Object::do_should_include_member): Add layout parameter.
4856 (class Sized_relobj): Update declaration.
4857 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4858 parameter.
4859 * dynobj.h (class Sized_dynobj): Update declaration.
4860 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4861 layout parameter.
4862 * plugin.h (class Sized_pluginobj): Update declaration.
4863
4864 2010-08-02 Ian Lance Taylor <iant@google.com>
4865
4866 PR 11866
4867 * output.cc (Output_segment::set_offset): Search for the first and
4868 last sections rather than assuming that the list is in order.
4869 (Output_segment::find_first_and_last_list): New function.
4870 * output.h (class Output_segment): Update declarations.
4871 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4872 (relro_strip_test_SOURCES): New variable.
4873 (relro_strip_test_DEPENDENCIES): New variable.
4874 (relro_strip_test_LDFLAGS): New variable.
4875 (relro_strip_test_LDADD): New variable.
4876 (relro_strip_test.so): New target.
4877
4878 2010-08-02 Ian Lance Taylor <iant@google.com>
4879
4880 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4881 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4882 (Target_i386::got_tlsdesc_section): New function.
4883 (Target_i386::got_section): Create space for GOT entries for
4884 TLSDESC relocations.
4885 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4886 R_386_TLS_GOTDESC.
4887 (Target_i386::Scan::global): Likewise.
4888 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4889 using TLSDESC GOT.
4890 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4891 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4892 (Target_x86_64::got_tlsdesc_section): New function.
4893 (Target_x86_64::got_section): Create space for GOT entries for
4894 TLSDESC relocations.
4895 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4896 R_386_TLS_GOTDESC.
4897 (Target_x86_64::Scan::global): Likewise.
4898 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4899 using TLSDESC GOT.
4900
4901 2010-08-02 Ian Lance Taylor <iant@google.com>
4902
4903 * testsuite/final_layout.sh: Use dc to convert from hex to
4904 decimal.
4905
4906 2010-07-29 Sriraman Tallam <tmsriram@google.com>
4907
4908 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4909 paramter to the call to gold::gc_process_relocs.
4910 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4911 paramter to the call to gold::gc_process_relocs.
4912 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4913 parameter to the call to gold::gc_process_relocs.
4914 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4915 template parameter to the call to gold::gc_process_relocs.
4916 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4917 paramter to the call to gold::gc_process_relocs.
4918 * gc.h (get_embedded_addend_size): New function.
4919 (gc_process_relocs): Save the size of the reloc for use by ICF.
4920 * icf.cc (get_section_contents): Get the addend from the text section
4921 for SHT_REL relocation sections.
4922 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4923 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4924 * int_encoding.h (read_from_pointer): New overloaded function.
4925 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4926 * testsuite/icf_sht_rel_addend_test.sh: New file.
4927 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4928 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4929
4930 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4931
4932 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4933 * Makefile.in: Regenerate.
4934 * testsuite/Makefile.in: Regenerate.
4935
4936 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4937
4938 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4939 * gold/testsuite/debug_msg.cc: Likewise.
4940 * gold/testsuite/odr_violation1.cc
4941 * gold/testsuite/odr_violation2.cc
4942
4943 2010-07-21 Cary Coutant <ccoutant@google.com>
4944
4945 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4946 string, and length fields.
4947 (Output_merge_string::Merged_strings_list): New type.
4948 (Output_merge_string::Merged_strings_lists): New typedef.
4949 (Output_merge_string): Replace merged_strings_ with
4950 merged_strings_lists_.
4951 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4952 Merged_strings_list per input object and section. Don't store pointer
4953 to the string. Don't store length with each merged string entry.
4954 (Output_merge_string::finalize_merged_data): Loop over list of merged
4955 strings lists. Recompute length of each merged string.
4956
4957 2010-07-15 Cary Coutant <ccoutant@google.com>
4958
4959 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4960 here.
4961
4962 2010-07-14 Ian Lance Taylor <iant@google.com>
4963
4964 * descriptors.cc (Descriptors::open): Report correct name in error
4965 message.
4966
4967 2010-07-13 Doug Kwan <dougkwan@google.com>
4968
4969 * arm.cc (Arm_input_section::Arm_input_section): For a
4970 SHT_ARM_EXIDX section, always keeps the input sections.
4971 (Arm_input_section::set_exidx_section_link): New method.
4972 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4973 has_errors_ to false.
4974 (Arm_exidx_input_section::has_errors,
4975 Arm_exidx_input_section::set_has_errors): New methods.
4976 (Arm_exidx_input_section::has_errors_): New data member.
4977 (Arm_relobj::get_exidx_shndx_list): New method.
4978 (Arm_output_section::append_text_sections_to_list): Do not skip
4979 section without SHF_EXECINSTR.
4980 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4981 errors.
4982 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4983 section header. Make error messages more verbose. Check for
4984 a non-executable section linked to an EXIDX section.
4985 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4986 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4987 check that there is no deferred EXIDX section if we exit early.
4988 Instead of not making an EXIDX section in case of an error, make one
4989 and set the has_errors flag of it.
4990 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4991 in a relocatable link.
4992 (Target_arm::do_relax): Look for the EXIDX output section instead of
4993 assuming that it is called .ARM.exidx.
4994 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4995 section list. Do not check for SHF_EXECINSTR section flags but
4996 skip any input section with errors.
4997 * output.cc (Output_section::Output_section): Initialize
4998 always_keeps_input_sections_ to false.
4999 (Output_section::add_input_section): Check for
5000 always_keeps_input_sections_.
5001 * output.h (Output_section::always_keeps_input_sections,
5002 Output_section::set_always_keeps_input_sections): New methods.
5003 (Output_section::always_keeps_input_sections): New data member.
5004
5005 2010-07-13 Rafael Espindola <espindola@google.com>
5006
5007 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5008 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5009
5010 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5011 Ian Lance Taylor <iant@google.com>
5012
5013 * output.h (Output_section_lookup_maps::add_merge_section):
5014 Correct check of whether value was inserted.
5015 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5016 (Output_section_lookup_maps::add_relaxed_input_section):
5017 Likewise.
5018 * arm.cc (Target_arm::got_section): Remove used local os.
5019 * i386.cc (Target_i386::got_section): Likewise.
5020 * x86_64.cc (Target_x86_64::got_section): Likewise.
5021 * sparc.cc (Target_sparc::got_section): Likewise.
5022 (Target_sparc::relocate): Remove unused local have_got_offset.
5023 * powerpc.cc (Target_powerpc::relocate): Likewise.
5024
5025 2010-07-13 Ian Lance Taylor <iant@google.com>
5026
5027 * compressed_output.cc (zlib_decompress): Fix signature in
5028 !HAVE_ZLIB_H case.
5029
5030 * archive.cc (Archive::include_member): Unlock an external member
5031 of a thin archive. Don't bother to delete an object we know is
5032 NULL.
5033
5034 2010-07-12 Cary Coutant <ccoutant@google.com>
5035
5036 * compressed_output.cc (zlib_decompress): New function.
5037 (get_uncompressed_size): New function.
5038 (decompress_input_section): New function.
5039 * compressed_output.h (get_uncompressed_size): New function.
5040 (decompress_input_section): New function.
5041 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5042 Handle compressed debug sections.
5043 * layout.cc (is_compressed_debug_section): New function.
5044 (Layout::output_section_name): Map compressed section names to
5045 canonical names.
5046 * layout.h (is_compressed_debug_section): New function.
5047 (is_debug_info_section): Recognize compressed debug sections.
5048 * merge.cc: Include compressed_output.h.
5049 (Output_merge_data::do_add_input_section): Handle compressed
5050 debug sections.
5051 (Output_merge_string::do_add_input_section): Handle compressed
5052 debug sections.
5053 * object.cc: Include compressed_output.h.
5054 (Sized_relobj::Sized_relobj): Initialize new data members.
5055 (build_compressed_section_map): New function.
5056 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5057 * object.h (Object::section_is_compressed): New method.
5058 (Object::do_section_is_compressed): New method.
5059 (Sized_relobj::Compressed_section_map): New type.
5060 (Sized_relobj::do_section_is_compressed): New method.
5061 (Sized_relobj::compressed_sections_): New data member.
5062 * output.cc (Output_section::add_input_section): Handle compressed
5063 debug sections.
5064 * reloc.cc: Include compressed_output.h.
5065 (Sized_relobj::write_sections): Handle compressed debug sections.
5066
5067 2010-07-08 Cary Coutant <ccoutant@google.com>
5068
5069 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5070 weak when resolving to a dynamic def.
5071 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5072 for weak undef/dynamic def cases. Adjust callers.
5073 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5074 undef_binding_weak_.
5075 (Symbol_table::sized_write_globals): Adjust symbol binding.
5076 (Symbol_table::sized_write_symbol): Add binding parameter.
5077 * symtab.h (Symbol::set_undef_binding): New method.
5078 (Symbol::is_undef_binding_weak): New method.
5079 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5080 (Symbol_table::should_override): Add new parameter.
5081 (Symbol_table::sized_write_symbol): Add new parameter.
5082
5083 * testsuite/weak_undef_file1.cc: Add new test case.
5084 * testsuite/weak_undef_file2.cc: Fix header comment.
5085 * testsuite/weak_undef_test.cc: Add new test case.
5086
5087 2010-06-29 Doug Kwan <dougkwan@google.com>
5088
5089 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5090 Initialize USE_SYMBOL_.
5091 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5092 definition.
5093 (Arm_reloc_property::uses_symbol_): New data member declaration.
5094 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5095 uses symbol value and symbol is undefined but not weakly undefined.
5096
5097 2010-06-28 Rafael Espindola <espindola@google.com>
5098
5099 * plugin.cc (Plugin::load): Use dlerror.
5100
5101 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5102
5103 * symtab.cc (detect_odr_violations): When reporting an ODR
5104 violation, report an object where the symbol is defined.
5105
5106 2010-06-25 Doug Kwan <dougkwan@google.com>
5107
5108 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5109 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5110 definition.
5111 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5112 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5113 target hook to detect function points.
5114 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5115 * icf.h (Icf::check_section_for_function_pointers): Change type of
5116 parameter SECTION_NAME to const reference to std::string. Use
5117 target hook to determine if section may have unsafe pointers.
5118 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5119 method definition.
5120
5121 2010-06-21 Rafael Espindola <espindola@google.com>
5122
5123 * fileread.cc (Input_file::find_fie): New
5124 (Input_file::open): Use Input_file::find_fie.
5125 * fileread.h (Input_file::find_fie): New
5126 * plugin.cc (set_extra_library_path): New.
5127 (Plugin::load): Add set_extra_library_path to the transfer vector.
5128 (Plugin_manager::set_extra_library_path): New.
5129 (Plugin_manager::add_input_file): Use the extra search path if set.
5130 (set_extra_library_path(): New.
5131 * plugin.h (Plugin_manager): Add set_extra_library_path and
5132 extra_search_path_.
5133
5134 2010-06-19 Cary Coutant <ccoutant@google.com>
5135
5136 * layout.cc (gdb_sections): Add .debug_types.
5137 (lines_only_debug_sections): Likewise.
5138
5139 2010-06-18 Rafael Espindola <espindola@google.com>
5140
5141 * plugin.cc (add_input_file,add_input_library)
5142 (Plugin_manager::add_input_file): Make filename arguments const.
5143 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5144 const.
5145
5146 2010-06-16 Doug Kwan <dougkwan@google.com>
5147
5148 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5149 .ARM.attributes section if we have not merged any input
5150 attributes sections.
5151
5152 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5153
5154 * arm.cc: Allow combining objects with no EABI version
5155 information.
5156
5157 2010-06-15 Rafael Espindola <espindola@google.com>
5158
5159 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5160
5161 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5162
5163 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5164 (struct iovec): Correct !HAVE_READV definition.
5165
5166 2010-06-10 Cary Coutant <ccoutant@google.com>
5167
5168 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5169 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5170 reloc sections.
5171 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5172
5173 PR 11683
5174 * symtab.h (Symbol::is_placeholder): New member function.
5175 * target-reloc.h (relocate_section): Check for placeholder symbols.
5176
5177 * testsuite/Makefile.am (plugin_test_8): New test.
5178 (plugin_test_9): New test.
5179 * testsuite/Makefile.in: Regenerate.
5180
5181 2010-06-09 Nick Clifton <nickc@redhat.com>
5182
5183 * yyscript.y (input_list_element): Allow strings prefixed with
5184 the '-' character. Treat these as libraries.
5185 * script.cc (script_add_library): New function. Adds a library
5186 specified by "-l<name>" found in an input script.
5187 * script-c.h: Add prototype for script_add_library.
5188
5189 2010-06-07 Doug Kwan <dougkwan@google.com>
5190
5191 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5192 Restrict stub-group size to be within long conditional branch
5193 range when working around cortex-A8 erratum.
5194
5195 2010-06-07 Damien Diederen <dd@crosstwine.com>
5196
5197 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5198 #ifdef typo.
5199
5200 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5201
5202 PR gold/11658
5203 * output.cc
5204 (Output_section::Input_section_sort_entry::compare_section_ordering):
5205 Change to return non-zero correctly.
5206 (Output_section::Input_section_sort_section_order_index_compare
5207 ::operator()): Change to fix ambiguity in comparisons.
5208
5209 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5210
5211 * gold.h (is_wildcard_string): New function.
5212 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5213 (Layout::layout_eh_frame): Ditto.
5214 (Layout::find_section_order_index): New method.
5215 (Layout::read_layout_from_file): New method.
5216 * layout.h (Layout::find_section_order_index): New method.
5217 (Layout::read_layout_from_file): New method.
5218 (Layout::input_section_position_): New private member.
5219 (Layout::input_section_glob_): New private member.
5220 * main.cc (main): Call read_layout_from_file here.
5221 * options.h (--section-ordering-file): New option.
5222 * output.cc (Output_section::input_section_order_specified_): New
5223 member.
5224 (Output_section::Output_section): Initialize new member.
5225 (Output_section::add_input_section): Add new parameter.
5226 Keep input sections when --section-ordering-file is used.
5227 (Output_section::set_final_data_size): Sort input sections when
5228 section ordering file is specified.
5229 (Output_section::Input_section_sort_entry): Add new parameter.
5230 Check sorting type.
5231 (Output_section::Input_section_sort_entry::compare_section_ordering):
5232 New method.
5233 (Output_section::Input_section_sort_compare::operator()): Change to
5234 consider section_order_index.
5235 (Output_section::Input_section_sort_init_fini_compare::operator()):
5236 Change to consider section_order_index.
5237 (Output_section::Input_section_sort_section_order_index_compare
5238 ::operator()): New method.
5239 (Output_section::sort_attached_input_sections): Change to sort
5240 according to section order when specified.
5241 (Output_section::add_input_section<32, true>): Add new parameter.
5242 (Output_section::add_input_section<64, true>): Add new parameter.
5243 (Output_section::add_input_section<32, false>): Add new parameter.
5244 (Output_section::add_input_section<64, false>): Add new parameter.
5245 * output.h (Output_section::add_input_section): Add new parameter.
5246 (Output_section::input_section_order_specified): New
5247 method.
5248 (Output_section::set_input_section_order_specified): New method.
5249 (Input_section::Input_section): Initialize section_order_index_.
5250 (Input_section::section_order_index): New method.
5251 (Input_section::set_section_order_index): New method.
5252 (Input_section::section_order_index_): New member.
5253 (Input_section::Input_section_sort_section_order_index_compare): New
5254 struct.
5255 (Output_section::input_section_order_specified_): New member.
5256 * script-sections.cc (is_wildcard_string): Delete and move modified
5257 method to gold.h.
5258 (Output_section_element_input::Output_section_element_input): Modify
5259 call to is_wildcard_string.
5260 (Output_section_element_input::Input_section_pattern
5261 ::Input_section_pattern): Ditto.
5262 (Output_section_element_input::Output_section_element_input): Ditto.
5263 * testsuite/Makefile.am (final_layout): New test case.
5264 * testsuite/Makefile.in: Regenerate.
5265 * testsuite/final_layout.cc: New file.
5266 * testsuite/final_layout.sh: New file.
5267
5268 2010-06-01 Rafael Espindola <espindola@google.com>
5269
5270 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5271
5272 2010-06-01 Rafael Espindola <espindola@google.com>
5273
5274 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5275 visibility of symbols.
5276
5277 2010-05-27 Doug Kwan <dougkwan@google.com>
5278
5279 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5280 from start of output section instead of address for a local symbol
5281 in a merged or relaxed section when doing a relocatable link.
5282
5283 2010-05-26 Rafael Espindola <espindola@google.com>
5284
5285 PR 11604
5286 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5287 adding sections the garbage collector removed.
5288 * gold/testsuite/Makefile.am: Add test.
5289 * gold/testsuite/Makefile.in: Regenerate.
5290 * gold/testsuite/plugin_test_7.sh: New.
5291 * gold/testsuite/plugin_test_7_1.c: New.
5292 * gold/testsuite/plugin_test_7_2.c: New.
5293
5294 2010-05-26 Rafael Espindola <espindola@google.com>
5295
5296 * script-sections.cc (Output_section_definition::set_section_addresses):
5297 Check for --section-start.
5298
5299 2010-05-26 Doug Kwan <dougkwan@google.com>
5300
5301 * arm.cc (Arm_scan_relocatable_relocs): New class.
5302 (Target_arm::relocate_special_relocatable): New method.
5303 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5304 (Arm_relocate_functions::thumb_branch_common): Same.
5305 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5306 instead of Default_scan_relocatable_relocs.
5307 * target-reloc.h (relocate_for_relocatable): Let target handle
5308 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5309 * target.h (Sized_target::relocate_special_relocatable): New method.
5310
5311 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5312
5313 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5314
5315 2010-05-23 Doug Kwan <dougkwan@google.com>
5316
5317 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5318 instead of a cast.
5319 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5320 with a direct branch, not a conditional branch, to a stub.
5321 * merge.cc (Output_merge_base::record_input_section): New method
5322 defintion.
5323 (Output_merge_data::do_add_input_section): Record input section if
5324 keeps-input-sections flag is set.
5325 (Output_merge_string::do_add_input_section): Ditto.
5326 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5327 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5328 INPUT_SECTIONS_.
5329 (Output_merge_base::keeps_input_sections,
5330 Output_merge_base::set_keeps_input_sections,
5331 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5332 method definitions.
5333 (Output_merge_base::Input_sections): New type declaration.
5334 (Output_merge_base::input_sections_begin,
5335 Output_merge_base::input_sections_end,
5336 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5337 (Output_merge_base::bool keeps_input_sections_,
5338 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5339 Output_merge_base::input_sections_): New data members.
5340 (Output_merge_data::do_set_keeps_input_sections): New method
5341 defintion.
5342 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5343 * output.cc (Output_section::Input_section::relobj): Move method
5344 defintion from class declaration to here and handle merge sections.
5345 (Output_section::Input_section::shndx): Ditto.
5346 (Output_section::Output_section): Remove initializations of removed
5347 data members and initialize new data member LOOKUP_MAPS_.
5348 (Output_section::add_input_section): Set keeps-input-sections flag
5349 for a newly created merge output section as appropriate. Adjust code
5350 to use Output_section_lookup_maps class.
5351 (Output_section::add_relaxed_input_section): Adjst code for lookup
5352 maps code refactoring.
5353 (Output_section::add_merge_input_section): Add a new parameter
5354 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5355 class. If adding input section to a newly created merge output
5356 section fails, remove the new merge section.
5357 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5358 Adjust code for use of the Output_section_lookup_maps class.
5359 (Output_section::find_merge_section): Ditto.
5360 (Output_section::build_lookup_maps): New method defintion.
5361 (Output_section::find_relaxed_input_section): Adjust code to use
5362 Output_section_lookup_maps class.
5363 (Output_section::get_input_sections): Export merge sections. Adjust
5364 code to use Output_section_lookup_maps class.
5365 (Output_section:::add_script_input_section): Adjust code to use
5366 Output_section_lookup_maps class. Update lookup maps for merge
5367 sections also.
5368 (Output_section::discard_states): Use Output_section_lookup_maps.
5369 (Output_section::restore_states): Same.
5370 * output.h (Merge_section_properties): Move class defintion out of
5371 Output_section.
5372 (Output_section_lookup_maps): New class.
5373 (Output_section::Input_section::is_merge_section): New method
5374 defintion.
5375 (Output_section::Input_section::relobj): Move defintion out of class
5376 defintion. Declare method only.
5377 (Output_section::Input_section::shndx): Ditto.
5378 (Output_section::Input_section::output_merge_base): New method defintion.
5379 (Output_section::Input_section::u2_.pomb): New union field.
5380 (Output_section::Merge_section_by_properties_map,
5381 Output_section::Output_section_data_by_input_section_map,
5382 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5383 Remove types.
5384 (Output_section::add_merge_input_section): Add new parameter
5385 KEEPS_INPUT_SECTIONS.
5386 (Output_section::build_lookup_maps): New method declaration.
5387 (Output_section::merge_section_map_,
5388 Output_section::merge_section_by_properties_map_,
5389 Output_section::relaxed_input_section_map_,
5390 Output_section::is_relaxed_input_section_map_valid_): Remove data
5391 members.
5392 (Output_section::lookup_maps_): New data member.
5393
5394 2010-05-21 Doug Kwan <dougkwan@google.com>
5395
5396 PR gold/11619
5397 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5398 avoid a compilation error.
5399
5400 2010-05-19 Rafael Espindola <espindola@google.com>
5401
5402 * script-sections.cc (Output_section_definition::allocate_to_segment):
5403 Update the phdrs_list even when the output section is NULL.
5404 * testsuite/Makefile.am: Add test.
5405 * testsuite/Makefile.in: Regenerate.
5406 * testsuite/script_test_9.cc: New.
5407 * testsuite/script_test_9.sh: New.
5408 * testsuite/script_test_9.t: New.
5409
5410 2010-05-19 Doug Kwan <dougkwan@google.com>
5411
5412 * arm.cc (Arm_input_section::original_size): New method.
5413 (Arm_input_section::do_addralign): Add a cast.
5414 (Arm_input_section::do_output_offset): Remove static cast.
5415 (Arm_input_section::original_addralign,
5416 Arm_input_section::original_size_): Change type to uint32_t.
5417 (Arm_input_section::init): Add safe casts for section alignment
5418 and size.
5419 (Arm_input_section::set_final_data_size): Do not set address and
5420 offset of stub table.
5421 (Arm_output_section::fix_exidx_coverage): Change use of of
5422 Output_section::Simple_input_section to that of
5423 Output_section::Input_section.
5424 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5425 except for the first pass.
5426 * output.cc (Output_section::get_input_sections): Change type of
5427 input_sections to std::list<Input_section>.
5428 (Output_section::add_script_input_section): Rename from
5429 Output_section::add_simple_input_section. Change type of SIS
5430 parameter from Simple_input_section to Input_section.
5431 * output.h (Output_section::Simple_input_section): Remove class.
5432 (Output_section::Input_section): Change class visibility to public.
5433 (Output_section::Input_section::addralign): Use stored alignments
5434 for special input sections if set.
5435 (Output_section::Input_section::set_addralign): New method.
5436 (Output_section::get_input_sections): Change parameter type from
5437 list of Simple_input_section to list of Input_section.
5438 (Output_section::add_script_input_section): Rename from
5439 Output_section::add_simple_input_section. Change first parameter's
5440 type from Simple_input_section to Input_section and remove the
5441 second and third parameters.
5442 * script-sections.cc (Input_section::Input_section_list): Change
5443 type to list of Output_section::Input_section/
5444 (Input_section_info::Input_section_info): Change parameter type of
5445 INPUT_SECTION to Output_section::Input_section.
5446 (Input_section_info::input_section): Change return type.
5447 (Input_section_info::input_section_): Change type to
5448 Output_section::Input_section.
5449 (Output_section_element_input::set_section_addresses): Adjust code
5450 to use Output_section::Input_section instead of
5451 Output_section::Simple_input_section. Adjust code for renaming
5452 of Output_section::add_simple_input_section.
5453 (Orphan_output_section::set_section_addresses): Ditto.
5454
5455 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5456
5457 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5458 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5459
5460 2010-05-18 Rafael Espindola <espindola@google.com>
5461
5462 * options.cc (General_options::finalize): Handle -nostdlib.
5463 * options.h (nostdlib): New option.
5464 * script.cc (script_add_search_dir): Handle -nostdlib.
5465
5466 2010-05-12 Doug Kwan <dougkwan@google.com>
5467
5468 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5469 attributes section only if there no attributes section after merging.
5470 (Target_arm::merge_object_attributes): Move value of
5471 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5472 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5473 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5474 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5475 and arm_attr_merge_7.stdout.
5476 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5477 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5478 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5479 arm_attr_merge_7b.o): New rules.
5480 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5481 arm_attr_merge_7
5482 * testsuite/Makefile.in: Regenerate.
5483 * testsuite/arm_attr_merge.sh: New file.
5484 * testsuite/arm_attr_merge_[67][ab].s: Same.
5485
5486 2010-05-05 Nick Clifton <nickc@redhat.com>
5487
5488 * po/es.po: Updated Spanish translation.
5489
5490 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5491
5492 * Makefile.am (install-exec-local): Properly install gold as
5493 default cross linker.
5494 * Makefile.in: Regenerated.
5495
5496 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5497 Nick Clifton <nickc@redhat.com>
5498
5499 * configure.ac (install_as_default): Define and set to false
5500 unless --enable-gold or --enable-gold=both/gold has been
5501 specified.
5502 * configure: Regenerate.
5503
5504 * Makefile.am (install-exec-local): Install the executable as
5505 'ld.gold'. If install_as_default is true then also install it as
5506 'ld'.
5507 * Makefile.in: Regenerated.
5508
5509 2010-04-24 Ian Lance Taylor <iant@google.com>
5510
5511 * layout.cc (Layout::layout_reloc): In relocatable link don't
5512 combine reloc sections for grouped sections.
5513
5514 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5515
5516 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5517 sections that are not ordinary to icf.
5518 * icf.cc (get_section_contents): Handle relocation pointing to section
5519 with no object or shndx information.
5520 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5521 * testsuite/Makefile.in: Regenerate.
5522 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5523 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5524
5525 2010-04-22 Ian Lance Taylor <iant@google.com>
5526
5527 * expression.cc (Expression::Expression_eval_info): Add
5528 result_alignment_pointer field.
5529 (Expression::eval_with_dot): Add result_alignment_pointer
5530 parameter. Change all callers.
5531 (Expression::eval_maybe_dot): Likewise.
5532 (class Binary_expression): Add alignment_pointer parameter to
5533 left_value and right_value. Change all callers.
5534 (BINARY_EXPRESSION): Set result alignment.
5535 (class Trinary_expression): Add alignment_pointer parameter to
5536 arg2_value and arg3_value. Change all callers.
5537 (Trinary_cond::value): Set result alignment.
5538 (Max_expression::value, Min_expression::value): Likewise.
5539 (Align_expression::value): Likewise.
5540 * script-sections.cc (class Sections_element): Add dot_alignment
5541 parameter to set_section_addresses virtual function. Update
5542 instantiations.
5543 (class Output_section_element): Likewise.
5544 (Script_sections::create_segments): Add dot_alignment parameter.
5545 Change all callers.
5546 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5547 (Script_sections::set_phdrs_clause_addresses): Likewise.
5548 * script-sections.h: Update declarations.
5549 * script.h: Update declarations.
5550 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5551 min_p_align.
5552 * testsuite/script_test_3.t: Set large alignment.
5553 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5554 segment has expected alignment.
5555
5556 2010-04-22 Nick Clifton <nickc@redhat.com>
5557
5558 * po/gold.pot: Updated by the Translation project.
5559 * po/vi.po: Updated Vietnamese translation.
5560
5561 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5562
5563 * testsuite/Makefile.am (check_PROGRAMS): Add
5564 icf_virtual_function_folding_test.
5565 * testsuite/Makefile.in: Regenerated.
5566
5567 2010-04-15 Andrew Haley <aph@redhat.com>
5568
5569 * options.h (merge_exidx_entries): New option.
5570 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5571 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5572 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5573 (Target_arm::merge_exidx_entries): New function.
5574 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5575 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5576 to Arm_exidx_fixup constructor.
5577 Add new arg, merge_exidx_entries.
5578 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5579 Arm_output_section::fix_exidx_coverage.
5580
5581 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5582
5583 * icf.cc (get_section_contents): Check for preemptible functions.
5584 Ignore addend when appropriate.
5585 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5586 section folded.
5587 (add_from_relobj): Check for section folded.
5588 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5589 * symtab.h (should_add_dynsym_entry): Add new parameter.
5590 * target-reloc.h (scan_relocs): Check for section folded.
5591 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5592 Check reloc types for function pointers in shared objects.
5593 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5594 case.
5595 (icf_preemptible_functions_test): New test case.
5596 (icf_string_merge_test): New test case.
5597 * testsuite.Makefile.in: Regenerate.
5598 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5599 bar_glob. Refactor code.
5600 * testsuite/icf_preemptible_functions_test.cc: New file.
5601 * testsuite/icf_preemptible_functions_test.sh: New file.
5602 * testsuite/icf_string_merge_test.cc: New file.
5603 * testsuite/icf_string_merge_test.sh: New file.
5604 * testsuite/icf_virtual_function_folding_test.cc: New file.
5605 * testsuite/icf_virtual_function_folding_test.sh: New file.
5606
5607 2010-04-14 Doug Kwan <dougkwan@google.com>
5608
5609 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5610 for local symbol recounting if we remove a section due to ICF.
5611 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5612 there are no regular objects in input.
5613
5614 2010-04-13 Doug Kwan <dougkwan@google.com>
5615
5616 * arm.cc (Arm_input_section::set_final_data_size): Compute
5617 accurate final data size instead of using current data size.
5618
5619 2010-04-09 Doug Kwan <dougkwan@google.com>
5620
5621 * layout.cc (Layout::choose_output_section): Handle script section
5622 types.
5623 (Layout::make_output_section_for_script): Add section type parameter.
5624 Handle script section types.
5625 * layout.h (Layout::make_output_section_for_script): Add section
5626 type parameter.
5627 * output.cc (Output_section::Output_section): Initialize data member
5628 is_noload_.
5629 (Output_section::do_reset_address_and_file_offset): Do not set address
5630 to 0 if section is a NOLOAD section.
5631 * output.h (Output_section::is_noload): New method.
5632 (Output_section::set_is_noload): Ditto.
5633 (Output_section::is_noload_): New data member.
5634 * script-c.h (Script_section_type): New enum type.
5635 (struct Parser_output_section_header): Add new file section_type.
5636 * script-sections.cc (Sections_element::output_section_name): Add
5637 parameter for returning script section type.
5638 (Output_section_definition::output_section_name): Ditto.
5639 (Output_section_definition::section_type)P; New method.
5640 (Output_section_definiton::script_section_type_name): Ditto.
5641 (Output_section_definition::script_section_type_): New data member.
5642 (Output_section_definition::Output_section_definition): Initialize
5643 data member Output_section_definition::script_section_type_.
5644 (Output_section_definition::create_sections): Pass script section type
5645 to Layout::make_output_section_for_script.
5646 (Output_section_definition::output_section_name): Return script
5647 section type to caller.
5648 (Output_section_definition::set_section_address): Do not advance
5649 dot value and load address if section type is NOLOAD. Set address
5650 of NOLOAD sections regardless of section flags.
5651 (Output_section_definition::print): Print section type if it is
5652 not SCRIPT_SECTION_TYPE_NONE.
5653 (Output_section_definition::section_type): New method.
5654 (Output_section_definition::script_section_type_name): Ditto.
5655 (Script_sections::output_section_name): Add new parameter
5656 PSECTION_TYPE for returning script section type. Pass it to
5657 section elements. Handle discard sections.
5658 (Sort_output_sections::operator()): Handle NOLOAD sections.
5659 * script-sections.h (Script_sections::Section_type): New enum type.
5660 (Script_sections::output_section_name): Add a new parameter for
5661 returning script section type.
5662 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5663 INFO and NOLOAD.
5664 * yyscript.y (union): Add new field SECTION_TYPE.
5665 (COPY, DSECT, INFO, NOLOAD): New tokens.
5666 (opt_address_and_section_type): Change type to output_section_header.
5667 (section_type): New non-terminal
5668 (section_header): Handle section type.
5669 (opt_address_and_section_type): Return section type value.
5670
5671 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5672
5673 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5674 * testsuite/plugin_common_test_2.c (foo): Likewise.
5675
5676 2010-04-08 Doug Kwan <dougkwan@google.com>
5677
5678 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5679 Output_merge_data.
5680 * output.cc (Output_section::add_merge_input_section): Simplify
5681 code and return status of Output_merge_base::add_input_section.
5682 Update merge section map only if Output_merge_base::add_input_section
5683 returns true.
5684
5685 2010-04-07 Doug Kwan <dougkwan@google.com>
5686
5687 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5688 if section is marked as containing instructions but has no mapping
5689 symbols.
5690 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5691 correct section index.
5692 (Arm_relobj::find_linked_text_section): Ditto.
5693
5694 2010-04-07 Cary Coutant <ccoutant@google.com>
5695
5696 * archive.cc (include_member): Destroy Read_symbols_data object before
5697 releasing file.
5698 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5699 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5700 (Read_symbols_data::~Read_symbols_data) New destructor.
5701 (Section_relocs::Section_relocs) New constructor.
5702 (Section_relocs::~Section_relocs) New destructor.
5703 (Read_relocs_data::Read_relocs_data) New constructor.
5704 (Read_relocs_data::~Read_relocs_data) New destructor.
5705 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5706 pointers to NULL after deleting.
5707
5708 2010-04-07 Doug Kwan <dougkwan@google.com>
5709
5710 * arm.cc: Replace "endianity" with "endianness" in comments.
5711 (Arm_exidx_cantunwind): Ditto.
5712 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5713 (Arm_relobj::merge_flags_and_attributes): New method.
5714 (Arm_relobj::merge_flags_and_attributes_): New data member.
5715 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5716 (Arm_relobj::scan_sections_for_stubs): Ditto.
5717 (Arm_relobj::do_read_symbols): Check to see if we really want to
5718 merge processor-specific flags and attributes. Exit early if
5719 an object is empty except for section names and the undefined symbol.
5720 (Target_arm::do_finalize_sections): Move check for ELF format to
5721 Arm_relobj::do_read_symbols. Merge processor specific flags and
5722 attributes from a regular object only when we have determined that
5723 it is aapropriate. Do not create an .ARM.attributes section in
5724 output if there is no regular input object.
5725 (Target_arm::merge_processor_specific_flags): Check
5726 --warn-mismatch before printing any error.
5727 (Target_arm::merge_object_attributes): Ditto.
5728 * gold.cc (queue_middle_tasks): Handle the case in which there is
5729 no regular object in input.
5730 * options.cc (General_options::parse_EB): New method.
5731 (General_options::parse_EL): Same.
5732 (General_options::General_options): Initialize endianness_.
5733 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5734 New options.
5735 (General_options::Endianness): New enum.
5736 (General_options::endianness): New method.
5737 (General_options::endianness_): New data member.
5738 * parameters.cc (Parameters::set_options): Check target endianness.
5739 (Parameters::set_target_once): Ditto.
5740 (Parameters::check_target_endianness): New method.
5741 (parameters_force_valid_target): If either -EL or -EB is specified,
5742 use it to define endianness of default target.
5743 * parameters.h (Parameters::check_target_endianness): New method
5744 declaration.
5745 * target.h (class Target): Change "endianity" to "endianness"
5746 in comments.
5747
5748 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5749
5750 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5751 * configure: Regenerate.
5752 * Makefile.in: Regenerate.
5753 * testsuite/Makefile.in: Regenerate.
5754
5755 2010-04-06 Cary Coutant <ccoutant@google.com>
5756
5757 gcc PR lto/42757
5758 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5759 prevailing definitions of common symbols.
5760 * testsuite/plugin_test_6.sh: New test case.
5761 * testsuite/plugin_common_test_1.c: New test case.
5762 * testsuite/plugin_common_test_2.c: New test case.
5763 * testsuite/Makefile.am (plugin_test_6): New test case.
5764 * testsuite/Makefile.in: Regenerate.
5765
5766 2010-04-06 Nick Clifton <nickc@redhat.com>
5767
5768 * po/vi.po: New Vietnamese translation.
5769
5770 2010-03-30 Doug Kwan <dougkwan@google.com>
5771
5772 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5773
5774 2010-03-25 Doug Kwan <dougkwan@google.com>
5775
5776 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5777 to avoid a conversion warning on a 32-bit host.
5778
5779 2010-03-24 Ian Lance Taylor <iant@google.com>
5780
5781 * testsuite/script_test_3.t: Add a TLS segment.
5782 * testsuite/Makefile.am (check_PROGRAMS): Add
5783 tls_phdrs_script_test.
5784 (tls_phdrs_script_test_SOURCES): Define.
5785 (tls_phdrs_script_test_DEPENDENCIES): Define.
5786 (tls_phdrs_script_test_LDFLAGS): Define.
5787 (tls_phdrs_script_test_LDADD): Define.
5788 * testsuite/Makefile.in: Rebuild.
5789
5790 2010-03-23 Cary Coutant <ccoutant@google.com>
5791
5792 * fileread.cc (find_or_make_view): Fix comment.
5793
5794 2010-03-23 Ian Lance Taylor <iant@google.com>
5795
5796 * script-sections.cc (class Orphan_section_placement): Define
5797 PLACE_TLS and PLACE_TLS_BSS.
5798 (Orphan_section_placement::Orphan_section_placement): Initialize
5799 new places.
5800 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5801 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5802 (tls_script_test_SOURCES): Define.
5803 (tls_script_test_DEPENDENCIES): Define.
5804 (tls_script_test_LDFLAGS): Define.
5805 (tls_script_test_LDADD): Define.
5806 * testsuite/Makefile.in: Rebuild.
5807
5808 2010-03-22 Doug Kwan <dougkwan@google.com>
5809
5810 * arm.cc (Arm_relocate_functions::abs8,
5811 Arm_relocate_functions::abs16): Use correct check for overflow
5812 specified in the ARM ELF specs.
5813 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5814 target of a BLX instruction specially.
5815 (Reloc_stub::stub_type_for_reloc): Ditto.
5816 (Relocate::relocate): Use symbolic names instead of numeric relocation
5817 codes to report error.
5818 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5819 workaround.
5820 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5821 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5822 thumb2_blx_out_of_range.stdout
5823 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5824 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5825 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5826 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5827 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5828 thumb2_blx_in_range, thumb2_blx_in_range.o,
5829 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5830 thumb2_blx_out_of_range.o): New rules.
5831 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5832 thumb2_blx_in_range and thumb2_blx_out_of_range.
5833 * testsuite/Makefile.in: Regenerate.
5834 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5835 * testsuite/thumb_blx_in_range.s: New file.
5836 * testsuite/thumb_blx_out_of_range.s: New file.
5837
5838 2010-03-22 Rafael Espindola <espindola@google.com>
5839
5840 * archive.cc (Should_include): Move to archive.h.
5841 (should_include_member): Make it a member of Archive.
5842 (Lib_group): New.
5843 (Add_lib_group_symbols): New.
5844 * archive.h: Include options.h.
5845 (Archive_member): Moved from Archive.
5846 (Should_include): Moved from archive.cc.
5847 (Lib_group): New.
5848 (Add_lib_group_symbols): New.
5849 * dynobj.cc (do_should_include_member): New.
5850 * dynobj.h (do_should_include_member): New.
5851 * gold.cc (queue_initial_tasks): Update call to queue.
5852 * main.cc (main): Print lib group stats.
5853 * object.cc (do_should_include_member): New.
5854 * object.h: Include archive.h.
5855 (Object::should_include_member): New.
5856 (Object::do_should_include_member): New.
5857 (Sized_relobj::do_should_include_member): New.
5858 * options.cc (General_options::parse_start_lib): New.
5859 (General_options::parse_end_lib): New.
5860 (Input_arguments::add_file): Handle lib groups.
5861 (Input_arguments::start_group): Check we are not in a lib.
5862 (Input_arguments::start_lib): New.
5863 (Input_arguments::end_lib): New.
5864 * options.h (General_options): Add start_lib and end_lib.
5865 (Input_argument::lib_): New.
5866 (Input_argument::lib): New.
5867 (Input_argument::is_lib): New.
5868 (Input_file_lib): New.
5869 (Input_arguments::in_lib_): New.
5870 (Input_arguments::in_lib): New.
5871 (Input_arguments::start_lib): New.
5872 (Input_arguments::end_lib_): New.
5873 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5874 in unused members as preempted.
5875 (Sized_pluginobj::do_should_include_member): New.
5876 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5877 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5878 return the blocker.
5879 (Read_symbols::do_whole_lib_group): New.
5880 (Read_symbols::do_lib_group): New.
5881 (Read_symbols::do_read_symbols): Handle lib groups.
5882 (Read_symbols::get_name): Handle lib groups.
5883 * readsyms.h (Read_symbols): Add an archive member pointer.
5884 (Read_symbols::do_whole_lib_group): New.
5885 (Read_symbols::do_lib_group): New.
5886 (Read_symbols::member_): New.
5887 * script.cc (read_input_script): Update call to queue_soon.
5888
5889 2010-03-19 Doug Kwan <dougkwan@google.com>
5890
5891 * arm.cc (Stub_table::Stub_table): Initialize new data members
5892 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5893 (Stub_table::add_reloc_stub): Assign stub offset and update
5894 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5895 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5896 New data members.
5897 (Stub_table::update_data_size_and_addralign): Use
5898 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5899 instead of going over all reloc stubs.
5900 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5901 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5902 Stringpool_template::offset_ to size of Stringpool_char.
5903 (Stringpool_template::new_key_offset): Remove code to initialize
5904 Stringpool_template::offset_.
5905 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5906 Stringpool_template::offset_ to zero.
5907
5908 2010-03-15 Doug Kwan <dougkwan@google.com>
5909
5910 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5911 offset_.
5912 (Stringpool_template::new_key_offset): New method.
5913 (Stringpool_template::add_string): Assign offsets when adding new
5914 strings.
5915 (Stringpool_template::set_string_offsets): Do not set string offsets
5916 when not optimizing.
5917 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5918 member size_.
5919 (Chunked_vector::clear): Clear size_.
5920 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5921 (Chunked_vector::size): Return size_.
5922 (Chunked_vector::push_back): Use size_ to find insert position.
5923 (Chunked_vector::size_): New data member.
5924 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5925 (Stringpool_template::new_key_offset): New method declaration.
5926 (Stringpool_template::offset_): New data member.
5927
5928 2010-03-15 Rafael Espindola <espindola@google.com>
5929
5930 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5931 Add_symbols' constructor.
5932 * readsyms.h (Add_symbols): Remove the input_group member.
5933
5934 2010-03-10 Ian Lance Taylor <iant@google.com>
5935
5936 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5937 target to ask whether a reference to a symbol requires a stack
5938 split.
5939 * target.h (Target::is_call_to_non_split): New function.
5940 (Target::do_is_call_to_non_split): Declare virtual function.
5941 * target.cc: Include "symtab.h".
5942 (Target::do_is_call_to_non_split): New function.
5943 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5944
5945 2010-03-10 Cary Coutant <ccoutant@google.com>
5946
5947 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5948 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5949 (File_read::open[2]): Add whole_file_view_ to list of views.
5950 (File_read::make_view): Remove test of whole_file_view_.
5951 (File_read::find_or_make_view): Create whole_file_view_ if
5952 necessary.
5953 (File_read::clear_views): Replace bool parameter with enum;
5954 adjust all callers. Don't delete views with permanent data;
5955 do delete cached views and views from archives if
5956 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5957 if clearing the corresponding view.
5958 * fileread.h (File_read::Clear_views_mode): New enum.
5959 (File_read::View::is_permanent_view): New method.
5960 (File_read::clear_views): Replace bool parameter
5961 with enum; adjust all callers.
5962 * options.h (General_options): Change keep_files_mapped option;
5963 add map_whole_files.
5964 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5965 releasing the file.
5966 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5967 the file.
5968
5969 2010-03-10 David S. Miller <davem@davemloft.net>
5970
5971 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5972
5973 2010-03-09 Sriraman Tallam <tmsriram@google.com>
5974
5975 * icf.cc (get_section_contents): Add '@' marker after processing the
5976 merge reloc.
5977
5978 2010-03-08 Doug Kwan <dougkwan@google.com>
5979
5980 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5981 due to a conversion warning.
5982 (Arm_relobj::update_output_local_symbol_count): Check for local
5983 symbol with unset output index.
5984
5985 2010-03-05 Ian Lance Taylor <iant@google.com>
5986
5987 * options.h (class General_options): Add --spare-dynamic-tags.
5988 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5989 --spare-dynamic-tags.
5990
5991 2010-03-05 Ian Lance Taylor <iant@google.com>
5992
5993 * incremental.cc: Include "libiberty.h".
5994
5995 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5996
5997 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5998 function, is_info_ member.
5999 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6000 (Versions::Versions): Update caller.
6001 (Versions::define_base_version): Likewise.
6002 (Versions::add_def): Likewise.
6003
6004 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6005
6006 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6007 (Scan::possible_function_pointer_reloc): New function.
6008 (Scan::local_reloc_may_be_function_pointer): Change to call
6009 possible_function_pointer_reloc.
6010 (Scan::global_reloc_may_be_function_pointer): Ditto.
6011 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6012 relocations in ".data.rel.ro._ZTV" section.
6013 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6014 * testsuite/icf_safe_so_test.cc: Ditto.
6015 * testsuite/icf_safe_test.cc: Ditto.
6016 * testsuite/icf_safe_test.sh: Ditto.
6017
6018 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6019 Ian Lance Taylor <iant@google.com>
6020
6021 * target-reloc.h (relocate_section): Check the symbol table index
6022 for -1U before setting the local symbol index.
6023 (scan_relocatable_relocs): If copying the relocation, record that
6024 the local symbol is required.
6025 * object.h (Symbol_value::is_output_symtab_index_set): New
6026 function.
6027 (Symbol_value::may_be_discarded_from_output_symtab): New
6028 function.
6029 (Symbol_value::has_output_symtab_entry): New function.
6030 (Symbol_value::needs_output_symtab_entry): Remove.
6031 (Symbol_value::output_symtab_index): Make sure the symbol index is
6032 set.
6033 (Symbol_value::set_output_symtab_index): Make sure the symbol
6034 index is not set. Make sure the new index is valid.
6035 (Symbol_value::set_must_have_output_symtab_entry): New function.
6036 (Symbol_value::has_output_dynsym_entry): New function.
6037 (Symbol_value::set_output_dynsym_index): Make sure the new index
6038 is valid.
6039 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6040 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6041 local symbol if permitted.
6042 (Sized_relobj::do_finalize_local_symbols): Call
6043 is_output_symtab_index_set rather than needs_output_symtab_entry.
6044 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6045 rather than needs_output_symtab_entry. Call
6046 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6047 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6048 is_output_symtab_index_set rather than needs_output_symtab_entry.
6049 * testsuite/discard_locals_relocatable_test.c: New file.
6050 * testsuite/discard_locals_test.sh: Test -r.
6051 * testsuite/Makefile.am (check_DATA): Add
6052 discard_locals_relocatable_test1.syms,
6053 discard_local_relocatable_test2.syms.
6054 (MOSTLYCLEANFILES): Likewise. Also add
6055 discard_locals_relocatable_test1.lout and
6056 discard_locals_relocatable_test2.out.
6057 (discard_locals_relocatable_test1.syms): New target.
6058 (discard_locals_relocatable_test.o): New target.
6059 (discard_locals_relocatable_test1.out): New target.
6060 (discard_locals_relocatable_test2.syms): New target.
6061 (discard_locals_relocatable_test2.out): New target.
6062 (various): Add missing ../ld-new dependencies.
6063 * testsuite/Makefile.in: Rebuild.
6064
6065 2010-03-03 Nick Clifton <nickc@redhat.com>
6066
6067 * po/fi.po: New Finnish translation.
6068
6069 2010-03-01 Doug Kwan <dougkwan@google.com>
6070
6071 * layout.cc (Layout::Layout): Force section types of .init_array*,
6072 .preinit_array* and .fini_array* sections.
6073 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6074 Fix check of return value of std::string::find.().
6075 (Output_section::Input_section_sort_compare::operator()): Remove
6076 comment about .init_array.
6077 (Output_section::Input_section_sort_init_fini_compare::operator()):
6078 New method.
6079 (Output_section::sort_attached_input_sections): Handle .init_array
6080 and .fini_array specially.
6081 * output.h (Output_section::Inut_section_sort_compare): Update
6082 comment.
6083 (Output_section::Input_section_sort_init_fini_compare): New struct.
6084
6085 2010-02-26 Doug Kwan <dougkwan@google.com>
6086
6087 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6088 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6089 * testsuite/debug_msg.sh: Avoid matching source line number for
6090 use of global variable undef_int.
6091
6092 2010-02-26 Doug Kwan <dougkwan@google.com>
6093
6094 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6095 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6096 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6097 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6098 * options.cc (General_options::General_options): Initialize member
6099 fix_v4bx_.
6100 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6101 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6102 and rm_no_fix_v4bx.stdout
6103 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6104 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6105 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6106 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6107 and arm_no_fix_v4bx.
6108 * Makefile.in: Regenerate.
6109 * testsuite/arm_fix_v4bx.s: New file.
6110 * testsuite/arm_fix_v4bx.sh: Ditto.
6111
6112 2010-02-24 Doug Kwan <dougkwan@google.com>
6113
6114 * arm.cc (Target_arm::got_section): Make the .got section the first
6115 non RELRO section in the data segment.
6116 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6117 suffixes of section names.
6118
6119 2010-02-24 Doug Kwan <dougkwan@google.com>
6120
6121 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6122 flags and attributes merging if an input file is a binary file.
6123 * fileread.cc (Input_file::open): Record format of original file.
6124 * fileread.h (Input_file::Format): New enum type.
6125 (Input_file::Input_file): Initialize data member format_.
6126 (Input_file::format): New method definition.
6127 (Input_file::format_):: New data member.
6128
6129 2010-02-24 Doug Kwan <dougkwan@google.com>
6130
6131 * arm.cc (Arm_output_data_got): New class.
6132 (ARM_TCB_SIZE): New constant
6133 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6134 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6135 If user uses a script with a SECTIONS clause, issue only a warning
6136 for a misplaced EXIDX input section. Otherwise, issue an error.
6137 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6138 garbage collection.
6139 (Target_arm::got_mode_index_entry): Handle static linking.
6140 (Target_arm::Scan::local): Ditto.
6141 (Target_arm::Scan::global): Ditto.
6142 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6143 all incorrectly implemented relocations.
6144 (Target_arm::fix_exidx_coverage): Pass layout to
6145 Arm_output_section::fix_exidx_coverage.
6146 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6147 from ".ARM.exidx." and ".ARM.extab.".
6148
6149 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6150
6151 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6152 section if it does not already exist.
6153 * attributes.cc (Attributes_section_data::Attributes_section_data):
6154 Don't crash if size is zero.
6155
6156 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6157 Ian Lance Taylor <iant@google.com>
6158
6159 * gold.cc (queue_middle_tasks): If no input files were opened,
6160 exit.
6161 * workqueue.h (Task_function::Task_function): Assert that there is
6162 a blocker.
6163
6164 2010-02-22 Doug Kwan <dougkwan@google.com>
6165
6166 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6167 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6168 types to avoid warnings due to different uint64_t implementations
6169 on different hosts.
6170
6171 2010-02-21 Doug Kwan <dougkwan@google.com>
6172
6173 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6174 handling of the maximum backward branch offset.
6175 (Arm_relocate_functions::thumb_branch_common): Ditto.
6176 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6177 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6178 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6179 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6180 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6181 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6182 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6183 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6184 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6185 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6186 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6187 thumb2_bl_out_of_range.o): New rules.
6188 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6189 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6190 thumb2_bl_out_of_range
6191 * testsuite/Makefile.in: Regenerate.
6192 * testsuite/arm_bl_in_range.s: New file.
6193 * testsuite/arm_bl_out_of_range.s: Ditto.
6194 * testsuite/arm_branch_in_range.sh: Ditto.
6195 * testsuite/arm_branch_range.t: Ditto.
6196 * testsuite/thumb2_branch_range.t: Ditto.
6197 * testsuite/thumb_bl_in_range.s: Ditto.
6198 * testsuite/thumb_bl_out_of_range.s: Ditto.
6199 * testsuite/thumb_branch_range.t: Ditto.
6200
6201 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6202
6203 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6204 Add reloc offset information.
6205 * icf.cc (get_section_contents): Change iterators to point to the new
6206 vectors. Add reloc offset information to the contents.
6207 * icf.h (Icf::Sections_reachable_info): New typedef.
6208 (Icf::Sections_reachable_list): New typedef.
6209 (Icf::Offset_info): New typedef.
6210 (Icf::Reloc_info): New struct typedef.
6211 (Icf::Reloc_info_list): New typedef.
6212 (Icf::symbol_reloc_list): Delete method.
6213 (Icf::addend_reloc_list): Delete method.
6214 (Icf::section_reloc_list): Delete method.
6215 (Icf::reloc_info_list): New method.
6216 (Icf::reloc_info_list_): New member.
6217
6218 2010-02-19 Doug Kwan <dougkwan@google.com>
6219
6220 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6221 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6222 * arm.cc (Arm_relocation_functions): New forward declaration.
6223 (Target_arm::Target_arm): Initialize new data members
6224 got_mod_index_offset_ and tls_base_symbol_defined_.
6225 (Target_arm::Relocate::relocate_tls): New method.
6226 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6227 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6228 New methods.
6229 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6230 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6231 (Target_arm::got_mod_index_offset_,
6232 Target_arm::tls_base_symbol_defined_): New data members.
6233 (Target_arm::Scan::local, Target::Scan::global,
6234 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6235 relocations.
6236
6237 2010-02-18 Doug Kwan <dougkwan@google.com>
6238
6239 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6240 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6241 text section as a parameter becuase some broken tools may not set
6242 the link in section header.
6243 (Target_arm::has_got_section): New method.
6244 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6245 without any mapping symbol as data only. Remove warning.
6246 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6247 link in its section header, try to discover the link by inspecting the
6248 REL31 relocation at the beginning of the section.
6249 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6250 in error message.
6251 (Target_arm::Scan::global): Treat any reference to the symbol
6252 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6253
6254 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6255
6256 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6257 (Scan::global_reloc_may_be_function_pointer): New function.
6258 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6259 (Scan::global_reloc_may_be_function_pointer): New function.
6260 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6261 (Scan::global_reloc_may_be_function_pointer): New function.
6262 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6263 (Scan::global_reloc_may_be_function_pointer): New function.
6264 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6265 (Scan::global_reloc_may_be_function_pointer): New function.
6266 (Scan::possible_function_pointer_reloc): New function.
6267 (Target_x86_64::can_check_for_function_pointers): New function.
6268 * gc.h (gc_process_relocs): Scan relocation types to determine if
6269 function pointers were taken for targets that support it.
6270 * icf.cc (Icf::find_identical_sections): Include functions for
6271 folding in safe ICF whose pointer is not taken.
6272 * icf.h (Secn_fptr_taken_set): New typedef.
6273 (fptr_section_id_): New member.
6274 (section_has_function_pointers): New function.
6275 (set_section_has_function_pointers): New function.
6276 (check_section_for_function_pointers): New function.
6277 * options.h: Fix comment for safe ICF option.
6278 * target.h (can_check_for_function_pointers): New function.
6279 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6280 Modify icf_safe_test for X86-64.
6281 * testsuite/Makefile.in: Regenerate.
6282 * testsuite/icf_safe_so_test.cc: New file.
6283 * testsuite/icf_safe_so_test.sh: New file.
6284 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6285 (main): Change to take pointer to function kept_func_3.
6286 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6287 folding is done correctly for X86-64.
6288
6289 2010-02-12 David S. Miller <davem@davemloft.net>
6290
6291 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6292 is_symbolless parameter.
6293 (Output_reloc<SHT_REL>::is_symbolless): New.
6294 (Output_reloc<SHT_REL>::is_symbolless_): New.
6295 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6296 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6297 (Output_reloc<SHT_RELA>::is_symbolless): New.
6298 (Output_data_reloc::add_global): Handle is_symbolless.
6299 (Output_data_reloc::add_global_relative): Likewise.
6300 (Output_data_reloc::add_local): Likewise.
6301 (Output_data_reloc::add_local_relative): Likewise.
6302 (Output_data_reloc::add_symbolless_global_addend): New.
6303 (Output_data_reloc::add_symbolless_local_addend): New.
6304 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6305 is_symbolless.
6306 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6307 instead of ->is_relative_
6308 (Output_reloc::write): Likewise.
6309 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6310 (Output_reloc::write_rel): Simplify.
6311
6312 * sparc.cc (Target_sparc::Scan::local): Use
6313 ->add_symbolless_local_addend as needed.
6314 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6315 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6316 based upon relocation offset.
6317
6318 2010-02-11 Doug Kwan <dougkwan@google.com>
6319
6320 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6321 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6322 beginning of function.
6323 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6324 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6325 parameter is_32bit in calls to should_apply_static_reloc.
6326 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6327 (check_DATA): Add arm_abs_global.stdout.
6328 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6329 arm_abs_global.stdout): New rules.
6330 (MOSTLLYCLEANFILES): Add arm_abs_global
6331 * Makefile.in: Regenerate.
6332 * testsuite/arm_abs_global.s: New file.
6333 * testsuite/arm_abs_global.sh: Ditto.
6334 * testsuite/arm_abs_lib.s: Ditto.
6335
6336 2010-02-11 Ian Lance Taylor <iant@google.com>
6337
6338 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6339 Read_relocs task.
6340 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6341 Allocate_commons_task first.
6342 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6343 task, rather than symtab_lock_.
6344 (Gc_process_relocs::~Gc_process_relocs): New function.
6345 (Gc_process_relocs::is_runnable): Check this_blocker_.
6346 (Gc_process_relocs::locks): Use next_blocker_ rather than
6347 blocker_.
6348 (Scan_relocs::~Scan_relocs): New function.
6349 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6350 symtab_lock_.
6351 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6352 next_blocker_.
6353 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6354 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6355 constructor accordingly.
6356 (class Gc_process_relocs): Likewise.
6357 (class Scan_relocs): Likewise.
6358 * common.h (class Allocate_commons_task): Remove symtab_lock_
6359 field, and corresponding constructor parameter.
6360 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6361 symtab_lock_.
6362 (Allocate_commons_task::locks): Likewise.
6363
6364 2010-02-11 Ian Lance Taylor <iant@google.com>
6365
6366 * gold-threads.h (class Once): Define.
6367 (class Initialize_lock): Rewrite as child of Once.
6368 * gold-threads.cc (class Once_initialize): Define.
6369 (once_pointer_control): New static variable.
6370 (once_pointer, once_arg): New static variables.
6371 (c_run_once): New static function.
6372 (Once::Once, Once::run_once, Once::internal_run): New functions.
6373 (class Initialize_lock_once): Remove.
6374 (initialize_lock_control): Remove.
6375 (initialize_lock_pointer): Remove.
6376 (initialize_lock_once): Remove.
6377 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6378 (Initialize_lock::initialize): Rewrite.
6379 (Initialize_lock::do_run_once): New function.
6380 * archive.cc (Archive::interpret_header): Only clear name if it is
6381 not already empty.
6382 * fileread.cc: Include "gold-threads.h"
6383 (file_counts_lock): New static variable.
6384 (file_counts_initialize_lock): Likewise.
6385 (File_read::release): Only increment counts when using --stats.
6386 Use a lock around the increment.
6387 * parameters.cc (class Set_parameters_target_once): Define.
6388 (set_parameters_target_once): New static variable.
6389 (Parameters::Parameters): Move here from parameters.h.
6390 (Parameters::set_target): Rewrite.
6391 (Parameters::set_target_once): New function.
6392 (Parameters::clear_target): Move here and rewrite.
6393 * parameters.h (class Parameters): Update declarations. Add
6394 set_parameters_target_once_ field.
6395 (Parameters::Parameters): Move to parameters.cc.
6396 (Parameters::clear_target): Likewise.
6397 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6398 task.
6399 (Start_group::~Start_group): New function.
6400 (Start_group::is_runnable): New function.
6401 (Start_group::locks, Start_group::run): New functions.
6402 (Finish_group::run): Change saw_undefined to size_t.
6403 * readsyms.h (class Start_group): Define.
6404 (class Finish_group): Change saw_undefined_ field to size_t.
6405 (Finish_group::Finish_group): Remove saw_undefined and
6406 this_blocker parameters. Change all callers.
6407 (Finish_group::set_saw_undefined): New function.
6408 (Finish_group::set_blocker): New function.
6409 * symtab.h (class Symbol_table): Change saw_undefined to return
6410 size_t. Change saw_undefined_ field to size_t.
6411 * target-select.cc (Set_target_once::do_run_once): New function.
6412 (Target_selector::Target_selector): Initialize set_target_once_
6413 field. Don't initialize lock_ and initialize_lock_ fields.
6414 (Target_selector::instantiate_target): Rewrite.
6415 (Target_selector::set_target): New function.
6416 * target-select.h (class Set_target_once): Define.
6417 (class Target_selector): Update declarations. Make
6418 Set_target_once a friend. Remove lock_ and initialize_lock_
6419 fields. Add set_target_once_ field.
6420
6421 2010-02-10 Ian Lance Taylor <iant@google.com>
6422
6423 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6424 queueing any tasks.
6425 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6426 (queue_middle_tasks): Add all blockers before queueing any tasks.
6427 (queue_final_tasks): Likewise.
6428 * token.h (Task_token::add_blockers): New function.
6429 * object.h (Input_objects::number_of_relobjs): New function.
6430
6431 2010-02-10 Ian Lance Taylor <iant@google.com>
6432
6433 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6434 shared, not if not position independent.
6435 * x86_64.cc (Relocate::relocate_tls): Likewise.
6436 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6437 (tls_pie_pic_test): New target.
6438 * testsuite/Makefile.in: Rebuild.
6439
6440 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6441 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6442 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6443 * testsuite/Makefile.in: Rebuild.
6444
6445 2010-02-09 David S. Miller <davem@davemloft.net>
6446
6447 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6448 R_SPARC_RELATIVE using ->add_local_relative().
6449 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6450
6451 * output.h (Output_data_dynamic::add_section_size): New method
6452 that takes two Output_data objects.
6453 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6454 entry param. Handle it in initializers.
6455 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6456 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6457 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6458 arg.
6459 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6460 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6461 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6462 for dynrel_includes_plt.
6463 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6464 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6465 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6466 before .rela.plt
6467 (Target_sparc::do_finalize_sections): Update to pass true for
6468 dynrel_includes_plt.
6469 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6470 output before .rela.plt
6471 (Target_powerpc::do_finalize_sections): Update to pass true for
6472 dynrel_includes_plt when 32-bit.
6473
6474 2010-02-08 Doug Kwan <dougkwan@google.com>
6475
6476 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6477 method.
6478 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6479 Arm_relobj::scan_section_for_cortex_a8_stubs,
6480 Arm_relobj::do_relocation_section): Instead of calling
6481 Output_section::output_address, use faster
6482 Arm_relobj::simple_input_section_output_address.
6483
6484 2010-02-08 David S. Miller <davem@davemloft.net>
6485
6486 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6487 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6488 relocation helper function.
6489
6490 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6491 just like R_SPARC_GOT{10,13,22}.
6492 (Target_sparc::Scan::local): Likewise.
6493 (Target_sparc::Relocate:relocate): Likewise.
6494
6495 2010-02-06 Ian Lance Taylor <iant@google.com>
6496
6497 * configure.ac: Rewrite targetobjs duplicate removal code to use
6498 only shell constructs.
6499 * configure: Rebuild.
6500
6501 2010-02-05 Doug Kwan <dougkwan@google.com>
6502
6503 PR 11247
6504 * arm.cc (Arm_relobj::section_is_scannable): New method.
6505 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6506 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6507
6508 2010-02-04 Doug Kwan <dougkwan@google.com>
6509
6510 PR 11247
6511 * arm-reloc-property.cc (cstdio): Include.
6512 * configure.ac (targetobjs): Remove duplicates.
6513 * configure: Regenerate.
6514 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6515 big and little endian version for a given address size.
6516
6517 2010-02-03 Doug Kwan <dougkwan@google.com>
6518
6519 * arm-reloc-property.cc
6520 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6521 definition.
6522 * arm-reloc-property.h
6523 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6524 New method definition.
6525 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6526 declaration.
6527 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6528 overflow to N.
6529 (GOT_PREL): Change implemented to Y.
6530 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6531 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6532 (Arm_relocate_functions::movw_abs_nc): Remove method.
6533 (Arm_relocate_functions::movt_abs): Ditto.
6534 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6535 (Arm_relocate_functions::thm_movt_abs): Ditto.
6536 (Arm_relocate_functions::movw_rel_nc): Ditto.
6537 (Arm_relocate_functions::movw_rel): Ditto.
6538 (Arm_relocate_functions::movt_rel): Ditto.
6539 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6540 (Arm_relocate_functions:thm_movw_rel): Ditto.
6541 (Arm_relocate_functions:thm_movt_rel): Ditto.
6542 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6543 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6544 New method definitions.
6545 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6546 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6547 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6548 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6549 (Target_arm::Relocate::relocate): Check for non-static or
6550 unimplemented relocation code and exit early. Change calls to
6551 Target_arm::reloc_uses_thumb_bit and
6552 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6553 instead. Refactor code to handle similar relocations to increase
6554 code sharing. Remove check for unsupported relocation code in switch
6555 statement.
6556 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6557 relocation property table to find out size. Change error message to
6558 print out the name of a relocation code instead of the numeric value.
6559 (Target_arm::scan_reloc_for_stub): Use relocation property table
6560 instead of calling Target_arm::reloc_uses_thumb_bit().
6561
6562 2010-02-02 Doug Kwan <dougkwan@google.com>
6563
6564 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6565 types of relaxed input section.
6566
6567 2010-02-02 Doug Kwan <dougkwan@google.com>
6568
6569 * Makefile.am (HFILES): Add arm-reloc-property.h.
6570 (DEFFILES): New.
6571 (TARGETSOURCES): Add arm-reloc-property.cc
6572 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6573 (libgold_a_SOURCES): $(DEFFILES)
6574 * Makefile.in: Regenerate.
6575 * arm-reloc-property.cc: New file.
6576 * arm-reloc-property.h: New file.
6577 * arm-reloc.def: New file.
6578 * arm.cc: Update comments.
6579 (arm-reloc-property.h): New included header.
6580 (arm_reloc_property_table): New global variable.
6581 (Target_arm::do_select_as_default_target): New method definition.
6582 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6583 arm-reloc-property to targ_extra_obj.
6584 * parameters.cc (set_parameters_target): Call
6585 Target::select_as_default_target().
6586 * target.h (Target::select_as_default_target): New method definition.
6587 (Target::do_select_as_default_target): Same.
6588
6589 2010-02-01 Doug Kwan <dougkwan@google.com>
6590
6591 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6592 first_output_text_section_.
6593 (Arm_exidx_fixup::first_output_text_section): New method definition.
6594 (Arm_exidx_fixup::first_output_text_section_): New data member.
6595 (Arm_exidx_fixup::process_exidx_section): Record the first text
6596 output section seen.
6597 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6598 and entsize in output section header.
6599
6600 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6601
6602 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6603 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6604 (Arm_relocate_functions::thm_alu11): New Method.
6605 (Arm_relocate_functions::thm_pc8): New Method.
6606 (Arm_relocate_functions::thm_pc12): New Method.
6607 (Target_arm::Scan::local): Handle the relocations.
6608 (Target_arm::Scan::global): Likewise.
6609 (Target_arm::Relocate::relocate): Likewise.
6610 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6611
6612 2010-01-29 Doug Kwan <dougkwan@google.com>
6613
6614 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6615 of relocation types as ld.
6616
6617 2010-01-29 Doug Kwan <dougkwan@google.com>
6618
6619 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6620 to public.
6621 (Arm_relocate_functions::thumb_branch_common): Ditto.
6622 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6623 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6624 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6625 Arm_relocate_functions::jump24): Remove.
6626 (Target_arm::Relocate::relocate): Adjust code to call
6627 Arm_relocation_functions::arm_branch_common and
6628 Arm_relocation_functions::thumb_branch_common instead of their removed
6629 wrappers. Merge switch-cases together to reduce source code size.
6630
6631 2010-01-29 Doug Kwan <dougkwan@google.com>
6632
6633 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6634 output_local_symbol_count_needs_update_.
6635 (Arm_relobj::output_local_symbol_count_needs_update,
6636 Arm_relobj::set_output_local_symbol_count_needs_update,
6637 Arm_relobj::update_output_local_symbol_count): New methods.
6638 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6639 member.
6640 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6641 of pointed function as in a R_ARM_PREL31 relocation.
6642 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6643 for output local symbol count updating.
6644 (Target_arm::do_relax): Update output local symbol counts in objects
6645 if necessary.
6646 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6647
6648 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6649
6650 * arm.cc: Added support for the ARM relocations:
6651 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6652 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6653 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6654 movw_prel_nc).
6655 (Arm_relocate_functions::movw_rel): New method.
6656 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6657 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6658 thm_movw_prel_nc).
6659 (Arm_relocate_functions::thm_movw_rel): New method.
6660 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6661 thm_movt_prel).
6662 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6663 relocations.
6664 (Target_arm::Scan::global): Likewise.
6665 (Target_arm::Relocate::relocate): Likewise.
6666 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6667 Likewise.
6668
6669 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6670
6671 * arm.cc: Added support for ARM group relocations.
6672 (Target_arm::reloc_needs_sym_origin): New method.
6673 (Arm_relocate_functions::calc_grp_kn): New method.
6674 (Arm_relocate_functions::calc_grp_residual): New method.
6675 (Arm_relocate_functions::calc_grp_gn): New method.
6676 (Arm_relocate_functions::arm_grp_alu): New Method.
6677 (Arm_relocate_functions::arm_grp_ldr): New Method.
6678 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6679 (Arm_relocate_functions::arm_grp_ldc): New Method.
6680 (Target_arm::Scan::local): Handle the ARM group relocations.
6681 (Target_arm::Scan::global): Likewise.
6682 (Target_arm::Relocate::relocate): Likewise.
6683 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6684 Likewise.
6685
6686 2010-01-26 Doug Kwan <dougkwan@google.com>
6687
6688 * arm.cc (set): Include.
6689 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6690 pointer type.
6691 (Arm_output_section::Text_section_list): New type.
6692 (Arm_output_section::append_text_sections_to_list): New method.
6693 (Arm_output_section::fix_exidx_coverage): Ditto.
6694 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6695 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6696 Relobj::set_section_offset() instead of
6697 Sized_relobj::invalidate_section_offset().
6698 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6699 parameter for section headers. Ignore relocation sections for
6700 unallocated sections and EXIDX sections.
6701 (Target_arm::fix_exidx_coverage): New method.
6702 (Target_arm::output_section_address_less_than): New type.
6703 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6704 linked text section instead of the EXIDX section.
6705 (Arm_output_section::create_stub_group): Add an assertion to check
6706 that this is not an EXIDX output section.
6707 (Arm_output_section::append_text_sections_to_list): New method.
6708 (Arm_output_section::fix_exidx_coverage): Ditto.
6709 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6710 Arm_relobj::section_needs_reloc_stub_scanning.
6711 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6712 first pass.
6713 (Target_arm::fix_exidx_coverage): New method.
6714 * object.h (Relobj::set_output_section): New method.
6715 (Sized_relobj::invalidate_section_offset): Remove method.
6716 (Sized_relobj::do_invalidate_section_offset): Remove method.
6717 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6718
6719 2010-01-25 Doug Kwan <dougkwan@google.com>
6720
6721 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6722 Fix warning due to signed and unsigned comparison on a 32-bit host.
6723
6724 2010-01-22 Doug Kwan <dougkwan@google.com>
6725
6726 * arm.cc (Target_arm::do_relax): Record an output section for section
6727 offset adjustment it contains any stub table that has changed.
6728 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6729 offsets in an output section if necessary.
6730 * output.cc (Output_section::Output_section): Initialize
6731 section_offsets_need_adjustments_.
6732 (Output_section::add_input_section_for_script): Renamed to
6733 Output_section::add_simple_input_section.
6734 (Output_section::save_states): Add a comment.
6735 (Output_section::discard_states): New method defintion.
6736 (Output_section::adjust_section_offsets): Same.
6737 * output.h (Output_section::add_input_section_for_script): Renamed to
6738 Output_section::add_simple_input_section.
6739 (Output_section::discard_states): New method declaration.
6740 (Output_section::adjust_section_offsets): Same.
6741 (Output_section::section_offsets_need_adjustment,
6742 Output_section::set_section_offsets_need_adjustment): New method
6743 definitions.
6744 (Output_section::section_offsets_need_adjustment_): New data member.
6745 * script-sections.cc
6746 (Output_section_element_input::set_section_address): Adjust code for
6747 renaming of Output_section::add_input_section_for_script.
6748 (Orphan_output_section::set_section_address): Same.
6749
6750 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6751
6752 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6753 Fix_v4bx enum values .
6754 * gold/options.h (General_options): New option definitions.
6755 (General_options::fix_v4bx): New method.
6756 (General_options::Fix_v4bx): New enum.
6757 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6758 (General_options::parse_fix_v4bx_interworking): New method.
6759
6760 2010-01-22 Doug Kwan <dougkwan@google.com>
6761
6762 * arm.cc (Arm_exidx_fixup): New class.
6763
6764 2010-01-21 Doug Kwan <dougkwan@google.com>
6765
6766 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6767 classes.
6768 (Arm_exidx_section_offset_map): New type.
6769
6770 2010-01-21 Doug Kwan <dougkwan@google.com>
6771
6772 * arm.cc (Arm_exidx_input_section): New class.
6773 (Arm_relobj::exidx_input_section_by_link,
6774 Arm_relobj::exidx_input_section_by_shndx,
6775 Arm_relobj::make_exidx_input_section): New methods.
6776 (read_arm_attributes_section): Remove.
6777 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6778 information about them.
6779 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6780 to here.
6781
6782 2010-01-20 Doug Kwan <dougkwan@google.com>
6783
6784 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6785 Input_section_specifier to Section_id.
6786 (Target_arm::new_arm_input_section: Adjust code for change of key
6787 type.
6788 (Target_arm::find_arm_input_section): Ditto.
6789 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6790 (Section_id): Remove.
6791 (Garbage_collection::Section_id_hash): Remove.
6792 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6793 (Section_id): Remove.
6794 (Icf::Section_id_hash): Remove.
6795 * object.h (Section_id, Const_section_id, Section_id_hash,
6796 Const_section_id_hash): New type definitions.
6797 * output.cc (Output_section::add_relaxed_input_section): Change to
6798 use Const_section_id instead of Input_section_specifier as key type.
6799 (Output_section::add_merge_input_section): Ditto.
6800 (Output_section::build_relaxation_map): Change to use Section_id
6801 instead of Input_section_specifier as key type.
6802 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6803 Ditto.
6804 (Output_section::convert_input_sections_to_relaxed_sections): Change
6805 to use Const_section_id instead of Input_section_specifier as key type.
6806 (Output_section::find_merge_section): Ditto.
6807 (Output_section::find_relaxed_input_section): Ditto.
6808 * output.h (Input_section_specifier): Remove class.
6809 (Output_section::Output_section_data_by_input_section_map): Change
6810 key type to Const_section_id.
6811 (Output_section::Output_relaxed_input_section_by_input_section_map):
6812 Ditto.
6813 (Output_section::Relaxation_map): Change key type to Section_id.
6814
6815 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6816
6817 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6818 (class Arm_v4bx_stub): New class.
6819 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6820 (Stub_factory::make_arm_v4bx_stub): New method.
6821 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6822 (Stub_table::empty): Handle v4bx stubs.
6823 (Stub_table::add_arm_v4bx_stub): New method.
6824 (Stub_table::find_arm_v4bx_stub): New method.
6825 (Arm_relocate_functions::v4bx): New method.
6826 (Target_arm::fix_v4bx): New method.
6827 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6828 (Stub_table::relocate_stubs): Likewise.
6829 (Stub_table::do_write): Likewise.
6830 (Stub_table::update_data_size_and_addralign): Likewise.
6831 (Stub_table::finalize_stubs): Likewise.
6832 (Target_arm::Scan::local): Likewise.
6833 (Target_arm::Scan::global): Likewise.
6834 (Target_arm::do_finalize_sections): Likewise.
6835 (Target_arm::Relocate::relocate): Likewise.
6836 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6837 Likewise.
6838 (Target_arm::scan_reloc_for_stub): Likewise.
6839 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6840
6841 2010-01-19 Ian Lance Taylor <iant@google.com>
6842
6843 * output.cc (Output_section_headers::do_sized_write): Write large
6844 segment count to sh_info field.
6845 (Output_file_header::do_sized_write): For large segment count,
6846 write PN_XNUM to e_phnum field.
6847
6848 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6849
6850 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6851 (Arm_relocate_functions::thm_jump8): New function.
6852 (Arm_relocate_functions::thm_jump11): New function.
6853 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6854 R_ARM_THM_JUMP11.
6855 (Target_arm::Scan::global): Likewise.
6856 (Target_arm::Relocate::relocate): Likewise.
6857 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6858 Likewise.
6859
6860 2010-01-14 Doug Kwan <dougkwan@google.com>
6861
6862 * arm.cc (map, utility): Include headers.
6863 (Target_arm::apply_cortex_a8_workaround): New method.
6864 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6865 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6866 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6867 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6868 the --[no-]fix-cortex-a8 command line options.
6869 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6870 (Target_arm::relocate_stub): Use addend in instruction template.
6871 * options.h (DEFINE_bool): Set the user-set flag.
6872 (General_options): Add --[no-]-fix-cortex options.
6873 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
6874 : Update fast look-up map after conversion.
6875
6876 2010-01-14 Sriraman Tallam <tmsriram@google.com>
6877
6878 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6879 in the first pass of do_layout.
6880
6881 2010-01-13 Doug Kwan <dougkwan@google.com>
6882
6883 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6884 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6885 apparent compiler problem of not folding static constant integral
6886 data members of elfcpp::Elf_sizes<32>.
6887
6888 2010-01-13 Doug Kwan <dougkwan@google.com>
6889
6890 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6891 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6892 Arm_relobj::scan_section_for_cortex_a8_erratum,
6893 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6894 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6895 sections to scan for relocation stubs into a new method
6896 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6897 relocation and Cortex-A8 stub scanning.
6898 (Target_arm::do_relax): Force stubs to be after stubbed sections
6899 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
6900 the beginning of a new relaxation pass. Update a comment.
6901 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6902
6903 2010-01-12 Ian Lance Taylor <iant@google.com>
6904
6905 * target-reloc.h (visibility_error): New inline function.
6906 (relocate_section): Call visibility_error.
6907 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6908 (MOSTLYCLEANFILES): Likewise.
6909 (protected_4_pic.o, protected_3.err): New targets.
6910 * testsuite/protected_4.cc: New file.
6911
6912 2010-01-12 Doug Kwan <dougkwan@google.com>
6913
6914 * arm.cc (Cortex_a8_reloc): New class.
6915 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6916 and cortex_a8_relocs_info_.
6917 (Target_arm::fix_cortex_a8): New method definition.
6918 (Target_arm::Cortex_a8_relocs_info): New type.
6919 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6920 New data member declarations.
6921 (Target_arm::scan_reloc_for_stub): Record information about
6922 relocations for THUMB branches that might be exempted from the
6923 Cortex-A8 workaround.
6924 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6925 at the beginning of a relaxation pass.
6926
6927 2010-01-12 Doug Kwan <dougkwan@google.com>
6928
6929 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6930 (Arm_relobj::Mapping_symbol_position,
6931 Arm_reloj::Mapping_symbol_position_less,
6932 Arm_relobj::Mapping_symbols_info): New types.
6933 (Target_arm::is_mapping_symbol_name): New method definition.
6934 (Arm_relobj::do_count_local_symbols): Save information about mapping
6935 symbols.
6936
6937 2010-01-11 Doug Kwan <dougkwan@google.com>
6938
6939 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6940 Arm_relocate_functions::thumb32_branch_upper,
6941 Arm_relocate_functions::thumb32_branch_lower,
6942 Arm_relocate_functions::thumb32_cond_branch_offset,
6943 Arm_relocate_functions::thumb32_cond_branch_upper,
6944 Arm_relocate_functions::thumb32_cond_branch_lower,
6945 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6946 branch offset encoding.
6947 (Arm_relocate_functions::thumb_branch_common): Use new branch
6948 offset encoding methods to avoid code duplication.
6949 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6950 (Stub_addend_reader::operator()): Use new branch encoding method
6951 to avoid code duplication.
6952
6953 2010-01-11 Doug Kwan <dougkwan@google.com>
6954
6955 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6956 (Target_arm::do_finalize_sections): Define special EXIDX section
6957 symbols only if referenced.
6958 * gc.h (Garbage_collection::add_reference): New method.
6959 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6960 code duplication.
6961
6962 2010-01-11 Ian Lance Taylor <iant@google.com>
6963
6964 * script.cc (Version_script_info::build_expression_list_lookup):
6965 Change complaing about duplicate wildcard match from error to
6966 warning.
6967
6968 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6969 of 2009-12-30.
6970 (Version_script_info::Version_script_info): Initialize globs_,
6971 default_version_, default_is_global_, and exact_. Don't
6972 initialize globals_ or locals_.
6973 (Version_script_info::build_lookup_tables): Build local symbols
6974 first.
6975 (Version_script_info::unquote): New function.
6976 (Version_script_info::add_exact_match): New function.
6977 (Version_script_info::build_expression_list_lookup): Remove lookup
6978 parameter. Add is_global parameter. Change all callers. Handle
6979 wildcard pattern specially. Unquote pattern. Call
6980 add_exact_match.
6981 (Version_script_info::get_name_to_match): New function.
6982 (Version_script_info::get_symbol_version): New function.
6983 (Version_script_info::get_symbol_version_helper): Remove.
6984 (Version_script_info::check_unmatched_names): Call unquote.
6985 * script.h (class Version_script_info): Change get_symbol_version
6986 to be non-inline and add is_global parameter; change all callers.
6987 Rewrite symbol_is_local. Update declarations. Define struct
6988 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6989 Remove globals_ and locals_ members. Add exact_, globs_,
6990 default_version_, is_global_.
6991 (Version_script_info::Glob): Remove pattern, add expression and
6992 is_global. Update constructor. Change all callers.
6993 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6994 default version.
6995 (Versions::symbol_section_contents): If a symbol is undefined, or
6996 defined in a dynamic object, set the version index to
6997 VER_NDX_LOCAL.
6998 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6999 symbol_is_local.
7000 (Symbol_table::add_from_pluginobj): Likewise.
7001 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7002
7003 2010-01-11 Doug Kwan <dougkwan@google.com>
7004
7005 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7006 (incremental_dump_LDADD): Add linking option for libintl.
7007 * Makefile.in: Regenerate.
7008
7009 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7010
7011 PR gold/11144
7012 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7013 instead of -Ds.
7014 * testsuite/Makefile.in: Regenerated.
7015
7016 2010-01-10 Doug Kwan <dougkwan@google.com>
7017
7018 * options.h (DEFINE_var): Use parentheses around argument varname__
7019 in macro body to avoid any unintended subsequent substitutions.
7020
7021 2010-01-10 Ian Lance Taylor <iant@google.com>
7022
7023 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7024 candidates before doing symbol resolution.
7025
7026 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7027 ODR candidates if only one is weak.
7028
7029 2010-01-08 Ian Lance Taylor <iant@google.com>
7030
7031 * script.cc (Version_script_info::build_expression_list_lookup):
7032 Don't warn about ambiguous version, just record the ambiguity.
7033 (Version_script_info::get_symbol_version_helper): Give error if
7034 version is ambiguous.
7035
7036 2010-01-08 Doug Kwan <dougkwan@google.com>
7037
7038 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7039 prev_data_size_ and prev_addralign_. Remove initializer for
7040 deleted data member has_been_changed_.
7041 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7042 to determine if the table is empty.
7043 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7044 Remove.
7045 (Stub_table::add_reloc_stub): Define method in class definition
7046 instead of just declaring it there.
7047 (Stub_table::add_cortex_a8_stub): New method definition.
7048 (Stub_table::update_data_size_and_addralign): Ditto.
7049 (Stub_table::finalize_stubs): Ditto.
7050 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7051 (Stub_table::do_addralign_): Return address alignment in the
7052 (Stub_table::do_reset_address_and_file_offset): Define method in
7053 class definition instead of declaring it there. Set current data
7054 size to be the data size of the previous pass.
7055 (Stub_table::set_final_data_size): Use current data size as the
7056 final data size.
7057 (Stub_table::relocate_stub): Change parameter type of stub from
7058 Reloc_stub pointer to Stub pointer.
7059 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7060 (Stub_table::Cortex_a8_stub_list): New typedef.
7061 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7062 Stub_table::prev_addralign_): New data member.
7063 (Arm_relobj::Arm_relobj): Initialize data member
7064 section_has_cortex_a8_workaround_.
7065 (Arm_relobj::section_has_cortex_a8_workaround,
7066 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7067 definitions.
7068 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7069 declarations.
7070 (Target_arm::relocate_stub): Change parameter type of stub from
7071 Reloc_stub pointer to Stub pointer.
7072 (Insn_template::size, Insn_template::alignment): Handle
7073 THUMB16_SPECIAL_TYPE.
7074 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7075 Stub_table::update_data_size_and_addralign,
7076 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7077 definitions.
7078 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7079 (Stub_table::do_write): Ditto.
7080 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7081
7082 2010-01-08 Ian Lance Taylor <iant@google.com>
7083
7084 PR 11108
7085 * symtab.h (class Symbol): Remove fields is_target_special_ and
7086 has_plt_offset_. Add field is_defined_in_discarded_section_.
7087 (Symbol::is_defined_in_discarded_section): New function.
7088 (Symbol::set_is_defined_in_discarded_section): New function.
7089 (Symbol::has_plt_offset): Rewrite.
7090 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7091 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7092 Don't initialize is_target_special_ or has_plt_offset_.
7093 Initialize is_defined_in_discarded_section_.
7094 (Symbol_table::add_from_relobj): If appropriate, set
7095 is_defined_in_discarded_section.
7096 * resolve.cc (Symbol::override_base_with_special): Don't test
7097 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7098 * target-reloc.h (relocate_section): Do special handling for
7099 symbols defined in discarded sections for global symbols as well
7100 as local symbols.
7101
7102 2010-01-08 Ian Lance Taylor <iant@google.com>
7103
7104 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7105 the SHT_SYMTAB case.
7106
7107 2010-01-08 Ian Lance Taylor <iant@google.com>
7108
7109 * object.cc (Sized_relobj::do_layout): Don't get confused if
7110 layout_eh_frame returns NULL.
7111
7112 2010-01-08 Ian Lance Taylor <iant@google.com>
7113
7114 PR 11084
7115 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7116 dynamic symbol table, use the normal symbol table.
7117 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7118 symbol table.
7119
7120 2010-01-08 Ian Lance Taylor <iant@google.com>
7121
7122 PR 11072
7123 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7124 sections.
7125
7126 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7127
7128 * version.cc (print_version): Change to "Copyright 2010".
7129
7130 2010-01-08 Ian Lance Taylor <iant@google.com>
7131
7132 PR 10287
7133 PR 11063
7134 * i386.cc (class Target_i386): Change return type of plt_section
7135 to be non-const.
7136 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7137 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7138 tls_desc_rel_ field.
7139 (Output_data_plt_i386::rel_tls_desc): New function.
7140 (Target_i386::rel_tls_desc_section): New function.
7141 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7142 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7143 R_386_TLS_DESC reloc in rel_tls_desc_section.
7144 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7145 Define struct Tlsdesc_info.
7146 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7147 (Target_x86_64::do_reloc_symbol_index): New function.
7148 (Target_x86_64::add_tlsdesc_info): New function.
7149 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7150 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7151 tlsdesc_rel_ field.
7152 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7153 all callers.
7154 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7155 (Target_x86_64::rela_tlsdesc_section): New function.
7156 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7157 handling.
7158 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7159 (Target_x86_64::do_reloc_addend): New function.
7160 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7161 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7162 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7163 (Output_reloc::type): New function.
7164 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7165 (Output_reloc::is_target_specific): New function.
7166 (Output_reloc::target_arg): New function.
7167 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7168 absolute relocs and target specific relocs.
7169 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7170 add_target_specific.
7171 (class Output_data_reloc) [SHT_RELA]: Likewise.
7172 * output.cc (Output_reloc::Output_reloc): Add four new versions
7173 for absolute relocs and target specific relocs.
7174 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7175 (Output_reloc::get_symbol_index): Likewise.
7176 (Output_reloc::local_section_offset): Check that local_sym_index_
7177 is not TARGET_CODE or 0.
7178 (Output_reloc::symbol_value): Likewise.
7179 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7180 reloc.
7181 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7182 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7183 functions.
7184 * layout.cc (add_target_dynamic_tags): Use output section for
7185 DT_PLTRELSZ and DT_JMPREL.
7186
7187 2010-01-07 Ian Lance Taylor <iant@google.com>
7188
7189 PR 11061
7190 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7191 function.
7192 (class Output_data_reloc_generic): Define.
7193 (class Output_data_reloc_base): Change base class to
7194 Output_data_reloc_generic. Change add() method to call
7195 bump_relative_reloc_count for a relative reloc. Remove
7196 sort_relocs_ field.
7197 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7198 to sort_relocs().
7199 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7200 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7201 appropriate.
7202 * layout.h (class Layout): Update declaration.
7203
7204 2010-01-07 Ian Lance Taylor <iant@google.com>
7205
7206 * output.h (class Output_data): Add const version of
7207 output_section and do_output_section.
7208 (class Output_section_data): Add const version of
7209 do_output_section.
7210 (class Output_section): Likewise.
7211 * layout.cc (Layout::add_target_dynamic_tags): New function.
7212 * layout.h (class Layout): Update declarations.
7213 * arm.cc (Target_arm::do_finalize_sections): Use
7214 add_target_dynamic_tags.
7215 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7216 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7217 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7218 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7219
7220 2010-01-07 Ian Lance Taylor <iant@google.com>
7221
7222 PR 11042
7223 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7224 object as needed.
7225
7226 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7227 Ian Lance Taylor <iant@google.com>
7228
7229 PR 11019
7230 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7231 Xindex::read_symtab_xindex.
7232
7233 2010-01-07 Doug Kwan <dougkwan@google.com>
7234
7235 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7236 (Insn_template::thumb16_bcond_insn): New method declaration.
7237 (Insn_template): Fix spelling.
7238 (Stub::thumb16_special): New method declaration.
7239 (Stub::do_write): Define virtual method which was previously pure
7240 virtual.
7241 (Stub::do_thumb16_special): New method declaration.
7242 (Stub::do_fixed_endian_write): New template member.
7243 (Reloc_stub::do_write): Remove.
7244 (Reloc_stub::do_fixed_endian_write): Remove.
7245 (Cortex_a8_stub): New class definition.
7246 (Stub_factory::make_cortex_a8_stub): New method definition.
7247 (Stub_factory::Stub_factory): Add missing static storage class
7248 qualifier for elf32_arm_stub_a8_veneer_blx.
7249
7250 2010-01-07 Ian Lance Taylor <iant@google.com>
7251
7252 PR 10980
7253 * options.h (class General_options): Add --warn-unresolved-symbols
7254 and --error-unresolved-symbols.
7255 * errors.cc (Errors::undefined_symbol): Implement
7256 --warn-unresolved-symbols.
7257
7258 * options.h (class General_options): Add -z text and -z textoff.
7259 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7260
7261 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7262
7263 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7264 (Garbage_collection::cident_sections): New function.
7265 (Garbage_collection::add_cident_section): New function.
7266 (Garbage_collection::cident_sections_): New member.
7267 (gc_process_relocs): Add references to sections whose names are C
7268 identifiers.
7269 * gold.h (cident_section_start_prefix): New constant.
7270 (cident_section_stop_prefix): New constant.
7271 (is_cident): New function.
7272 * layout.cc (Layout::define_section_symbols): Replace string constants
7273 with the newly defined constants.
7274 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7275 C identifiers.
7276 * testsuite/Makefile.am: Add gc_orphan_section_test.
7277 * testsuite/Makefile.in: Regenerate.
7278 * testsuite/gc_orphan_section_test.cc: New file.
7279 * testsuite/gc_orphan_section_test.sh: New file.
7280
7281 2010-01-06 Ian Lance Taylor <iant@google.com>
7282
7283 PR 10980
7284 * options.h (class General_options): Add --warn-shared-textrel.
7285 * layout.cc (Layout::finish_dynamic_section): Implement
7286 --warn-shared-textrel.
7287
7288 PR 10980
7289 * options.h (class General_options): Add --warn-multiple-gp.
7290
7291 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7292
7293 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7294 $(THREADSLIB) and $(LIBDL).
7295 * Makefile.in: Rebuild.
7296
7297 2010-01-06 Ian Lance Taylor <iant@google.com>
7298
7299 PR 10980
7300 * options.cc (General_options::parse_section_start): New function.
7301 (General_options::section_start): New function.
7302 (General_options::General_options): Initialize all members.
7303 * options.h: Include <map>
7304 (class General_options): Add --section-start. Add section_starts_
7305 member.
7306 * layout.cc (Layout::attach_allocated_section_to_segment): If
7307 --section-start was used, set the address of the segment. Remove
7308 local sort_sections.
7309 (Layout::relaxation_loop_body): If the address of the load segment
7310 has been set by --section-start, don't use it.
7311 * output.h (Output_segment::update_flags_for_output_section): New
7312 function.
7313 * output.cc (Output_segment::add_output_section): Call
7314 update_flags_for_output_section.
7315
7316 2010-01-05 Ian Lance Taylor <iant@google.com>
7317
7318 PR 10980
7319 * options.h (class General_options): Add --undefined-version.
7320 * script.cc (struct Version_expression): Add was_matched_by_symbol
7321 field.
7322 (Version_script_info::matched_symbol): New function.
7323 (Version_script_info::get_symbol_version_helper): Call
7324 matched_symbol.
7325 (Version_script_info::check_unmatched_names): New function.
7326 * script.h (class Version_script_info): Update declarations.
7327 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7328
7329 * options.h (class General_options): Use DEFINE_bool_alias for
7330 allow_multiple_definition.
7331 * resolve.cc (Symbol_table::should_override): Don't test
7332 allow_multiple_definition.
7333
7334 PR 10980
7335 * options.h (class General_options): Add --cref.
7336 * main.cc (main): Print cref table if --cref. Don't close mapfile
7337 until after printing cref table.
7338 * cref.cc: Include "symtab.h".
7339 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7340 (Cref_table_compare::operator()): New function.
7341 (Cref_inputs::gather_cref): New function.
7342 (filecol): New static const.
7343 (Cref_inputs::print_cref): New function.
7344 (Cref::print_cref): New function.
7345 * cref.h: Include <cstdio>.
7346 (class Cref): Update declarations.
7347 * mapfile.h (Mapfile::file): New function.
7348 * object.h (class Object): Define Symbols. Declare virtual
7349 do_get_global_symbols.
7350 (Object::get_global_symbols): New function.
7351 * object.cc (Input_objects::add_object): Pass object to cref_ if
7352 --cref.
7353 (Input_objects::archive_start): Likewise.
7354 (Input_objects::archive_stop): Likewise.
7355 (Input_objects::print_cref): New function.
7356 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7357 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7358 --cref.
7359 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7360 function.
7361 * plugin.h (class Sized_pluginobj): Update declarations.
7362
7363 2010-01-05 Ian Lance Taylor <iant@google.com>
7364
7365 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7366 to is_default_version. Rename insdef to insdefault.
7367 (Symbol_table::add_from_relobj): Rename def to is_default_version
7368 and local to is_forced_local.
7369 (Symbol_table::add_from_pluginobj): Likewise.
7370 (Symbol_table::add_from_dynobj): Likewise.
7371 (Symbol_table::define_special_symbol): Rename insdef to
7372 insdefault.
7373
7374 2010-01-04 Ian Lance Taylor <iant@google.com>
7375
7376 PR 10980
7377 * options.h (class General_options): Add
7378 --allow-multiple-definition and -z muldefs.
7379 * resolve.cc (Symbol_table::should_override): Don't warn about a
7380 multiple symbol definition if --allow-multiple-definition or -z
7381 muldefs.
7382
7383 PR 10980
7384 * options.h (class General_options): Add --add-needed and
7385 --copy-dt-needed-entries. Tweak --as-needed help entry.
7386 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7387 error if --copy-dt-needed-entries aka --add-needed is used and
7388 would cause a change in behaviour.
7389
7390 PR 10980
7391 * options.h (class General_options): Add -G as a short version of
7392 --shared. Add no-op options -assert, -g, and -i.
7393
7394 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7395
7396 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7397 check for .text or .gnu.linkonce.t sections.
7398 * icf.cc (Icf::find_identical_sections): Ditto.
7399 Change the detection for mangled function name within the section
7400 name.
7401 * icf.h (is_section_foldable_candidate): New function.
7402
7403 2009-12-30 Ian Lance Taylor <iant@google.com>
7404
7405 PR 10980
7406 * options.h (class General_options): Permit two dashes with
7407 --retain-symbols-file.
7408
7409 2009-12-30 Ian Lance Taylor <iant@google.com>
7410
7411 PR 10979
7412 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7413 don't put the file header and segment headers in the text
7414 segment.
7415
7416 PR 10979
7417 * common.cc (Sort_commons::operator()): Stabilize sort when both
7418 entries are NULL.
7419 (Symbol_table::do_allocate_commons_list): When allocating common
7420 symbols, skip a symbol which is no longer common.
7421 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7422 an object before checking its type.
7423 * testsuite/common_test_2.c: New file.
7424 * testsuite/common_test_3.c: New file.
7425 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7426 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7427 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7428 (common_test_2_pic.o, common_test_2.so): New targets.
7429 (common_test_3_pic.o, common_test_3.so): New targets.
7430 * testsuite/Makefile.in: Rebuild.
7431
7432 PR 10979
7433 * script.cc (read_input_script): If we see a new SECTIONS clause,
7434 and we have added an input section, give an error.
7435 * layout.h (class Layout): Add have_added_input_section function.
7436 Add have_added_input_section_ field.
7437 * layout.cc (Layout::Layout): Initialize
7438 have_added_input_section_.
7439 (Layout::layout): Set have_added_input_section_.
7440 (Layout::layout_eh_frame): Likewise.
7441
7442 2009-12-30 Ian Lance Taylor <iant@google.com>
7443
7444 PR 10931
7445 * options.h (class General_options): Add --sort-common option.
7446 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7447 * common.cc (Sort_common): Add sort_order parameter to
7448 constructor. Add sort_order_ field.
7449 (Sort_commons::operator): Check sort_order_.
7450 (Symbol_table::allocate_commons): Determine the sort order.
7451 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7452 Change all callers.
7453 (Symbol_table::do_allocate_commons_list): Likewise.
7454
7455 2009-12-30 Ian Lance Taylor <iant@google.com>
7456
7457 PR 10916
7458 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7459 symbols from this object, don't change the visibility of an
7460 undefined symbol.
7461 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7462
7463 2009-12-30 Ian Lance Taylor <iant@google.com>
7464
7465 PR 10861
7466 * script.h (class Version_script_info): Define Language enum.
7467 Update declarations. Define Glob, Exact, and Lookup types. Add
7468 new fields globals_, locals_, and is_finalized_.
7469 * script.cc: Various formatting fixes.
7470 (class Parser_closure): Change language_stack_ from a vector of
7471 std::string to one of Version_script_info::Language. Adjust all
7472 uses accordingly.
7473 (class Lazy_demangler): Remove.
7474 (struct Version_expression): Change language from std::string to
7475 Version_script_info::Language.
7476 (Version_script_info::Version_script_info): New function.
7477 (Version_script_info::~Version_script_info): Don't call clear.
7478 (Version_script_info::finalize): New function.
7479 (Version_script_info::build_lookup_tables): New function.
7480 (Version_script_info::build_expression_list_lookup): New
7481 function.
7482 (Version_script_info::get_symbol_version_helper): Rewrite to use
7483 lookup tables.
7484 (Version_script_info::print_expression_list): Adjust to use
7485 Version_script_info::Language.
7486 (script_push_lex_into_version_mode): Check that the version script
7487 has not been finalized.
7488 (version_script_push_lang): Change language string to
7489 Version_script_info::Language.
7490 * options.cc (Command_line::version_script): New function.
7491 * options.h (class General_options): Add finalize_dynamic_list
7492 function. Change version_script from declaration to definition.
7493 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7494 * testsuite/version_script.map: Remove duplicate def of foo.
7495 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7496 version_script.map.
7497 * testsuite/Makefile.in: Rebuild.
7498
7499 2009-12-30 Ian Lance Taylor <iant@google.com>
7500
7501 PR 10843
7502 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7503 if the input symbol index is 0, make the output symbol index 0.
7504
7505 2009-12-30 Ian Lance Taylor <iant@google.com>
7506
7507 PR 10670
7508 * options.h (class General_options): Add -x/--discard-all.
7509 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7510 --discard-all. If the local symbol needs a dynamic entry, check
7511 that before handling --discard-locals.
7512
7513 2009-12-30 Ian Lance Taylor <iant@google.com>
7514
7515 PR 10450
7516 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7517 flags to PF_R.
7518 (Output_segment::add_output_section): Don't change the flags if
7519 the type is PT_TLS.
7520
7521 PR 10450
7522 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7523 GNU hash table if they need a dynamic value. Otherwise, don't add
7524 them if they are defined in a dynamic object or are forced local.
7525
7526 2009-12-29 Ian Lance Taylor <iant@google.com>
7527
7528 PR 10450
7529 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7530 .gnu.hash table for a 32-bit target.
7531
7532 PR 10450
7533 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7534 regular and a dynamic object only needs a dynamic symbol table
7535 entry if it is externally visible.
7536
7537 PR 10450
7538 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7539 constructor. Add global_offset_table_ field.
7540 (Target_i386::got_section): Set global_offset_table_.
7541 (Target_i386::do_finalize_sections): Set global_offset_table_
7542 size.
7543 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7544 in constructor. Add global_offset_table_ field.
7545 (Target_x86_64::got_section): Set global_offset_table_.
7546 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7547 size.
7548
7549 * layout.cc (Layout::Layout): Initialize increase_relro_.
7550 (Layout::get_output_section): Add is_relro, is_last_relro, and
7551 is_first_non_relro parameters. Change all callers.
7552 (Layout::choose_output_section): Likewise.
7553 (Layout::add_output_section_data): Likewise.
7554 (Layout::make_output_section): Likewise.
7555 (Layout::set_segment_offsets): Clear increase_relro when using a
7556 linker script.
7557 * layout.h (class Layout): Add increase_relro method. Add
7558 increase_relro_ field. Update declarations.
7559 * output.cc (Output_section::Output_section): Initialize
7560 is_last_relro_ and is_first_non_relro_.
7561 (Output_segment::add_output_section): Group relro sections is
7562 do_sort is true. Handle is_last_relro and is_first_non_relro.
7563 (Output_segment::maximum_alignment): Remove relro handling.
7564 (Output_segment::set_section_addresses): Add increase_relro
7565 parameter. Change all callers. Add initial alignment to align
7566 relro sections on separate page. Remove old relro handling.
7567 (Output_segment::set_section_list_addresses): Remove in_relro
7568 parameter. Change all callers.
7569 (Output_segment::set_offset): Add increase parameter. Change all
7570 callers. Remove old relro handling.
7571 * output.h (class Output_section): Add new methods: is_last_relro,
7572 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7573 Add is_last_relro_ and is_first_non_relro_ fields.
7574 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7575 Create separate .got.plt section. Call increase_relro.
7576 * x86_64.cc (Target_x86_64::got_section): Likewise.
7577 * testsuite/relro_script_test.t: Add .got.plt.
7578
7579 PR 10450
7580 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7581 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7582 (Layout::finalize): Call set_dynamic_symbol_size.
7583 (Layout::set_dynamic_symbol_size): New function.
7584 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7585 set_dynamic_symbol_size.
7586
7587 PR 10450
7588 * output.h (class Output_section): Add is_entsize_zero_ field.
7589 * output.cc (Output_section::Output_section): Initialize
7590 is_entsize_zero_.
7591 (Output_section::set_entsize): If two different entsizes are
7592 requested, force it to zero.
7593 (Output_section::add_input_section): Set flags for .debug_str
7594 before updating section flags. Set entsize.
7595 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7596 and SHF_STRING if all input sections have those flags.
7597
7598 2009-12-29 Rafael Espindola <espindola@google.com>
7599
7600 * main.cc (main): Fix the sys time reporting.
7601 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7602 reporting.
7603
7604 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7605
7606 * options.cc (General_options::parse_version): Allow -v to exit
7607 without an error if there is nothing to link.
7608
7609 2009-12-29 Ian Lance Taylor <iant@google.com>
7610
7611 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7612 using a version of gcc before 4.1.
7613 * configure: Rebuild.
7614
7615 2009-12-28 Chris Demetriou <cgd@google.com>
7616
7617 * attributes.cc (Output_attributes_section_data::do_write): Use
7618 std::vector::front rather than std::vector::data.
7619
7620 2009-12-28 Ian Lance Taylor <iant@google.com>
7621
7622 * symtab.h (class Symbol_table): Add enum Defined.
7623 * resolve.cc (Symbol_table::should_override): Add defined
7624 parameter. Change all callers. Test whether object is NULL
7625 before calling a method on it.
7626 (Symbol_table::report_resolve_problem): Add defined parameter.
7627 Change all callers.
7628 (Symbol_table::should_override_with_special): Likewise.
7629 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7630 parameter. Change all callers.
7631 (Symbol_table::do_define_in_output_data): Likewise.
7632 (Symbol_table::define_in_output_segment): Likewise.
7633 (Symbol_table::do_define_in_output_segment): Likewise.
7634 (Symbol_table::define_as_constant): Likewise.
7635 (Symbol_table::do_define_as_constant): Likewise.
7636 * script.h (class Symbol_assignment): Add is_defsym parameter to
7637 constructor; change all callers.
7638 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7639 parameter. Change all callers. Add is_defsym_ field.
7640 (class Parser_closure): Add parsing_defsym parameter to
7641 constructor; change all callers. Add parsing_defsym accessor
7642 function. Add parsing_defsym_ field.
7643
7644 2009-12-28 Ian Lance Taylor <iant@google.com>
7645
7646 * gold.cc (queue_middle_tasks): Fix formatting.
7647 * object.cc (Relobj::is_section_name_included): Likewise.
7648
7649 2009-12-23 Ian Lance Taylor <iant@google.com>
7650
7651 * i386.cc (Target_i386::do_calls_non_split): Recognize
7652 -fsplit-stack prologue for a function with a static chain.
7653 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7654 -fsplit-stack prologue when using %r11.
7655
7656 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7657
7658 * options.cc (General_options::parse_version): Make -v continue and do
7659 the link like GNU ld does.
7660
7661 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7662
7663 * Makefile.am (CCFILES): Add timer.cc.
7664 (HFILES): Add timer.h.
7665 * configure.ac: Check for sysconf and times.
7666 * main.cc: include timer.h.
7667 (main): Use Timer instead of get_run_time.
7668 * timer.cc: New.
7669 * timer.h: New.
7670 * workqueue.cc: include timer.h.
7671 (Workqueue::find_and_run_task):
7672 Report user, sys and wall time.
7673 * Makefile.in: Regenerate.
7674 * config.in: Regenerate.
7675 * configure: Regenerate.
7676
7677 2009-12-16 Doug Kwan <dougkwan@google.com>
7678
7679 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7680 sections.
7681 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7682 relaxed input sections.
7683 * output.cc (Output_section::find_relaxed_input_section): Change
7684 return type to Output_relaxed_input_section pointer. Adjust code
7685 for new type of relaxed_input_section_map_.
7686 * output.h (Output_section::find_relaxed_input_section): Change
7687 return type to Output_relaxed_input_section pointer.
7688 (Output_section::Output_relaxed_input_section_by_input_section_map):
7689 New type.
7690 (Output_section::relaxed_input_section_map_): Change type to
7691 Output_section::Output_relaxed_input_section_by_input_section_map.
7692 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7693 input section.
7694
7695 2009-12-15 Ian Lance Taylor <iant@google.com>
7696
7697 * layout.cc (Layout::create_shstrtab): Only write out after input
7698 sections if we are compressing debug sections.
7699
7700 2009-12-15 Ian Lance Taylor <iant@google.com>
7701
7702 * archive.cc (Archive::add_symbols): Only look up a symbol without
7703 a version if there is, in fact, a version.
7704
7705 2009-12-14 Ian Lance Taylor <iant@google.com>
7706
7707 Revert -Wshadow changes, all changes from:
7708 2009-12-11 Doug Kwan <dougkwan@google.com>
7709 2009-12-11 Nick Clifton <nickc@redhat.com>
7710 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7711
7712 2009-12-11 Doug Kwan <dougkwan@google.com>
7713
7714 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7715 due to -Wshadow.
7716 * attributes.cc (Object_attribute::size): Ditto.
7717 (Attributes_section_data::size): Ditto.
7718 (Attributes_section_data::Attributes_section_data): Ditto.
7719 (Output_attributes_section_data::do_write): Ditto.
7720 * attributes.h (Object_attribute::set_type): Ditto.
7721 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7722
7723 2009-12-11 Nick Clifton <nickc@redhat.com>
7724
7725 * archive.cc: Fix shadowed variable warnings.
7726 * arm.cc: Likewise.
7727 * compressed_output.cc: Likewise.
7728 * compressed_output.h: Likewise.
7729 * configure: Likewise.
7730 * dwarf_reader.cc: Likewise.
7731 * dynobj.cc: Likewise.
7732 * dynobj.h: Likewise.
7733 * ehframe.cc: Likewise.
7734 * ehframe.h: Likewise.
7735 * errors.cc: Likewise.
7736 * expression.cc: Likewise.
7737 * fileread.cc: Likewise.
7738 * fileread.h: Likewise.
7739 * freebsd.h: Likewise.
7740 * i386.cc: Likewise.
7741 * icf.cc: Likewise.
7742 * incremental.h: Likewise.
7743 * layout.cc: Likewise.
7744 * layout.h: Likewise.
7745 * mapfile.cc: Likewise.
7746 * merge.cc: Likewise.
7747 * merge.h: Likewise.
7748 * object.cc: Likewise.
7749 * object.h: Likewise.
7750 * options.h: Likewise.
7751 * output.cc: Likewise.
7752 * output.h: Likewise.
7753 * parameters.cc: Likewise.
7754 * plugin.cc: Likewise.
7755 * powerpc.cc: Likewise.
7756 * reduced_debug_output.cc: Likewise.
7757 * reduced_debug_output.h: Likewise.
7758 * reloc.cc: Likewise.
7759 * reloc.h: Likewise.
7760 * resolve.cc: Likewise.
7761 * script-sections.cc: Likewise.
7762 * script.cc: Likewise.
7763 * script.h: Likewise.
7764 * sparc.cc: Likewise.
7765 * symtab.cc: Likewise.
7766 * symtab.h: Likewise.
7767 * target-select.cc: Likewise.
7768 * target-select.h: Likewise.
7769 * token.h: Likewise.
7770 * workqueue.cc: Likewise.
7771 * workqueue.h: Likewise.
7772 * x86_64.cc: Likewise.
7773
7774 2009-12-10 Doug Kwan <dougkwan@google.com>
7775
7776 * arm.cc (attributes.h): New include.
7777 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7778 (Arm_relobj::~Arm_relobj): Delete object pointed by
7779 attributes_section_data_.
7780 (Arm_relobj::attributes_section_data): New method definition.
7781 (Arm_relobj::attributes_section_data_): New data member declaration.
7782 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7783 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7784 attributes_section_data_.
7785 (Arm_dynobj::attributes_section_data): New method definition.
7786 (Arm_dynobj::attributes_section_data_): New data member declaration.
7787 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7788 initialization value of may_use_blx_ to false.
7789 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7790 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7791 object attributes to compute results instead of hard-coding.
7792 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7793 Target_arm::get_secondary_compatible_arch,
7794 Target_arm::set_secondary_compatible_arch
7795 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7796 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7797 New method declarations.
7798 (Target_arm::get_aeabi_object_attribute): New method definition.
7799 (Target_arm::attributes_section_data_): New data member declaration.
7800 (read_arm_attributes_section): New template definition.
7801 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7802 (Arm_dynobj::do_read_symbols): Ditto.
7803 (Target_arm::do_finalize_sections): Merge attributes sections from
7804 input. Check for BLX use after attributes section merging.
7805 Fix __exidx_start and __exidx_end visibility. Create an
7806 .ARM.attributes section if necessary.
7807 (Target_arm::get_secondary_compatible_arch,
7808 Target_arm::set_secondary_compatible_arch,
7809 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7810 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7811 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7812 New method definitions.
7813
7814 2009-12-09 Ian Lance Taylor <iant@google.com>
7815
7816 * plugin.cc (Plugin::load): Don't cast from void* to a function
7817 pointer.
7818
7819 2009-12-09 Ian Lance Taylor <iant@google.com>
7820
7821 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7822 information fields.
7823
7824 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7825
7826 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7827 Replace two_file_shared_1.so with two_file_shared_2.so.
7828 * testsuite/Makefile.in: Regenerated.
7829
7830 2009-12-08 Doug Kwan <dougkwan@google.com>
7831
7832 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7833 (HFILES): Add attributes.h and int_encoding.h.
7834 * Makefile.in: Regenerate.
7835 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7836 function definitions to int_encoding.cc
7837 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7838 prototypes to int_encoding.h
7839 * reduced_debug_output.cc (int_encoding.h): New include.
7840 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7841 function definitions to int_encoding.cc
7842 (insert_into_vector, read_from_pointer): Move template definitions to
7843 int_encoding.h
7844 * attributes.cc: New file.
7845 * attributes.h: New file.
7846 * int_encoding.cc: New file.
7847 * int_encoding.h: New file.
7848
7849 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7850
7851 PR gold/11055
7852 * incremental-dump.cc (dump_incremental_inputs): New.
7853 (main): Use dump_incremental_inputs.
7854
7855 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7856
7857 PR gold/10893
7858 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7859 checking elfcpp::STT_FUNC.
7860 (Target_i386::Relocate::relocate): Likewise.
7861 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7862
7863 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7864 symbols from shared libraries into normal FUNC symbols.
7865
7866 * symtab.h (Symbol): Add is_func and use it.
7867
7868 2009-12-05 Doug Kwan <dougkwan@google.com>
7869
7870 * arm.cc (Target_arm::arm_info): Initialize new fields
7871 attributes_section and attributes_vendor.
7872 * i386.cc (Target_i386::i386_info): Same.
7873 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7874 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7875 fields attributes_section and attributes_vendor.
7876 * sparc.cc (Target_sparc::sparc_info): Same.
7877 * target.h (Target::attributes_section, Target::attributes_vendor,
7878 Target::is_attributes_section, Target::attribute_arg_type,
7879 Target::attributes_order): New method definitions.
7880 (Target::Target_info::attributes_section,
7881 Target::Target_info::attributes_vendor): New fields.
7882 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7883 virtual method definitions.
7884 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7885 attributes_section and attributes_vendor.
7886 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7887
7888 2009-12-05 Doug Kwan <dougkwan@google.com>
7889
7890 * arm.cc: Update comments about interworking and stub generation.
7891 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7892 considered as non-PIC.
7893 (Arm_relocate_functions::base_abs): Fix formatting.
7894 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7895 of function to use GOT entry address instead of offset.
7896 (Target_arm::Scan::global): Issue an error if a symbol would need a
7897 PLT does not get one because it is untyped. Remove code to create
7898 dynamic symbols for relative branches.
7899 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7900 takes unsigned integer instead of boolean.
7901
7902 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7903
7904 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7905 (two_file_test_LDADD): Likewise.
7906 (common_test_1_LDADD): Likewise.
7907 (exception_test_LDADD) Likewise.
7908 (weak_test_LDADD): Likewise.
7909 (many_sections_test_LDADD): Likewise.
7910 (initpri1_LDADD): Likewise.
7911 (script_test_1_LDADD): Likewise.
7912 (script_test_2_LDADD): Likewise.
7913 (justsyms_LDADD): Likewise.
7914 (binary_test_LDADD): Likewise.
7915 (large_LDADD): Likewise.
7916 * testsuite/Makefile.in: Regenerated.
7917
7918 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
7919
7920 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7921 (Symbol_table::override_with_special): Likewise.
7922 (Symbol_table::add_from_object): Likewise.
7923
7924 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7925
7926 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7927 Don't set the data_offset twice.
7928
7929 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7930
7931 * testsuite/Makefile.in: Regenerate.
7932
7933 2009-12-03 Doug Kwan <dougkwan@google.com>
7934
7935 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7936 (Target_arm::do_finalize_sections): Add parameter for symbol table
7937 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7938 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7939 parameter for symbol table pointer.
7940 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7941 an additional parameter for a pointer to symbol table.
7942 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7943 parameter for a symbol table pointer.
7944 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7945 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7946 Ditto.
7947 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7948 parameter for a symbol table pointer.
7949
7950 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
7951
7952 * incremental.cc (Incremental_inputs_header)
7953 (Incremental_inputs_header_write, Incremental_inputs_entry)
7954 (Incremental_inputs_entry_write): Move ...
7955 * incremental.h (Incremental_inputs_header)
7956 (Incremental_inputs_header_write, Incremental_inputs_entry)
7957 (Incremental_inputs_entry_write): here.
7958
7959 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7960
7961 * incremental.cc (make_sized_incremental_binary): Set the target.
7962 Error if it is incompatible.
7963 * output.h (Output_file): Add filename method.
7964
7965 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7966
7967 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7968 from the get_* methods.
7969
7970 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7971
7972 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7973 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7974 Write 0 for the data_offset of scripts.
7975
7976 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7977
7978 * testsuite/Makefile.am: Add the incremental_test.sh test.
7979 * testsuite/incremental_test.sh: New.
7980 * testsuite/incremental_test_1.c: New.
7981 * testsuite/incremental_test_2.c: New.
7982
7983 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
7984
7985 * incremental-dump.cc (main): Fix typos.
7986
7987 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
7988
7989 PR gold/11025
7990 * incremental-dump.cc (main): Use llu to print 64 bit values.
7991
7992 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7993 H.J. Lu <hongjiu.lu@intel.com>
7994
7995 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7996 $(LIBDL).
7997 (incremental_dump_LDADD): Likewise.
7998 * Makefile.in: Regenerated.
7999
8000 2009-11-25 Doug Kwan <dougkwan@google.com>
8001
8002 Revert:
8003
8004 2009-11-25 Doug Kwan <dougkwan@google.com>
8005
8006 * arm.cc (Target_arm::Target_arm): Move method definition
8007 outside of class definition. Add code to handle
8008 --target1-rel, --target1-abs and --target2= options.
8009 (Target_arm::get_reloc_reloc_type): Change method to be
8010 non-static and const.
8011 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8012 New data member declaration.
8013 (Target_arm::Scan::local, Target_arm::Scan::global,
8014 Target_arm::Relocate::relocate,
8015 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8016 Adjust call to Target_arm::get_real_reloc_type.
8017 (Target_arm::get_real_reloc_type): Use command line options
8018 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8019 * options.h (--target1-rel, --target1-abs, --target2): New
8020 ARM-only options.
8021
8022 2009-11-25 Doug Kwan <dougkwan@google.com>
8023
8024 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8025 class definition. Add code to handle --target1-rel, --target1-abs
8026 and --target2= options.
8027 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8028 and const.
8029 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8030 member declaration.
8031 (Target_arm::Scan::local, Target_arm::Scan::global,
8032 Target_arm::Relocate::relocate,
8033 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8034 call to Target_arm::get_real_reloc_type.
8035 (Target_arm::get_real_reloc_type): Use command line options to
8036 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8037 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8038 options.
8039
8040 2009-11-25 Doug Kwan <dougkwan@google.com>
8041
8042 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8043 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8044 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8045 formatting.
8046 (Arm_relocate_functions::thm_call): Replace body with a call to
8047 Arm_relocate_functions::thumb_branch_common.
8048 (Arm_relocate_functions::thm_jump24,
8049 Arm_relocate_functions::thm_xpc22): New method definitions.
8050 (Arm_relocate_functions::thumb_branch_common): New method definition.
8051 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8052 operator.
8053 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8054 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8055
8056 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8057
8058 * Makefile.am: Build incremental-dump
8059 * Makefile.in: Regenerate.
8060 * incremental-dump.cc: New.
8061 * incremental.cc (Incremental_inputs_header_data,
8062 Incremental_inputs_entry_data): Move to incremental.h
8063 * incremental.h: (Incremental_inputs_header_data,
8064 Incremental_inputs_entry_data): Move from incremental.cc
8065
8066 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8067
8068 * incremental.cc (Incremental_inputs_header,
8069 Incremental_inputs_header_write, Incremental_inputs_entry,
8070 Incremental_inputs_entry_write): Add a typedef with the data type.
8071
8072 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8073
8074 * incremental.cc (Incremental_inputs_header,
8075 Incremental_inputs_header_write, Incremental_inputs_entry,
8076 Incremental_inputs_entry_write): Update comment about which
8077 type has the filed descriptions.
8078
8079 2009-11-15 Doug Kwan <dougkwan@google.com>
8080
8081 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8082 (Arm_relocate_functions::arm_branch_common): Change method defintion
8083 in class definition to a method declaration and update list of formal
8084 parameters.
8085 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8086 Arm_relocation_functions::jump24): Adjust call to
8087 Arm_relocate_functions::arm_branch_common. Update list of formal
8088 parameters.
8089 (Arm_relocate_functions::xpc25): New method definition.
8090 (Arm_relocate_functions::arm_branch_common): Move method defintion
8091 out from class definition. Use stubs for mode-switching and extending
8092 branch ranges.
8093 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8094 specially. Change code to enable use of stubs in ARM branches.
8095
8096 2009-11-10 Doug Kwan <dougkwan@google.com>
8097
8098 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8099 in method declaration.
8100 (Target_arm::relocate_stub): New method declaration.
8101 (Target_arm::default_target): Change to return a pointer instead of
8102 a const reference.
8103 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8104 Target_arm::default_target.
8105 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8106 method definition.
8107 (Target_arm::relocate_section): Adjust view.
8108 (Target_arm::relocate_stub): New method definition.
8109
8110 2009-11-10 Doug Kwan <dougkwan@google.com>
8111
8112 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8113 a format warning.
8114 * incremental.cc (open_incremental_binary): Initialized local
8115 variables to avoid warnings.
8116 * object.cc (make_elf_object): Ditto.
8117 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8118 a format warning.
8119
8120 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8121
8122 PR gold/10930
8123 * testsuite/plugin_test.c: Include "config.h".
8124
8125 2009-11-09 Doug Kwan <dougkwan@google.com>
8126
8127 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8128 (arm_symbol_value): Remove.
8129 (Arm_relocate_functions::arm_branch_common,
8130 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8131 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8132 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8133 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8134 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8135 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8136 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8137 Arm_relocate_functions::thm_mobw_abs_nc,
8138 Arm_relocate_functions::thm_mov_abs,
8139 Arm_relocate_functions::movw_prel_nc,
8140 Arm_relocate_functions::thm_movt_abs,
8141 Arm_relocate_functions::movt_prel,
8142 Arm_relocate_functions::thm_movw_prel_nc,
8143 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8144 (Target_arm::Relocate::relocate): Only decompose address into two
8145 parts if relocation type uses the thumb-bit and pass the actual
8146 bit instead of a flag indicating that the thumb-bit is used. Adjust
8147 calls to methods in Arm_relocate_functions for this change.
8148
8149 2009-11-08 Ian Lance Taylor <iant@google.com>
8150
8151 PR 10925
8152 * reloc.cc: Instantiate
8153 Sized_relobj::initialize_input_to_output_maps and
8154 Sized_relobj:free_input_to_output_maps.
8155
8156 2009-11-06 Ian Lance Taylor <iant@google.com>
8157
8158 PR 10876
8159 * defstd.cc (in_segment): Set only_if_ref true for "end".
8160
8161 2009-11-06 Doug Kwan <dougkwan@google.com>
8162
8163 * arm.cc (class Reloc_stub): Correct a comment.
8164 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8165 (Target_arm::scan_section_for_stubs): New method declaration.
8166 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8167 Change methods from private to protected.
8168 (Target_arm::do_may_relax): New method definition.
8169 (Target_arm::do_relax, Target_arm::group_sections,
8170 Target_arm::scan_reloc_for_stub,
8171 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8172 (Target_arm::arm_input_section_map_): New data member declaration.
8173 (Target_arm::scan_reloc_for_stub,
8174 Target_arm::scan_reloc_section_for_stubs,
8175 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8176 Target_arm::do_relax): New method definitions.
8177
8178 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8179
8180 * configure.ac: Check for (struct stat)::st_mtim
8181 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8182 * config.in: Regenerate.
8183 * configure: Regenerate.
8184
8185 2009-11-05 Ian Lance Taylor <iant@google.com>
8186
8187 PR 10910
8188 * output.cc (Output_segment::add_output_section): Add missing
8189 return statement.
8190
8191 2009-11-04 Ian Lance Taylor <iant@google.com>
8192
8193 PR 10880
8194 * object.h (class Object): Add is_needed and set_is_needed
8195 methods. Add is_needed_ field. Make bool fields into bitfields.
8196 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8197 defined in a dynamic object and referenced by a regular object,
8198 set is_needed for the dynamic object.
8199 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8200 if the file is marked with as_needed and it is not needed.
8201
8202 2009-11-04 Ian Lance Taylor <iant@google.com>
8203
8204 PR 10887
8205 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8206 tags if data is discarded by linker script.
8207 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8208 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8209 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8210 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8211
8212 2009-11-04 Ian Lance Taylor <iant@google.com>
8213
8214 * layout.cc (Layout::get_output_section): Add is_interp and
8215 is_dynamic_linker_section parameters. Change all callers.
8216 (Layout::choose_output_section): Likewise.
8217 (Layout::make_output_section): Likewise.
8218 (Layout::add_output_section_data): Add is_dynamic_linker_section
8219 parameter. Change all callers.
8220 * layout.h (class Layout): Update declarations.
8221 * output.h (class Output_section): Add is_interp, set_is_interp,
8222 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8223 Add is_interp_, is_dynamic_linker_section_ fields. Change
8224 generate_code_fills_at_write_ to a bitfield.
8225 * output.cc (Output_section::Output_sections): Initialize new
8226 fields.
8227 (Output_segment::add_output_section): Add do_sort parameter.
8228 Change all callers.
8229
8230 2009-11-03 Ian Lance Taylor <iant@google.com>
8231
8232 PR 10860
8233 * options.h (class General_options): Add --warn-common.
8234 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8235 merging two common symbols.
8236 (Symbol_table::should_override): Handle --warn-common when merging
8237 a common symbol with a defined symbol. Use report_resolve_problem
8238 for multiple definitions.
8239 (Symbol_table::report_resolve_problem): New function.
8240 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8241
8242 2009-11-03 Doug Kwan <dougkwan@google.com>
8243
8244 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8245 stub_factory_.
8246 (Target_arm::stub_factory): New method definition.
8247 (Target_arm::new_arm_input_section,
8248 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8249 Target_arm::reloc_uses_thumb_bit): New method declarations.
8250 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8251 New type definitions.
8252 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8253 member declarations.
8254 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8255 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8256 New method definitions.
8257
8258 2009-11-03 Ian Lance Taylor <iant@google.com>
8259
8260 * options.h (class General_options): Add --warn_constructors.
8261
8262 2009-11-03 Ian Lance Taylor <iant@google.com>
8263
8264 PR 10893
8265 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8266 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8267
8268 2009-11-03 Ian Lance Taylor <iant@google.com>
8269
8270 PR 10895
8271 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8272 --msgid-bugs-address.
8273 (install-pdf): New target.
8274 (install-data_yes): Look up one directory to find mkinstalldirs.
8275
8276 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8277
8278 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8279 tree.
8280
8281 2009-10-30 Doug Kwan <dougkwan@google.com>
8282
8283 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8284
8285 2009-10-30 Doug Kwan <dougkwan@google.com>
8286
8287 * arm.cc (Stub_addend_reader): New struct template definition
8288 and partial specializations.
8289 (Stub_addend_reader::operator()): New method definition for a
8290 partially specialized template.
8291
8292 2009-10-30 Doug Kwan <dougkwan@google.com>
8293
8294 * arm.cc (Arm_relobj::processor_specific_flags): New method
8295 definition.
8296 (Arm_relobj::do_read_symbols): New method declaration.
8297 (Arm_relobj::processor_specific_flags_): New data member declaration.
8298 (Arm_dynobj): New class definition.
8299 (Target_arm::do_finalize_sections): Add input_objects parameter.
8300 (Target_arm::do_adjust_elf_header): New method declaration.
8301 (Target_arm::are_eabi_versions_compatible,
8302 (Target_arm::merge_processor_specific_flags): New method declaration.
8303 (Target_arm::do_make_elf_object): New overloaded method definitions
8304 and declaration.
8305 (Arm_relobj::do_read_symbols): New method definition.
8306 (Arm_dynobj::do_read_symbols): Ditto.
8307 (Target_arm::do_finalize_sections): Add input_objects parameters.
8308 Merge processor-specific flags from all input objects.
8309 (Target_arm::are_eabi_versions_compatible,
8310 Target_arm::merge_processor_specific_flags,
8311 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8312 New method definitions.
8313 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8314 Input_objects pointer type parameter.
8315 * layout.cc (Layout::finalize): Pass input objects to target's.
8316 finalize_sections function.
8317 * output.cc (Output_file_header::do_sized_write): Set ELF file
8318 header's processor-specific flags.
8319 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8320 Input_objects pointer type parameter.
8321 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8322 * target.h (Input_objects): New forward class declaration.
8323 (Target::processor_specific_flags,
8324 Target::are_processor_specific_flags_sect): New method definitions.
8325 (Target::finalize_sections): Add input_objects parameter.
8326 (Target::Target): Initialize processor_specific_flags_ and
8327 are_processor_specific_flags_set_.
8328 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8329 parameter.
8330 (Target::set_processor_specific_flags): New method definition.
8331 (Target::processor_specific_flags_,
8332 Target::are_processor_specific_flags_set_): New data member
8333 declarations.
8334 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8335 Input_objects pointer type parameter.
8336
8337 2009-10-30 Doug Kwan <dougkwan@google.com>
8338
8339 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8340
8341 2009-10-28 Ian Lance Taylor <iant@google.com>
8342
8343 * object.h (class Relobj): Drop options parameter from
8344 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8345 do_scan_relocs, do_relocate. Change all callers.
8346 (class Sized_relobj): Drop options parameters from
8347 do_gc_process_relocs, do_scan_relocs, do_relocate,
8348 do_relocate_sections, relocate_sections, emit_relocs_scan,
8349 emit_relocs_scan_reltype. Change all callers.
8350 (struct Relocate_info): Remove options field and all references to
8351 it.
8352 * reloc.h (class Read_relocs): Remove options constructor
8353 parameter and options_ field. Change all callers.
8354 (class Gc_process_relocs, class Scan_relocs): Likewise.
8355 (class Relocate_task): Likewise.
8356 * target-reloc.h (scan_relocs): Remove options parameter. Change
8357 all callers.
8358 (scan_relocatable_relocs): Likewise.
8359 * target.h (class Sized_target): Remove options parameter from
8360 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8361 all callers.
8362 * gc.h (gc_process_relocs): Remove options parameter. Change all
8363 callers.
8364 * arm.cc: Update functions to remove options parameters.
8365 * i386.cc: Likewise.
8366 * powerpc.cc: Likewise.
8367 * sparc.cc: Likewise.
8368 * x86_64.cc: Likewise.
8369 * testsuite/testfile.cc: Likewise.
8370
8371 2009-10-28 Doug Kwan <dougkwan@google.com>
8372
8373 * arm.cc (Arm_relobj): New class definition.
8374 (Arm_relobj::scan_sections_for_stubs,
8375 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8376 New method definitions.
8377
8378 2009-10-28 Cary Coutant <ccoutant@google.com>
8379
8380 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8381 (Plugin::cleanup_done_): New member.
8382 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8383 (Plugin_manager::cleanup_done_): Remove.
8384 (Plugin_manager::add_input_file): Edit error message.
8385 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8386 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8387
8388 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8389
8390 * fileread.cc: (File_read::View::~View): Use the new
8391 data_ownership_ filed.
8392 (File_read::~File_read): Dispose the new whole_file_view_.
8393 (File_read::open): Mmap the whole file if needed.
8394 (File_read::open): Use whole_file_view_ instead of contents_.
8395 (File_read::find_view): Use whole_file_view_ if applicable.
8396 (File_read::do_read): Use whole_file_view_ instead of contents_.
8397 (File_read::make_view): Use whole_file_view_ instead of contents_,
8398 update File_read::View::View call.
8399 (File_read::find_or_make_view): Update File_read::View::View
8400 call.
8401 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8402 remove contents_
8403 (File_read::View::Data_ownership): New enum.
8404 (File_read::View::View): Replace bool mapped_ with Data_ownership
8405 argument.
8406 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8407 (File_read::View::data_ownership_): New field.
8408 (File_read::contents_): Remove (replaced by whole_file_view_).
8409 (File_read::whole_file_view_): New field.
8410 * options.h (class General_options): Add --keep-files-mapped.
8411
8412 2009-10-27 Cary Coutant <ccoutant@google.com>
8413
8414 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8415 * testsuite/Makefile.am (plugin_test_5): New test case.
8416 * testsuite/Makefile.in: Regenerate.
8417
8418 2009-10-25 Doug Kwan <dougkwan@google.com>
8419
8420 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8421 from private to protected to allow access by child class.
8422 (Sized_relobj::do_relocate_sections): New method declaration.
8423 (Sized_relobj::relocate_sections): Virtualize.
8424 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8425 Sized_relobj::relocate_sections. Instantiate template explicitly
8426 for different target sizes and endianity.
8427
8428 2009-10-24 Doug Kwan <dougkwan@google.com>
8429
8430 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8431 (Arm_input_section::as_arm_input_section): New method.
8432 (Arm_output_section): New class definition.
8433 (Arm_output_section::create_stub_group,
8434 Arm_output_section::group_sections): New method definitions.
8435
8436 2009-10-22 Doug Kwan <dougkwan@google.com>
8437
8438 * arm.cc (Arm_input_section): New class definition.
8439 (Arm_input_section::init, Arm_input_section:do_write,
8440 Arm_input_section::set_final_data_size,
8441 Arm_input_section::do_reset_address_and_file_offset): New method
8442 definitions.
8443
8444 2009-10-21 Doug Kwan <dougkwan@google.com>
8445
8446 * arm.cc (Stub_table, Arm_input_section): New forward class
8447 declarations.
8448 (Stub_table): New class defintion.
8449 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8450 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8451 New method definition.
8452
8453 2009-10-21 Doug Kwan <dougkwan@google.com>
8454
8455 * arm.cc: Update copyright comments.
8456 (Target_arm): New forward class template declaration.
8457 (Arm_address): New type.
8458 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8459 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8460 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8461 constants.
8462 (Insn_template): Same.
8463 (DEF_STUBS): New macro.
8464 (Stub_type): New enum type.
8465 (Stub_template): New class definition.
8466 (Stub): Same.
8467 (Reloc_stub): Same.
8468 (Stub_factory): Same.
8469 (Target_arm::Target_arm): Initialize may_use_blx_ and
8470 should_force_pic_veneer_.
8471 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8472 Target_arm::should_force_pic_veneer,
8473 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8474 Target_arm::using_thumb_only, Target_arm:;default_target): New
8475 method defintions.
8476 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8477 New data member declarations.
8478 (Insn_template::size, Insn_template::alignment): New method defintions.
8479 (Stub_template::Stub_template): New method definition.
8480 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8481 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8482 (Stub_factory::Stub_factory): New method definition.
8483 * gold.h (string_hash): New template.
8484 * output.h (Input_section_specifier::hash_value): Use
8485 gold::string_hash.
8486 (Input_section_specifier::string_hash): Remove.
8487 * stringpool.cc (Stringpool_template::string_hash): Use
8488 gold::string_hash.
8489
8490 2009-10-20 Doug Kwan <dougkwan@google.com>
8491
8492 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8493 symbols of relaxed input sections.
8494 * output.h (Output_section::find_relaxed_input_section): Make
8495 method public.
8496
8497 2009-10-16 Doug Kwan <dougkwan@google.com>
8498
8499 * dynobj.cc (Versions::Versions): Initialize version_script_.
8500 Only insert base version symbol definition for a shared object
8501 if version script defines any version versions.
8502 (Versions::define_base_version): New method definition.
8503 (Versions::add_def): Check that base version is not needed.
8504 (Versions::add_need): Define base version lazily.
8505 * dynobj.h (Versions::define_base_version): New method declaration.
8506 (Versions::needs_base_version_): New data member declaration.
8507 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8508 (check_DATA): Add no_version_test.stdout.
8509 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8510 New make rules.
8511 * testsuite/Makefile.in: Regenerate.
8512 * testsuite/no_version_test.c: New file.
8513 * testsuite/no_version_test.sh: Ditto.
8514
8515 2009-10-16 Doug Kwan <dougkwan@google.com>
8516
8517 * expression.cc (class Segment_start_expression): New class definition.
8518 (Segment_start_expression::value): New method definition.
8519 (script_exp_function_segment_start): Return a new
8520 Segment_start_expression.
8521 * gold/script-c.h (script_saw_segment_start_expression): New function
8522 prototype.
8523 * script-sections.cc (Script_sections::Script_sections): Initialize
8524 SAW_SEGMENT_START_EXPRESSION_ to false.
8525 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8526 and -Tbbs options to specify section addresses if given in
8527 command line and no SEGMENT_START expression is seen in a script.
8528 * script-sections.h (Script_sections::saw_segment_start_expression,
8529 Script_sections::set_saw_segment_start_expression): New method
8530 definition.
8531 (Script_sections::saw_segment_start_expression_): New data member
8532 declaration.
8533 * script.cc (script_saw_segment_start_expression): New function.
8534 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8535 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8536 script_test_7.sh and script_test_8.sh.
8537 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8538 script_test_8.stdout.
8539 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8540 (script_test_6, script_test_6.stdout, script_test_7,
8541 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8542 * Makefile.in: Regenerate.
8543 * testsuite/script_test_6.sh: New file.
8544 * testsuite/script_test_6.t: Same.
8545 * testsuite/script_test_7.sh: Same.
8546 * testsuite/script_test_7.t: Same.
8547 * testsuite/script_test_8.sh: Same.
8548
8549 2009-10-16 Doug Kwan <dougkwan@google.com>
8550
8551 * output.cc (Output_segment::set_section_list_address): Cast
8552 expressions to unsigned long long type to avoid format warnings.
8553
8554 2009-10-15 Ian Lance Taylor <iant@google.com>
8555
8556 * script.cc (Script_options::add_symbol_assignment): Always add a
8557 dot assignment to script_sections_.
8558 * script-sections.cc (Script_sections::add_dot_assignment):
8559 Initialize if necessary.
8560
8561 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8562 program headers with no load segment if there is a linker script.
8563
8564 * layout.cc (Layout::set_segment_offsets): Align the file offset
8565 to the segment aligment for -N or -n with no load segment.
8566 * output.cc (Output_segment::add_output_section): Don't crash if
8567 the first section is a TLS section.
8568 (Output_segment::set_section_list_addresses): Print an error
8569 message if the address moves backward in a linker script.
8570 * script-sections.cc
8571 (Output_section_element_input::set_section_addresses): Don't
8572 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8573 (Orphan_output_section::set_section_addresses): Likewise.
8574
8575 2009-10-15 Doug Kwan <dougkwan@google.com>
8576
8577 * layout.cc (Layout::finish_dynamic_section): Generate tags
8578 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8579 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8580 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8581
8582 2009-10-14 Ian Lance Taylor <iant@google.com>
8583
8584 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8585 fields.
8586 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8587 data_shdr fields of relinfo.
8588 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8589 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8590 R_386_TLS_LDO_32, adjust based on section flags.
8591 (Target_i386::Relocate::fix_up_ldo): Remove.
8592
8593 2009-10-13 Ian Lance Taylor <iant@google.com>
8594
8595 Add support for -pie.
8596 * options.h (class General_options): Add -pie and
8597 --pic-executable.
8598 (General_options::output_is_position_independent): Test -pie.
8599 (General_options::output_is_executable): Return true if not shared
8600 and not relocatable.
8601 (General_options::output_is_pie): Remove.
8602 * options.cc (General_options::finalize): Reject incompatible uses
8603 of -pie.
8604 * gold.cc (queue_middle_tasks): A -pie link is not static.
8605 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8606 * symtab.cc (Symbol::final_value_is_known): Return false if
8607 output_is_position_independent.
8608 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8609 output_is_position_independent.
8610 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8611 output_is_position_independent.
8612 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8613 output_is_position_independent.
8614 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8615 two_file_pie_test.
8616 (basic_pie_test.o, basic_pie_test): New targets.
8617 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8618 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8619 (two_file_pie_test): New target.
8620 * testsuite/Makefile.in: Rebuild.
8621 * README: Remove note saying that -pie is not supported.
8622
8623 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8624
8625 * options.h (class General_options): Add -init and -fini.
8626 * layout.cc (Layout::finish_dynamic_section): Emit
8627 given init and fini functions.
8628
8629 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8630
8631 * gc.h (gc_process_relocs): Check if icf is enabled using new
8632 function.
8633 * gold.cc (queue_initial_tasks): Likewise.
8634 (queue_middle_tasks): Likewise.
8635 * object.cc (do_layout): Likewise.
8636 * symtab.cc (is_section_folded): Likewise.
8637 * main.cc (main): Likewise.
8638 * reloc.cc (Read_relocs::run): Likewise.
8639 (Sized_relobj::do_scan_relocs): Likewise.
8640 * icf.cc (is_function_ctor_or_dtor): New function.
8641 (Icf::find_identical_sections): Check if function is ctor or dtor when
8642 safe icf is chosen.
8643 * options.h (General_options::icf): Change option to be an enum.
8644 (Icf_status): New enum.
8645 (icf_enabled): New method.
8646 (icf_safe_folding): New method.
8647 (set_icf_status): New method.
8648 (icf_status_): New variable.
8649 * (options.cc) (General_options::finalize): Set icf_status_.
8650 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8651 icf_test and icf_keep_unique_test to use the --icf enum flag.
8652 * testsuite/icf_safe_test.sh: New file.
8653 * testsuite/icf_safe_test.cc: New file.
8654
8655 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8656
8657 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8658 includes to gc.h and icf.h.
8659 * arm.cc: Include gc.h.
8660 * gold.cc: Likewise.
8661 * i386.cc: Likewise.
8662 * powerpc.cc: Likewise.
8663 * sparc.cc: Likewise.
8664 * x86_64.cc: Likewise.
8665 * gc.h: Include icf.h.
8666
8667 2009-10-11 Ian Lance Taylor <iant@google.com>
8668
8669 * plugin.cc: Include "gold.h" before other header files.
8670
8671 2009-10-10 Chris Demetriou <cgd@google.com>
8672
8673 * options.h (Input_file_argument::Input_file_type): New enum.
8674 (Input_file_argument::is_lib_): Replace with...
8675 (Input_file_argument::type_): New member.
8676 (Input_file_argument::Input_file_argument): Take Input_file_type
8677 'type' rather than boolean 'is_lib' as second argument.
8678 (Input_file_argument::is_lib): Use type_.
8679 (Input_file_argument::is_searched_file): New function.
8680 (Input_file_argument::may_need_search): Handle is_searched_file.
8681 * options.cc (General_options::parse_library): Support -l:filename.
8682 (General_options::parse_just_symbols): Update for Input_file_argument
8683 changes.
8684 (Command_line::process): Likewise.
8685 * archive.cc (Archive::get_file_and_offset): Likewise.
8686 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8687 * script.cc (read_script_file, script_add_file): Likewise.
8688 * fileread.cc (Input_file::Input_file): Likewise.
8689 (Input_file::will_search_for): Handle is_searched_file.
8690 (Input_file::open): Likewise.
8691 * readsyms.cc (Read_symbols::get_name): Likewise.
8692 * testsuite/Makefile.am (searched_file_test): New test.
8693 * testsuite/Makefile.in: Regenerate.
8694 * testsuite/searched_file_test.cc: New file.
8695 * testsuite/searched_file_test_lib.cc: New file.
8696
8697 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8698 Ian Lance Taylor <iant@google.com>
8699
8700 * descriptor.cc: Include <cstdio> and "binary-io.h".
8701 (Descriptors::open): Open the files in binary mode always.
8702 * script.cc (Lex::get_token): Treat \r as whitespace.
8703
8704 2009-10-09 Ian Lance Taylor <iant@google.com>
8705
8706 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8707
8708 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8709 Ian Lance Taylor <iant@google.com>
8710
8711 * configure.ac: Check for readv function also.
8712 * fileread.cc (readv): Define if not HAVE_READV.
8713 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8714 does not exist.
8715 * config.in: Regenerate.
8716 * configure: Regenerate.
8717
8718 2009-10-09 Doug Kwan <dougkwan@google.com>
8719
8720 * layout.cc (Layout::make_output_section): Call target hook to make
8721 ordinary output section.
8722 (Layout::finalize): Adjust parameter list of call the
8723 Target::may_relax().
8724 * layout.h (class Layout::section_list): New method.
8725 * merge.h (Output_merge_base::entsize): Change visibility to public.
8726 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8727 New methods.
8728 (Output_merge_string::do_is_string): New method.
8729 * object.cc (Sized_relobj::do_setup): renamed from
8730 Sized_relobj::set_up.
8731 * object.h (Sized_relobj::adjust_shndx,
8732 Sized_relobj::initializ_input_to_output_maps,
8733 Sized_relobj::free_input_to_output_maps): Change visibilities to
8734 protected.
8735 (Sized_relobj::setup): Virtualize.
8736 (Sized_relobj::do_setup): New method declaration.
8737 (Sized_relobj::invalidate_section_offset,
8738 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8739 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8740 * options.cc (parse_int): New function.
8741 * options.h (parse_int): New declaration.
8742 (DEFINE_int): New macro.
8743 (stub_group_size): New option.
8744 * output.cc (Output_section::Output_section): Initialize memebers
8745 merge_section_map_, merge_section_by_properties_map_,
8746 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8747 (Output_section::add_input_section): Handled deferred code-fill
8748 generation and remove an old comment.
8749 (Output_section::add_relaxed_input_section): New method definition.
8750 (Output_section::add_merge_input_section): Use merge section by
8751 properties map to speed to search. Update merge section maps
8752 as appropriate.
8753 (Output_section::build_relaxation_map): New method definition.
8754 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8755 Same.
8756 (Output_section::relax_input_section): Renamed to
8757 Output_section::convert_input_sections_to_relaxed_sections and change
8758 interface to take a vector of pointers to relaxed sections.
8759 (Output_section::find_merge_section,
8760 Output_section::find_relaxed_input_section): New method definitions.
8761 (Output_section::is_input_address_mapped,
8762 Output_section::output_offset, Output_section::output_address):
8763 Use output section data maps to speed up searching.
8764 (Output_section::find_starting_output_address): Add comments.
8765 (Output_section::do_write,
8766 Output_section::write_to_postprocessing_buffer): Do code-fill
8767 generation as appropriate.
8768 (Output_section::get_input_sections): Invalidate relaxed input section
8769 map.
8770 (Output_section::restore_states): Adjust type of checkpoint .
8771 Invalidate relaxed input section map.
8772 * output.h (Output_merge_base): New class declaration.
8773 (Input_section_specifier): New class defintion.
8774 (class Output_relaxed_input_section) Change base class to
8775 Output_section_data_build.
8776 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8777 base class initializer.
8778 (Output_section::add_relaxed_input_section): New method declaration.
8779 (Output_section::Input_section): Change visibility to protected.
8780 (Output_section::Input_section::relobj,
8781 Output_section::Input_section::shndx): Handle relaxed input sections.
8782 Output_section::input_sections) Change visibility to protected. Also
8783 define overload to return a non-const pointer.
8784 (Output_section::Merge_section_properties): New class defintion.
8785 (Output_section::Merge_section_by_properties_map,
8786 Output_section::Output_section_data_by_input_section_map,
8787 Output_section::Relaxation_map): New types.
8788 (Output_section::relax_input_section): Rename method to
8789 Output_section::convert_input_sections_to_relaxed_sections and change
8790 interface to take a vector of relaxed section pointers.
8791 (Output_section::find_merge_section,
8792 Output_section::find_relaxed_input_section,
8793 Output_section::build_relaxation_map,
8794 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8795 New method declarations.
8796 (Output_section::merge_section_map_
8797 Output_section::merge_section_by_properties_map_,
8798 Output_section::relaxed_input_section_map_,
8799 Output_section::is_relaxed_input_section_map_valid_,
8800 Output_section::generate_code_fills_at_write_): New data members.
8801 * script-sections.cc
8802 (Output_section_element_input::set_section_addresses): Call
8803 current_data_size and addralign methods of relaxed input sections.
8804 (Orphan_output_section::set_section_addresses): Call current_data_size
8805 and addralign methods of relaxed input sections.
8806 * symtab.cc (Symbol_table::compute_final_value): Extract template
8807 from the body of Symbol_table::sized_finalize_symbol.
8808 (Symbol_table::sized_finalized_symbol): Call
8809 Symbol_table::compute_final_value.
8810 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8811 (Symbol_table::compute_final_value): New templated method declaration.
8812 * target.cc (Target::do_make_output_section): New method defintion.
8813 * target.h (Target::make_output_section): New method declaration.
8814 (Target::relax): Add more parameters for input objects, symbol table
8815 and layout. Adjust call to do_relax.
8816 (Target::do_make_output_section): New method declaration.
8817 (Target::do_relax): Add parameters for input objects, symbol table
8818 and layout.
8819
8820 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8821
8822 * pread.c: Include stdio.h.
8823
8824 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8825
8826 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8827 defined.
8828
8829 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8830
8831 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8832 Change read_shndx type to unsigned int.
8833 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8834 int.
8835 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8836 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8837 Change read_shndx type to unsigned int.
8838 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8839 int.
8840 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8841 * layout.cc (Layout::create_symtab_sections): Cast the result of
8842 local_symcount * symsize to off_t in the gold_assert.
8843
8844 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8845
8846 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8847 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8848 R_ARM_BASE_ABS.
8849 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8850 (Arm_relocate_functions::thm_abs5): New function.
8851 (Arm_relocate_functions::abs12): New function.
8852 (Arm_relocate_functions::abs16): New function.
8853 (Arm_relocate_functions::base_abs): New function.
8854 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8855 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8856 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8857 R_ARM_BASE_ABS.
8858 (Scan::global): Likewise.
8859 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8860 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8861 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8862 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8863 R_ARM_BASE_ABS.
8864
8865 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8866
8867 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8868 (Arm_relocate_functions::movt_prel): New function.
8869 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8870 (Arm_relocate_functions::thm_movt_prel): New function.
8871 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8872 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8873 (Scan::global, Relocate::relocate): Likewise.
8874 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8875
8876 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8877
8878 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8879 Incremental_checker.
8880 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8881 unsigned int.
8882 (class Incremental_inputs_header): New class.
8883 (Incremental_inputs_header_writer): Edit comment.
8884 (Incremental_inputs_entry): New class.
8885 (Incremental_inputs_entry_writer): Edit comment.
8886 (Sized_incremental_binary::do_find_incremental_inputs_section):
8887 Add *strtab_shndx parameter, fill it.
8888 (Sized_incremental_binary::do_check_inputs): New method.
8889 (Incremental_checker::can_incrementally_link_output_file): Use
8890 Sized_incremental_binary::check_inputs.
8891 (Incremental_inputs::report_command_line): Save command line in
8892 command_line_.
8893 * incremental.h:
8894 (Incremental_binary::find_incremental_inputs_section): New
8895 method.
8896 (Incremental_binary::do_find_incremental_inputs_section): Add
8897 strtab_shndx parameter.
8898 (Incremental_binary::do_check_inputs): New pure virtual method.
8899 (Sized_incremental_binary::do_check_inputs): Declare.
8900 (Incremental_checker::Incremental_checker): Add incremental_inputs
8901 parameter, use it to initialize incremental_inputs_.
8902 (Incremental_checker::incremental_inputs_): New field.
8903 (Incremental_checker::command_line): New method.
8904 (Incremental_checker::inputs): New method.
8905 (Incremental_checker::command_line_): New field.
8906
8907 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8908
8909 * incremental.cc: Include <cstdarg> and "target-select.h".
8910 (vexplain_no_incremental): New function.
8911 (explain_no_incremental): New function.
8912 (Incremental_binary::error): New method.
8913 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8914 method.
8915 (make_sized_incremental_binary): New function.
8916 (open_incremental_binary): New function.
8917 (can_incrementally_link_file): Add checks if output is ELF and has
8918 inputs section.
8919 * incremental.h: Include "elfcpp_file.h" and "output.h".
8920 (Incremental_binary): New class.
8921 (Sized_incremental_binary): New class.
8922 (open_incremental_binary): Declare.
8923 * object.cc (is_elf_object): Use
8924 elfcpp::Elf_recognizer::is_elf_file.
8925 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8926 * output.h (Output_file::filesize): New method.
8927
8928 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8929
8930 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8931 New function.
8932 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8933 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8934 function.
8935 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8936 function.
8937 (Arm_relocate_functions::movw_abs_nc): New function.
8938 (Arm_relocate_functions::movt_abs): New function.
8939 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8940 (Arm_relocate_functions::thm_movt_abs): New function.
8941 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8942 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8943 (Scan::global): Likewise.
8944 (Relocate::relocate): Likewise.
8945 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8946
8947 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8948
8949 * arm.cc (Arm_relocate_functions::got_prel) New function.
8950 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8951 (Relocate::relocate): Likewise.
8952 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8953
8954 2009-10-06 Ian Lance Taylor <iant@google.com>
8955
8956 * options.h (class General_options): Define
8957 split_stack_adjust_size parameter.
8958 * object.h (class Object): Add uses_split_stack_ and
8959 has_no_split_stack_ fields. Add uses_split_stack and
8960 has_no_split_stack accessor functions. Declare
8961 handle_split_stack_section.
8962 (class Reloc_symbol_changes): Define.
8963 (class Sized_relobj): Define Function_offsets. Declare
8964 split_stack_adjust, split_stack_adjust_reltype, and
8965 find_functions.
8966 * object.cc (Object::handle_split_stack_section): New function.
8967 (Sized_relobj::do_layout): Call handle_split_stack_section.
8968 * dynobj.cc (Sized_dynobj::do_layout): Call
8969 handle_split_stack_section.
8970 * reloc.cc (Sized_relobj::relocate_sections): Call
8971 split_stack_adjust for executable sections in split_stack
8972 objects. Pass reloc_map to relocate_section.
8973 (Sized_relobj::split_stack_adjust): New function.
8974 (Sized_relobj::split_stack_adjust_reltype): New function.
8975 (Sized_relobj::find_functions): New function.
8976 * target-reloc.h: Include "object.h".
8977 (relocate_section): Add reloc_symbol_changes parameter. Change
8978 all callers.
8979 * target.h (class Target): Add calls_non_split method. Declare
8980 do_calls_non_split virtual method. Declare match_view and
8981 set_view_to_nop.
8982 * target.cc: Include "elfcpp.h".
8983 (Target::do_calls_non_split): New function.
8984 (Target::match_view): New function.
8985 (Target::set_view_to_nop): New function.
8986 * gold.cc (queue_middle_tasks): Give an error if mixing
8987 split-stack and non-split-stack objects with -r.
8988 * i386.cc (Target_i386::relocate_section): Add
8989 reloc_symbol_changes parameter.
8990 (Target_i386::do_calls_non_split): New function.
8991 * x86_64.cc (Target_x86_64::relocate_section): Add
8992 reloc_symbol_changes parameter.
8993 (Target_x86_64::do_calls_non_split): New function.
8994 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8995 parameter.
8996 * powerpc.cc (Target_powerpc::relocate_section): Add
8997 reloc_symbol_changes parameter.
8998 * sparc.cc (Target_sparc::relocate_section): Add
8999 reloc_symbol_changes parameter.
9000 * configure.ac: Call AM_CONDITIONAL for the default target.
9001 * configure: Rebuild.
9002 * testsuite/Makefile.am (TEST_AS): New variable.
9003 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9004 (check_DATA): Add split_i386 and split_x86_64 files.
9005 (SPLIT_DEFSYMS): Define.
9006 (split_i386_[1234n].o): New targets.
9007 (split_i386_[124]): New targets.
9008 (split_i386_[1234r].stdout): New targets.
9009 (split_x86_64_[1234n].o): New targets.
9010 (split_x86_64_[124]): New targets.
9011 (split_x86_64_[1234r].stdout): New targets.
9012 (MOSTLYCLEANFILES): Add new executables.
9013 * testsuite/split_i386.sh: New file.
9014 * testsuite/split_x86_64.sh: New file.
9015 * testsuite/split_i386_1.s: New file.
9016 * testsuite/split_i386_2.s: New file.
9017 * testsuite/split_i386_3.s: New file.
9018 * testsuite/split_i386_4.s: New file.
9019 * testsuite/split_i386_n.s: New file.
9020 * testsuite/split_x86_64_1.s: New file.
9021 * testsuite/split_x86_64_2.s: New file.
9022 * testsuite/split_x86_64_3.s: New file.
9023 * testsuite/split_x86_64_4.s: New file.
9024 * testsuite/split_x86_64_n.s: New file.
9025 * testsuite/testfile.cc (Target_test): Update relocation_section
9026 function.
9027 * testsuite/Makefile.in: Rebuild.
9028
9029 2009-10-06 Ian Lance Taylor <iant@google.com>
9030
9031 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9032 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9033 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9034 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9035 the address on ldo_addrs_.
9036 (Target_i386::Relocate::fix_up_ldo): New function.
9037
9038 2009-10-06 Rafael Espindola <espindola@google.com>
9039
9040 * plugin.cc (add_input_library): New.
9041 (Plugin::load): Add add_input_library to tv.
9042 (Plugin_manager::add_input_file): Add the is_lib argument.
9043 (add_input_file): Update call to Plugin_manager::add_input_file.
9044 (add_input_library): New.
9045 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9046
9047 2009-09-30 Doug Kwan <dougkwan@google.com>
9048
9049 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9050 symbol and call Symbol::may_need_copy_reloc to determine if
9051 a copy reloc is needed.
9052 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9053 nocopyreloc is given in command line.
9054 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9055 given in command line.
9056 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9057 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9058 of the removed Target_i386::may_need_copy_reloc.
9059 * options.h (copyreloc): New option with default value false.
9060 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9061 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9062 instead of the removed Target_powerpc::may_need_copy_reloc.
9063 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9064 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9065 instead of the removed Target_sparc::may_need_copy_reloc.
9066 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9067 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9068 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9069 instead of the removed Target_x86_64::may_need_copy_reloc.
9070
9071 2009-09-30 Ian Lance Taylor <iant@google.com>
9072
9073 * object.h (class Object): Remove target_ field, and target,
9074 sized_target, and set_target methods.
9075 (Object::sized_target): Remove.
9076 (class Sized_relobj): Update declarations. Remove sized_target.
9077 * object.cc (Sized_relobj::setup): Remove target parameter.
9078 Change all callers.
9079 (Input_objects::add_object): Don't do anything with the target.
9080 (make_elf_sized_object): Add punconfigured parameter. Change all
9081 callers. Set or test parameter target.
9082 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9083 Change all callers.
9084 * parameters.cc (Parameters::set_target): Change parameter type to
9085 be non-const.
9086 (Parameters::default_target): Remove.
9087 (set_parameters_target): Change parameter type to be non-const.
9088 (parameters_force_valid_target): New function.
9089 (parameters_clear_target): New function.
9090 * parameters.h (class Parameters): Update declarations. Remove
9091 default_target method. Add sized_target and clear_target
9092 methods. Change target_ to be non-const.
9093 (set_parameters_target): Update declaration.
9094 (parameters_force_valid_target): Declare.
9095 (parameters_clear_target): Declare.
9096 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9097 as NULL if we aren't searching.
9098 (Add_symbols::run): Don't check for compatible target.
9099 * fileread.cc (Input_file::open_binary): Call
9100 parameters_force_valid_target.
9101 * gold.cc (queue_middle_tasks): Likewise.
9102 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9103 set_target on object.
9104 * dynobj.h (class Sized_dynobj): Update declarations.
9105 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9106 make_elf_object returns NULL.
9107 (Archive::include_member): Don't check whether object target is
9108 compatible.
9109 * output.cc (Output_section::add_input_section): Get target from
9110 parameters.
9111 (Output_section::relax_input_section): Likewise.
9112 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9113 parameters.
9114 (Sized_relobj::do_scan_relocs): Likewise.
9115 (Sized_relobj::relocate_sections): Likewise.
9116 * resolve.cc (Symbol_table::resolve): Likewise.
9117 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9118 parameter. Change all callers.
9119 (Symbol_table::add_from_object): Get target from parameters.
9120 (Symbol_table::add_from_relobj): Don't check object target.
9121 (Symbol_table::add_from_dynobj): Likewise.
9122 (Symbol_table::define_special_symbol): Get target from
9123 parameters.
9124 * symtab.h (class Symbol_table): Update declaration.
9125 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9126 parameter. Change all callers. Clear parameter target.
9127 (Binary_test): Test target here.
9128 * testsuite/object_unittest.cc (gold_testsuite): Remove
9129 target_test_pointer parameter. Change all callers.
9130 (Object_test): Test target here.
9131
9132 2009-09-26 Ian Lance Taylor <iant@google.com>
9133
9134 * testsuite/initpri1.c: Don't try to use constructor priorities if
9135 compiling with gcc before 4.3.
9136
9137 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9138
9139 * testsuite/retain_symbols_file_test.sh (check_present): Change
9140 output file name to retain_symbols_file_test.stdout.
9141 (check_absent): Likewise.
9142
9143 2009-09-18 Craig Silverstein <csilvers@google.com>
9144
9145 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9146 * options.cc: Include <cerrno> and <fstream>.
9147 (General_options::finalize): Parse -retain-symbols-file tag.
9148 * options.h: New flag.
9149 (General_options): New method should_retain_symbol, new
9150 variable symbols_to_retain.
9151 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9152 should_retain_symbol map.
9153 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9154 * testsuite/Makefile.in: Regenerate.
9155 * testsuite/retain_symbols_file_test.sh: New file.
9156
9157 2009-09-18 Nick Clifton <nickc@redhat.com>
9158
9159 * po/es.po: Updated Spanish translation.
9160
9161 2009-09-17 Doug Kwan <dougkwan@google.com>
9162
9163 * debug.h (DEBUG_RELAXATION): New constant.
9164 (DEBUG_ALL): Add DEBUG_RELAXATION.
9165 (debug_string_to_enum): Add relaxation debug option.
9166 * layout.cc
9167 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9168 Layout::Relaxation_debug_check::read_sections,
9169 Layout::Relaxation_debug_check::read_sections): New method definitions.
9170 (Layout::Layout): Initialize data members
9171 record_output_section_data_from_scrips_,
9172 script_output_section_data_list_ and relaxation_debug_check_.
9173 (Layout::save_segments, Layout::restore_segments,
9174 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9175 Layout::relaxation_loop_body): New method definitions.
9176 (Layout::finalize): Support relaxation. Move section layout code to
9177 Layout::relaxation_loop_body.
9178 (Layout::set_asection_address_from_script): Move code for orphan
9179 section placement out.
9180 (Layout::place_orphan_sections_in_script): New method definition.
9181 * layout.h (Output_segment_headers, Output_file_header):
9182 New forward class declarations.
9183 (Layout::~Layout): Define.
9184 (Layout::new_output_section_data_from_script): New method definition.
9185 (Layout::place_orphan_sections_in_script): New method declaration.
9186 (Layout::Segment_states): New type declaration.
9187 (Layout::save_segments, Layout::restore_segments,
9188 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9189 Layout::relaxation_loop_body): New method declarations.
9190 (Layout::Output_section_data_list): New type declaration.
9191 (Layout::Relaxation_debug_check): New class definition.
9192 (Layout::record_output_section_data_from_script_,
9193 Layout::script_output_section_data_list_, Layout::segment_states_,
9194 Layout::relaxation_debug_check_): New data members.
9195 * output.cc: (Output_section_headers::do_size): New method definition.
9196 (Output_section_headers::Output_section_headers): Move size
9197 computation to Output_section_headers::do_size.
9198 (Output_segment_headers::do_size): New method definition.
9199 (Output_file_header::Output_file_header): Move size computation to
9200 Output_file_header::do_size and call it.
9201 (Output_file_header::do_size): New method definition.
9202 (Output_data_group::Output_data_group): Adjust call to
9203 Output_section_data.
9204 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9205 (Output_symtab_xindex::do_write): Add array bound check.
9206 (Output_section::Input_section::print_to_mapfile): Handle
9207 RELAXED_INPUT_SECTION_CODE.
9208 (Output_section::Output_section): Initialize data member checkpoint_.
9209 (Output_section::~Output_section): Delete checkpoint object pointed
9210 by checkpoint_.
9211 (Output_section::add_input_section): Always add an Input_section if
9212 relaxing.
9213 (Output_section::add_merge_input_section): Add assert.
9214 (Output_section::relax_input_section): New method definition.
9215 (Output_section::set_final_data_size): Set load address to zero for
9216 an unallocated section.
9217 (Output_section::do_address_and_file_offset_have_reset_values):
9218 New method definition.
9219 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9220 Handle relaxed input section.
9221 (Output_section::sort_attached_input_sections): Checkpoint input
9222 section list lazily.
9223 (Output_section::get_input_sections): Change type of input_sections to
9224 list of Simple_input_section pointers. Checkpoint input section list
9225 lazily. Also handle relaxed input sections.
9226 (Output_section::add_input_section_for_script): Take a reference to
9227 a Simple_input_section object instead of Relobj pointer and section
9228 index as parameter. Handle relaxed input sections.
9229 (Output_section::save_states, Output_section::restore_states): New
9230 method definitions.
9231 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9232 (Output_data::is_data_size_fixed): New method definition.
9233 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9234 if it is fixed.
9235 (Output_data::address_and_file_offset_have_reset_values): New method
9236 definition.
9237 (Output_data::do_address_and_file_offset_have_reset_values): New method
9238 definition.
9239 (Output_data::set_data_size): Check that data size is not fixed.
9240 (Output_data::fix_data_size): New method definition.
9241 (Output_data::is_data_size_fixed_): New data member.
9242 (Output_section_headers::set_final_data_size): New method definition.
9243 (Output_section_headers::do_size): New method declaration.
9244 (Output_segment_headers::set_final_data_size): New method definition.
9245 (Output_segment_headers::do_size): New method declaration.
9246 (Output_file_header::set_final_data_size)::New method definition.
9247 (Output_file_header::do_size)::New method declaration.
9248 (Output_section_data::Output_section_data): Add new parameter
9249 is_data_size_fixed and use it to fix data size.
9250 (Output_data_const::Output_data_const): Adjust call to base class
9251 constructor and fix data size.
9252 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9253 base class constructor and fix data size.
9254 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9255 base class constructor and fix data size.
9256 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9257 class constructor and fix data size.
9258 (Output_data_group::set_final_data_size): New method definition.
9259 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9260 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9261 class constructor and fix data size.
9262 (Output_relaxed_input_section): New class definition.
9263 (Output_section::Simple_input_section): New class definition.
9264 (Output_section::get_input_sections): Adjust parameter list.
9265 (Output_section::add_input_section_for_script): Same.
9266 (Output_section::save_states, Output_section::restore_states,
9267 Output_section::do_address_and_file_offset_have_reset_values,
9268 (Output_section::Input_section::Input_section): Handle
9269 RELAXED_INPUT_SECTION_CODE. Add new overload for
9270 Output_relaxed_input_section.
9271 (Output_section::Input_section::is_input_section,
9272 Output_section::Input_section::set_output_section): Handle relaxed
9273 input section.
9274 (Output_section::Input_section::is_relaxed_input_section,
9275 Output_section::Input_section::output_section_data,
9276 Output_section::Input_section::relaxed_input_section): New method
9277 definitions.
9278 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9279 value.
9280 (Output_section::Input_section::u1_): Update comments.
9281 (Output_section::Input_section::u2_): Add new union member poris.
9282 (Output_section::Checkpoint_output_section): New classs definition.
9283 (Output_section::relax_input_section): New method declaration.
9284 (Output_section::checkpoint_): New data member.
9285 (Output_segment): Update comments.
9286 (Output_segment::Output_segment): Un-privatize copy constructor.
9287 (Output_segment::operator=): Un-privatize.
9288 * script-sections.cc (Output_section_element::Input_section_list):
9289 Change element type to Output_section::Simple_input_section.
9290 (Output_section_element_dot_assignment::set_section_addresses):
9291 Register output section data for relaxation clean up.
9292 (Output_data_exression::Output_data_expression): Adjust call to base
9293 constructor to fix data size.
9294 (Output_section_element_data::set_section_addresses): Register
9295 Output_data_expression object for relaxation clean up.
9296 (struct Input_section_info): Replace Relobj pointer and section index
9297 pair with Output_section::Simple_input_section and Convert struct to a
9298 class.
9299 (Input_section_sorter::operator()): Adjust access to
9300 Input_section_info data member to use accessors.
9301 (Output_section_element_input::set_section_addresses): Use layout
9302 parameter. Adjust code to use Output_section::Simple_input_section
9303 and Input_secction_info classes. Register filler for relaxation
9304 clean up.
9305 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9306 and section index pair with Output_section::Simple_input_section
9307 class. Adjust code accordingly.
9308 (Phdrs_element::release_segment): New method definition.
9309 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9310 segment list.
9311 (Script_sections::release_segments): New method definition.
9312 * gold/script-sections.h (Script_sections::release_segments): New
9313 method declaration.
9314 * gold/target.h (Target::may_relax, Target::relax,
9315 Target::do_may_relax, Target::do_relax): New method definitions.
9316
9317 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9318
9319 * arm.cc (has_signed_unsigned_overflow): New function.
9320 (Arm_relocate_functions::abs8): New function.
9321 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9322 (Target_arm::Scan::global): Likewise.
9323 (Target_arm::relocate::relocate): Likewise.
9324 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9325 Likewise.
9326
9327 2009-09-16 Cary Coutant <ccoutant@google.com>
9328
9329 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9330 * testsuite/Makefile.in: Regenerate.
9331
9332 2009-09-11 Nick Clifton <nickc@redhat.com>
9333
9334 * po/gold.pot: Updated by the Translation project.
9335
9336 2009-09-08 Cary Coutant <ccoutant@google.com>
9337
9338 * output.cc (Output_file::open): Add execute permission to empty file.
9339 * testsuite/Makefile.am (permission_test): New test.
9340 * testsuite/Makefile.in: Regenerate.
9341
9342 2009-09-02 Ian Lance Taylor <iant@google.com>
9343
9344 * output.cc (Output_file::resize): Call map_no_anonymous rather
9345 than map.
9346
9347 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9348
9349 * gold.cc: Include "incremental.h".
9350 (queue_initial_tasks): Call Incremental_checker methods.
9351 * incremental.cc: Include "output.h".
9352 (Incremental_checker::can_incrementally_link_output_file): New
9353 method.
9354 * incremental.h (Incremental_checker): New class.
9355
9356 * output.cc (Output_file::open_for_modification): New method.
9357 (Output_file::map_anonymous): Changed return type to bool. Record
9358 map in base_ field.
9359 (Output_file::map_no_anonymous): New method, broken out of map.
9360 (Output_file::map): Use map_no_anonymous and map_anonymous.
9361 * output.h (class Output_file): Update declarations.
9362
9363 2009-08-24 Cary Coutant <ccoutant@google.com>
9364
9365 * options.h (Command_line::Pre_options): New class.
9366 (Command_line::pre_options): New member.
9367 * options.cc (gold::options::ready_to_register): New variable.
9368 (One_option::register_option): Do nothing if not registering options.
9369 Assert if same short option registered twice.
9370 (General_options::General_options): Turn off option registration when
9371 done constructing.
9372 (Command_line::Pre_options::Pre_options): New constructor.
9373
9374 2009-08-24 Cary Coutant <ccoutant@google.com>
9375
9376 * options.h (General_options::no_keep_memory): Remove incorrect
9377 short option.
9378
9379 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9380
9381 * Makefile.am (am__skiplex, am__skipyacc): New.
9382 * Makefile.in: Regenerate.
9383
9384 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9385
9386 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9387 (INCLUDES): ... this.
9388 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9389 (AM_CPPFLAGS): Renamed from ...
9390 (INCLUDE): ... this.
9391 * Makefile.in, testsuite/Makefile.in: Regenerate.
9392
9393 * Makefile.in: Regenerate.
9394 * aclocal.m4: Likewise.
9395 * config.in: Likewise.
9396 * configure: Likewise.
9397 * testsuite/Makefile.in: Likewise.
9398
9399 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9400 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9401 * Makefile.in: Regenerate.
9402 * testsuite/Makefile.in: Regenerate.
9403
9404 2009-08-19 Cary Coutant <ccoutant@google.com>
9405
9406 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9407 symbols in shared libraries overridden by hidden or internal symbols
9408 in the main program.
9409
9410 2009-08-19 Chris Demetriou <cgd@google.com>
9411
9412 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9413 checking source file names in error messages.
9414
9415 2009-08-18 Doug Kwan <dougkwan@google.com>
9416
9417 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9418 an elcpp::Ehdr as parameter. Adjust call to set_target.
9419 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9420 an elfcpp::Ehdr as parameter.
9421 * object.cc (Object::set_target): Remove the version that looks up
9422 a target and sets it.
9423 (Sized_relobj::setup): Take a Target object instead of
9424 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9425 (make_elf_sized_object): Find target and ask target to
9426 make an ELF object.
9427 * object.h: (Object::set_target): Remove the version that looks up
9428 a target and sets it.
9429 (Sized_relobj::setup): Take a Target object instead of
9430 an elfcpp:Ehdr as parameter.
9431 * target.cc: Include dynobj.h.
9432 (Target::do_make_elf_object_implementation): New.
9433 (Target::do_make_elf_object): New.
9434 * target.h (Target::make_elf_object): New template declaration.
9435 (Target::do_make_elf_object): New method declarations.
9436 (Target::do_make_elf_object_implementation): New template declaration.
9437
9438 2009-08-14 Ian Lance Taylor <iant@google.com>
9439
9440 * gold.h (FUNCTION_NAME): Define.
9441 (gold_unreachable): Use FUNCTION_NAME.
9442
9443 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9444
9445 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9446 symbol in the --keep-unique list is not found.
9447
9448 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9449
9450 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9451 been maked as --keep-unique.
9452 (Icf::unfold_section): New function.
9453 * icf.h (Icf::unfold_section): New function.
9454 * options.h (General_options::keep_unique): New option.
9455 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9456 * testsuite/Makefile.in: Regenerate.
9457 * testsuite/icf_keep_unique_test.sh: New file.
9458 * testsuite/icf_keep_unique_test.cc: New file.
9459
9460 2009-08-12 Cary Coutant <ccoutant@google.com>
9461
9462 PR 10471
9463 * resolve.cc (Symbol_table::resolve): Check for references from
9464 dynamic objects to hidden and internal symbols.
9465 * testsuite/Makefile.am (hidden_test.sh): New test.
9466 * testsuite/Makefile.in: Regenerate.
9467 * testsuite/hidden_test.sh: New script.
9468 * testsuite/hidden_test_1.c: New test source.
9469 * testsuite/hidden_test_main.c: New test source.
9470
9471 2009-08-11 Doug Kwan <dougkwan@google.com>
9472
9473 * arm.cc: Update comments.
9474 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9475 segment to locate the .ARM.exidx section if present.
9476
9477 2009-08-09 Doug Kwan <dougkwan@google.com>
9478
9479 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9480 patch.
9481
9482 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9483 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9484 compiler warnings.
9485
9486 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9487
9488 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9489 valid tls_segment only for non-debug-section relocations.
9490 * testsuite/Makefile.am: Add gc_tls_test.
9491 * testsuite/Makefile.in: Regenerate.
9492 * testsuite/gc_tls_test.cc: New file.
9493 * testsuite/gc_tls_test.sh: New file.
9494
9495 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9496
9497 * icf.cc: New file.
9498 * icf.h: New file.
9499 * Makefile.am (CCFILES): Add icf.cc.
9500 (HFILES): Add icf.h
9501 * Makefile.in: Regenerate.
9502 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9503 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9504 section, symbol and addend information for the relocs.
9505 * gold.cc (queue_middle_tasks): Call identical code folding.
9506 * gold.h: Add defines for multimap.
9507 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9508 to the call of finalize_local_symbols.
9509 * main.cc (main): Create object of class Icf.
9510 * object.cc (Sized_relobj::do_layout): Allow this function to be
9511 called twice during icf.
9512 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9513 to sections marked as identical by icf.
9514 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9515 when available.
9516 (Sized_relobj::do_section_entsize): New function.
9517 * object.h (Object::section_entsize): New function.
9518 (Object::do_section_entsize): New pure virtual function.
9519 (Relobj::finalize_local_symbols): Add new parameter.
9520 (Relobj::do_section_entsize): New function.
9521 * options.h (General_options::icf): New option.
9522 (General_options::icf_iterations): New option.
9523 (General_options::print_icf_sections): New option.
9524 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9525 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9526 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9527 icf.
9528 * symtab.cc (Symbol_table::is_section_folded): New function.
9529 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9530 to sections marked as identical by icf.
9531 * symtab.h (Symbol_table::set_icf): New function.
9532 (Symbol_table::icf): New function.
9533 (Symbol_table::is_section_folded): New function.
9534 (Symbol_table::icf_): New data member.
9535 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9536 * testsuite/Makefile.am: Add commands to build icf_test.
9537 * testsuite/Makefile.in: Regenerate.
9538 * testsuite/icf_test.sh: New file.
9539 * testsuite/icf_test.cc: New file.
9540
9541 2009-07-24 Chris Demetriou <cgd@google.com>
9542
9543 * layout.cc (is_compressible_debug_section): Fix incorrect
9544 comment about compressed section names.
9545
9546 2009-07-20 Ian Lance Taylor <ian@airs.com>
9547
9548 PR 10419
9549 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9550
9551 2009-07-16 Ian Lance Taylor <iant@google.com>
9552
9553 PR 10400
9554 * layout.h: #include <map>.
9555 (class Kept_section): Change from struct to class. Add accessors
9556 and setters. Add section size to Comdat_group mapping. Change
9557 Comdat_group to std::map. Add is_comdat_ field. Add
9558 linkonce_size field in union.
9559 (class Layout): Update declaration of find_or_add_kept_section.
9560 Don't declare find_kept_object.
9561 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9562 parameter. Add object, shndx, is_comdat, and is_group_name
9563 parameters. Change all callers. Adjust for new Kept_section.
9564 (Layout::find_kept_object): Remove.
9565 * object.cc (Sized_relobj::include_section_group): Update use of
9566 Kept_section. Rename secnum to shndx. Only record
9567 Kept_comdat_section if sections are the same size.
9568 (Sized_relobj::include_linkonce_section): Update use of
9569 Kept_section. Only record Kept_comdat_section if sections are the
9570 same size. Set size of linkonce section.
9571 (Sized_relobj::map_to_kept_section): Update call to
9572 get_kept_comdat_section.
9573 * object.h (class Sized_relobj): Rename fields in
9574 Kept_comdat_section to drop trailing underscores; change object
9575 field to Relobj*. Change Kept_comdat_section_table to store
9576 struct rather than pointer.
9577 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9578 Add kept_object and kept_shndx parameters. Change all callers.
9579 (Sized_relobj::get_kept_comdat_section): Change return type to
9580 bool. Add kept_object and kept_shndx parameters. Change all
9581 callers.
9582 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9583 Layout::find_or_add_kept_section.
9584
9585 2009-07-09 Ian Lance Taylor <iant@google.com>
9586
9587 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9588 Reserve space in the hash table.
9589
9590 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9591
9592 * fileread.cc (File_read::get_mtime): New method.
9593 * fileread.h (Timespec): New structure.
9594 (File_read::get_mtime): New method.
9595 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9596 Renamed from timestamp_nsec.
9597 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9598 Elf_Xword.
9599 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9600 timestamp_nsec.
9601 (Incremental_inputs::report_archive): Save mtime; style fix.
9602 (Incremental_inputs::report_obejct): Save mtime; style fix.
9603 (Incremental_inputs::report_script): Save mtime; style fix.
9604 (Incremental_inputs::finalize_inputs): Style fix.
9605 (Incremental_inputs::finalize): Style fix.
9606 (Incremental_inputs::create_input_section_data): Store inputs
9607 mtime.
9608 * incremental.h (Incremental_inputs::report_script): Add mtime
9609 argument.
9610 (Incremental_inputs::Input_info::Input_info): Intialize only one
9611 union member.
9612 (Incremental_inputs::Input_info::archive): Move to nameless
9613 union.
9614 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9615 (Incremental_inputs::Input_info::script): Move to nameless union.
9616 (Incremental_inputs::mtime): New field.
9617 * script.cc (read_input_script): Pass file mtime to
9618 Incremental_input.
9619 * script.h (Script_info::inputs): Style fix.
9620
9621 2009-07-01 Ian Lance Taylor <ian@airs.com>
9622
9623 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9624 instead of 32.
9625
9626 2009-06-24 Ian Lance Taylor <iant@google.com>
9627
9628 PR 10156
9629 * layout.cc (Layout::choose_output_section): If we find an
9630 existing section, update the flags.
9631 (Layout::create_notes): New function, broken out of
9632 Layout::finalize.
9633 (Layout::finalize): Don't create note sections.
9634 (Layout::create_note): Don't crash if linker script discards
9635 section.
9636 (Layout::create_gold_note): Likewise.
9637 (Layout::create_build_id): Likewise. Don't set
9638 after_input_sections on the section.
9639 (Layout::create_executable_stack_info): Remove target parameter.
9640 Change caller.
9641 * layout.h (class Layout): Declare create_notes. Update
9642 declaration of create_executable_stack_info.
9643 * gold.cc (queue_middle_tasks): Call create_notes.
9644 * output.cc (Output_section::update_flags_for_input_section): Move
9645 here from output.h. If SHF_ALLOC flag is newly set, mark address
9646 invalid.
9647 * output.h (Output_data::mark_address_invalid): New function.
9648 (class Output_section): Only declare, not define,
9649 update_flags_for_input_section. Remove set_flags.
9650
9651 2009-06-24 Ian Lance Taylor <iant@google.com>
9652
9653 * script-sections.cc (Output_section_definition::
9654 set_section_addresses): Rename shadowing local load_address to
9655 laddr.
9656
9657 2009-06-24 Ian Lance Taylor <iant@google.com>
9658
9659 PR 10244
9660 * reloc.cc (relocate_sections): Skip empty relocation sections.
9661
9662 2009-06-23 Ian Lance Taylor <iant@google.com>
9663
9664 PR 10156
9665 * layout.cc (Layout::create_note): Use choose_output_section
9666 rather than make_output_section.
9667
9668 2009-06-23 Ian Lance Taylor <iant@google.com>
9669
9670 PR 10237
9671 * options.cc (General_options::parse_V): Set printed_version_.
9672 (General_options::General_options): Initialize printed_version_.
9673 * options.h (class General_options): Add printed_version_ field.
9674 * gold.cc (queue_initial_tasks): If there are no input files,
9675 don't give a fatal error if we printed the version information.
9676 (queue_middle_tasks): If using -r with a shared object, give a
9677 fatal error rather than an ordinary error.
9678
9679 2009-06-23 Ian Lance Taylor <iant@google.com>
9680
9681 PR 10219
9682 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9683 (Layout::make_output_section): Set have_stabstr_section_ if we see
9684 a .stab*str section.
9685 (Layout::finalize): Call link_stabs_sections.
9686 (Layout::link_stabs_sections): New file.
9687 * layout.h (class Layout): Add have_stabstr_section_ field.
9688 Declare link_stabs_sections.
9689
9690 2009-06-23 Doug Kwan <dougkwan@google.com>
9691
9692 * Makefile.am (libgold_a_LIBADD): New.
9693 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9694 * Makefile.in: Regenerate.
9695 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9696 * configure: Regenerate.
9697 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9698 * fileread.cc: Include sys/state.h
9699 * gold.h: Declare memmem and strndup if found missing.
9700 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9701
9702 2009-06-23 Ian Lance Taylor <iant@google.com>
9703
9704 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9705 * configure: Rebuild.
9706
9707 2009-06-23 Ian Lance Taylor <iant@google.com>
9708
9709 PR 10147
9710 * object.cc (Object::section_contents): Don't try to get a view if
9711 the section has length zero.
9712 (Object::handle_gnu_warning_section): If the section is empty, use
9713 the name of the section as the warning.
9714
9715 2009-06-23 Ian Lance Taylor <iant@google.com>
9716
9717 PR 10133
9718 * stringpool.h (class Stringpool_template): Add optimize_ field.
9719 (Stringpool_template::set_optimize): New function.
9720 * stringpool.cc (Stringpool_template::Stringpool_template):
9721 Initialize optimize_ field.
9722 (Stringpool_template::set_string_offsets): Test local optimize
9723 fild rather than parameter.
9724 * layout.cc (Layout::Layout): Call set_optimize on the section
9725 name stringpool.
9726
9727 2009-06-22 Ian Lance Taylor <iant@google.com>
9728
9729 PR 10030
9730 * yyscript.y: Parse TARGET.
9731 * script.cc (script_set_target): New function.
9732 * script-c.h (script_set_target): Declare.
9733 * options.cc (General_options::string_to_object_format): Rename
9734 from string_to_object_format in anonymous namespace. Change
9735 callers.
9736 * options.h (class General_options): Declare
9737 string_to_object_format.
9738
9739 2009-06-22 Ian Lance Taylor <iant@google.com>
9740
9741 * script-sections.cc (Script_sections::create_segments): Don't put
9742 program headers in a PT_LOAD segment if -n or -N.
9743
9744 2009-06-22 Ian Lance Taylor <iant@google.com>
9745
9746 PR 10141
9747 * options.h (class General_options): Add -z lazy and -z now. Sort
9748 -z options into alphabetical order.
9749 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9750
9751 2009-06-21 Ian Lance Taylor <iant@google.com>
9752
9753 * layout.cc (Layout::make_output_section): Call
9754 Target::new_output_section.
9755 (Layout::attach_allocated_section_to_segment): Put large section
9756 sections in a separate load segment with the large segment flag
9757 set.
9758 (Layout::segment_precedes): Sort large data segments after other
9759 load segments.
9760 (align_file_offset): New static function.
9761 (Layout::set_segment_offsets): Use align_file_offset.
9762 * output.h (class Output_section): Add is_small_section_ and
9763 is_large_section_ fields.
9764 (Output_section::is_small_section): New function.
9765 (Output_section::set_is_small_section): New function.
9766 (Output_section::is_large_section): New function.
9767 (Output_section::set_is_large_section): New function.
9768 (Output_section::is_large_data_section): New function.
9769 (class Output_segment): Add is_large_data_segment_ field.
9770 (Output_segment::is_large_data_segment): New function.
9771 (Output_segment::set_is_large_data_segment): New function.
9772 * output.cc (Output_section::Output_section): Initialize new
9773 fields.
9774 (Output_segment::Output_segment): Likewise.
9775 (Output_segment::add_output_section): Add assertion that large
9776 data sections always go in large data segments. Force small data
9777 sections to the end of the list of data sections. Force small BSS
9778 sections to the start of the list of BSS sections. For large BSS
9779 sections to the end of the list of BSS sections.
9780 * symtab.h (class Symbol): Declare is_common_shndx.
9781 (Symbol::is_defined): Check Symbol::is_common_shndx.
9782 (Symbol::is_common): Likewise.
9783 (class Symbol_table): Define enum Commons_section_type. Update
9784 declarations. Add small_commons_ and large_commons_ fields.
9785 * symtab.cc (Symbol::is_common_shndx): New function.
9786 (Symbol_table::Symbol_table): Initialize new fields.
9787 (Symbol_table::add_from_object): Put small and large common
9788 symbols in the right list.
9789 (Symbol_table::sized_finalized_symbol): Check
9790 Symbol::is_common_shndx.
9791 (Symbol_table::sized_write_globals): Likewise.
9792 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9793 common symbol lists. Don't call do_allocate_commons_list if the
9794 list is empty.
9795 (Symbol_table::do_allocate_commons_list): Remove is_tls
9796 parameter. Add comons_section_type parameter. Change all
9797 callers. Handle small and large common symbols.
9798 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9799 Symbol::is_common_shndx.
9800 * resolve.cc (symbol_to_bits): Likewise.
9801 * target.h (Target::small_common_shndx): New function.
9802 (Target::small_common_section_flags): New function.
9803 (Target::large_common_shndx): New function.
9804 (Target::large_common_section_flags): New function.
9805 (Target::new_output_section): New function.
9806 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9807 small_common_section_flags, and large_common_section_flags
9808 fields.
9809 (Target::do_new_output_section): New virtual function.
9810 * arm.cc (Target_arm::arm_info): Initialize new fields.
9811 * i386.cc (Target_i386::i386_info): Likewise.
9812 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9813 Likewise.
9814 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9815 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9816 (Target_x86_64::do_new_output_section): New function.
9817 * configure.ac: Define conditional MCMODEL_MEDIUM.
9818 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9819 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9820 (large_LDFLAGS): Define.
9821 * testsuite/large.c: New file.
9822 * testsuite/testfile.cc (Target_test::test_target_info):
9823 Initialize new fields.
9824 * configure, testsuite/Makefile.in: Rebuild.
9825
9826 2009-06-05 Doug Kwan <dougkwan@google.com>
9827
9828 * Makefile.am (CCFILES): Add target.cc.
9829 * Makefile.in: Regenerate.
9830 * i386.cc (class Target_i386): Define new virtual method to
9831 override do_is_local_label_name in parent.
9832 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9833 local symbols if --discard-locals or -X is given.
9834 * options.h (class General_options): Declare new options
9835 '--discard-locals' and '-X' for discarding locals.
9836 * target.h (class Target): Define new methods is_local_label_name.
9837 Declare new virtual method do_is_local_label_name.
9838 * target.cc: New file.
9839 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9840 (check_SCRIPTS): Add discard_locals_test.sh.
9841 (check_DATA): Add discard_local_tests.syms.
9842 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9843 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9844 * testsuite/Makefile.in: Regenerate.
9845 * testsuite/discard_locals_test.c: New file.
9846 * testsuite/discard_locals_test.sh: Same.
9847
9848 2009-06-05 Doug Kwan <dougkwan@google.com>
9849
9850 * object.cc (Sized_relobj::Sized_relobj): Initialize
9851 discarded_eh_frame_shndx_ to -1U.
9852 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9853 section.
9854 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9855 a discarded .eh_frame section.
9856 (Sized_relobj::do_finalize_local_symbols): Ditto.
9857 * object.h (class Sized_relobj): Declare new member
9858 discarded_eh_frame_shndx_.
9859 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9860 (local_labels_test.o, local_labels_test): New rules.
9861 * testsuite/Makefile.in: Regenerate.
9862
9863 2009-06-04 Doug Kwan <dougkwan@google.com>
9864
9865 * layout.cc (Layout::section_name_mapping): Add mapping for
9866 special ARM sections.
9867
9868 2009-06-03 Doug Kwan <dougkwan@google.com>
9869
9870 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9871 (utils::has_overflow): Same.
9872
9873 2009-06-03 Ian Lance Taylor <iant@google.com>
9874
9875 * layout.cc (Layout::section_name_mapping): New array, replacing
9876 Layout::linkonce_mapping.
9877 (Layout::section_name_mapping_count): New variable, replacing
9878 Layout::linkonce_mapping_count.
9879 (Layout::linkonce_output_name): Remove.
9880 (Layout::output_section_name): Rewrite.
9881 * layout.h (class Layout): Rename Linkonce_mapping to
9882 Section_name_mapping, linkonce_mapping to section_name_mapping,
9883 linkonce_mapping_count to section_name_mapping_count. Don't
9884 declare linkonce_output_name.
9885
9886 2009-06-03 Doug Kwan <dougkwan@google.com>
9887
9888 * gold/arm.cc (namespace utils): New.
9889 (Target_arm::reloc_is_non_pic): Define new method.
9890 (class Arm_relocate_functions): New.
9891 (Target_arm::Relocate::relocate): Handle relocation types used by
9892 Android.
9893
9894 2009-06-03 Ian Lance Taylor <iant@google.com>
9895
9896 * arm.cc (Target_arm::scan::global): Use || instead of |.
9897
9898 2009-06-02 Doug Kwan <dougkwan@google.com>
9899
9900 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9901 issued_non_pic_error_.
9902 (class Target_arm::Scan): Declare new method check_non_pic.
9903 Define new method symbol_needs_plt_entry.
9904 Declare new data member issued_non_pic_error_.
9905 (class Target_arm::Relocate): Declare new method
9906 should_apply_static_reloc.
9907 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9908 (Target_arm::Scan::check_non_pic): Define new method.
9909 (Target_arm::Scan::local): Handle a small subset of reloc types used
9910 by Android.
9911 (Target_arm::Scan::local): Same.
9912 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9913
9914 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9915
9916 * incremental.cc (Incremental_inputs::report_command_line): Filter
9917 out --incremental-* options.
9918
9919 2009-05-29 Doug Kwan <dougkwan@google.com>
9920
9921 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9922 template class.
9923 (class Target_arm): Update comment.
9924 (Target_arm::Target_arm): Initialize new data members GOT_,
9925 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9926 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9927 and Target_arm::rel_dyn_section.
9928 Declare new_enum Target_arm::Got_type.
9929 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9930 and DYNBSS_.
9931 Update commments for member do_dynsym_value.
9932 (Target_arm::got_size, Target_arm::plt_section,
9933 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9934 new methods inside class defintion.
9935 (Target_arm::got_section): Define new method.
9936 (Target_arm::rel_dyn_section): Same.
9937 (Output_data_plt_arm): New template class.
9938 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9939 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9940 (Output_data_plt_arm::add_entry): Same.
9941 (Output_data_plt_arm::first_plt_entry): Define new
9942 static data member for PLT instruction template.
9943 (Output_data_plt_arm::plt_entry): Same.
9944 (Output_data_plt_arm::do_write): Define new method.
9945 (Target_arm::make_plt_entry): Same.
9946 (Target_arm::do_finalize_sections): Same.
9947 (Target_arm::do_dynsym_value): Same.
9948
9949 2009-05-28 Doug Kwan <dougkwan@google.com>
9950
9951 * Makefile.am (TARGETSOURCES): Add arm.cc.
9952 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9953 * Makefile.in: Regenerate.
9954 * arm.cc: New file.
9955 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9956
9957 2009-05-26 Doug Kwan <dougkwan@google.com>
9958
9959 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9960 (General_options::check_excluded_libs): Strip off directories in
9961 archive name before matching like GNU ld does.
9962 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9963 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9964 (exclude_libs_test_LDFLAGS): Add linker option
9965 -Wl,--exclude-libs,libexclude_libs_test_3
9966 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9967 an explicit archive without using -l.
9968 (alt/libexclude_libs_test_3.a): New make rule.
9969 * testsuite/Makefile.in: Regenerate.
9970 * testsuite/exclude_libs_test.c : Declare lib3_default().
9971 (main): Call it.
9972 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9973 * exclude_libs_test_3.c: New file.
9974
9975 2009-05-26 Nick Clifton <nickc@redhat.com>
9976
9977 * po/id.po: New Indonesian translation.
9978 * po/gold.pot: Updated template file.
9979
9980 2009-05-22 Sriraman Tallam <tmsriram@google.com>
9981
9982 * testsuite/Makefile.am: Add -ffunction-sections to compile
9983 gc_comdat_test files. Add -Wl,--gc-sections to build
9984 gc_comdat_test.
9985 * testsuite/Makefile.in: Regenerate.
9986 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9987
9988 2009-05-21 Sriraman Tallam <tmsriram@google.com>
9989
9990 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9991 kept comdat section was garbage collected.
9992 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9993 * testsuite/Makefile.in: Regenerate.
9994 * testsuite/gc_comdat_test.sh: New file.
9995 * testsuite/gc_comdat_test_1.cc: New file.
9996 * testsuite/gc_comdat_test_2.cc: New file.
9997
9998 2009-05-19 Doug Kwan <dougkwan@google.com>
9999
10000 * archive.cc (Archive::Archive): Move constructor from archive.h
10001 to here. Initialize no_export_.
10002 (Archive::get_elf_object_for_member): Set no_export flag of object.
10003 * archive.h (Archive::Archive): Move constructor body to
10004 archive.cc.
10005 (Archive::no_export): New method.
10006 (Archive::no_export_): New field.
10007 * object.h (Object::Object): Initialize no_export_ to false.
10008 (Object::no_export, Object::set_no_export): New methods.
10009 (Object::no_export_): New field.
10010 * options.cc (General_options::parse_exclude_libs): New method.
10011 (General_options::check_excluded_libs) Same.
10012 * options.h (exclude_libs): New option.
10013 (General_options::check_excluded_libs): New method declaration.
10014 (General_options::excluded_libs_): New field.
10015 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10016 default or protected visibility if an object has no-export flag set.
10017 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10018 (check_SCRIPTS): Add exclude_libs_test.sh.
10019 (check_DATA): Add exclude_libs_test.syms.
10020 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10021 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10022 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10023 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10024 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10025 libexclude_libs_test_2.a): New rules.
10026 * testsuite/Makefile.in: Regenerate.
10027 * testsuite/exclude_libs_test.c: New file.
10028 * testsuite/exclude_libs_test.sh: Ditto.
10029 * testsuite/exclude_libs_test_1.c: Ditto.
10030 * testsuite/exclude_libs_test_2.c: Ditto.
10031
10032 2009-05-15 Ian Lance Taylor <iant@google.com>
10033
10034 * configure.ac: Check for declarations for cases where libiberty.h
10035 checks HAVE_DECL_xxx.
10036 * configure, config.in: Rebuild.
10037
10038 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10039
10040 * gold.h (Incremental_argument_list): Remove (invalid) forward
10041 declaration.
10042 * incremental.cc (Incremental_inputs::report_achive): New method.
10043 (Incremental_inputs::report_object): New method.
10044 (Incremental_inputs::report_script): New method.
10045 (Incremental_inputs::finalize_inputs): New method.
10046 (Incremental_inputs::finalize): Call finalize_inputs().
10047 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10048 Create inputs entries.
10049 * incremental.h (Incremental_input_type): New enum.
10050 (Incremental_inputs::Incremental_input): Initialize new fields.
10051 (Incremental_inputs::report_inputs): New method.
10052 (Incremental_inputs::report_achive): New method.
10053 (Incremental_inputs::report_object): New method.
10054 (Incremental_inputs::report_script): New method.
10055 (Incremental_inputs::finalize_inputs): New method.
10056 (Incremental_inputs::Input_info): New struct.
10057 (Incremental_inputs::Input_info_map): New typedef.
10058 (Incremental_inputs::lock_): New field.
10059 (Incremental_inputs::Inputs_): New field.
10060 (Incremental_inputs::Inputs_map): New field.
10061 * main.cc (main): Call Incremental_input::report_inputs.
10062 * options.h (Input_argument_list): Typedef moved from
10063 Input_arguments.
10064 (Input_file_group::Files): Remove, use ::Input_argument_list.
10065 (Input_file_group::Input_argument_list): Remove, use
10066 ::Input_argument_list.
10067 * plugin.cc (Plugin_manager::add_input_file): Add error in
10068 incremental build.
10069 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10070 functions.
10071 * script.cc (read_input_script): Call
10072 Incremental_input::report_script.
10073 * script.h (Script_info): New class.
10074
10075 2009-04-27 Ian Lance Taylor <iant@google.com>
10076
10077 * x86_64.cc (do_adjust_output_section): Set entsize to
10078 plt_entry_size.
10079
10080 2009-04-23 Elliott Hughes <enh@google.com>
10081
10082 * output.cc (Output_file::close): After short writes, continue
10083 writing from the correct offset in the buffer being written.
10084
10085 2009-04-23 Chris Demetriou <cgd@google.com>
10086
10087 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10088 * configure: Regenerate.
10089 * config.in: Regenerate.
10090 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10091 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10092
10093 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10094
10095 * incremental.cc (Incremental_inputs_header_data): Renamed from
10096 Incremental_input_header_data.
10097 (Incremental_inputs_header_data::data_size): New field.
10098 (Incremental_inputs_header_data::put_input_file_count): Renamed
10099 from input_file_count.
10100 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10101 from command_line_offset.
10102 (Incremental_inputs_header_data::put_reserved): Renamed from
10103 put_reserved.
10104 (Incremental_inputs_entry_data): Renamed from
10105 Incremental_input_entry_data.
10106 (Incremental_inputs_entry_data::data_size): New field.
10107 (Incremental_inputs::report_command_line): New method.
10108 (Incremental_inputs::finalize): New method.
10109 (Incremental_inputs::create_incremental_inputs_data): New method.
10110 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10111 * incremental.h: New file.
10112 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10113 (Layout::finalize): Create incremental inputs section in
10114 incremental builds.
10115 (Layout::create_incremental_info_sections): New method.
10116 * layout.h (Layout::incremental_inputs): New method.
10117 (Layout::create_incremental_info_sections): New method.
10118 (Layout::incremental_inputs_): New field.
10119 * main.cc (main): Notify Incremental_input of the command line.
10120
10121 2009-04-01 Ian Lance Taylor <iant@google.com>
10122 Mikolaj Zalewski <mikolajz@google.com>
10123
10124 * gold.h (reserve_unordered_map): Define, three versions, one for
10125 each version of Unordered_map.
10126 * layout.cc (Layout::Layout): Remove options parameter. Add
10127 number_of_input_files parameter. Don't initialize options_.
10128 Initialize number_of_input_files_ and resized_signatures_. Move
10129 sections_are_attached_.
10130 (Layout::layout_group): Reserve space for group_signatures_.
10131 (Layout::find_or_add_kept_section): Change name parameter to be a
10132 reference. Resize signatures_ map when it gets large enough.
10133 (Layout::layout_eh_frame): Use parameters->options() instead of
10134 this->options_.
10135 (Layout::make_output_section): Likewise.
10136 (Layout::attach_allocated_section_to_segment): Likewise.
10137 (Layout::finalize, Layout::create_executable_stack): Likewise.
10138 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10139 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10140 * layout.h (class Layout): Update declarations. Remove options_
10141 field. Add number_of_input_files_ and resized_signatures_
10142 fields. Move sections_are_attached_ field.
10143 * main.cc (main): Pass number of input files to Layout
10144 constructor. Don't pass options.
10145
10146 2009-03-30 Ian Lance Taylor <iant@google.com>
10147
10148 * ffsll.c (ffsll): Correct implementation.
10149
10150 2009-03-27 Ian Lance Taylor <iant@google.com>
10151
10152 * ffsll.c: New file.
10153 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10154 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10155 * ftruncate.c (ftruncate): Declare before definition.
10156 * mremap.c (mremap): Likewise.
10157 * pread.c (pread): Likewise.
10158 * configure, Makefile.in, config.in: Rebuild.
10159
10160 * mremap.c: New file.
10161 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10162 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10163 (mremap): Declare if HAVE_MREMAP is not defined.
10164 * configure, Makefile.in, config.in: Rebuild.
10165
10166 2009-03-27 Cary Coutant <ccoutant@google.com>
10167
10168 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10169 position independent.
10170 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10171 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10172
10173 2009-03-24 Cary Coutant <ccoutant@google.com>
10174
10175 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10176 an executable.
10177 (needs_dynamic_reloc): Likewise.
10178
10179 2009-03-24 Ian Lance Taylor <iant@google.com>
10180
10181 * yyscript.y (file_cmd): Recognize EXTERN.
10182 (extern_name_list, extern_name_list_body): New nonterminals.
10183 * script.cc (script_add_extern): Define.
10184 * script-c.h (script_add_extern): Declare.
10185
10186 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10187
10188 * object.cc (is_elf_object): Define.
10189 * object.h (is_elf_object): Declare.
10190 * archive.cc (Archive::get_elf_object_for_member): Call
10191 is_elf_object.
10192 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10193
10194 2009-03-24 Elliott Hughes <enh@google.com>
10195
10196 * output.cc (Output_file::map_anonymous): Define.
10197 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10198 try an anonymous one. Report the size if the mmap fails.
10199 * output.h (class Output_file): Declare map_anonymous.
10200
10201 2009-03-24 Ian Lance Taylor <iant@google.com>
10202
10203 * target-select.cc (instantiate_target): Don't acquire the lock if
10204 the instantiated_target_ field has already been set.
10205
10206 2009-03-23 Ian Lance Taylor <iant@google.com>
10207
10208 * gold-threads.h (class Initialize_lock): Define.
10209 * gold-threads.cc (class Initialize_lock_once): Define.
10210 (initialize_lock_control): New static variable.
10211 (initialize_lock_pointer): New static variable.
10212 (initialize_lock_once): New static function.
10213 (Initialize_lock::Initialize_lock): Define.
10214 (Initialize_lock::initialize): Define.
10215 * target-select.h: Include "gold-threads.h".
10216 (class Target_selector): Add lock_ and initialize_lock_ fields.
10217 Don't define instantiate_target, just declare it.
10218 * target-select.cc (Target_selector::Target_selector): Initialize
10219 new fields.
10220 (Target_selector::instantiate_target): Define.
10221 * descriptors.h: Include "gold-threads.h".
10222 (class Descriptors): Add initialize_lock_ field.
10223 * descriptors.cc (Descriptors::Descriptors): Initialize new
10224 field.
10225 (Descriptors::open): Use initialize_lock_ field
10226 * errors.h (class Errors): Add initialize_lock_ field.
10227 * errors.cc (Errors::Errors): Initialize new field.
10228 (Errors::initialize_lock): Use initialize_lock_ field.
10229 * powerpc.cc (class Target_selector_powerpc): Remove
10230 instantiated_target_ field. In do_recognize call
10231 instantiate_target rather than do_instantiate_target. In
10232 do_instantiate_target just allocate a new target.
10233 * sparc.cc (class Target_selector_sparc): Likewise.
10234
10235 * freebsd.h: New file.
10236 * i386.cc: Include "freebsd.h".
10237 (Target_i386): Derive from Target_freebsd rather than
10238 Sized_target.
10239 (Target_selector_i386): Derive from Target_selector_freebsd rather
10240 than Target_selector.
10241 * x86_64.cc: Include "freebsd.h".
10242 (Target_x86_64): Derive from Target_freebsd rather than
10243 Sized_target.
10244 (Target_selector_x86_64): Derive from Target_selector_freebsd
10245 rather than Target_selector.
10246 * target.h (class Target): Add adjust_elf_header and
10247 do_adjust_elf_header.
10248 * output.cc (Output_file_header:: do_sized_write): Call target
10249 adjust_elf_header routine.
10250 * configure.tgt: Set targ_osabi.
10251 * configure.ac: Define GOLD_DEFAULT_OSABI.
10252 * parameters.cc (Parameters::default_target): Pass
10253 GOLD_DEFAULT_OSABI to select_target.
10254 * target-select.h (class Target_selector): Make instantiate_target
10255 protected rather than private.
10256 * Makefile.am (HFILES): Add freebsd.h.
10257 * configure, Makefile.in, config.in: Rebuild.
10258
10259 * merge.cc (do_add_input_section): Correct pend value. Change
10260 message about last entry not being null terminated from error to
10261 warning.
10262
10263 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10264
10265 * incremental.cc: New file.
10266 * Makefile.am (CCFILES): Add incremental.cc.
10267 * Makefile.in: Rebuild.
10268
10269 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10270
10271 * layout.cc (Layout::output_section_name): Preserve names
10272 of '.note.' sections.
10273
10274 2009-03-19 Ian Lance Taylor <iant@google.com>
10275
10276 * descriptors.cc (Descriptors::open): Check that the options are
10277 valid before using them.
10278
10279 2009-03-18 Ian Lance Taylor <iant@google.com>
10280
10281 * script-sections.h: Include <list>.
10282 (class Script_sections): Change Sections_elements from std::vector
10283 to std::list. Typedef public Elements_iterator. Add
10284 orphan_section_placement_, data_segment_align_start_, and
10285 saw_data_segment_align_ fields. Remove data_segment_align_index_
10286 field.
10287 * script-sections.cc (class Orphan_section_placement): New class.
10288 (class Sections_element): Add virtual functions is_relro and
10289 orphan_section_init. Remove virtual function place_orphan_here.
10290 (class Output_section_definition): Add is_relro and
10291 orphan_section_init. Remove place_orphan_here.
10292 (class Orphan_output_section): Likewise.
10293 (Script_sections::Script_sections): Update for field changes.
10294 (Script_sections::data_segment_align): Set saw_data_segment_align_
10295 and data_segment_align_start_, not data_segment_align_index.
10296 (Script_sections::data_segment_relro_end): Check
10297 saw_data_segment_align_. Use data_segment_align_start_ rather
10298 than data_segment_align_index_.
10299 (Script_sections::place_orphan): Rewrite to use
10300 Orphan_section_placement.
10301
10302 2009-03-17 Ian Lance Taylor <iant@google.com>
10303
10304 * archive.cc (Archive::add_symbols): Check for a version attached
10305 to the symbol name in the archive map.
10306 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10307 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10308 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10309 (ver_test_11.a): New target.
10310 * testsuite/Makefile.in: Rebuild.
10311
10312 * configure.ac: Check for chsize and posix_fallocate. Replace
10313 ftruncate.
10314 * ftruncate.c: New file, from gnulib.
10315 * output.cc (posix_fallocate): Define dummy version if not
10316 HAVE_POSIX_FALLOCATE.
10317 (Output_file::map): Call posix_fallocate rather than lseek and
10318 write.
10319 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10320 * configure, Makefile.in, config.in: Rebuild.
10321
10322 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10323
10324 * layout.h (Layout::create_note): Add section_name parameter.
10325 * layout.cc (Layout::create_note): Likewise.
10326 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10327
10328 2009-03-17 Ian Lance Taylor <iant@google.com>
10329
10330 * descriptors.cc: Include "options.h".
10331 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10332 (Descriptors::open): Always use O_CLOEXEC when opening a new
10333 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10334 then set FD_CLOEXEC.
10335
10336 * sparc.cc (class Target_sparc): Add has_got_section.
10337 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10338 make sure we have a GOT section.
10339
10340 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10341 (Target_sparc::Scan::local): Likewise.
10342 (Target_sparc::Scan::global): Likewise.
10343 (Target_sparc::Relocate::relocate): Likewise.
10344 (Target_sparc::Relocate::relocate_tls): Likewise.
10345
10346 * symtab.cc (Symbol_table::define_default_version): New function,
10347 broken out of add_from_object.
10348 (Symbol_table::add_from_object): Call define_default_version.
10349 (Symbol_table::define_special_symbol): Add resolve_oldsym
10350 parameter. Change all callers. If the version for a symbol comes
10351 from a version script, resolve it with the symbol with the same
10352 name with no version. Also add the symbol without a version if
10353 appropriate.
10354 (do_define_in_output_data): If resolving with oldsym, don't delete
10355 sym.
10356 (do_define_in_output_segment): Likewise.
10357 (do_define_as_constant): Likewise.
10358 * symtab.h (class Symbol_table): Update declarations.
10359
10360 2009-03-13 Ian Lance Taylor <iant@google.com>
10361
10362 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10363 (Read_symbols::requeue): New function.
10364 (Read_symbols::do_read_symbols): If make_elf_object fails because
10365 the target type is not configured, and the file was searched for,
10366 issue a warning and retry with the next directory.
10367 (Add_symbols::run): If the file has an incompatible format, and
10368 it was searched for, requeue the Read_symbols task. On error,
10369 release the object.
10370 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10371 dirindex parameter to constructor. Change all callers. Declare
10372 incompatible_warning and requeue.
10373 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10374 input_argument_ and input_group_ fields. Add them to
10375 constructor. Change all callers.
10376 (class Read_script): Add dirindex_ field. Add it to constructor.
10377 Change all callers.
10378 * archive.cc (Archive::setup): Remove input_objects parameter.
10379 Change all callers.
10380 (Archive::get_file_and_offset): Likewise.
10381 (Archive::read_all_symbols): Likewise.
10382 (Archive::read_symbols): Likewise.
10383 (Archive::get_elf_object_for_member): Remove input_objects
10384 parameter. Add punconfigured parameter. Change all callers.
10385 (Archive::add_symbols): Change return type to bool. Check return
10386 value of include_member.
10387 (Archive::include_all_members): Likewise.
10388 (Archive::include_member): Change return type to bool. Return
10389 false if first included object has incompatible target. Set
10390 included_member_ field.
10391 (Add_archive_symbols::run): If add_symbols returns false, requeue
10392 Read_symbols task.
10393 * archive.h (class Archive): Add included_member_ field.
10394 Initialize it in constructor. Add input_file and searched_for
10395 methods. Update declarations.
10396 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10397 input_argument_ fields. Add them to constructor. Change all
10398 callers.
10399 * script.cc: Include "target-select.h".
10400 (class Parser_closure): Add skip_on_incompatible_target_ and
10401 found_incompatible_target_ fields. Add
10402 skip_on_incompatible_target parameter to constructor. Change all
10403 callers. Add methods skip_on_incompatible_target,
10404 clear_skip_on_incompatible_target, found_incompatible_target, and
10405 set_found_incompatible_target.
10406 (read_input_script): Add dirindex parameter. Change all callers.
10407 If parser finds an incompatible target, requeue Read_symbols
10408 task.
10409 (script_set_symbol): Clear skip_on_incompatible_target in
10410 closure.
10411 (script_add_assertion, script_parse_option): Likewise.
10412 (script_start_sections, script_add_phdr): Likewise.
10413 (script_check_output_format): New function.
10414 * script.h (read_input_script): Update declaration.
10415 * script-c.h (script_check_output_format): Declare.
10416 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10417 (ignore_cmd): Remove OUTPUT_FORMAT.
10418 * fileread.cc (Input_file::Input_file): Add explicit this.
10419 (Input_file::will_search_for): New function.
10420 (Input_file::open): Add pindex parameter. Change all callers.
10421 * fileread.h (class Input_file): Add input_file_argument method.
10422 Declare will_search_for. Update declarations.
10423 * object.cc (make_elf_object): Add punconfigured parameter.
10424 Change all callers.
10425 * object.h (class Object): Make input_file public. Add
10426 searched_for method.
10427 (make_elf_object): Update declaration.
10428 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10429 restart search.
10430 * dirsearch.h (class Dirsearch): Update declaration.
10431 * options.h (class General_options): Add --warn-search-mismatch.
10432 * parameters.cc (Parameters::is_compatible_target): New function.
10433 * parameters.h (class Parameters): Declare is_compatible_target.
10434 * workqueue.cc (Workqueue::add_blocker): New function.
10435 * workqueue.h (class Workqueue): Declare add_blocker.
10436
10437 * fileread.cc (Input_file::open): Remove options parameter.
10438 Change all callers.
10439 (Input_file::open_binary): Likewise.
10440 * script.cc (read_input_script): Likewise.
10441 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10442 options parameter from constructor. Change all callers.
10443 (class Read_script): Likewise.
10444 * fileread.h (class Input_file): Update declarations.
10445 * script.h (read_input_script): Update declaration.
10446
10447 2009-03-10 Nick Clifton <nickc@redhat.com>
10448
10449 * po/es.po: New Spanish translation.
10450
10451 2009-03-06 Cary Coutant <ccoutant@google.com>
10452
10453 * options.cc (parse_short_option): Keep dash_z from registering itself.
10454
10455 2009-03-03 Ian Lance Taylor <iant@google.com>
10456
10457 PR 9918
10458 * target-reloc.h (relocate_section): Pass output_section to
10459 relocate.
10460 * i386.cc (Target_i386::should_apply_static_reloc): Add
10461 output_section parameter. Change all callers.
10462 (Target_i386::Relocate::relocate): Add output_section parameter.
10463 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10464 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10465 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10466 * testsuite/two_file_shared.sh: New script.
10467 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10468 (check_DATA): Add two_file_shared.dbg.
10469 (two_file_shared.dbg): New target.
10470 * testsuite/Makefile.in: Rebuild.
10471
10472 2009-03-01 Ian Lance Taylor <iant@google.com>
10473
10474 * configure.ac: Check for byteswap.h.
10475 * configure: Rebuild.
10476 * config.in: Rebuild.
10477
10478 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10479
10480 * layout.cc (Layout::find_or_add_kept_section): New function.
10481 (Layout::add_comdat): Removed.
10482 * layout.h (struct Kept_section): Move out of class Layout.
10483 Remove trailing underscores from field names. Add group_sections
10484 field. Rename group_ field to is_group. Change all uses.
10485 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10486 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10487 comdat_groups_ field.
10488 (Sized_relobj::include_section_group): Use
10489 find_or_add_kept_section and Kept_section::group_sections.
10490 (Sized_relobj::include_linkonce_section): Likewise.
10491 * object.cc (class Sized_relobj): Don't define Comdat_group or
10492 Comdat_group_table. Remove find_comdat_group and
10493 add_comdat_group. Remove comdat_groups_ field.
10494 * plugin.cc (include_comdat_group): Use
10495 Layout::find_or_add_kept_section.
10496
10497 2009-02-28 Ian Lance Taylor <iant@google.com>
10498
10499 * README: --gc-sections and map files are now supported. Document
10500 some build requirements.
10501
10502 PR 6992
10503 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10504 relocatable link set the value of the section symbol to zero.
10505 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10506 relocatable link don't include the section address in the local
10507 symbol value.
10508
10509 2009-02-27 Ian Lance Taylor <iant@google.com>
10510
10511 PR 6811
10512 * options.h (class Search_directory): Add is_system_directory.
10513 (class General_options): Declare is_in_system_directory.
10514 * options.cc (get_relative_sysroot): Make static.
10515 (get_default_sysroot): Make static.
10516 (General_optoins::is_in_system_directory): New function.
10517 * fileread.cc (Input_file::is_in_system_directory): New function.
10518 * fileread.h (class Input_file): Declare is_in_system_directory.
10519 * object.h (class Object): Add is_in_system_directory.
10520 (class Input_objects): Remove system_library_directory_ field.
10521 * object.cc (Input_objects::add_object): Don't set
10522 system_library_directory_.
10523 (input_objects::found_in_system_library_directory): Remove.
10524 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10525 parameter. Change all callers.
10526 (Symbol_table::sized_write_globals): Likewise.
10527 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10528 Call Object::is_in_system_directory.
10529 * symtab.h (class Symbol_table): Update declarations.
10530
10531 PR 5990
10532 * descriptors.h (Open_descriptor): Add is_on_stack field.
10533 * descriptors.cc (Descriptors::open): If the descriptor is on the
10534 top of the stack, remove it. Initialize is_on_stack field.
10535 (Descriptors::release): Only add pod to stack if it is not on the
10536 stack already.
10537 (Descriptors::close_some_descriptor): Clear stack_next and
10538 is_on_stack fields.
10539
10540 PR 7091
10541 * output.cc (Output_section::find_starting_output_address): Rename
10542 from starting_output_address; add PADDR parameter; change return
10543 type.
10544 * output.h (class Output_section): Declare
10545 find_starting_output_address instead of starting_output_address.
10546 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10547 section symbol for which we can't find a merge section.
10548
10549 PR 9836
10550 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10551 hidden or internal, force the symbol to be local.
10552 * resolve.cc (Symbol::override_visibility): Define.
10553 (Symbol::override_base): Use override_visibility.
10554 (Symbol_table::resolve): Likewise.
10555 (Symbol::override_base_with_special): Likewise.
10556 (Symbol_table::override_with_special): If the visibility is hidden
10557 or internal, force the symbol to be local.
10558 * symtab.h (class Symbol): Add set_visibility and
10559 override_visibility.
10560 * testsuite/ver_test_1.sh: New file.
10561 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10562 (check_DATA): Add ver_test_1.syms.
10563 (ver_test_1.syms): New target.
10564 * testsuite/Makefile.in: Rebuild.
10565
10566 2009-02-25 Cary Coutant <ccoutant@google.com>
10567
10568 * layout.cc (Layout::choose_output_section): Don't rename sections
10569 when using a linker script that has a SECTIONS clause.
10570 * Makefile.in: Regenerate.
10571
10572 * testsuite/Makefile.am (script_test_5.sh): New test case.
10573 * testsuite/Makefile.in: Regenerate.
10574 * testsuite/script_test_5.cc: New file.
10575 * testsuite/script_test_5.sh: New file.
10576 * testsuite/script_test_5.t: New file.
10577
10578 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10579
10580 * archive.cc (Archive::include_member): Update calls to add_symbols.
10581 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10582 the Layout argument.
10583 * dynobj.h (do_add_symbols): Add the Layout argument.
10584 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10585 Layout argument.
10586 * object.h (Object::add_symbols): Add the Layout argument.
10587 (Object::do_add_symbols): Add the Layout argument.
10588 (Sized_relobj::do_add_symbols): Add the Layout argument.
10589 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10590 Unify the two versions.
10591 (Add_plugin_symbols): Remove.
10592 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10593 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10594 (Add_plugin_symbols): Remove.
10595 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10596 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10597 (Add_symbols::run): Make it work with Pulginobj.
10598
10599 2009-02-06 Ian Lance Taylor <iant@google.com>
10600
10601 * object.cc (Sized_relobj::do_layout): Make info message start
10602 with lower case letter.
10603
10604 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10605
10606 * binary.cc: Fix file comment.
10607
10608 * options.h (enum Incremental_disposition): Define.
10609 (class General_options): Add new options: --incremental,
10610 --incremental_changed, --incremental_unchanged,
10611 --incremental_unknown. Add incremental_disposition_ and
10612 implicit_incremental_ fields.
10613 (General_options::incremental_disposition): New function.
10614 (class Position_dependent_options): Add incremental_disposition
10615 option.
10616 (Position_dependent_options::copy_from_options): Set incremental
10617 dispositions.
10618 * options.cc (General_options::parse_incremental_changed): New
10619 function.
10620 (General_options::parse_incremental_unchanged): New function.
10621 (General_options::parse_incremental_unknown): New function.
10622 (General_options::General_options): Initialize new fields
10623 incremental_disposition_ and implicit_incremental_.
10624 (General_options::finalize): Check for uasge of --incremental-*
10625 without --incremental.
10626
10627 2009-02-06 Chris Demetriou <cgd@google.com>
10628
10629 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10630 pointer and to report location as the file name associated with
10631 the symbol.
10632 (gold_undefined_symbol_at_location): New function to replace the
10633 old gold_undefined_symbol functionality.
10634 * target-reloc.h (relocate_section): Update to use
10635 gold_undefined_symbol_at_location.
10636 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10637 Call gold_undefined_symbol function rather than gold_error.
10638 * errors.h (Errors::undefined_symbol): Take location as a
10639 string, rather than calculating it from a relocation.
10640 * errors.cc (Errors::fatal): Print "fatal error:" before the
10641 formatted message.
10642 (Errors::error, Errors::error_at_location): Print "error: "
10643 before the formatted message.
10644 (Errors::undefined_symbol): Take location as a string, rather
10645 than calculating it from a relocation.
10646 (gold_undefined_symbol_at_location): New function akin to
10647 old gold_undefined_symbol, calculates location from relocation.
10648 (gold_undefined_symbol): Change to take only a Symbol pointer
10649 and to report location as the file name associated with the symbol.
10650 * testsuite/debug_msg.sh: Update for changed error messages.
10651 * testsuite/undef_symbol.sh: Likewise.
10652
10653 2009-02-04 Duncan Sands <baldrick@free.fr>
10654
10655 PR 9812
10656 * reduced_debug_output.h
10657 (Output_reduced_debug_abbrev_section::failed): Use format for
10658 gold_warning.
10659 (Output_reduced_debug_info_section::faild): Likewise.
10660
10661 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10662
10663 * script.cc (Lazy_demangler): New class.
10664 (Version_script_info::get_symbol_version_helper): Demangle a
10665 symbol only once.
10666
10667 2009-01-29 Cary Coutant <ccoutant@google.com>
10668
10669 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10670 to __tls_get_addr.
10671 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10672
10673 2009-01-28 Ian Lance Taylor <iant@google.com>
10674
10675 * version.cc (version_string): Bump to 1.9.
10676
10677 * gold.h: Include <cstring> and <stdint.h>.
10678 * version.cc: Include <cstdio>.
10679 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10680 warning.
10681 * reduced_debug_output.cc (insert_into_vector): Rename from
10682 Insert_into_vector; change all callers. Use Swap_unaligned to
10683 avoid aliasing issue; remove union since it is unnecessary.
10684
10685 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10686
10687 * Makefile.am (CCFILES): Add gc.cc.
10688 (HFILES): Add gc.h.
10689 * Makefile.in: Regenerate.
10690 * gold.cc (Gc_runner): New class.
10691 (queue_initial_tasks): Call garbage collection related tasks
10692 when corresponding options are invoked.
10693 (queue_middle_gc_tasks): New function.
10694 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10695 processed early before laying out sections during garbage collection.
10696 * gold.h (queue_middle_gc_tasks): New function.
10697 (is_prefix_of): Move from "layout.cc".
10698 * i386.cc (Target_i386::gc_process_relocs): New function.
10699 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10700 * main.cc (main): Create object of class "Garbage_collection".
10701 * object.cc (Relobj::copy_symbols_data): New function.
10702 (Relobj::is_section_name_included): New function.
10703 (Sized_relobj::do_layout): Allow this function to be called twice
10704 during garbage collection and defer layout of section during the
10705 first call.
10706 * object.h (Relobj::get_symbols_data): New function.
10707 (Relobj::is_section_name_included): New function.
10708 (Relobj::copy_symbols_data): New function.
10709 (Relobj::set_symbols_data): New function.
10710 (Relobj::get_relocs_data): New function.
10711 (Relobj::set_relocs_data): New function.
10712 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10713 (Relobj::gc_process_relocs): New function.
10714 (Relobj::do_gc_process_relocs): New pure virtual function.
10715 (Relobj::sd_): New data member.
10716 (Sized_relobj::is_output_section_offset_invalid): New function.
10717 (Sized_relobj::do_gc_process_relocs): New function.
10718 * options.h (General_options::gc_sections): Modify to not be a no-op.
10719 (General_options::print_gc_sections): New option.
10720 * plugin.cc (Plugin_finish::run): Remove function call to
10721 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10722 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10723 * reloc.cc (Read_relocs::run): Add task to process relocs and
10724 determine unreferenced sections when doing garbage collection.
10725 (Gc_process_relocs): New class.
10726 (Sized_relobj::do_gc_process_relocs): New function.
10727 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10728 sections that are garbage collected.
10729 * reloc.h (Gc_process_relocs): New class.
10730 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10731 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10732 symbols whose corresponding sections are garbage collected.
10733 (Symbol_table::Symbol_table): Add new parameter for the garbage
10734 collection object.
10735 (Symbol_table::gc_mark_undef_symbols): New function.
10736 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10737 (Symbol_table::gc_mark_dyn_syms): New function.
10738 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10739 as garbage.
10740 (Symbol_table::add_from_object): Likewise.
10741 (Symbol_table::add_from_relobj): When building shared objects, do not
10742 treat externally visible symbols as garbage.
10743 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10744 table information for static and relocatable links.
10745 * symtab.h (Symbol_table::set_gc): New function.
10746 (Symbol_table::gc): New function.
10747 (Symbol_table::gc_mark_undef_symbols): New function.
10748 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10749 (Symbol_table::gc_mark_dyn_syms): New function.
10750 (Symbol_table::gc_): New data member.
10751 * target.h (Sized_target::gc_process_relocs): New pure virtual
10752 function.
10753 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10754 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10755
10756 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10757
10758 * options.h (General_options::gc_sections): Define as a no-op for now.
10759 (General_options::no_keep_memory): Ditto.
10760 (General_options::Bshareable): Define.
10761 * options.cc (General_options::finalize): Honor -Bshareable.
10762
10763 2009-01-20 Andreas Schwab <schwab@suse.de>
10764
10765 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10766 read the value in the contents, since we don't use it. Use the
10767 template endianness when writing.
10768 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10769
10770 2009-01-19 Andreas Schwab <schwab@suse.de>
10771
10772 * configure.tgt (powerpc64-*): Fix targ_obj.
10773
10774 2009-01-15 Ian Lance Taylor <iant@google.com>
10775
10776 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10777 local symbols when stripping all symbols.
10778
10779 2009-01-14 Cary Coutant <ccoutant@google.com>
10780
10781 * output.cc (Output_reloc): Add explicit instantiations.
10782
10783 2009-01-14 Cary Coutant <ccoutant@google.com>
10784
10785 * archive.cc (Archive::get_elf_object_for_member): Remove call
10786 to File_read::claim_for_plugin.
10787 * descriptors.cc (Descriptors::open): Remove reference to
10788 is_claimed.
10789 (Descriptors::claim_for_plugin): Remove.
10790 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10791 (Descriptors::is_claimed): Remove.
10792 (claim_descriptor_for_plugin): Remove.
10793 * fileread.cc (File_read::claim_for_plugin): Remove.
10794 * fileread.h (File_read::claim_for_plugin): Remove.
10795 (File_read::descriptor): Reopen descriptor if necessary.
10796 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10797 (Plugin_manager::all_symbols_read): Add task parameter. Change
10798 all callers.
10799 (Plugin_manager::get_input_file): New function.
10800 (Plugin_manager::release_input_file): New function.
10801 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10802 corresponding data member.
10803 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10804 and pass to base constructor. Change all callers.
10805 (get_input_file, release_input_file): New functions.
10806 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10807 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10808 (Plugin_manager::all_symbols_read): Add task parameter.
10809 (Plugin_manager::get_input_file): New function.
10810 (Plugin_manager::release_input_file): New function.
10811 (Plugin_manager::task_): New data member.
10812 (Pluginobj::Pluginobj): Add filesize parameter.
10813 (Pluginobj::filename): New function.
10814 (Pluginobj::descriptor): New function.
10815 (Pluginobj::filesize): New function.
10816 (Pluginobj::filesize_): New data member.
10817 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10818 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10819 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10820
10821 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10822 with archive libraries.
10823 * testsuite/Makefile.in: Regenerate.
10824 * testsuite/plugin_test.c (struct sym_info): New type.
10825 (get_input_file, release_input_file): New static variables.
10826 (onload): Capture new transfer vector entries.
10827 (claim_file_hook): Stop reading at end of file according to filesize.
10828 Factor out parsing of readelf output into separate function.
10829 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10830 APIs and get the source file name from the symbol table. Convert
10831 source file name to corresponding object file name. Print info
10832 message when adding new input files.
10833 (parse_readelf_line): New function.
10834 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10835 * testsuite/plugin_test_2.sh: Likewise.
10836 * testsuite/plugin_test_3.sh: Likewise.
10837 * testsuite/plugin_test_4.sh: New test case.
10838
10839 2009-01-07 Ian Lance Taylor <iant@google.com>
10840
10841 * version.cc (version_string): Bump to 1.8.
10842
10843 2008-12-23 Cary Coutant <ccoutant@google.com>
10844
10845 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10846 * plugin.cc (Plugin_manager::finish): Rename as
10847 layout_deferred_objects. Move cleanup to separate function.
10848 (Plugin_manager::cleanup): New function.
10849 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10850 separately.
10851 * plugin.h (Plugin_manager::finish): Rename as
10852 layout_deferred_objects.
10853 (Plugin_manager::cleanup): New function.
10854 (Plugin_manager::cleanup_done): New field.
10855
10856 2008-12-23 Cary Coutant <ccoutant@google.com>
10857
10858 * plugin.cc (is_visible_from_outside): New function.
10859 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10860 so we don't return "IR only" status for exported symbols or -r links.
10861
10862 * testsuite/Makefile.am (plugin_test_3): New test case.
10863 * testsuite/Makefile.in: Regenerate.
10864 * testsuite/plugin_test_3.sh: New file.
10865
10866 2008-12-22 Cary Coutant <ccoutant@google.com>
10867
10868 * object.cc (Sized_relobj::layout_section): New function.
10869 (Sized_relobj::do_layout): Defer layout of input sections until after
10870 plugin has provided replacement files.
10871 (Sized_relobj::do_layout_deferred_sections): New function.
10872 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10873 (Relobj::layout_deferred_sections): New function.
10874 (Relobj::do_layout_deferred_sections): New function.
10875 (Sized_relobj::do_layout_deferred_sections): New function.
10876 (Sized_relobj::layout_section): New function.
10877 (Sized_relobj::Deferred_layout): New structure.
10878 (Sized_relobj::deferred_layout_): New field.
10879 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10880 Change all callers. Layout deferred sections.
10881 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10882 references.
10883 (Plugin_hook::run): Move code from do_plugin_hook inline.
10884 (Plugin_hook::do_plugin_hook): Remove.
10885 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10886 (Plugin_manager::finish): Renamed, was cleanup.
10887 (Plugin_manager::should_defer_layout): New function.
10888 (Plugin_manager::add_deferred_layout_object): New function.
10889 (Plugin_manager::Deferred_layout_list): New type.
10890 (Plugin_manager::deferred_layout_objects_): New field.
10891 (Plugin_hook::do_plugin_hook): Remove.
10892
10893 2008-12-17 Ian Lance Taylor <iant@google.com>
10894
10895 * options.h (class General_options): Add --no case for
10896 --export-dynamic.
10897
10898 2008-12-16 Cary Coutant <ccoutant@google.com>
10899
10900 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10901 vector.
10902 (Plugin_manager::claim_file): Create plugin object even if
10903 plugin did not call the add_symbols callback.
10904 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10905 asking for more symbols than were added.
10906 * testsuite/Makefile.am (plugin_test_1): Add test case with
10907 no global symbols.
10908 (empty.syms): New target.
10909 * testsuite/Makefile.in: Regenerate.
10910 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10911 message. Don't call add_symbols if no globals.
10912 (all_symbols_read_hook): Don't provide replacement for empty
10913 claimed file.
10914
10915 2008-12-12 Ian Lance Taylor <iant@google.com>
10916
10917 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10918 r_type == 0 for a local symbol with r_sym == 0.
10919 (scan_relocatable_relocs): Pass r_sym to
10920 local_non_section_strategy.
10921 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10922 r_sym parameter.
10923
10924 * configure.ac: Update test for TLS descriptors: they are
10925 supported as of glibc 2.9.
10926 * configure: Rebuild.
10927
10928 2008-12-11 Ian Lance Taylor <iant@google.com>
10929
10930 PR 7091
10931 * target-reloc.h (Default_scan_relocatable_relocs): For each
10932 function, map r_type == 0 to RELOC_DISCARD.
10933
10934 2008-12-10 Cary Coutant <ccoutant@google.com>
10935
10936 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10937 object to override a kept COMDAT group from a plugin object.
10938
10939 2008-12-09 Ian Lance Taylor <iant@google.com>
10940
10941 PR 7088
10942 * yyscript.y (file_cmd): Handle INPUT.
10943
10944 * testsuite/initpri1.c: Change all declarations to be full
10945 prototypes by adding void, to avoid compiler warnings.
10946
10947 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
10948
10949 * options.cc (General_options::parse_plugin_opt): New.
10950 (General_options::add_plugin): The argument now is just the filename.
10951 (General_options::add_plugin_option): New.
10952 * options.h (plugin_opt): New.
10953 (add_plugin): Change argument name.
10954 (add_plugin_option): New.
10955 * plugin.cc (Plugin::load): Don't parse the plugin option.
10956 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10957 (Plugin::add_option): New.
10958 (Plugin::args_): Change type.
10959 (Plugin::filename_): New.
10960 (Plugin_manager::add_plugin_option): New.
10961 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10962 * testsuite/Makefile.in: Regenerate.
10963
10964 2008-12-05 Cary Coutant <ccoutant@google.com>
10965
10966 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10967 Handle --strip-lto-sections option.
10968 * options.h (strip_lto_sections): New option.
10969
10970 2008-12-01 Cary Coutant <ccoutant@google.com>
10971
10972 * plugin.cc (ld_plugin_message): Change format parameter to const.
10973 Fix mismatch between new[] and delete.
10974
10975 2008-11-14 Cary Coutant <ccoutant@google.com>
10976
10977 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10978 instead of -1U.
10979
10980 2008-11-05 Craig Silverstein <csilvers@google.com>
10981
10982 * options.cc (General_options::parse_dynamic_list): New function.
10983 * options.h (General_options): New flags dynamic_list,
10984 dynamic_list_data, dynamic_list_cpp_new, and
10985 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10986 (General_options::in_dynamic_list): New function.
10987 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10988 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10989 (Lex::can_continue_name): Likewise.
10990 (yylex): Likewise.
10991 (read_script_file): New parameter script_options.
10992 (read_dynamic_list): New function.
10993 (Script_options::define_dynamic_list): New function.
10994 (dynamic_list_keyword_parsecodes): New variable.
10995 (dynamic_list_keywords): New variable.
10996 * script.h (Script_options::define_dynamic_list): New function
10997 prototype.
10998 (read_dynamic_list): New function prototype.
10999 * symtab.cc (strprefix): New macro.
11000 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11001 dynamic_list_data, dynamic_list_cpp_new, and
11002 dynamic_list_cpp_typeinfo.
11003 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11004 (dynamic_list_expr): New rule.
11005 (dynamic_list_nodes): Likewise.
11006 (dynamic_list_node): Likewise.
11007 * testsuite/Makefile.am (dynamic_list): New test.
11008 * testsuite/Makefile.in: Regenerated.
11009 * testsuite/dynamic_list.t: New file.
11010 * testsuite/dynamic_list.sh: New file.
11011
11012 2008-11-05 Craig Silverstein <csilvers@google.com>
11013
11014 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11015 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11016 (t11_last): Likewise.
11017 * testsuite/ver_test_6.c (main): Likewise.
11018
11019 2008-10-07 Cary Coutant <ccoutant@google.com>
11020
11021 * options.c (General_options::finalize): Add check for -static and
11022 -shared.
11023 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11024 is not empty.
11025
11026 2008-10-02 Cary Coutant <ccoutant@google.com>
11027
11028 * plugin.cc (make_sized_plugin_object): Fix conditional
11029 compilation to work when not all targets are enabled.
11030
11031 2008-09-29 Cary Coutant <ccoutant@google.com>
11032
11033 * archive.cc (Archive::get_file_and_offset): Use filename instead
11034 of name to get library path.
11035 (Archive::include_member): Unlock external member of a thin archive.
11036
11037 * testsuite/Makefile.am (TEST_AR): New variable.
11038 (thin_archive_test_1): New test.
11039 (thin_archive_test_2): New test.
11040 * testsuite/Makefile.in: Regenerate.
11041 * testsuite/thin_archive_main.cc: New file.
11042 * testsuite/thin_archive_test_1.cc: New file.
11043 * testsuite/thin_archive_test_2.cc: New file.
11044 * testsuite/thin_archive_test_3.cc: New file.
11045 * testsuite/thin_archive_test_4.cc: New file.
11046
11047 2008-09-29 Cary Coutant <ccoutant@google.com>
11048
11049 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11050 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11051 instead of -1U.
11052 (Sized_relobj::do_finalize_local_symbols): Likewise.
11053 (Sized_relobj::map_to_kept_section): Likewise.
11054 * object.h (Sized_relobj::invalid_address): New constant.
11055 (Sized_relobj::do_output_section_offset): Check for invalid_address
11056 and return -1ULL.
11057 * output.cc (Output_reloc::local_section_offset): Use constant
11058 invalid_address instead of -1U.
11059 (Output_reloc::get_address): Likewise.
11060 (Output_section::output_address): Change -1U to -1ULL.
11061 * output.h (Output_reloc::invalid_address): New constant.
11062 * reloc.cc (Sized_relobj::write_sections): Use constant
11063 invalid_address instead of -1U.
11064 (Sized_relobj::relocate_sections): Likewise.
11065 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11066 values for merge sections.
11067 * target-reloc.h (relocate_for_relocatable): Use constant
11068 invalid_address instead of -1U.
11069
11070 2008-09-19 Cary Coutant <ccoutant@google.com>
11071
11072 Add plugin functionality for link-time optimization (LTO).
11073 * configure.ac (plugins): Add --enable-plugins option.
11074 * configure: Regenerate.
11075 * config.in: Regenerate.
11076 * Makefile.am (LIBDL): New variable.
11077 (CCFILES): Add plugin.cc.
11078 (HFILES): Add plugin.h.
11079 (ldadd_var): Add LIBDL.
11080 * Makefile.in: Regenerate.
11081
11082 * archive.cc: Include "plugin.h".
11083 (Archive::setup): Don't preread archive symbols when using a plugin.
11084 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11085 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11086 files.
11087 (Archive::include_member): Add symbols from plugin objects.
11088 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11089 * descriptors.cc (Descriptors::open): Check for file descriptors
11090 abandoned by plugins.
11091 (Descriptors::claim_for_plugin): New function.
11092 * descriptors.h (Descriptors::claim_for_plugin): New function.
11093 (Open_descriptor::is_claimed): New field.
11094 (claim_descriptor_for_plugin): New function.
11095 * fileread.cc (File_read::claim_for_plugin): New function.
11096 * fileread.h (File_read::claim_for_plugin): New function.
11097 (File_read::descriptor): New function.
11098 * gold.cc: Include "plugin.h".
11099 (queue_initial_tasks): Add task to call plugin hooks for generating
11100 new object files.
11101 * main.cc: Include "plugin.h".
11102 (main): Load plugin libraries.
11103 * object.h (Pluginobj): Declare.
11104 (Object::pluginobj): New function.
11105 (Object::do_pluginobj): New function.
11106 (Object::set_target): New function.
11107 * options.cc: Include "plugin.h".
11108 (General_options::parse_plugin): New function.
11109 (General_options::General_options): Initialize plugins_ field.
11110 (General_options::add_plugin): New function.
11111 * options.h (Plugin_manager): Declare.
11112 (General_options): Add --plugin option.
11113 (General_options::has_plugins): New function.
11114 (General_options::plugins): New function.
11115 (General_options::add_plugin): New function.
11116 (General_options::plugins_): New field.
11117 * plugin.cc: New file.
11118 * plugin.h: New file.
11119 * readsyms.cc: Include "plugin.h".
11120 (Read_symbols::do_read_symbols): Check for archive before checking
11121 for ELF file. Call plugin hooks to claim files.
11122 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11123 from a real object file; force override when processing replacement
11124 files.
11125 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11126 (Symbol::init_base_object): Likewise.
11127 (Symbol::init_base_output_data): Likewise.
11128 (Symbol::init_base_output_segment): Likewise.
11129 (Symbol::init_base_constant): Likewise.
11130 (Symbol::init_base_undefined): Likewise.
11131 (Symbol::output_section): Assert that object is not a plugin.
11132 (Symbol_table::add_from_pluginobj): New function.
11133 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11134 undefined.
11135 (Symbol_table::sized_write_globals): Likewise.
11136 (Symbol_table::add_from_pluginobj): Instantiate template.
11137 * symtab.h (Sized_pluginobj): Declare.
11138 (Symbol::in_real_elf): New function.
11139 (Symbol::set_in_real_elf): New function.
11140 (Symbol::in_real_elf_): New field.
11141 (Symbol_table::add_from_pluginobj): New function.
11142
11143 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11144 (LIBDL): New variable.
11145 (LDADD): Add LIBDL.
11146 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11147 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11148 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11149 (MOSTLYCLEANFILES): Likewise.
11150 * testsuite/Makefile.in: Regenerate.
11151 * testsuite/plugin_test.c: New file.
11152 * testsuite/plugin_test_1.sh: New file.
11153 * testsuite/plugin_test_2.sh: New file.
11154
11155 2008-09-16 Ian Lance Taylor <iant@google.com>
11156
11157 * target-reloc.h (relocate_section): Check whether a symbol is
11158 defined by the ABI before reporting an undefined symbol error.
11159 * target.h (Target::is_defined_by_abi): Make parameter const.
11160 (Target::do_is_defined_by_abi): Likewise.
11161 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11162 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11163 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11164 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11165 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11166 * testsuite/Makefile.in: Rebuild.
11167
11168 * fileread.cc (make_view): Add casts to avoid warning.
11169
11170 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11171
11172 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11173 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11174
11175 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11176
11177 * options.h (General_options::output_is_executable): New.
11178 (General_options::output_is_pie): New.
11179 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11180 for shared libraries.
11181 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11182
11183 2008-09-11 Chris Demetriou <cgd@google.com>
11184
11185 * options.h (origin): New -z option.
11186 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11187 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11188 in DT_FLAGS_1.
11189
11190 2008-09-05 Cary Coutant <ccoutant@google.com>
11191
11192 * fileread.cc (File_read::make_view): Add check for attempt to map
11193 beyond end of file.
11194
11195 2008-09-05 Cary Coutant <ccoutant@google.com>
11196
11197 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11198 explicit instantiations.
11199
11200 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11201
11202 PR gold/6858
11203 * options.cc (General_options::finalize): Allow undefined symbols
11204 in shlibs if linking -shared.
11205
11206 PR gold/6859
11207 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11208 symbols as not needing a dynsym entry.
11209
11210 2008-08-20 Craig Silverstein <csilvers@google.com>
11211
11212 * fileread.cc (File_read::open): Do not lock the file unless it
11213 was successfully opened.
11214
11215 2008-08-14 Cary Coutant <ccoutant@google.com>
11216
11217 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11218 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11219 * testsuite/tls_test.cc (struct int128): 128-bit struct
11220 for testing TLS relocs with non-zero addend.
11221 (v12): New TLS variable.
11222 (t12): New test.
11223 (t_last): Add check for v12.
11224 * testsuite/tls_test.h (t12): New function.
11225 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11226
11227 2008-08-13 Ian Lance Taylor <iant@google.com>
11228
11229 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11230 set tls_segment_ or relro_segment_.
11231 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11232 when appropriate.
11233 * output.h (Output_section::clear_is_relro): New function.
11234 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11235 sections specially even when output_data_ is empty.
11236 (Output_segment::maximum_alignment): When first section is relro,
11237 only force alignment for PT_LOAD segments.
11238 * script.cc (script_data_segment_align): New function.
11239 (script_data_segment_relro_end): New function.
11240 * script-c.h (script_data_segment_align): Declare.
11241 (script_data_segment_relro_end): Declare.
11242 * script-sections.h (class Script_sections): Declare
11243 data_segment_align and data_segment_relro_end. Add fields
11244 segment_align_index_ and saw_relro_end_.
11245 * script-sections.cc (class Sections_element): Add set_is_relro
11246 virtual function. Add new bool* parameter to place_orphan_here.
11247 Add get_output_section virtual function.
11248 (class Output_section_definition): Add set_is_relro. Add new
11249 bool* parameter to place_orphan_here. Add get_output_section.
11250 Add is_relro_ field.
11251 (Output_section_definition::Output_section_definition): Initialize
11252 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11253 and is_relro_ fields.
11254 (Output_section_definition::place_orphan_here): Add is_relro
11255 parameter.
11256 (Output_section_definition::set_section_addresses): Set relro for
11257 output section.
11258 (Output_section_definition::alternate_constraint): Likewise.
11259 (class Orphan_output_section): Add new bool* parameter to
11260 place_orphan_here. Add get_output_section.
11261 (Orphan_output_section::place_orphan_here): Add is_relro
11262 parameter.
11263 (Script_sections::Script_sections): Initialize
11264 data_segment_align_index_ and saw_relro_end_.
11265 (Script_sections::data_segment_align): New function.
11266 (Script_sections::data_segment_relro_end): New function.
11267 (Script_sections::place_orphan): Set or clear is_relro.
11268 (Script_sections::set_section_addresses): Force alignment of first
11269 TLS section.
11270 * yyscript.y (exp): Call script_data_segment_align and
11271 script_data_segment_relro_end.
11272 * testsuite/relro_script_test.t: New file.
11273 * testsuite/relro_test.cc (using_script): Declare.
11274 (t1, t2): Test using_script.
11275 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11276 (relro_script_test_SOURCES): Define.
11277 (relro_script_test_DEPENDENCIES): Define.
11278 (relro_script_test_LDFLAGS): Define.
11279 (relro_script_test_LDADD): Define.
11280 (relro_script_test.so): New target.
11281 * testsuite/Makefile.in: Rebuild.
11282
11283 2008-08-06 Cary Coutant <ccoutant@google.com>
11284
11285 * archive.cc (Archive::total_archives, Archive::total_members)
11286 (Archive::total_members_loaded): New variables.
11287 (Archive::setup): Add parameter. Add option to preread
11288 archive symbols.
11289 (Archive::read_armap): Add counter.
11290 (Archive::get_file_and_offset): New function.
11291 (Archive::get_elf_object_for_member): New function.
11292 (Archive::read_all_symbols): New function.
11293 (Archive::read_symbols): New function.
11294 (Archive::add_symbols): Add counters.
11295 (Archive::include_all_members): Use armap to find members if it's
11296 already built.
11297 (Archive::include_member): Skip reading symbols if already read.
11298 Factored code into Archive::get_file_and_offset and
11299 Archive::get_elf_object_for_member. Changed call to
11300 Mapfile::report_include_archive_member.
11301 (Archive::print_stats): New function.
11302 * archive.h: Declare Object and Read_symbols_data classes.
11303 (Archive::Archive): Add initializers for new members.
11304 (Archive::setup): Add parameter.
11305 (Archive::print_stats): New function.
11306 (Archive::total_archives, Archive::total_members)
11307 (Archive::total_members_loaded): New variables.
11308 (Archive::get_file_and_offset): New function.
11309 (Archive::get_elf_object_for_member): New function.
11310 (Archive::read_all_symbols): New function.
11311 (Archive::read_symbols): New function.
11312 (Archive::Archive_member): New class.
11313 (Archive::members_): New member.
11314 (Archive::num_members_): New member.
11315 * main.cc: Include archive.h.
11316 (main): Call Archive::print_stats.
11317 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11318 archive parameter; member_name is now the fully-decorated name.
11319 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11320 * options.h: (General_options): Add --preread-archive-symbols option.
11321 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11322 Archive::setup.
11323
11324 2008-08-04 Ian Lance Taylor <iant@google.com>
11325
11326 * symtab.h (Symbol::use_plt_offset): New function.
11327 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11328 * powerpc.cc (Relocate::relocate): Likewise.
11329 * sparc.cc (Relocate::relocate): Likewise.
11330 * x86_64.cc (Relocate::relocate): Likewise.
11331 * testsuite/weak_plt.sh: New test.
11332 * testsuite/weak_plt_main.cc: New test.
11333 * testsuite/weak_plt_shared.cc: New test.
11334 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11335 (check_PROGRAMS): Add weak_plt.
11336 (check_DATA): Add weak_plt_shared.so.
11337 (weak_plt_main_pic.o, weak_plt): New targets.
11338 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11339 * testsuite/Makefile.in: Rebuild.
11340
11341 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11342 gcctestdir/ld.
11343 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11344 * testsuite/Makefile.in: Rebuild.
11345
11346 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11347
11348 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11349 * Makefile.in: Regenerate.
11350 * po/POTFILES.in: Regenerate.
11351
11352 2008-07-29 Ian Lance Taylor <iant@google.com>
11353
11354 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11355 symbols before other symbols.
11356 * testsuite/script_test_2.cc (test_addr): Declare.
11357 (test_addr_alias): Declare.
11358 (main): Check that test_addr and test_addr_alias have the right
11359 values.
11360 * testsuite/script_test_2.t: Define test_addr_alias and
11361 test_addr.
11362
11363 2008-07-24 Ian Lance Taylor <iant@google.com>
11364
11365 PR 5990
11366 * descriptors.cc: New file.
11367 * descriptors.h: New file.
11368 * gold-threads.h (class Hold_optional_lock): New class.
11369 * fileread.cc: Include "descriptors.h".
11370 (File_read::~File_read): Release descriptor rather than closing
11371 it.
11372 (File_read::open) [file]: Call open_descriptor rather than open.
11373 Set is_descriptor_opened_.
11374 (File_read::open) [memory]: Assert that descriptor is not open.
11375 (File_read::reopen_descriptor): New function.
11376 (File_read::release): Release descriptor.
11377 (File_read::do_read): Make non-const. Reopen descriptor.
11378 (File_read::read): Make non-const.
11379 (File_read::make_view): Reopen descriptor.
11380 (File_read::do_readv): Likewise.
11381 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11382 Update declarations.
11383 * layout.cc: Include "descriptors.h".
11384 (Layout::create_build_id): Use open_descriptor rather than open.
11385 * output.cc: Include "descriptors.h".
11386 (Output_file::open): Use open_descriptor rather than open.
11387 * archive.cc (Archive::const_iterator): Change Archive to be
11388 non-const.
11389 (Archive::begin, Archive::end): Make non-const.
11390 (Archive::count_members): Likewise.
11391 * archive.h (class Archive): Update declarations.
11392 * object.h (Object::read): Make non-const.
11393 * Makefile.am (CCFILES): Add descriptors.cc.
11394 (HFILES): Add descriptors.h.
11395 * Makefile.in: Rebuild.
11396
11397 PR 6716
11398 * gold.h: Always include <clocale>. Add Solaris workarounds
11399 following code in binutils/sysdep.h.
11400
11401 PR 6048
11402 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11403 this->eh_frame_hdr_ is NULL before using it.
11404
11405 * dynobj.cc (Versions::Versions): Update comment.
11406
11407 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11408 the base version name.
11409
11410 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11411 array size plus one.
11412 (Stringpool_template::set_string_offsets): Subtract one from key
11413 before using it as an array index.
11414 (Stringpool_template::get_offset_with_length): Likewise.
11415 (Stringpool_template::write_to_buffer): Likewise.
11416 * stringpool.h (Stringpool_template::get_offset_from_key):
11417 Likewise.
11418
11419 2008-07-23 Ian Lance Taylor <iant@google.com>
11420
11421 PR 6658
11422 * object.h (Merged_symbol_value::value): Do our best to handle a
11423 negative addend.
11424
11425 PR 6647
11426 * script.cc (Version_script_info::get_versions): Don't add empty
11427 version tag to return value.
11428 (Version_script_info::get_symbol_version_helper): Change return
11429 type to bool. Add pversion parameter. Change all callers.
11430 (script_register_vers_node): Don't require a non-NULL tag.
11431 * script.h (class Version_script_info): Update declarations.
11432 (Version_script_info::get_symbol_version): Change return type to
11433 bool. Add version parameter. Change all callers.
11434 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11435 handling. Handle an empty version from a version script.
11436 (Symbol_table::define_special_symbol): Likewise.
11437 * testsuite/ver_test_10.script: New file.
11438 * testsuite/ver_test_10.sh: New file.
11439 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11440 (check_DATA): Add ver_test_10.syms.
11441 (ver_test_10.syms, ver_test_10.so): New target.
11442 * testsuite/Makefile.in: Rebuild.
11443
11444 2008-07-23 Simon Baldwin <simonb@google.com>
11445
11446 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11447 to zero for undefined symbols from dynamic libraries.
11448
11449 2008-07-23 Ian Lance Taylor <iant@google.com>
11450
11451 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11452 Change all callers.
11453 * symtab.h (class Symbol_table): Update declaration.
11454 * testsuite/ver_test_9.cc: New file.
11455 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11456 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11457 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11458 (ver_test_9.so, ver_test_9.o): New targets.
11459 * testsuite/Makefile.in: Rebuild.
11460
11461 2008-07-22 Ian Lance Taylor <iant@google.com>
11462
11463 * options.h (class General_options): Define --check-sections.
11464 * layout.cc (Layout::set_segment_offsets): Handle
11465 --check-sections.
11466
11467 * options.h (class General_options): Define -n/--nmagic and
11468 -N/--omagic.
11469 * options.cc (General_options::finalize): For -n/--nmagic or
11470 -N/--omagic, set -static.
11471 * layout.cc (Layout::attach_allocated_section_to_segment): If
11472 -N/--omagic, don't put read-only and read-write sections in
11473 different segments.
11474 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11475 finding a read-only segment.
11476 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11477 don't set the minimum segment alignment to the common page size,
11478 and don't set the file offset to the address modulo the page size.
11479 * script-sections.cc (Script_sections::create_segments): If
11480 -n/--omagic, don't put read-only and read-write sections in
11481 different segments.
11482
11483 * cref.cc: New file.
11484 * cref.h: New file.
11485 * options.h (class General_options): Add --print-symbol-counts.
11486 * main.cc (main): Issue defined symbol report if requested.
11487 * archive.cc (Archive::interpret_header): Make into a const member
11488 function.
11489 (Archive::add_symbols): Call Input_objects::archive_start and
11490 archive_stop.
11491 (Archive::const_iterator): Define new class.
11492 (Archive::begin, Archive::end): New functions.
11493 (Archive::include_all_members): Rewrite to use iterator.
11494 (Archive::count_members): New function.
11495 * archive.h (class Archive): Update declarations.
11496 (Archive::filename): New function.
11497 * object.cc: Include "cref.h".
11498 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11499 (Sized_relobj::do_get_global_symbol_counts): New function.
11500 (Input_objects::add_object): Add object to cross-referencer.
11501 (Input_objects::archive_start): New function.
11502 (Input_objects::archive_stop): New function.
11503 (Input_objects::print_symbol_counts): New function.
11504 * object.h: Declare Cref and Archive.
11505 (Object::get_global_symbol_counts): New function.
11506 (Object::do_get_global_symbol_counts): New pure virtual function.
11507 (class Sized_relobj): Add defined_count_ field. Update
11508 declarations.
11509 (class Input_objects): Add cref_ field. Update constructor.
11510 Update declarations.
11511 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11512 defined_count_.
11513 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11514 symbol counts.
11515 (Sized_dynobj::do_get_global_symbol_counts): New function.
11516 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11517 defined_count_. Update declarations. Define Symbols typedef.
11518 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11519 parameter. Change all callers.
11520 (Symbol_table::add_from_dynobj): Add sympointers and defined
11521 parameters. Change all callers.
11522 * symtab.h (class Symbol_table): Update declarations.
11523 * Makefile.am (CCFILES): Add cref.cc.
11524 (HFILES): Add cref.h.
11525 * Makefile.in: Rebuild.
11526
11527 2008-07-22 Simon Baldwin <simonb@google.com>
11528
11529 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11530 to zero when writing undefined symbols.
11531
11532 2008-07-22 Ian Lance Taylor <iant@google.com>
11533
11534 * output.cc (Output_section::add_input_section): Don't try to
11535 merge empty merge sections.
11536
11537 2008-07-21 Craig Silverstein <csilvers@google.com>
11538
11539 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11540 Include symbol version in error message.
11541
11542 2008-07-20 Chris Demetriou <cgd@google.com>
11543
11544 * configure.ac (gold_cv_c_random_seed): New configured variable.
11545 (RANDOM_SEED_CFLAGS): New substituted variable.
11546 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11547 * configure: Rebuild.
11548 * Makefile.in: Likewise.
11549 * testsuite/Makefile.in: Likewise.
11550
11551 2008-07-18 Ian Lance Taylor <iant@google.com>
11552
11553 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11554 where we see NAME/NULL and NAME/VERSION as separate symbols.
11555 * testsuite/ver_test_main.cc (main): Call t4.
11556 (t4, t4_2a): Define.
11557 * testsuite/ver_test_2.cc (t4_2): Define.
11558 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11559 * testsuite/ver_test_4.cc (t4_2a): Define.
11560 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11561 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11562
11563 2008-07-17 Ian Lance Taylor <iant@google.com>
11564
11565 * dynobj.cc (Versions::add_def): If we give an error about a
11566 missing version, go ahead and create the version anyhow.
11567
11568 2008-07-10 Ian Lance Taylor <iant@google.com>
11569
11570 Handle output sections with more than 0x7fffffff bytes.
11571 * object.h (class Relobj): Change map_to_output_ to
11572 output_sections_, and just keep a section pointer. Change all
11573 uses. Move comdat group support to Sized_relobj.
11574 (Relobj::is_section_specially_mapped): Remove.
11575 (Relobj::output_section): Remove poff parameter. Change all
11576 callers.
11577 (Relobj::output_section_offset): New function.
11578 (Relobj::set_section_offset): Rewrite.
11579 (Relobj::map_to_output): Remove.
11580 (Relobj::output_sections): New function.
11581 (Relobj::do_output_section_offset): New pure virtual function.
11582 (Relobj::do_set_section_offset): Likewise.
11583 (class Sized_relobj): Add section_offsets_ field. Add comdat
11584 group support from Relobj. Update declarations.
11585 (Sized_relobj::get_output_section_offset): New function.
11586 (Sized_relobj::do_output_section_offset): New function.
11587 (Sized_relobj::do_set_section_offset): New function.
11588 * object.cc (Relobj::output_section_address): Remove.
11589 (Sized_relobj::Sized_relobj): Initialize new fields.
11590 (Sized_relobj::include_section_group): Cast find_kept_object to
11591 Sized_relobj.
11592 (Sized_relobj::include_linkonce_section): Likewise.
11593 (Sized_relobj::do_layout): Use separate arrays for output section
11594 and output offset.
11595 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11596 output_sections.
11597 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11598 output_sections and section_offsets.
11599 (Sized_relobj::write_local_symbols): Likewise.
11600 (map_to_kept_section): Compute output address directly.
11601 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11602 output_sections and section_offsets.
11603 (Sized_relobj::write_sections): Likewise.
11604 (Sized_relobj::relocate_sections): Likewise.
11605 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11606 * output.h (class Output_reloc): Update declarations. Change
11607 u2_.relobj to Sized_relobj*.
11608 (class Output_data_reloc): Change add functions to use
11609 Sized_relobj*.
11610 * output.cc (Output_reloc::Output_reloc): Change relobj to
11611 Sized_relobj*.
11612 (Output_reloc::local_section_offset): Change return type to
11613 Elf_Addr. Use get_output_section_offset.
11614 (Output_reloc::get_address): Likewise.
11615 (Output_section::is_input_address_mapped): Don't call
11616 is_section_specially_mapped.
11617 (Output_section::output_offset): Likewise.
11618 (Output_section::output_address): Likewise.
11619 (Output_section::starting_output_address): Likewise.
11620 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11621 parameter to Sized_relobj*.
11622 (Copy_relocs::need_copy_reloc): Likewise.
11623 (Copy_relocs::save): Likewise.
11624 * copy-relocs.h (class Copy_relocs): Update declarations.
11625 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11626 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11627 * target-reloc.h (relocate_for_relocatable): Change
11628 offset_in_output_section type to Elf_Addr. Change code that uses
11629 it as well.
11630 * layout.cc (Layout::layout): Always set *off.
11631 * mapfile.cc (Mapfile::print_input_section): Use
11632 output_section_offset.
11633 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11634 Sized_relobj*.
11635 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11636 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11637 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11638
11639 2008-07-03 Ian Lance Taylor <iant@google.com>
11640
11641 * layout.cc (Layout::include_section): Do not discard unrecognized
11642 SHT_STRTAB sections.
11643
11644 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11645
11646 * script.cc (Lex::can_continue_name): Make '?' allowable in
11647 version-script names.
11648 * testsuite/version_script.map: Change glob pattern to use '?'
11649
11650 2008-06-30 Manish Singh <yosh@gimp.org>
11651
11652 PR 6585
11653 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11654 Correct typo.
11655
11656 2008-06-30 Ian Lance Taylor <iant@google.com>
11657
11658 PR 6660
11659 PR 6682
11660 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11661 versions]: Don't try to read the value in the contents, since we
11662 don't use it. Use the template endianness when writing.
11663
11664 2008-06-25 Cary Coutant <ccoutant@google.com>
11665
11666 * fileread.cc (File_read::make_view): Assert on zero-length view.
11667 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11668 symbol table when there are no symbols to read.
11669
11670 2008-06-23 Craig Silverstein <csilvers@google.com>
11671
11672 * version.cc (version_string): Bump to 1.7
11673
11674 2008-06-18 Craig Silverstein <csilvers@google.com>
11675
11676 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11677 constant 0xFFFF to type Valtype.
11678 (Powerpc_relocate_functions::rel16_ha): Likewise.
11679
11680 2008-06-17 Ian Lance Taylor <iant@google.com>
11681
11682 * output.h (Output_section::Input_section): Initialize p2align_ to
11683 zero for Output_section_data constructors.
11684 (Output_section::Input_section::addralign): If not an input
11685 section, return the alignment of the Output_section_data.
11686 * testsuite/copy_test.cc: New file.
11687 * testsuite/copy_test_1.cc: New file.
11688 * testsuite/copy_test_2.cc: New file.
11689 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11690 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11691 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11692 (copy_test_1_pic.o, copy_test_1.so): New targets.
11693 (copy_test_2_pic.o, copy_test_2.so): New targets.
11694 * testsuite/Makefile.in: Rebuild.
11695
11696 * script-sections.cc (Script_sections::place_orphan): Initialize
11697 local variable exact.
11698
11699 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11700
11701 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11702
11703 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11704 David S. Miller <davem@davemloft.net>
11705
11706 * powerpc.cc: New file.
11707 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11708 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11709 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11710 * Makefile.in: Rebuild.
11711
11712 2008-06-09 Ian Lance Taylor <iant@google.com>
11713
11714 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11715 <exception>.
11716 (throwing, orig_terminate): New static variables.
11717 (terminate_handler): New static function.
11718 (t2): Set terminate handler.
11719
11720 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11721
11722 PR 6584
11723 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11724 alignment.
11725
11726 2008-05-30 Cary Coutant <ccoutant@google.com>
11727
11728 * archive.cc (Archive::include_all_members) Correct to step
11729 over symbol table and extended name table in thin archives.
11730
11731 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11732
11733 PR 6407
11734 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11735 calculation.
11736
11737 2008-05-28 Caleb Howe <cshowe@google.com>
11738
11739 * reduced_debug_output.cc: New file.
11740 * reduced_debug_output.h: New file.
11741 * options.h (class General_options): Add --strip-debug-non-line.
11742 * options.cc (General_options::finalize): Add strip_debug_non_line
11743 to the strip heirarchy.
11744 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11745 fields.
11746 * layout.cc: Include "reduced_debug_output.h".
11747 (Layout::Layout): Initialize new fields.
11748 (line_only_debug_sections): New static array.
11749 (is_lines_only_debug_sections): New static inline function.
11750 (Layout::include_section): Handle --strip-debug-non-line.
11751 (Layout::make_output_section): If --strip-debug-non-line, build
11752 new output sections for .debug_abbrev and .debug_info.
11753 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11754 gold. Warn about possible overflow.
11755 (read_signed_LEB_128): Likewise.
11756 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11757 (read_signed_LEB_128): Declare.
11758 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11759 (HFILES): Add reduced_debug_output.h.
11760 * Makefile.in: Rebuild.
11761
11762 2008-05-21 Ian Lance Taylor <iant@google.com>
11763
11764 * mapfile.cc: New file.
11765 * mapfile.h: New file.
11766 * options.h (class General_options): Add -M/--print-map and -Map.
11767 * options.cc (General_options::finalize): Make -M equivalent to
11768 -Map -.
11769 * main.cc: Include <cstdio> and "mapfile.h".
11770 (main): Open mapfile if requested.
11771 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11772 constructor. Change caller.
11773 (queue_initial_tasks): Add mapfile parameter. Change caller.
11774 (queue_middle_tasks): Likewise.
11775 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11776 declarations.
11777 * archive.cc: Include "mapfile.h".
11778 (Archive::add_symbols): Add mapfile parameter. Change all
11779 callers. Pass mapfile, symbol, and reason to include_member.
11780 (Archive::include_all_members): Add mapfile parameter. Change all
11781 callers.
11782 (Archive::include_member): Add mapfile, sym, and why parameters.
11783 Change all callers. Report inclusion to map file.
11784 * archive.h: Include "fileread.h".
11785 (class Archive): Update declarations.
11786 (Archive::file): New const method.
11787 (class Add_archive_symbols): Add mapfile_ field. Update
11788 constructor. Change all callers.
11789 * readsyms.h (class Read_symbols): Likewise.
11790 (class Finish_group): Likewise.
11791 (class Read_script): Likewise.
11792 * common.cc: Include "mapfile.h".
11793 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11794 all callers.
11795 (Symbol_table::do_allocate_commons): Likewise.
11796 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11797 symbol allocation to mapfile.
11798 * common.h (class Allocate_commons_task): Add mapfile_ field.
11799 Update constructor. Change all callers.
11800 * symtab.h (class Symbol_table): Update declarations.
11801 * layout.cc: Include "mapfile.h".
11802 (Layout_task_runner::run): Print information to mapfile.
11803 (Layout::create_gold_note): Change Output_data_fixed_space to
11804 Output_data_zero_fill.
11805 (Layout::create_build_id): Likewise.
11806 (Layout::print_to_mapfile): New function.
11807 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11808 constructor. Change caller.
11809 (class Layout): Declare print_to_mapfile.
11810 * output.cc (Output_section::Input_section::print_to_mapfile): New
11811 function.
11812 (Output_section::add_input_section): If producing a map, always
11813 add to input_sections_ list.
11814 (Output_section::do_print_to_mapfile): New function.
11815 (Output_segment::print_sections_to_mapfile): New function.
11816 (Output_segment::print_section_list_to_mapfile): New function.
11817 * output.h: Include "mapfile.h".
11818 (Output_data::print_to_mapfile): New function.
11819 (Output_data::do_print_to_mapfile): New virtual function.
11820 (Output_segment_headers::do_print_to_mapfile): New function.
11821 (Output_file_header::do_print_to_mapfile): New function.
11822 (Output_data_const::do_print_to_mapfile): New function.
11823 (class Output_data_const_buffer): Add map_name_ field. Update
11824 constructor. Change all callers. Add do_print_to_mapfile
11825 function.
11826 (class Output_data_fixed_space): Likewise.
11827 (class Output_data_space): Likewise.
11828 (class Output_data_zero_fill): New class.
11829 (Output_data_strtab::do_print_to_mapfile): New function.
11830 (Output_data_reloc_base::do_print_to_mapfile): New function.
11831 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11832 (Output_data_group::do_print_to_mapfile): New function.
11833 (Output_data_got::do_print_to_mapfile): New function.
11834 (Output_data_dynamic::do_print_to_mapfile): New function.
11835 (Output_symtab_xindex::do_print_to_mapfile): New function.
11836 (class Output_section): Declare do_print_to_mapflie. Declare
11837 print_to_mapfile in Input_section.
11838 (class Output_segment): Declare new functions.
11839 * object.h (Sized_relobj::symbol_count): New function.
11840 * script-sections.cc
11841 (Output_section_element_dot_assignment::set_section_addresses):
11842 Change Output_data_fixed_space to Output_data_zero_fill.
11843 (Output_data_expression::do_print_to_mapfile): New function.
11844 * script.cc (read_input_script): Add mapfile parameter. Change
11845 all callers.
11846 * script.h (read_input_script): Update declaration.
11847 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11848 (Eh_frame::do_print_to_mapfile): New function.
11849 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11850 (Output_merge_string::do_print_to_mapfile): New function.
11851 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11852 function.
11853 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11854 function.
11855 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11856 function.
11857 * Makefile.am (CCFILES): Add mapfile.cc.
11858 (HFILES): Add mapfile.h.
11859 * Makefile.in: Rebuild.
11860
11861 2008-05-19 Ian Lance Taylor <iant@google.com>
11862
11863 * options.h (class General_options): Add -z relro.
11864 * layout.cc (Layout::Layout): Initialize relro_segment_.
11865 (Layout::add_output_section_data): Return the output section.
11866 (Layout::make_output_section): Rcognize relro sections and mark
11867 them appropriately.
11868 (Layout::attach_allocated_section_to_segment): Put relro sections
11869 in a PT_GNU_RELRO segment.
11870 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11871 section as relro.
11872 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11873 PT_TLS segments.
11874 (Layout::linkonce_mapping): Map d.rel.ro.local to
11875 .data.rel.ro.local.
11876 (Layout::output_section_name): Us .data.rel.ro.local for any
11877 section which begins with that.
11878 * layout.h (class Layout): Update add_output_section_data
11879 declaration. Add relro_segment_ field.
11880 * output.cc (Output_section::Output_section): Initialize is_relro_
11881 and is_relro_local_ fields.
11882 (Output_segment::add_output_section): Group relro sections.
11883 (Output_segment::is_first_section_relro): New function.
11884 (Output_segment::maximum_alignment): If there is a relro section,
11885 align the segment to the common page size.
11886 (Output_segment::set_section_addresses): Track whether we are
11887 looking at relro sections. If the last section is a relro
11888 section, align to the common page size.
11889 (Output_segment::set_section_list_addresses): Add in_relro
11890 parameter. Change all callers. Align to the page size when
11891 moving from relro to non-relro section.
11892 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11893 segment.
11894 * output.h (class Output_section): Add is_relro_ and
11895 is_relro_local_ fields.
11896 (Output_section::is_relro): New function.
11897 (Output_section::set_is_relro): New function.
11898 (Output_section::is_relro_local): New function.
11899 (Output_section::set_is_relro_local): New function.
11900 (class Output_segment): Update declarations.
11901 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11902 * sparc.cc (Target_sparc::got_section): Likewise.
11903 * x86_64.cc (Target_x86_64::got_section): Likewise.
11904 * testsuite/relro_test_main.cc: New file.
11905 * testsuite/relro_test.cc: New file.
11906 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11907 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11908 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11909 (relro_test.so, relro_test_pic.o): New targets.
11910 * testsuite/Makefile.in: Rebuild.
11911
11912 2008-05-16 Ian Lance Taylor <iant@google.com>
11913
11914 * output.cc (Output_segment::add_output_section): Remove front
11915 parameter.
11916 * output.h (class Output_segment): Remove
11917 add_initial_output_section and overloaded add_output_section.
11918 Update declaration of remaining add_output_section.
11919 * layout.cc (Layout::create_interp): Call add_output_section
11920 rather than add_initial_output_section.
11921 (Layout::finish_dynamic_section): Likewise.
11922
11923 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11924 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11925 know the dynamic type.
11926 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11927 field. Initialize it in constructor.
11928 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11929 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11930 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11931 reloc.
11932
11933 * output.cc (Output_reloc::get_address): Change return type to
11934 Elf_Addr.
11935 * output.h (class Output_reloc): Update get_address declaration.
11936 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11937 for section addresses.
11938
11939 2008-05-09 Ian Lance Taylor <iant@google.com>
11940
11941 PR 6493
11942 * gold.cc (gold_nomem): Use return value of write.
11943
11944 2008-05-08 Ian Lance Taylor <iant@google.com>
11945
11946 * symtab.c (Symbol::init_base_output_data): Add version
11947 parameter. Change all callers.
11948 (Symbol::init_base_output_segment): Likewise.
11949 (Symbol::init_base_constant): Likewise.
11950 (Symbol::init_base_undefined): Likewise.
11951 (Sized_symbol::init_output_data): Likewise.
11952 (Sized_symbol::init_output_segment): Likewise.
11953 (Sized_symbol::init_constant): Likewise.
11954 (Sized_symbol::init_undefined): Likewise.
11955 (Symbol_table::do_define_in_output_data): If the new symbol has a
11956 version, mark it as the default.
11957 (Symbol_table::do_define_in_output_segment): Likewise.
11958 (Symbol_table::do_define_as_constant): Likewise.
11959 * symtab.h (class Symbol): Update declarations.
11960 (class Sized_symbol): Likewise.
11961 * resolve.cc (Symbol::override_version): New function.
11962 (Symbol::override_base): Call override_version.
11963 (Symbol::override_base_with_special): Likewise.
11964 * testsuite/ver_script_8.script: New file.
11965 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11966 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11967 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11968 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11969
11970 2008-05-06 Ian Lance Taylor <iant@google.com>
11971
11972 PR 6049
11973 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11974 functions.
11975 (class General_options): Remove existing --undefined, and add
11976 --no-undefined instead. Add new --undefined as synonym for -u.
11977 * archive.cc (Archive::add_symbols): Check whether symbol was
11978 named with -u.
11979 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11980 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11981 all uses. Add IS_UNDEFINED. Update declarations to split
11982 different versions of init_base. Declare init_base_undefined.
11983 (Symbol::is_defined): Handle IS_UNDEFINED.
11984 (Symbol::is_undefined): Likewise.
11985 (Symbol::is_weak_undefined): Call is_undefined.
11986 (Symbol::is_absolute): Handle IS_CONSTANT.
11987 (class Sized_symbol): Update declarations to split different
11988 versions of init. Declare init_undefined.
11989 (class Symbol_table): Declare new functions.
11990 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11991 Change all callers.
11992 (Symbol::init_base_output_data): Likewise.
11993 (Symbol::init_base_output_segment): Likewise.
11994 (Symbol::init_base_constant): Likewise.
11995 (Symbol::init_base_undefined): New function.
11996 (Sized_symbol::init_object): Rename from init. Change all
11997 callers.
11998 (Sized_symbol::init_output_data): Likewise.
11999 (Sized_symbol::init_output_segment): Likewise.
12000 (Sized_symbol::init_constant): Likewise.
12001 (Sized_symbol::init_undefined): New function.
12002 (Symbol_table::add_undefined_symbols_from_command_line): New
12003 function.
12004 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12005 function.
12006 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12007 (Symbol::output_section): Likewise.
12008 (Symbol::set_output_section): Likewise.
12009 (Symbol_table::sized_finalize_symbol): Likewise.
12010 (Symbol_table::sized_write_globals): Likewise.
12011 * resolve.cc (Symbol_table::should_override): Likewise.
12012 (Symbol::override_base_with_special): Likewise.
12013
12014 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12015 symbol, change it to have default visibility.
12016 * testsuite/protected_1.cc: New file.
12017 * testsuite/protected_2.cc: New file.
12018 * testsuite/protected_3.cc: New file.
12019 * testsuite/protected_main_1.cc: New file.
12020 * testsuite/protected_main_2.cc: New file.
12021 * testsuite/protected_main_3.cc: New file.
12022 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12023 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12024 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12025 (protected_1.so): New target.
12026 (protected_1_pic.o, protected_2_pic.o): New targets.
12027 (protected_3_pic.o): New target.
12028 (check_PROGRAMS): Add protected_2.
12029 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12030 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12031 * testsuite/Makefile.in: Rebuild.
12032
12033 * options.h (DEFINE_var): Add set_user_set_##varname__.
12034 (DEFINE_bool_alias): New macro.
12035 (class General_options): Define -Bstatic using DEFINE_bool_alias
12036 rather than DEFINE_special. Add --undefined as an alias for -z
12037 defs.
12038 * options.cc (General_options::parse_Bstatic): Remove.
12039
12040 * options.h (class General_options): Add --fatal-warnings.
12041 * main.cc (main): Implement --fatal-warnings.
12042 * errors.h (Errors::warning_count): New function.
12043
12044 * options.h (class General_options): Add -Bsymbolic-functions.
12045 * symtab.h (Symbol::is_preemptible): Check for
12046 -Bsymbolic-functions.
12047
12048 2008-05-05 Ian Lance Taylor <iant@google.com>
12049
12050 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12051 as noVARNAME rather than no-VARNAME.
12052 (class General_options): Add option -z combreloc.
12053 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12054 get_address.
12055 (Output_reloc::sort_before) [SHT_REL]: New function.
12056 (Output_reloc::sort_before) [SHT_RELA]: New function.
12057 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12058 Sort_relocs_comparison.
12059 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12060 parameter. Change all callers.
12061 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12062 sort_relocs parameter. Change all callers.
12063 * output.cc (Output_reloc::get_address): New function, broken out
12064 of write_rel.
12065 (Output_reloc::write_rel): Call it.
12066 (Output_reloc::compare): New function.
12067 (Output_data_reloc_base::do_write): Optionally sort relocs.
12068
12069 * configure.ac: If targ_extra_obj is set, link it in.
12070 * configure.tgt: Initialize all variables.
12071 (x86_64*): Set targ_extra_obj and targ_extra_size.
12072 * configure: Rebuild.
12073
12074 * object.cc (Sized_relobj::include_section_group): Adjust section
12075 indexes read from group data. Build vector to pass to
12076 layout_group.
12077 * layout.cc (Layout::layout_group): Add flags and shndxes
12078 parameters. Remove contents parameter. Change caller. Update
12079 explicit instantiations.
12080 * layout.h (class Layout): Update layout_group declaration.
12081 * output.cc (Output_data_group::Output_data_group): Add flags and
12082 input_shndxes parameters. Remove contents parameter. Change
12083 caller.
12084 (Output_data_group::do_write): Change input_sections_ to
12085 input_shndxes_.
12086 * output.h (class Output_data_group): Update constructor
12087 declaration. Rename input_sections_ to input_shndxes_.
12088 * testsuite/many_sections_test.cc: Add template.
12089
12090 2008-04-30 Cary Coutant <ccoutant@google.com>
12091
12092 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12093
12094 * layout.cc (Layout::include_section): Refactored check for debug
12095 info section.
12096 (Layout::add_comdat): Add new parameters. Change type
12097 of signature parameter. Add object and shndx to signatures table.
12098 (Layout::find_kept_object): New function.
12099 * layout.h: Include <cstring>.
12100 (Layout::is_debug_info_section): New function.
12101 (Layout::add_comdat): Add new parameters.
12102 (Layout::find_kept_object): New function.
12103 (Layout::Kept_section): New struct.
12104 (Layout::Signatures): Change type of map range.
12105 * object.cc (Relobj::output_section_address): New function.
12106 (Sized_relobj::include_section_group): Add new parameters. Change
12107 calls to Layout::add_comdat. Change to build table of kept comdat
12108 groups and table mapping discarded sections to kept sections.
12109 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12110 (Sized_relobj::do_layout): Change calls to include_section_group and
12111 include_linkonce_section.
12112 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12113 value to zero when section is discarded.
12114 (Sized_relobj::map_to_kept_section): New function.
12115 * object.h (Relobj::output_section_address): New function.
12116 (Relobj::Comdat_group): New type.
12117 (Relobj::find_comdat_group): New function.
12118 (Relobj::Comdat_group_table): New type.
12119 (Relobj::Kept_comdat_section): New type.
12120 (Relobj::Kept_comdat_section_table): New type.
12121 (Relobj::add_comdat_group): New function.
12122 (Relobj::set_kept_comdat_section): New function.
12123 (Relobj::get_kept_comdat_section): New function.
12124 (Relobj::comdat_groups_): New field.
12125 (Relobj::kept_comdat_sections_): New field.
12126 (Symbol_value::input_value): Update comment.
12127 (Sized_relobj::map_to_kept_section) New function.
12128 (Sized_relobj::include_linkonce_section): Add new parameter.
12129 * target-reloc.h (Comdat_behavior): New type.
12130 (get_comdat_behavior): New function.
12131 (relocate_section): Add code to map a discarded section to the
12132 corresponding kept section when applying a relocation.
12133
12134 2008-04-30 Craig Silverstein <csilvers@google.com>
12135
12136 * dwarf_reader.cc (next_generation_count): New static var.
12137 (Addr2line_cache_entry): New struct.
12138 (addr2line_cache): New static var.
12139 (Dwarf_line_info::one_addr2line): Added caching.
12140 (Dwarf_line_info::clear_addr2line_cache): New function.
12141 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12142 cache-size parameter.
12143 (Dwarf_line_info::one_addr2line_cache): New function.
12144 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12145 new cache-size argument to one_addr2line(), and clear cache.
12146
12147 2008-04-28 Cary Coutant <ccoutant@google.com>
12148
12149 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12150 R_386_PC8 relocations.
12151
12152 2008-04-23 Ian Lance Taylor <iant@google.com>
12153
12154 * object.cc (Sized_relobj::include_section_group): Check for
12155 invalid section group.
12156
12157 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12158 header size.
12159
12160 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12161 than read for file header.
12162 * archive.cc (Archive::include_member): Likewise.
12163
12164 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12165
12166 * aclocal.m4: Regenerate.
12167 * configure: Regenerate.
12168
12169 2008-04-19 Ian Lance Taylor <iant@google.com>
12170
12171 * version.cc (version_string): Bump to 1.6.
12172
12173 * testsuite/Makefile.am (many_sections_r_test): New target.
12174 (many_sections_r_test_SOURCES): Remove.
12175 (many_sections_r_test_DEPENDENCIES): Remove.
12176 (many_sections_r_test_LDFLAGS): Remove.
12177 (many_sections_r_test_LDADD): Remove.
12178
12179 * object.cc (Sized_relobj::do_add_symbols): Always pass
12180 local_symbol_count_ to add_from_relobj.
12181
12182 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12183 every thousand variables.
12184 * testsuite/Makefile.in: Rebuild.
12185
12186 * object.cc (Xindex::initialize_symtab_xindex): New function.
12187 (Xindex::read_symtab_xindex): New function.
12188 (Xindex::sym_xindex_to_shndx): New function.
12189 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12190 available.
12191 (Sized_relobj::do_initialize_xindex): New function.
12192 (Sized_relobj::do_read_symbols): Adjust section links.
12193 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12194 parameter. Change all callers.
12195 (Sized_relobj::include_section_group): Adjust section links and
12196 symbol section indexes.
12197 (Sized_relobj::do_layout): Adjust section links.
12198 (Sized_relobj::do_count_local_symbols): Adjust section links and
12199 symbol section indexes.
12200 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12201 ordinary and special symbols.
12202 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12203 dynsym_xindex parameters. Change all callers. Adjust section
12204 links. Use SHN_XINDEX when needed.
12205 (Sized_relobj::get_symbol_location_info): Adjust section links.
12206 Don't get fooled by special symbols.
12207 * object.h (class Xindex): Define.
12208 (class Object): Add xindex_ parameter. Declare virtual functoin
12209 do_initialize_xindex.
12210 (Object::adjust_sym_shndx): New function.
12211 (Object::set_xindex): New protected function.
12212 (class Symbol_value): Add is_ordinary_shndx_ field.
12213 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12214 (Symbol_value::value): Assert ordinary section.
12215 (Symbol_value::initialize_input_to_output_map): Likewise.
12216 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12217 Change all callers.
12218 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12219 all callers.
12220 (class Sized_relobj): Update declarations.
12221 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12222 parameter. Change all callers.
12223 (Sized_relobj::adjust_shndx): New function.
12224 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12225 field.
12226 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12227 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12228 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12229 (Sized_dynobj::read_dynsym_section): Adjust section links.
12230 (Sized_dynobj::read_dynamic): Likewise.
12231 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12232 section links.
12233 (Sized_dynobj::do_initialize_xindex): New function.
12234 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12235 do_initialize_xindex.
12236 (Sized_dynobj::adjust_shndx): New function.
12237 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12238 dynsym_xindex_ fields.
12239 (Layout::finalize): Add a call to set_section_indexes before
12240 creating the symtab sections.
12241 (Layout::set_section_indexes): Don't do anything if the section
12242 already has a section index.
12243 (Layout::create_symtab_sections): Add shnum parameter. Change
12244 caller. Create .symtab_shndx section if needed.
12245 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12246 caller.
12247 (Layout::allocated_output_section_count): New function.
12248 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12249 needed.
12250 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12251 fields. Update declarations.
12252 (Layout::symtab_xindex): New function.
12253 (Layout::dynsym_xindex): New function.
12254 (class Write_symbols_task): Add layout_ field.
12255 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12256 Change caller.
12257 * output.cc (Output_section_headers::Output_section_headers): Add
12258 shstrtab_section parameter. Change all callers.
12259 (Output_section_headers::do_sized_write): Store overflow values
12260 for section count and section string table section index in
12261 section header zero.
12262 (Output_file_header::do_sized_write): Check for overflow of
12263 section count and section string table section index.
12264 (Output_symtab_xindex::do_write): New function.
12265 (Output_symtab_xindex::endian_do_write): New function.
12266 * output.h (class Output_section_headers): Add shstrtab_section_.
12267 Update declarations.
12268 (class Output_symtab_xindex): Define.
12269 (Output_section::has_out_shndx): New function.
12270 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12271 field.
12272 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12273 Change all callers.
12274 (Sized_symbol::init): Likewise.
12275 (Symbol::output_section): Check for ordinary symbol.
12276 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12277 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12278 callers.
12279 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12280 Change all callers. Simplify handling of symbols from sections
12281 not included in the link.
12282 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12283 distinction.
12284 (Weak_alias_sorter::operator()): Assert that symbols are
12285 ordinary.
12286 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12287 distinction.
12288 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12289 parameters. Change all callers.
12290 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12291 symbol distinction. Use SHN_XINDEX when needed.
12292 (Symbol_table::write_section_symbol): Add symtab_xindex
12293 parameter. Change all callers.
12294 (Symbol_table::sized_write_section_symbol): Likewise. Use
12295 SHN_XINDEX when needed.
12296 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12297 declarations.
12298 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12299 (Symbol::is_defined): Check is_ordinary.
12300 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12301 (Symbol::is_absolute, Symbol::is_common): Likewise.
12302 (class Sized_symbol): Update declarations.
12303 (class Symbol_table): Update declarations.
12304 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12305 parameters. Change all callers.
12306 (Sized_symbol::override): Likewise.
12307 (Symbol_table::override): Likewise.
12308 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12309 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12310 is_ordinary, and orig_st_shndx parameters. Change all callers.
12311 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12312 to be in an ordinary section.
12313 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12314 object and is_ordinary parameters. Change all callers.
12315 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12316 Change all callers. Don't add undefined or non-ordinary symbols
12317 to reloc_map_.
12318 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12319 Change all callers.
12320 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12321 declarations.
12322 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12323 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12324 (Sized_relobj::relocate_sections): Likewise.
12325 * target-reloc.h (scan_relocs): Adjust section symbol index.
12326 (scan_relocatable_relocs): Likewise.
12327 * i386.cc (Scan::local): Check for ordinary symbols.
12328 * sparc.cc (Scan::local): Likewise.
12329 * x86_64.cc (Scan::local): Likewise.
12330 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12331 to symbol_section_and_value.
12332 * testsuite/many_sections_test.cc: New file.
12333 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12334 (check_PROGRAMS): Add many_sections_test.
12335 (many_sections_test_SOURCES): Define.
12336 (many_sections_test_DEPENDENCIES): Define.
12337 (many_sections_test_LDFLAGS): Define.
12338 (BUILT_SOURCES): Add many_sections_define.h.
12339 (many_sections_define.h): New target.
12340 (BUILT_SOURCES): Add many_sections_check.h.
12341 (many_sections_check.h): New target.
12342 (check_PROGRAMS): Add many_sections_r_test.
12343 (many_sections_r_test_SOURCES): Define.
12344 (many_sections_r_test_DEPENDENCIES): Define.
12345 (many_sections_r_test_LDFLAGS): Define.
12346 (many_sections_r_test_LDADD): Define.
12347 (many_sections_r_test.o): New target.
12348 * testsuite/Makefile.in: Rebuild.
12349
12350 2008-04-17 Cary Coutant <ccoutant@google.com>
12351
12352 * errors.cc (Errors::info): New function.
12353 (gold_info): New function.
12354 * errors.h (Errors::info): New function.
12355 * gold.h (gold_info): New function.
12356 * object.cc (Input_objects::add_object): Print trace output.
12357 * options.cc (options::parse_set): New function.
12358 (General_options::parse_wrap): Deleted.
12359 (General_options::General_options): Deleted initializer.
12360 * options.h (options::String_set): New typedef.
12361 (options::parse_set): New function.
12362 (DEFINE_set): New macro.
12363 (General_options::wrap): Changed to use DEFINE_set. Changed
12364 callers of any_wrap_symbols and is_wrap_symbol.
12365 (General_options::trace, General_options::trace_symbol):
12366 New options.
12367 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12368 (General_options::wrap_symbols_): Deleted.
12369 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12370
12371 2008-04-17 David S. Miller <davem@davemloft.net>
12372
12373 * options.cc (General_options::parse_V): New function.
12374 * options.h: Add entries for -V and -Qy.
12375
12376 2008-04-17 Ian Lance Taylor <iant@google.com>
12377
12378 * common.cc (Symbol_table::allocate_commons): Remove options
12379 parameter. Change caller.
12380 (Symbol_table::do_allocate_commons): Remove options parameter.
12381 Change caller. Just call do_allocate_commons_list twice.
12382 (Symbol_table::do_allocate_commons_list): New function, broken out
12383 of do_allocate_commons.
12384 * common.h (class Allocate_commons_task): Remove options_ field.
12385 Update constructor.
12386 * symtab.cc (Symbol_table::Symbol_table): Initialize
12387 tls_commons_.
12388 (Symbol_table::add_from_object): Put TLS common symbols on
12389 tls_commons_ list.
12390 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12391 which are IN_OUTPUT_DATA.
12392 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12393 allocate_commons and do_allocate_commons declarations. Declare
12394 do_allocate_commons_list.
12395 * gold.cc (queue_middle_tasks): Update creation of
12396 Allocate_commons_task to not pass options.
12397 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12398 (TLS_TEST_C_FLAGS): New variable.
12399 (tls_test_c_pic.o): New target.
12400 (tls_test_shared.so): Link in tls_test_c_pic.o.
12401 (tls_test_c_pic_ie.o): New target.
12402 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12403 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12404 (tls_test_c.o): New target.
12405 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12406 (tls_pic_test_LDADD): Likewise.
12407 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12408 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12409 (tls_test_c_gnu2.o): New target.
12410 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12411 tls_test_c_gnu2.o.
12412 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12413 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12414 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12415 * testsuite/tls_test.cc: Include "config.h".
12416 (t_last): Call t11_last.
12417 * testsuite/tls_test.h (t11, t11_last): Declare.
12418 * testsuite/tls_test_c.c: New file.
12419 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12420 * configure.ac: Check for OpenMP support.
12421 * configure, config.in, Makefile.in: Rebuild.
12422 * testsuite/Makefile.in: Rebuild.
12423
12424 2008-04-16 Cary Coutant <ccoutant@google.com>
12425
12426 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12427 (Target_i386::tls_base_symbol_defined_): New field.
12428 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12429 (Target_i386::Scan::global): Likewise.
12430 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12431 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12432 (Target_x86_64::tls_base_symbol_defined_): New field.
12433 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12434 (Target_x86_64::Scan::global): Likewise.
12435
12436 2008-04-16 Cary Coutant <ccoutant@google.com>
12437
12438 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12439 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12440 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12441 building shared libraries.
12442 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12443 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12444 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12445 * testsuite/Makefile.in: Rebuild.
12446 * testsuite/weak_undef.h: New file.
12447 * testsuite/weak_undef_file1.cc: Add extra test cases.
12448 * testsuite/weak_undef_file2.cc: Likewise.
12449 * testsuite/weak_undef_test.cc: Likewise.
12450
12451 2008-04-16 David S. Miller <davem@davemloft.net>
12452
12453 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12454 Add issued_non_pic_error_ field. Declare check_non_pic.
12455 (Target_sparc::Scan::check_non_pic): New function.
12456 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12457 (Target_sparc::Scan::global): Likewise.
12458
12459 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12460 * configure: Rebuild.
12461
12462 * options.h (DEFINE_enable): New macro.
12463 (new_dtags): New enable option.
12464 (initfirst, interpose, loadfltr, nodefaultlib,
12465 nodelete, nodlopen, nodump): New -z options.
12466 * layout.cc (Layout:finish_dynamic_section): If new
12467 dtags enabled, emit DT_RUNPATH. Also, emit a
12468 DT_FLAGS_1 containing any specified -z flags.
12469
12470 2008-04-16 Ian Lance Taylor <iant@google.com>
12471
12472 * copy-relocs.cc: New file.
12473 * copy-relocs.h: New file.
12474 * reloc.cc: Remove Copy_relocs code.
12475 * reloc.h: Likewise.
12476 * reloc-types.h (struct Reloc_types) [both versions]: Add
12477 get_reloc_addend_noerror.
12478 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12479 variants of add_global which take an addend which must be zero.
12480 * i386.cc: Include "copy-relocs.h".
12481 (class Target_i386): Change type of copy_relocs_ to variable,
12482 update initializer.
12483 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12484 Change all callers.
12485 (Target_i386::do_finalize_sections): Change handling of
12486 copy_relocs_.
12487 * sparc.cc: Include "copy-relocs.h".
12488 (class Target_sparc): Change type of copy_relocs_ to variable,
12489 update initializer.
12490 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12491 Change all callers.
12492 (Target_sparc::do_finalize_sections): Change handling of
12493 copy_relocs_.
12494 * x86_64.cc: Include "copy-relocs.h".
12495 (class Target_x86_64): Change type of copy_relocs_ to variable,
12496 update initializer.
12497 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12498 class. Change all callers.
12499 (Target_x86_64::do_finalize_sections): Change handling of
12500 copy_relocs_.
12501 * Makefile.am (CCFILES): Add copy-relocs.cc.
12502 (HFILES): Add copy-relocs.h.
12503
12504 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12505
12506 * testsuite/script_test_4.sh: Permit leading zeroes.
12507
12508 2008-04-15 Ian Lance Taylor <iant@google.com>
12509
12510 * script-sections.cc (Script_sections::create_segments): Use
12511 header_size_adjustment even when there is enough room for the
12512 headers.
12513 * testsuite/script_test_4.sh: New file.
12514 * testsuite/script_test_4.t: New file.
12515 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12516 (check_DATA): Add script_test_4.stdout.
12517 (MOSTLYCLEANFILES): Likewise.
12518 (script_test_4): New target.
12519 (script_test_4.stdout): New target.
12520 * testsuite/Makefile.in: Rebuild.
12521
12522 * sparc.cc: Add definitions for Output_data_plt_sparc class
12523 constants.
12524
12525 2008-04-14 David S. Miller <davem@davemloft.net>
12526
12527 * sparc.cc: New file.
12528 * Makefile.am (TARGETSOURCES): Add sparc.cc
12529 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12530 * configure.tgt: Document targ_extra_size and
12531 targ_extra_big_endian. Add entries for sparc-* and
12532 sparc64-*.
12533 * configure.ac: Handle targ_extra_size and
12534 targ_extra_big_endian.
12535 * Makefile.in: Rebuild.
12536 * configure: Likewise.
12537 * po/POTFILES.in: Likewise.
12538 * po/gold.pot: Likewise.
12539
12540 2008-04-14 Ian Lance Taylor <iant@google.com>
12541
12542 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12543 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12544 in the name/type/flags to section mapping. Don't call
12545 allocate_output_section.
12546 (Layout::choose_output_section): Change parameter from adjust_name
12547 to is_input_section. Don't permit input sections after sections
12548 are attached to segments. Don't call allocate_output_section.
12549 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12550 not write_enable_output_section.
12551 (Layout::make_output_section): Don't push to
12552 unattached_section_list_ nor call attach_to_segment. Call
12553 attach_section_to_segment if sections are attached.
12554 (Layout::attach_sections_to_segments): New function.
12555 (Layout::attach_section_to_segment): New function.
12556 (Layout::attach_allocated_section_to_segment): Rename from
12557 attach_to_segment. Remove flags parameter.
12558 (Layout::allocate_output_section): Remove function.
12559 (Layout::write_enable_output_section): Remove function.
12560 * layout.h (class Layout): Update for above changes. Add new
12561 field sections_are_attached_.
12562 * output.h (Output_section::update_flags_for_input_section): New
12563 function.
12564 * output.cc (Output_section::add_input_section): Call
12565 update_flags_for_input_section.
12566 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12567
12568 2008-04-11 Cary Coutant <ccoutant@google.com>
12569
12570 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12571 thought unnecessary.
12572 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12573
12574 2008-04-11 Ian Lance Taylor <iant@google.com>
12575
12576 * output.h (class Output_section_data): Remove inline definition
12577 of set_addralign.
12578 * output.cc (Output_section_data::set_addralign): New function.
12579
12580 2008-04-11 Cary Coutant <ccoutant@google.com>
12581
12582 Add support for TLS descriptors for i386 and x86_64.
12583 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12584 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12585 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12586 GOT_TYPE_TLS_DESC.
12587 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12588 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12589 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12590 relocations.
12591 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12592 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12593 Fix problem with initial-exec relocations.
12594 (Target_i386::Relocate::relocate_tls): Likewise.
12595 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12596 relaxation.
12597 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12598 support for section-plus-offset dynamic table entries.
12599 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12600 (Output_data_dynamic::Dynamic_entry): Add support for
12601 section-plus-offset dynamic table entries.
12602 (Output_data_dynamic::Classification): Likewise.
12603 (Output_data_dynamic::classification_): Renamed offset_.
12604 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12605 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12606 (Target_x86_64::make_plt_section): New function.
12607 (Target_x86_64::reserve_tlsdesc_entries): New function.
12608 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12609 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12610 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12611 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12612 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12613 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12614 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12615 add extra PLT entry for TLS descriptors.
12616 (Output_data_plt_x86_64::got_): New field.
12617 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12618 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12619 fields.
12620 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12621 descriptors.
12622 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12623 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12624 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12625 R_386_TLS_DESC_CALL relocations.
12626 (Target_x86_64::Scan::global): Likewise.
12627 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12628 for TLS descriptors.
12629 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12630 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12631 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12632 GD-to-IE relaxation.
12633 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12634 and TLS_DESCRIPTORS.
12635 * Makefile.in: Rebuild.
12636 * configure: Rebuild.
12637 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12638 (tls_test_shared2.so): New target.
12639 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12640 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12641 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12642 (tls_shared_gd_to_ie_test_LDADD): New variable.
12643 (tls_shared_gnu2_gd_to_ie_test): New target.
12644 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12645 New targets.
12646 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12647 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12648 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12649 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12650 (tls_shared_gnu2_test): New target.
12651 (tls_test_gnu2_shared.so): New target.
12652 (tls_shared_gnu2_test_SOURCES): New variable.
12653 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12654 (tls_shared_gnu2_test_LDFLAGS): New variable.
12655 (tls_shared_gnu2_test_LDADD): New variable.
12656 * testsuite/Makefile.in: Rebuild.
12657 * testsuite/Makefile.
12658
12659 2008-04-11 Ian Lance Taylor <iant@google.com>
12660
12661 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12662 justsyms.t.
12663 * testsuite/Makefile.in: Rebuild.
12664
12665 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12666 long.
12667 * testsuite/script_test_2.cc (main): Adjust test.
12668
12669 2008-04-11 David S. Miller <davem@davemloft.net>
12670 Ian Lance Taylor <iant@google.com>
12671
12672 * options.h (General_options): Add entries for '-Y' and
12673 '-relax'.
12674 * options.cc (General_options:finalize): If -Y was used, add those
12675 entries to the library path instead of the default "/lib" and
12676 "/usr/lib".
12677
12678 2008-04-11 David S. Miller <davem@davemloft.net>
12679
12680 * testsuite/justsyms.t: Start at 0x100.
12681 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12682 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12683 long.
12684 * testsuite/script_test_2.cc: Adjust string and section length
12685 checks.
12686
12687 2008-04-09 Ian Lance Taylor <iant@google.com>
12688
12689 PR gold/5996
12690 * script-sections.cc (Sections_element::allocate_to_segment): Add
12691 orphan parameter.
12692 (Output_section_definition::allocate_to_segment): Likewise.
12693 (Orphan_output_section::allocate_to_segment): Likewise.
12694 (Script_sections::attach_sections_using_phdrs_clause): Don't
12695 propagate non-PT_LOAD segments to orphan sections.
12696 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12697 readelf rather than objdump.
12698 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12699 .interp section and PT_INTERP segment are the same size.
12700 * testsuite/Makefile.in: Rebuild.
12701
12702 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12703 aliases for symbols defined in the same object.
12704 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12705 (weak_alias_test_SOURCES): New variable.
12706 (weak_alias_test_DEPENDENCIES): New variable.
12707 (weak_alias_test_LDFLAGS): New variable.
12708 (weak_alias_test_LDADD): New variable.
12709 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12710 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12711 (weak_alias_test_3.o): New target.
12712 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12713 * testsuite/weak_alias_test_main.cc: New file.
12714 * testsuite/weak_alias_test_1.cc: New file.
12715 * testsuite/weak_alias_test_2.cc: New file.
12716 * testsuite/weak_alias_test_3.cc: New file.
12717
12718 2008-04-08 Ian Lance Taylor <iant@google.com>
12719
12720 * options.h (class General_options): Add --noinhibit-exec option.
12721 * main.cc (main): Check --noinhibit-exec.
12722
12723 * options.h (class General_options): Define --wrap as a special
12724 option. Add wrap_symbols_ field.
12725 (General_options::any_wrap_symbols): New function.
12726 (General_options::is_wrap_symbol): New function.
12727 * options.cc (General_options::parse_wrap): New function.
12728 (General_options::General_options): Initialize wrap_symbols_.
12729 * symtab.cc (Symbol_table::wrap_symbol): New function.
12730 (Symbol_table::add_from_object): Handle --wrap.
12731 * symtab.h (class Symbol_table): Declare wrap_symbol.
12732 * target.h (Target::wrap_char): New function.
12733 (Target::Target_info): Add wrap_char field.
12734 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12735 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12736 * testsuite/testfile.cc (Target_test::test_target_info):
12737 Likewise.
12738
12739 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12740 there is one.
12741
12742 * layout.h (class Layout): Add added_eh_frame_data_ field.
12743 * layout.cc (Layout::Layout): Initialize new field.
12744 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12745 output section until we find a section we merged successfully.
12746 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12747 that the size be non-zero.
12748
12749 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12750 qualifier.
12751
12752 2008-04-08 Craig Silverstein <csilvers@google.com>
12753
12754 * configure.ac: Export new conditional variable HAVE_ZLIB.
12755 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12756 on HAVE_ZLIB.
12757 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12758 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12759
12760 2008-04-07 Ian Lance Taylor <iant@google.com>
12761
12762 * version.cc (version_string): Set to "1.5".
12763
12764 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12765 Add issued_non_pic_error_ field. Declare check_non_pic.
12766 (Target_x86_64::Scan::check_non_pic): New function.
12767 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12768 (Target_x86_64::Scan::global): Likewise.
12769
12770 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12771 addend parameter. Change caller. Handle merge sections.
12772 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12773 Address to Addend. Don't add in the result of
12774 local_section_offset, pass down the addend and use the returned
12775 value.
12776 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12777 Update declarations of local_section_offset and symbol_value.
12778 * testsuite/two_file_test_1.cc (t18): New function.
12779 * testsuite/two_file_test_2.cc (f18): New function.
12780 * testsuite/two_file_test_main.cc (main): Call t18.
12781 * testsuite/two_file_test.h (t18, f18): Declare.
12782
12783 * configure.ac: Don't test for objdump, c++filt, or readelf.
12784 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12785 conditionals.
12786 (TEST_READELF): New variable.
12787 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12788 (check_PROGRAMS): Add two_file_strip_test.
12789 (two_file_strip_test): New target.
12790 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12791 (two_file_same_shared_strip_test_SOURCES): New variable.
12792 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12793 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12794 (two_file_same_shared_strip_test_LDADD): New variable.
12795 (two_file_shared_strip.so): New target.
12796 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12797 (ver_test_5.syms, ver_test_7.syms): Likewise.
12798 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12799 (strip_test_3.stdout): Use TEST_OBJDUMP.
12800 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12801
12802 2008-04-04 Cary Coutant <ccoutant@google.com>
12803
12804 * symtab.h (Symbol::is_weak_undefined): New function.
12805 (Symbol::is_strong_undefined): New function.
12806 (Symbol::is_absolute): New function.
12807 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12808 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12809 absolute symbols.
12810 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12811 (weak_undef_test): New target.
12812 * testsuite/Makefile.in: Rebuild.
12813 * testsuite/weak_undef_file1.cc: New file.
12814 * testsuite/weak_undef_file2.cc: New file.
12815 * testsuite/weak_undef_test.cc: New file.
12816
12817 2008-04-03 Craig Silverstein <csilvers@google.com>
12818
12819 * compressed_output.h (class Output_compressed_section): Use
12820 unsigned buffer.
12821 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12822 add zlib header.
12823 (zlib_compressed_suffix): Removed.
12824 (Output_compressed_section::set_final_data_size): Use unsigned
12825 buffers.
12826 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12827 Fix linker invocation.
12828 (flagstest_o_specialfile_and_compress_debug_sections):
12829 Likewise.
12830 * testsuite/Makefile.in: Regenerated.
12831
12832 2008-04-02 David S. Miller <davem@davemloft.net>
12833
12834 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12835 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12836
12837 2008-04-02 Craig Silverstein <csilvers@google.com>
12838
12839 * TODO: New file.
12840
12841 2008-04-02 Ian Lance Taylor <iant@google.com>
12842
12843 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12844 parameters. Update for new key type to views_. Change all
12845 callers.
12846 (File_read::read): Adjust for byteshift in returned view.
12847 (File_read::add_view): New function, broken out of
12848 find_and_make_view.
12849 (File_read::make_view): New function, broken out of
12850 find_and_make_view.
12851 (File_read::find_or_make_view): Add offset and aligned
12852 parameters. Rewrite accordingly. Change all callers.
12853 (File_read::get_view): Add offset and aligned parameters. Adjust
12854 for byteshift in return value.
12855 (File_read::get_lasting_view): Likewise.
12856 * fileread.h (class File_read): Update declarations.
12857 (class File_read::View): Add byteshift_ field. Add byteshift to
12858 constructor. Add byteshift method.
12859 * archive.h (Archive::clear_uncached_views): New function.
12860 (Archive::get_view): Add aligned parameter. Change all callers.
12861 * object.h (Object::get_view): Add aligned parameter. Change all
12862 callers.
12863 (Object::get_lasting_view): Likewise.
12864
12865 * fileread.cc (File_read::release): Don't call clear_views if
12866 there are multiple objects.
12867 * fileread.h (File_read::clear_uncached_views): New function.
12868 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12869 on the archive.
12870
12871 2008-03-31 Cary Coutant <ccoutant@google.com>
12872
12873 Add thin archive support.
12874 * archive.cc (Archive::armagt): New const.
12875 (Archive::setup): Remove task parameter and calls to unlock.
12876 (Archive::unlock_nested_archives): New function.
12877 (Archive::read_header): Add nested_off parameter. Change
12878 all callers.
12879 (Archive::interpret_header): Likewise.
12880 (Archive::include_all_members): Change to handle thin
12881 archives.
12882 (Archive::include_member): Likewise.
12883 * archive.h (Archive::Archive): Add new parameters and
12884 initializers.
12885 (Archive::armagt): New const.
12886 (Archive::setup): Remove task parameter.
12887 (Archive::unlock_nested_archives): New function.
12888 (Archive::read_header): Add nested_off parameter.
12889 (Archive::interpret_header): Likewise.
12890 (Archive::Nested_archive_table): New typedef.
12891 (Archive::is_thin_archive_): New field.
12892 (Archive::nested_archives_): New field.
12893 (Archive::options_): New field.
12894 (Archive::dirpath_): New field.
12895 (Archive::task_): New field.
12896 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12897 for thin archives. Pass additional parameters to
12898 Archive::Archive. Unlock the archive file after calling
12899 Archive::setup.
12900
12901 2008-03-29 Ian Lance Taylor <iant@google.com>
12902
12903 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12904 version symbol to be local.
12905 * testsuite/ver_test_4.sh: New file.
12906 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12907 (check_DATA): Add ver_test_4.syms.
12908 (ver_test_4.syms): New target.
12909 * testsuite/Makefile.in: Rebuild.
12910
12911 * output.cc
12912 (Output_section::Input_section_sort_entry::has_priority): New
12913 function.
12914 (Output_section::Input_section_sort_entry::match_file_name): New
12915 function.
12916 (Output_section::Input_section_sort_entry::match_section_name):
12917 Remove.
12918 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12919 Remove.
12920 (Output_section::Input_section_sort_entry::match_section_file):
12921 Remove.
12922 (Output_section::Input_section_sort_compare::operator()): Rewrite
12923 using new Input_section_sort_entry functions. Sort crtbegin and
12924 crtend first. Sort sections with no priority before sections with
12925 a priority.
12926 * testsuite/initpri1.c (d3): Check j != 4.
12927 (cd5): New constructor/destructor function.
12928 (main): Check j != 2.
12929
12930 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12931 new symbol when resolving, don't call set_is_default.
12932 * testsuite/ver_test_7.cc: New file.
12933 * testsuite/ver_test_7.sh: New file.
12934 * testsuite/Makefile.am (ver_test_7.so): New target.
12935 (ver_test_7.o): New target.
12936 (check_SCRIPTS): Add ver_test_7.sh.
12937 (check_DATA): Add ver_test_7.syms.
12938 (ver_test_7.syms): New target.
12939
12940 2008-03-28 Ian Lance Taylor <iant@google.com>
12941
12942 * layout.cc (Layout::layout): If we see an input section with a
12943 name that needs sorting, set the must_sort flag for the output
12944 section.
12945 (Layout::make_output_section): If the name of the output section
12946 indicates that it might require sorting, set the may_sort flag.
12947 * output.h (Output_section::may_sort_attached_input_sections): New
12948 function.
12949 (Output_section::set_may_sort_attached_input_sections): New
12950 function.
12951 (Output_section::must_sort_attached_input_sections): New
12952 function.
12953 (Output_section::set_must_sort_attached_input_sections): New
12954 function.
12955 (class Output_section): Declare Input_section_sort_entry. Define
12956 Input_section_sort_compare. Declare
12957 sort_attached_input_sections. Add new fields:
12958 may_sort_attached_input_sections_,
12959 must_sort_attached_input_sections_,
12960 attached_input_sections_are_sorted_.
12961 * output.cc (Output_section::Output_section): Initialize new
12962 fields.
12963 (Output_section::add_input_section): Add an entry to
12964 input_sections_ if may_sort or must_sort are true.
12965 (Output_section::set_final_data_size): Call
12966 sort_attached_input_sections if necessary.
12967 (Output_section::Input_section_sort_entry): Define new class.
12968 (Output_section::Input_section_sort_compare::operator()): New
12969 function.
12970 (Output_section::sort_attached_input_sections): New function.
12971 * configure.ac: Check whether the compiler supports constructor
12972 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12973 * testsuite/initpri1.c: New file.
12974 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12975 CONSTRUCTOR_PRIORITY.
12976 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12977 (initpri1_LDFLAGS): New variable.
12978 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12979
12980 2008-03-27 Ian Lance Taylor <iant@google.com>
12981
12982 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12983 * testsuite/common_test_1.c: New file.
12984 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12985 (common_test_1_SOURCES): New variable.
12986 (common_test_1_DEPENDENCIES): New variable.
12987 (common_test_1_LDFLAGS): New variable.
12988
12989 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12990 and commons_ correctly when NAME/VERSION does not override
12991 NAME/NULL.
12992 * testsuite/ver_test_6.c: New file.
12993 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12994 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12995 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12996
12997 2008-03-26 Ian Lance Taylor <iant@google.com>
12998
12999 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13000 of an undefined symbol from a version script.
13001 * testsuite/Makefile.am (ver_test_5.so): New target.
13002 (ver_test_5.o): New target.
13003 (check_SCRIPTS): Add ver_test_5.sh.
13004 (check_DATA): Add ver_test_5.syms.
13005 (ver_test_5.syms): New target.
13006 * testsuite/ver_test_5.cc: New file.
13007 * testsuite/ver_test_5.script: New file.
13008 * testsuite/ver_test_5.sh: New file.
13009 * Makefile.in, testsuite/Makefile.in: Rebuild.
13010
13011 PR gold/5986
13012 Fix problems building gold with gcc 4.3.0.
13013 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13014 (gold_error_at_location, gold_warning_at_location): Use it.
13015 * configure.ac: Check whether we can compile and use a template
13016 function with a printf attribute.
13017 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13018 when jumping over bytes.
13019 * object.cc: Instantiate Object::read_section_data.
13020 * debug.h: Include <cstring>
13021 * dwarf_reader.cc: Include <algorithm>
13022 * main.cc: Include <cstring>.
13023 * options.cc: Include <cstring>.
13024 * output.cc: Include <cstring>.
13025 * script.cc: Include <cstring>.
13026 * script.h: Include <string>.
13027 * symtab.cc: Include <cstring> and <algorithm>.
13028 * target-select.cc: Include <cstring>.
13029 * version.cc: Include <string>.
13030 * testsuite/testmain.cc: Include <cstdlib>.
13031 * configure, config.in: Rebuild.
13032
13033 2008-03-25 Ian Lance Taylor <iant@google.com>
13034
13035 * options.cc: Include "../bfd/bfdver.h".
13036 (options::help): Print bug reporting address.
13037
13038 * version.cc (print_version): Adjust output for current value of
13039 BFD_VERSION_STRING.
13040
13041 * NEWS: New file.
13042
13043 * options.cc (options::help): Print list of supported targets.
13044 * target-select.h: Include <vector>.
13045 (class Target_selector): Make machine_, size_, and is_big_endian_
13046 fields const. Add bfd_name_ and instantiated_target_ fields.
13047 (Target_selector::Target_selector): Add bfd_name parameter.
13048 (Target_selector::recognize): Make non-virtual, call
13049 do_recognize.
13050 (Target_selector::recognize_by_name): Make non-virtual, call
13051 do_recognize_by_name.
13052 (Target_selector::supported_names): New function.
13053 (Target_selector::bfd_name): New function.
13054 (Target_selector::do_instantiate_target): New pure virtual
13055 function.
13056 (Target_selector::do_recognize): New virtual function.
13057 (Target_selector::do_recognize_by_name): New virtual function.
13058 (Target_selector::instantiate_target): New private function.
13059 (supported_target_names): Declare.
13060 * target-select.cc (Target_selector::Target_selector): Update for
13061 new parameter and fields.
13062 (select_target_by_name): Check that the name matches before
13063 calling recognize_by_name.
13064 (supported_target_names): New function.
13065 * i386.cc (class Target_selector_i386): Update Target_selector
13066 constructor call. Remove recognize and recognize_by_name. Add
13067 do_instantiate_target.
13068 * x86_64.cc (class Target_selector_x86_64): Likewise.
13069 * testsuite/testfile.cc (class Target_selector_test): Update for
13070 changes to Target_selector.
13071
13072 * README: Rewrite, with some notes on unsupported features.
13073
13074 2008-03-24 Cary Coutant <ccoutant@google.com>
13075
13076 * i386.cc (Target_i386::Got_type): New enum declaration.
13077 (Target_i386::Scan::local): Updated callers of Output_data_got
13078 member functions.
13079 (Target_i386::Scan::global): Likewise.
13080 (Target_i386::Relocate::relocate): Likewise.
13081 (Target_i386::Relocate::relocate_tls): Likewise.
13082 * object.h (Got_offset_list): New class.
13083 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13084 (Sized_relobj::local_got_offset): Likewise.
13085 (Sized_relobj::set_local_got_offset): Likewise.
13086 (Sized_relobj::local_has_tls_got_offset): Removed.
13087 (Sized_relobj::local_tls_got_offset): Removed.
13088 (Sized_relobj::set_local_tls_got_offset): Removed.
13089 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13090 * output.cc (Output_data_got::add_global): Added got_type parameter.
13091 (Output_data_got::add_global_with_rel): Likewise.
13092 (Output_data_got::add_global_with_rela): Likewise.
13093 (Output_data_got::add_global_pair_with_rel): New function.
13094 (Output_data_got::add_global_pair_with_rela): New function.
13095 (Output_data_got::add_local): Added got_type parameter.
13096 (Output_data_got::add_local_with_rel): Likewise.
13097 (Output_data_got::add_local_with_rela): Likewise.
13098 (Output_data_got::add_local_pair_with_rel): New function.
13099 (Output_data_got::add_local_pair_with_rela): New function.
13100 (Output_data_got::add_global_tls): Removed.
13101 (Output_data_got::add_global_tls_with_rel): Removed.
13102 (Output_data_got::add_global_tls_with_rela): Removed.
13103 (Output_data_got::add_local_tls): Removed.
13104 (Output_data_got::add_local_tls_with_rel): Removed.
13105 (Output_data_got::add_local_tls_with_rela): Removed.
13106 * output.h (Output_data_got::add_global): Added got_type parameter.
13107 (Output_data_got::add_global_with_rel): Likewise.
13108 (Output_data_got::add_global_with_rela): Likewise.
13109 (Output_data_got::add_global_pair_with_rel): New function.
13110 (Output_data_got::add_global_pair_with_rela): New function.
13111 (Output_data_got::add_local): Added got_type parameter.
13112 (Output_data_got::add_local_with_rel): Likewise.
13113 (Output_data_got::add_local_with_rela): Likewise.
13114 (Output_data_got::add_local_pair_with_rel): New function.
13115 (Output_data_got::add_local_pair_with_rela): New function.
13116 (Output_data_got::add_global_tls): Removed.
13117 (Output_data_got::add_global_tls_with_rel): Removed.
13118 (Output_data_got::add_global_tls_with_rela): Removed.
13119 (Output_data_got::add_local_tls): Removed.
13120 (Output_data_got::add_local_tls_with_rel): Removed.
13121 (Output_data_got::add_local_tls_with_rela): Removed.
13122 * resolve.cc (Symbol::override_base_with_special): Removed
13123 reference to has_got_offset_ field.
13124 * symtab.cc (Symbol::init_fields): Replaced initialization
13125 of got_offset_ with got_offsets_. Removed initialization
13126 of has_got_offset_
13127 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13128 (Symbol::got_offset): Likewise.
13129 (Symbol::set_got_offset): Likewise.
13130 (Symbol::has_tls_got_offset): Removed.
13131 (Symbol::tls_got_offset): Removed.
13132 (Symbol::set_tls_got_offset): Removed.
13133 (Symbol::got_offset_): Removed.
13134 (Symbol::tls_mod_got_offset_): Removed.
13135 (Symbol::tls_pair_got_offset_): Removed.
13136 (Symbol::got_offsets_): New field.
13137 (Symbol::has_got_offset): Removed.
13138 (Symbol::has_tls_mod_got_offset): Removed.
13139 (Symbol::has_tls_pair_got_offset): Removed.
13140 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13141 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13142 member functions.
13143 (Target_x86_64::Scan::global): Likewise.
13144 (Target_x86_64::Relocate::relocate): Likewise.
13145 (Target_x86_64::Relocate::relocate_tls): Likewise.
13146
13147 2008-03-25 Ben Elliston <bje@au.ibm.com>
13148
13149 * yyscript.y: Fix spelling error in comment.
13150
13151 2008-03-24 Ian Lance Taylor <iant@google.com>
13152
13153 * options.h (class General_options): Define build_id option.
13154 * layout.h (class Layout): Declare write_build_id, create_note,
13155 create_build_id. Add build_id_note_ member.
13156 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13157 "libiberty.h", "md5.h", "sha1.h".
13158 (Layout::Layout): Initialize eh_frame_data_,
13159 eh_frame_hdr_section_, and build_id_note_.
13160 (Layout::finalize): Call create_build_id.
13161 (Layout::create_note): New function, broken out of
13162 Layout::create_gold_note.
13163 (Layout::create_gold_note): Call create_note.
13164 (Layout::create_build_id): New function.
13165 (Layout::write_build_id): New function.
13166 (Close_task_runner::run): Call write_build_id.
13167
13168 * x86_64.cc: Correct license to GPLv3.
13169
13170 2008-03-23 Ian Lance Taylor <iant@google.com>
13171
13172 * options.cc: Include "demangle.h".
13173 (parse_optional_string): New function.
13174 (parse_long_option): Handle takes_optional_argument.
13175 (parse_short_option): Update dash_z initializer. Handle
13176 takes_optional_argument.
13177 (General_options::General_options): Initialize do_demangle_.
13178 (General_options::finalize): Set do_demangle_. Handle demangling
13179 style.
13180 * options.h (parse_optional_string): Declare.
13181 (struct One_option): Add optional_arg field. Update constructor.
13182 Update call constructor calls. Add takes_optional_argument
13183 function.
13184 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13185 (DEFINE_optional_string): Define.
13186 (General_options::demangle): Change from DEFINE_bool to
13187 DEFINE_optional_string.
13188 (General_options::no_demangle): New function.
13189 (General_options::do_demangle): New function.
13190 (General_options::set_do_demangle): New function.
13191 (General_options::execstack_status_): Move definition to end of
13192 class definition.
13193 (General_options::static_): Likewise.
13194 (General_options::do_demangle_): New field.
13195 * object.cc (big_endian>::get_symbol_location_info): Call
13196 Options::do_demangle, not Options::demangle.
13197 * symtab.cc (demangle): Likewise.
13198
13199 2008-03-22 Ian Lance Taylor <iant@google.com>
13200
13201 * gold.h: Include <cstddef> and <sys/types.h>
13202 * options.h: Include <cstring>.
13203
13204 2008-03-21 Ian Lance Taylor <iant@google.com>
13205
13206 * Added source code to GNU binutils.
This page took 0.307182 seconds and 4 git commands to generate.