* object.h (Sized_relobj_file::find_shdr): New function.
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2012-08-11 Alan Modra <amodra@gmail.com>
2
3 * object.h (Sized_relobj_file::find_shdr): New function.
4 (Sized_relobj_file::find_special_sections): New function.
5 * object.cc (Sized_relobj_file::find_shdr): New function.
6 (Sized_relobj_file::find_eh_frame): Use find_shdr.
7 (Sized_relobj_file::find_special_sections): New function, split out..
8 (Sized_relobj_file::do_read_symbols): ..from here.
9 * output.h (Output_data_got::replace_constant): New function.
10 (Output_data_got::num_entries): New function.
11 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
12 (Output_data_got::got_offset): Protected rather than private.
13 (Output_data_got::replace_got_entry): New function.
14 * output.cc (Output_data_got::replace_got_entry): New function.
15 * powerpc.cc (class Powerpc_relobj): New.
16 (class Powerpc_relocate_functions): Delete all psymval variants or
17 convert to value,addend type. Delete pcrela, pcrela_unaligned.
18 Implement _ha functions using corresponding _hi function.
19 (Powerpc_relobj::find_special_sections): New function.
20 (Target_powerpc::do_make_elf_object): New function.
21 (class Output_data_got_powerpc): New.
22 (class Output_data_glink): New.
23 (class Powerpc_scan_relocatable_reloc): New.
24 Many more changes througout file.
25
26 2012-08-09 Nick Clifton <nickc@redhat.com>
27
28 * po/vi.po: Updated Vietnamese translation.
29
30 2012-08-07 Ian Lance Taylor <iant@google.com>
31
32 * layout.cc (Layout::add_target_dynamic_tags): If
33 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
34 plt_rel.
35
36 2012-07-30 Nick Clifton <nickc@redhat.com>
37
38 * po/gold.pot: Updated template.
39 * po/es.po: Updated Spanish translation.
40
41 2012-07-18 Cary Coutant <ccoutant@google.com>
42
43 PR gold/14344
44 * configure.ac: Add check for -gpubnames support.
45 * configure: Regenerate.
46 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
47 support; force -gno-pubnames.
48 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
49 support.
50 (gdb_index_test_4): New test.
51 * testsuite/Makefile.in: Regenerate.
52 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
53 * testsuite/gdb_index_test_2.sh: Likewise.
54 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
55 * testsuite/gdb_index_test_4.sh: New script.
56 * testsuite/gdb_index_test_comm.sh: New script with common code;
57 don't look for space after colon.
58
59 2012-07-16 Sriraman Tallam <tmsriram@google.com>
60
61 * gold.cc (queue_middle_tasks): Update function order only after
62 deferred objects due to plugins are processed.
63
64 2012-07-11 Ian Lance Taylor <iant@google.com>
65
66 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
67 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
68 (Target_arm::scan_reloc_for_stub): Likewise.
69 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
70 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
71 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
72 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
73 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
74
75 2012-07-10 Dodji Seketeli <dodji@redhat.com>
76 Ian Lance Taylor <iant@google.com>
77
78 PR gold/14309
79 * configure.ac: Test whether std::tr1::hash<off_t> works.
80 * gold.h: Add a specialization for std::tr1::hash<off_t> if
81 needed.
82 * output.h (class Output_fill): Add virtual destructor.
83 * configure, config.in: Rebuild.
84
85 2012-06-22 Roland McGrath <mcgrathr@google.com>
86
87 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
88
89 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
90
91 * plugin.cc (Plugin::load): Handle position independent executables.
92
93 2012-06-06 Cary Coutant <ccoutant@google.com>
94
95 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
96 add .debug_macro.
97 (lines_only_debug_sections): Likewise.
98 (gdb_fast_lookup_sections): New static array.
99 (is_gdb_debug_section): Rename formal parameter.
100 (is_lines_only_debug_section): Likewise.
101 (is_gdb_fast_lookup_section): New function.
102 (Layout::include_section): Check for ".zdebug_" prefix; pass
103 section name suffix to is_gdb_debug_section, et al.; check for
104 fast-lookup sections when building .gdb_index.
105 * options.h (--strip-debug-gdb): Update GDB version number.
106
107 2012-06-06 Cary Coutant <ccoutant@google.com>
108
109 * configure.ac: Add check for fallocate.
110 * configure: Regenerate.
111 * config.in: Regenerate.
112
113 * options.h (class General_options): Add --mmap-output-file and
114 --posix-fallocate options.
115 * output.cc: (posix_fallocate): Remove; replace with...
116 (gold_fallocate): New function.
117 (Output_file::map_no_anonymous): Call gold_fallocate.
118 (Output_file::map): Check --mmap-output-file option.
119
120 2012-06-05 Jing Yu <jingyu@google.com>
121
122 * gold.h (textdomain): Add do {} to empty while(0).
123 (bindtextdomain): Likewise.
124
125 2012-06-04 Cary Coutant <ccoutant@google.com>
126
127 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
128 has_dynsym_index.
129
130 2012-05-25 Sriraman Tallam <tmsriram@google.com>
131
132 * symtab.cc (Symbol_table::define_special_symbol):
133 Initialize *poldsym to prevent uninitialized variable errors.
134
135 2012-05-23 Cary Coutant <ccoutant@google.com>
136
137 * layout.cc (Layout::section_name_mapping): Add rules to handle
138 exact match on .data.rel.ro.local or .data.rel.ro.
139 (Layout::output_section_name): Check for exact matches.
140
141 2012-05-23 Cary Coutant <ccoutant@google.com>
142
143 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
144 more carefully.
145
146 2012-05-22 Cary Coutant <ccoutant@google.com>
147
148 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
149 object before exporting symbol.
150
151 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
152
153 * testsuite/tls_test.cc: Include "config.h" first.
154 * testsuite/tls_test_c.c: Likewise.
155
156 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
157 Nick Clifton <nickc@redhat.com>
158
159 PR 14072
160 * configure.in: Add check that sysdep.h has been included before
161 any system header files.
162 * configure: Regenerate.
163 * config.in: Regenerate.
164
165 2012-05-14 Cary Coutant <ccoutant@google.com>
166
167 * layout.cc (Layout::make_output_section): Mark .tdata section
168 as RELRO.
169 * testsuite/relro_test.cc: Add a TLS variable.
170
171 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
172
173 PR gold/14091
174 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
175 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
176 R_X86_64_64.
177
178 2012-05-08 Cary Coutant <ccoutant@google.com>
179
180 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
181 (lines_only_debug_sections): Likewise.
182
183 2012-05-02 Roland McGrath <mcgrathr@google.com>
184
185 * nacl.cc: New file.
186 * nacl.h: New file.
187 * Makefile.am (CCFILES, HFILES): Add them.
188 * Makefile.in: Regenerate.
189 * i386.cc (Output_data_plt_i386_nacl): New class.
190 (Output_data_plt_i386_nacl_exec): New class.
191 (Output_data_plt_i386_nacl_dyn): New class.
192 (Target_i386_nacl): New class.
193 (Target_selector_i386_nacl): New class.
194 (target_selector_i386): Use it instead of Target_selector_i386.
195 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
196 (Target_x86_64_nacl): New class.
197 (Target_selector_x86_64_nacl): New class.
198 (target_selector_x86_64, target_selector_x32): Use it instead of
199 Target_selector_x86_64.
200 * arm.cc (Output_data_plt_arm_nacl): New class.
201 (Target_arm_nacl): New class.
202 (Target_selector_arm_nacl): New class.
203 (target_selector_arm, target_selector_armbe): Use it instead of
204 Target_selector_arm.
205
206 * target-select.cc (select_target): Take new Input_file* and off_t
207 arguments, pass them on to recognize method of selector.
208 * object.cc (make_elf_sized_object): Update caller.
209 * parameters.cc (parameters_force_valid_target): Likewise.
210 * incremental.cc (make_sized_incremental_binary): Likewise.
211 * target-select.h: Update decl.
212 (Target_selector::recognize): Take new Input_file* argument,
213 pass it on to do_recognize.
214 (Target_selector::do_recognize): Take new Input_file* argument.
215 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
216 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
217 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
218 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
219
220 * target.h (Target::Target_info): New members isolate_execinstr
221 and rosegment_gap.
222 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
223 * arm.cc (Target_arm::arm_info): Update initializer.
224 * i386.cc (Target_i386::i386_info): Likewise.
225 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
226 * sparc.cc (Target_sparc::sparc_info): Likewise.
227 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
228 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
229 * layout.cc (Layout::attach_allocated_section_to_segment):
230 Take new const Target* argument. If target->isolate_execinstr(), act
231 like --rosegment.
232 (Layout::find_first_load_seg): Take new const Target* argument;
233 if target->isolate_execinstr(), reject PF_X segments.
234 (Layout::relaxation_loop_body): Update caller.
235 (Layout::set_segment_offsets): If target->isolate_execinstr(),
236 reset file offset to zero when we hit LOAD_SEG, and then do a second
237 loop over the segments before LOAD_SEG to reassign offsets after
238 addresses have been determined. Handle target->rosegment_gap().
239 (Layout::attach_section_to_segment): Take new const Target* argument;
240 pass it to attach_allocated_section_to_segment.
241 (Layout::make_output_section): Update caller.
242 (Layout::attach_sections_to_segments): Take new const Target* argument;
243 pass it to attach_section_to_segment.
244 * gold.cc (queue_middle_tasks): Update caller.
245 * layout.h (Layout): Update method decls with new arguments.
246
247 * arm.cc (Target_arm::Target_arm): Take optional argument for the
248 Target_info pointer to use.
249 (Target_arm::do_make_data_plt): New virtual method.
250 (Target_arm::make_data_plt): New method that calls it.
251 (Target_arm::make_plt_entry): Use it.
252 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
253 for the section alignment.
254 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
255 method.
256 (Output_data_plt_arm::first_plt_entry_offset): Call it.
257 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
258 method.
259 (Output_data_plt_arm::get_plt_entry_size): Call it.
260 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
261 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
262 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
263 method.
264 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
265 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
266 method instead of sizeof(plt_entry).
267 (Output_data_plt_arm::add_entry): Likewise.
268 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
269 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
270 than static method.
271 (Target_arm::plt_entry_size): Likewise.
272 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
273 Move to ...
274 (Output_data_plt_arm_standard): ... here, new class.
275 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
276 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
277 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
278
279 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
280 Take additional argument for the PLT entry size.
281 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
282 Use get_plt_entry_size method rather than plt_entry_size variable.
283 (Output_data_plt_x86_64::reserve_slot): Likewise.
284 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
285 (Output_data_plt_x86_64::add_entry): Likewise.
286 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
287 (Output_data_plt_x86_64::address_for_global): Likewise.
288 (Output_data_plt_x86_64::address_for_local): Likewise.
289 (Output_data_plt_x86_64::set_final_data_size): Likewise.
290 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
291 Make method non-static.
292 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
293 method.
294 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
295 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
296 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
297 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
298 virtual method.
299 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
300 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
301 virtual method.
302 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
303 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
304 virtual method.
305 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
306 (Output_data_plt_x86_64::plt_entry_size)
307 (Output_data_plt_x86_64::first_plt_entry)
308 (Output_data_plt_x86_64::plt_entry)
309 (Output_data_plt_x86_64::tlsdesc_plt_entry)
310 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
311 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
312 (Output_data_plt_x86_64_standard): ... here, new class.
313 (Target_x86_64::Target_x86_64): Take optional argument for the
314 Target_info pointer to use.
315 (Target_x86_64::do_make_data_plt): New virtual method.
316 (Target_x86_64::make_data_plt): New method to call it.
317 (Target_x86_64::init_got_plt_for_update): Use that.
318 Call this->plt_->add_eh_frame method here.
319 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
320 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
321 rather than static method.
322 (Target_x86_64::plt_entry_size): Likewise.
323 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
324 rather than plt_entry_size variable. Move guts of PLT filling to...
325 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
326 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
327 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
328
329 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
330 additional argument for the section alignment.
331 Don't do add_eh_frame_for_plt here.
332 (Output_data_plt_i386::first_plt_entry_offset): Make the method
333 non-static. Use get_plt_entry_size method rather than plt_entry_size
334 variable.
335 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
336 method.
337 (Output_data_plt_i386::get_plt_entry_size): Call it.
338 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
339 (Output_data_plt_i386::add_eh_frame): New method to call it.
340 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
341 method.
342 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
343 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
344 method.
345 (Output_data_plt_i386::fill_plt_entry): New method to call it.
346 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
347 method instead of plt_entry_size.
348 (Output_data_plt_i386::plt_entry_size)
349 (Output_data_plt_i386::plt_eh_frame_fde_size)
350 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
351 (Output_data_plt_i386_standard): ... here, new class.
352 (Output_data_plt_i386_exec): New class.
353 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
354 (Output_data_plt_i386_exec::first_plt_entry): ... here.
355 (Output_data_plt_i386::exec_plt_entry): Move to ...
356 (Output_data_plt_i386_exec::plt_entry): ... here.
357 (Output_data_plt_i386_dyn): New class.
358 (Output_data_plt_i386::first_plt_entry): Move to ...
359 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
360 (Output_data_plt_i386::dyn_plt_entry): Move to ...
361 (Output_data_plt_i386_dyn::plt_entry): ... here.
362 (Target_i386::Target_i386): Take optional argument for the Target_info
363 pointer to use.
364 (Target_i386::do_make_data_plt): New virtual method.
365 (Target_i386::make_data_plt): New method to call it.
366 (Target_i386::make_plt_section): Use that.
367 Call this->plt_->add_eh_frame method here.
368 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
369 rather than plt_entry_size variable.
370 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
371 (Output_data_plt_i386::address_for_local): Likewise.
372 (Output_data_plt_i386::do_write): Likewise.
373 Move guts of PLT filling to...
374 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
375 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
376 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
377 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
378
379 2012-05-01 Cary Coutant <ccoutant@google.com>
380
381 * dwarf_reader.cc (Dwarf_die::read_attributes)
382 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
383 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
384 * reduced_debug_output.cc
385 (Output_reduced_debug_info_section::get_die_end): Remove
386 DW_FORM_GNU_ref_index. Add default case.
387
388 2012-04-26 Mark Wielaard <mjw@redhat.com>
389
390 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
391 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
392 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
393 DW_AT_high_pc as offset from DW_AT_low_pc.
394
395 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
396 * testsuite/Makefile.in: Regenerate.
397 * testsuite/gdb_index_test_3.c: New test source file.
398 * testsuite/gdb_index_test_3.sh: New test source file.
399
400 2012-04-25 Ian Lance Taylor <iant@google.com>
401
402 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
403 pointer.
404 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
405 as a class, not a struct.
406 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
407 (Target_arm::apply_cortex_a8_workaround): Likewise.
408 * gc.h: Declare Reloc_types as a struct, not a class.
409 * object.h: Declare Symbols_data as a struct.
410 * reloc.h: Declare Read_relocs_data as a struct.
411 * target.h: Declare Relocate_info as a struct.
412
413 2012-04-24 David S. Miller <davem@davemloft.net>
414
415 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
416 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
417 and R_SPARC_WPLT30.
418
419 2012-04-24 Cary Coutant <ccoutant@google.com>
420
421 * incremental-dump.cc (find_input_containing_global): Replace
422 magic number with symbolic constant.
423 (dump_incremental_inputs): Update version number.
424 * incremental.cc (Output_section_incremental_inputs): Update version
425 number; import symbolic constants from Incremental_inputs_reader.
426 (Incremental_inputs::create_data_sections): Align relocations
427 section correctly for 64-bit targets.
428 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
429 constants; add padding.
430 (Output_section_incremental_inputs::write_header): Add assert for
431 header_size.
432 (Output_section_incremental_inputs::write_input_files): Add assert
433 for input_entry_size.
434 (Output_section_incremental_inputs::write_info_blocks): Add padding;
435 add assert for object_info_size, input_section_entry_size,
436 global_sym_entry_size.
437 * incremental.h (Incremental_inputs_reader): Add symbolic constants
438 for data structure sizes; use them.
439 (Incremental_input_entry_reader): Import symbolic constants from
440 Incremental_inputs_reader; use them.
441
442 2012-04-23 David S. Miller <davem@davemloft.net>
443
444 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
445 and elf_flags_set_.
446 (Target_sparc::Target_sparc): Initialize new fields.
447 (Target_sparc::do_make_elf_object): New function.
448 (Target_sparc::do_adjust_elf_header): New function.
449
450 2012-04-23 Cary Coutant <ccoutant@google.com>
451
452 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
453 CU range table of gdb index.
454
455 2012-04-20 David S. Miller <davem@davemloft.net>
456
457 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
458 instead of false.
459
460 2012-04-16 David S. Miller <davem@davemloft.net>
461
462 * sparc.cc (Target_sparc::got_address): New function.
463 (Sparc_relocate_functions::gdop_hix22): New function.
464 (Sparc_relocate_functions::gdop_lox10): New function.
465 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
466 relocs.
467 (Target_sparc::Scan::local): Likewise if the global symbol is not
468 preemptible and is not IFUNC.
469 (Target_sparc::Relocate::relocate): Perform GOTDATA code
470 transformations for local and non-preemptible non-IFUNC global
471 symbols.
472
473 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
474 writing out 64-bit part of ranges.
475
476 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
477 -fpic and -fpie respectively.
478 * Makefile.in: Regenerate.
479
480 * sparc.cc (class Target_sparc): Add rela_ifunc_.
481 (Target_sparc::Target_sparc): Initialize new field.
482 (Target_sparc::do_plt_section_for_global): New function.
483 (Target_sparc::do_plt_section_for_local): New function.
484 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
485 (Target_sparc::make_plt_section): New function, broken out of
486 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
487 (Target_sparc::make_plt_entry): Call make_plt_section.
488 (Target_sparc::make_local_ifunc_plt_entry): New function.
489 (Target_sparc::rela_ifunc_section): New function.
490 (Target_sparc::plt_section): Remove const.
491 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
492 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
493 and ifunc_count_ fields.
494 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
495 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
496 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
497 (Output_data_plt_sparc::rela_ifunc): New function.
498 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
499 (Output_data_plt_sparc::has_ifunc_section): New function.
500 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
501 (Output_data_plt_sparc::address_for_global): New function.
502 (Output_data_plt_sparc::address_for_local): New function.
503 (Output_data_plt_sparc::plt_index_to_offset): New function.
504 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
505 and entry_count.
506 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
507 entry_count.
508 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
509 R_SPARC_JMP_IREL to switch.
510 (Target_sparc::Scan::check_non_pic): Likewise.
511 (Target_sparc::Scan::local): Handle IFUNC symbols.
512 (Target_sparc::Scan::local): Likewise.
513 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
514 and plt_address_for_local.
515 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
516 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
517
518 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
519 (class Output_data_reloc): Adjust calls to Output_reloc_type.
520 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
521 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
522 global relocs too.
523 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
524 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
525 calls.
526 * sparc.cc (Target_sparc::Scan::global): Likewise.
527 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
528
529 2012-04-16 Cary Coutant <ccoutant@google.com>
530
531 * archive.cc (Library_base::should_include_member): Check for
532 --export-dynamic-symbol.
533 * options.h (class General_options): Add --export-dynamic-symbol.
534 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
535 --export-dynamic-symbol.
536 (Symbol_table::gc_mark_undef_symbols): Likewise.
537 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
538
539 2012-04-12 David S. Miller <davem@davemloft.net>
540
541 * sparc.cc (Reloc::wdisp10): New relocation method.
542 (Reloc::h34): Likewise.
543 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
544 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
545 R_SPARC_WDISP10.
546 (Target_sparc::Scan::local): Likewise.
547 (Target_sparc::Scan::global): Likewise.
548 (Target_sparc::Relocate::relocate): Likewise.
549
550 2012-04-09 Cary Coutant <ccoutant@google.com>
551
552 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
553 low_pc == 0.
554
555 2012-04-06 Ian Lance Taylor <iant@google.com>
556
557 * timer.cc: #include <unistd.h>.
558
559 2012-04-06 Roland McGrath <mcgrathr@google.com>
560
561 * configure.in (AC_CHECK_HEADERS): Add locale.h.
562 * config.in: Regenerate.
563 * configure: Regenerate.
564
565 2012-04-05 Nick Clifton <nickc@redhat.com>
566
567 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
568 (AM_LC_MESSAGES): Add.
569 * aclocal.m4: Regenerate.
570 * config.in: Regenerate.
571 * configure: Regenerate.
572
573 2012-03-21 Cary Coutant <ccoutant@google.com>
574
575 * Makefile.am: Add gdb-index.cc, gdb-index.h.
576 * Makefile.in: Regenerate.
577 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
578 (Sized_elf_reloc_mapper::symbol_section): New function.
579 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
580 (make_elf_reloc_mapper): New function.
581 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
582 (Dwarf_abbrev_table::do_read_abbrevs): New function.
583 (Dwarf_abbrev_table::do_get_abbrev): New function.
584 (Dwarf_ranges_table::read_ranges_table): New function.
585 (Dwarf_ranges_table::read_range_list): New function.
586 (Dwarf_pubnames_table::read_section): New function.
587 (Dwarf_pubnames_table::read_header): New function.
588 (Dwarf_pubnames_table::next_name): New function.
589 (Dwarf_die::Dwarf_die): New function.
590 (Dwarf_die::read_attributes): New function.
591 (Dwarf_die::skip_attributes): New function.
592 (Dwarf_die::set_name): New function.
593 (Dwarf_die::set_linkage_name): New function.
594 (Dwarf_die::attribute): New function.
595 (Dwarf_die::string_attribute): New function.
596 (Dwarf_die::int_attribute): New function.
597 (Dwarf_die::uint_attribute): New function.
598 (Dwarf_die::ref_attribute): New function.
599 (Dwarf_die::child_offset): New function.
600 (Dwarf_die::sibling_offset): New function.
601 (Dwarf_info_reader::check_buffer): New function.
602 (Dwarf_info_reader::parse): New function.
603 (Dwarf_info_reader::do_parse): New function.
604 (Dwarf_info_reader::do_read_string_table): New function.
605 (Dwarf_info_reader::lookup_reloc): New function.
606 (Dwarf_info_reader::get_string): New function.
607 (Dwarf_info_reader::visit_compilation_unit): New function.
608 (Dwarf_info_reader::visit_type_unit): New function.
609 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
610 Sized_elf_reloc_mapper.
611 (Sized_dwarf_line_info::symbol_section): Remove function.
612 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
613 (Sized_dwarf_line_info::read_line_mappings): Remove object
614 parameter, adjust callers.
615 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
616 * dwarf_reader.h: Include <sys/types.h>.
617 (class Track_relocs): Remove forward declaration.
618 (class Elf_reloc_mapper): New class.
619 (class Sized_elf_reloc_mapper): New class.
620 (class Dwarf_abbrev_table): New class.
621 (class Dwarf_range_list): New class.
622 (class Dwarf_ranges_table): New class.
623 (class Dwarf_pubnames_table): New class.
624 (class Dwarf_die): New class.
625 (class Dwarf_info_reader): New class.
626 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
627 (Sized_dwarf_line_info::symbol_section): Remove member function.
628 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
629 base class.
630 * gdb-index.cc: New source file.
631 * gdb-index.h: New source file.
632 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
633 and .debug_types sections, call Layout::add_to_gdb_index.
634 (Sized_relobj_incr::do_section_name): Implement.
635 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
636 return type; Implement.
637 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
638 return type.
639 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
640 parameter list and return type.
641 (Sized_incr_dynobj::do_section_contents): Likewise.
642 * layout.cc: Include gdb-index.h.
643 (Layout::Layout): Initialize gdb_index_data_.
644 (Layout::init_fixed_output_section): Check for .gdb_index section.
645 (Layout::add_to_gdb_index): New function. Instantiate.
646 * layout.h: Add forward declaration for class Gdb_index.
647 (Layout::add_to_gdb_index): New member function.
648 (Layout::gdb_index_data_): New data member.
649 * main.cc: Include gdb-index.h.
650 (main): Print statistics for gdb index.
651 * object.cc (Object::section_contents): Move code into
652 do_section_contents.
653 (need_decompressed_section): Check for sections needed when building
654 gdb index.
655 (build_compressed_section_map): Likewise.
656 (Sized_relobj_file::do_read_symbols): Need local symbols when building
657 gdb index.
658 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
659 sections; call Layout::add_to_gdb_index.
660 (Sized_relobj_file::do_decompressed_section_contents): Call
661 do_section_contents directly.
662 * object.h (Object::do_section_contents): Adjust parameter list and
663 return type.
664 (Object::do_decompressed_section_contents): Call do_section_contents
665 directly.
666 (Sized_relobj_file::do_section_contents): Adjust parameter list and
667 return type.
668 * options.h (class General_options): Add --gdb-index option.
669 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
670 list and return type.
671 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
672 * reloc.h (Track_relocs::checkpoint): New function.
673 (Track_relocs::reset): New function.
674
675 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
676 New test cases.
677 * testsuite/Makefile.in: Regenerate.
678 * testsuite/gdb_index_test.cc: New test source file.
679 * testsuite/gdb_index_test_1.sh: New test source file.
680 * testsuite/gdb_index_test_2.sh: New test source file.
681
682 2012-03-19 Doug Kwan <dougkwan@google.com>
683
684 * arm.cc (Target_arm::do_define_standard_symbols): New method.
685 (Target_arm::do_finalize_sections): Remove code which defines
686 __exidx_start and __exidx_end. Make symbol table parameter
687 anonymous as it is not used.
688 * gold.cc (queue_middle_tasks): Call target hook to define any
689 target-specific symbols.
690 * target.h (Target::define_standard_symbols): New method.
691 (Target::do_define_standard_symbols): Same.
692 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
693 * testsuite/Makefile.in: Regenerate.
694 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
695 and __exidx_end.
696 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
697 relocations are generated for __exidx_start and __exidx_end.
698
699 2012-03-16 Doug Kwan <dougkwan@google.com>
700
701 * testsuite/Makefile.am: Disable test initpri3b.
702 * testsuite/Makefile.in: Regenerate.
703
704 2012-03-15 Doug Kwan <dougkwan@google.com>
705
706 * arm.cc (Target_arm::got_section): Make .got section read-only
707 if -z now is given.
708
709 2012-03-15 Ian Lance Taylor <iant@google.com>
710
711 PR gold/13850
712 * layout.cc (Layout::make_output_section): Correctly mark
713 SHT_INIT_ARRAY, et. al., as relro.
714
715 2012-03-14 Doug Kwan <dougkwan@google.com>
716
717 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
718 dynamic relocations for protected symbols in shared objects.
719
720 2012-03-13 Ian Lance Taylor <iant@google.com>
721
722 * resolve.cc (Symbol_table::resolve): When merging common symbols,
723 keep the larger alignment.
724
725 2012-03-12 Cary Coutant <ccoutant@google.com>
726
727 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
728 handling of DW_LNE_define_file.
729
730 2012-03-12 Cary Coutant <ccoutant@google.com>
731
732 * reduced_debug_output.cc
733 (Output_reduced_debug_info_section::get_die_end): Add new FORM
734 codes to switch.
735
736 2012-02-29 Cary Coutant <ccoutant@google.com>
737
738 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
739
740 2012-02-29 Cary Coutant <ccoutant@google.com>
741
742 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
743 Call Object::decompressed_section_contents.
744 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
745 New dtor.
746 (Sized_dwarf_line_info::buffer_start_): New data member.
747 * merge.cc (Output_merge_data::do_add_input_section): Call
748 Object::decompressed_section_contents.
749 (Output_merge_string::do_add_input_section): Likewise.
750 * object.cc (need_decompressed_section): New function.
751 (build_compressed_section_map): Decompress sections needed later.
752 (Sized_relobj_file::do_decompressed_section_contents): New function.
753 (Sized_relobj_file::do_discard_decompressed_sections): New function.
754 * object.h (Object::decompressed_section_contents): New function.
755 (Object::discard_decompressed_sections): New function.
756 (Object::do_decompressed_section_contents): New function.
757 (Object::do_discard_decompressed_sections): New function.
758 (Compressed_section_info): New type.
759 (Compressed_section_map): Include decompressed section contents.
760 (Sized_relobj_file::do_decompressed_section_contents): New function.
761 (Sized_relobj_file::do_discard_decompressed_sections): New function.
762
763 2012-02-16 Cary Coutant <ccoutant@google.com>
764
765 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
766 * testsuite/Makefile.in: Regenerate.
767
768 2012-02-14 Cary Coutant <ccoutant@google.com>
769
770 * options.cc (General_options::finalize): Disallow -pie and -static.
771
772 2012-02-03 Doug Kwan <dougkwan@google.com>
773
774 * arm.cc (Arm_relocate_functions::abs8,
775 Arm_relocate_functions::abs16): Use
776 Bits::has_signed_unsigned_overflow32.
777 (Arm_relocate_functions::thm_abs8): Correct range of
778 overflow check.
779 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
780 in assertions.
781
782 2012-02-02 Doug Kwan <dougkwan@google.com>
783
784 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
785 position independent outputs, not just shared objects.
786
787 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
788
789 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
790 * configure: Regenerated.
791
792 2012-01-27 Ian Lance Taylor <iant@google.com>
793
794 * reloc.h (Bits): New class with static functions, copied from
795 namespace utils in arm.cc.
796 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
797 instead.
798
799 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
800
801 * incremental.cc (write_info_blocks): Correct relocation offset.
802
803 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
804
805 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
806 (Relocate::tls_gd_to_le): Likewise.
807
808 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
809
810 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
811
812 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
813
814 * configure.ac: Check if -mcmodel=medium works.
815 * configure: Regenerated.
816
817 2012-01-24 Cary Coutant <ccoutant@google.com>
818
819 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
820 definition and ...
821 (read_unsigned_LEB_128_x): ... this new function.
822 (read_signed_LEB_128): Replaced with inline definition and ...
823 (read_signed_LEB_128_x): ... this new function.
824 * int_encoding.h (read_unsigned_LEB_128_x): New function.
825 (read_unsigned_LEB_128): Add inline definition.
826 (read_signed_LEB_128_x): New function.
827 (read_signed_LEB_128): Add inline definition.
828 * testsuite/Makefile.am (leb128_unittest): New unit test.
829 * testsuite/Makefile.in: Regenerate.
830 * testsuite/leb128_unittest.cc: New unit test.
831
832 2012-01-23 Ian Lance Taylor <iant@google.com>
833
834 PR gold/13617
835 * i386.cc (Target_i386::do_code_fill): When using a jmp
836 instruction, pad with nop instructions.
837 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
838
839 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
840
841 * x86_64.cc (gc_process_relocs): Add typename on types used in
842 template.
843 (scan_relocs): Likewise.
844 (relocate_section): Likewise.
845 (apply_relocation): Likewise.
846
847 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
848
849 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
850 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
851 under x32.
852
853 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
854
855 * x86_64.cc: Initial support for x32.
856
857 2012-01-03 Cary Coutant <ccoutant@google.com>
858
859 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
860 Use abstract base class for GOT.
861 * gold/output.h (class Output_data_got_base): New abstract base class.
862 (class Output_data_got): Derive from new base class, adjust ctors.
863 (Output_data_got::reserve_slot): Make virtual; rename to
864 do_reserve_slot; Adjust callers.
865 * gold/target.h (Sized_target::init_got_plt_for_update): Return
866 pointer to abstract base class.
867 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
868
869 2011-12-18 Ian Lance Taylor <iant@google.com>
870
871 * object.h (Relobj::local_symbol_value): New function.
872 (Relobj::local_plt_offset): New function.
873 (Relobj::local_has_got_offset): New function.
874 (Relobj::local_got_offset): New function.
875 (Relobj::set_local_got_offset): New function.
876 (Relobj::do_local_symbol_value): New pure virtual function.
877 (Relobj::do_local_plt_offset): Likewise.
878 (Relobj::do_local_has_got_offset): Likewise.
879 (Relobj::do_local_got_offset): Likewise.
880 (Relobj::do_set_local_got_offset): Likewise.
881 (Sized_relobj::do_local_has_got_offset): Rename from
882 local_has_got_offset.
883 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
884 (Sized_relobj::do_set_local_got_offset): Rename from
885 set_local_got_offset.
886 (Sized_relobj_file::do_local_plt_offset): Rename from
887 local_plt_offset.
888 (Sized_relobj_file::do_local_symbol_value): New function.
889 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
890 local_plt_offset.
891 * output.cc (Output_data_got::Got_entry::write): Change object to
892 Relobj. Use local_symbol_value.
893 (Output_data_got::add_global_with_rel): Change rel_dyn to
894 Output_data_reloc_generic*. Use add_global_generic.
895 (Output_data_got::add_global_with_rela): Remove. Change all
896 callers to use add_global_with_rel.
897 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
898 Output_data_reloc_generic*. Use add_global_generic.
899 (Output_data_got::add_global_pair_with_rela): Remove. Change all
900 callers to use add_global_pair_with_rel.
901 (Output_data_got::add_local): Change object to Relobj*.
902 (Output_data_got::add_local_plt): Likewise.
903 (Output_data_got::add_local_with_rel): Change object to Relobj*,
904 change rel_dyn to Output_data_reloc_generic*. Use
905 add_local_generic.
906 (Output_data_got::add_local_with_rela): Remove. Change all
907 callers to use all_local_with_rel.
908 (Output_data_got::add_local_pair_with_rel): Change object to
909 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
910 add_output_section_generic.
911 (Output_data_got::add_local_pair_with_rela): Remove. Change all
912 callers to use add_local_pair_with_rel.
913 (Output_data_got::reserve_local): Change object to Relobj*.
914 * output.h: (class Output_data_reloc_generic): Add pure virtual
915 declarations for add_global_generic, add_local_generic,
916 add_output_section_generic.
917 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
918 functions for Output_data_reloc_generic. Update declarations for
919 changes listed in output.cc.
920 (class Output_data_got): Change template parameter to got_size.
921 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
922 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
923 function.
924 (Sized_relobj_incr::do_local_plt_offset): New function.
925 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
926 add_global_generic.
927
928 2011-12-17 Cary Coutant <ccoutant@google.com>
929
930 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
931 * resolve.cc (Symbol_table::resolve): Likewise.
932 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
933 arrays.
934 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
935
936 2011-12-16 Ian Lance Taylor <iant@google.com>
937
938 * output.h (Output_data_reloc_generic::add): Only call
939 add_dynamic_reloc if this is a dynamic reloc section.
940
941 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
942
943 PR gold/13505
944 * target-reloc.h (apply_relocation): Replace <64, false> with
945 <size, big_endian>.
946
947 2011-11-25 Nick Clifton <nickc@redhat.com>
948
949 * po/it.po: New Italian translation.
950
951 2011-11-17 Sterling Augustine <saugustine@google.com>
952
953 * script.cc (script_include_directive): Implement.
954 (read_script_file): New local variables name and search_path. Update
955 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
956 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
957 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
958
959 2011-11-11 Sterling Augustine <saugustine@google.com>
960
961 * yyscript.y (section_cmd): Add support for INCLUDE directive.
962 (file_or_sections_cmd): Likewise.
963
964 2011-11-11 Doug Kwan <dougkwan@google.com>
965
966 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
967 if --just-symbols is given.
968
969 2011-11-10 Doug Kwan <dougkwan@google.com>
970
971 PR gold/13362
972 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
973 when processing data relocs.
974 * reloc.h (Relocate_functions::rel_unaligned): New method.
975 (Relocate_functions::pcrel_unaligned): Ditto.
976 (Relocate_functions::rel32_unaligned): Ditto.
977 (Relocate_functions::pcrel32_unaligned): Ditto.
978
979 2011-11-09 Doug Kwan <dougkwan@google.com>
980
981 PR gold/13362
982 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
983 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
984 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
985 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
986 (Relocate_functions::rel_unaligned): New.
987 (Relocate_functions::rel32_unaligned): New.
988 * target-reloc.h (relocate_for_relocatable): Add code to handle
989 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
990 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
991 arm_unaligned_reloc_r): New targets.
992 * testsuite/Makefile.in: Regenerate.
993 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
994 linking.
995
996 2011-11-02 Ian Lance Taylor <iant@google.com>
997
998 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
999 NATIVE_LINKER.
1000 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1001 * options.cc (General_options::finalize): Use library search path
1002 from configure script if specified. If not native and no sysroot,
1003 only search TOOLLIBDIR.
1004 * options.h (Search_directory::Search_directory): Change name to
1005 const std::string&.
1006 (General_options::add_to_library_path_with_sysroot): Change arg to
1007 const std::string&.
1008 * configure, Makefile.in, config.in: Rebuild.
1009
1010 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1011
1012 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1013 we are working around the ARM1176 Erratum.
1014 * options.h (General_options::fix_arm1176): Add option.
1015 * testsuite/Makefile.am: Add testcases, and keep current ones
1016 working.
1017 * testsuite/Makefile.in: Regenerate.
1018 * testsuite/arm_fix_1176.s: New file.
1019 * testsuite/arm_fix_1176.sh: Likewise.
1020
1021 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1022
1023 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1024 may_use_blx_.
1025 (Target_arm::may_use_blx): Remove method.
1026 (Target_arm::set_may_use_blx): Likewise.
1027 (Target_arm::may_use_v4t_interworking): New method.
1028 (Target_arm::may_use_v5t_interworking): Likewise.
1029 (Target_arm::may_use_blx_): Remove member variable.
1030 (Arm_relocate_functions::arm_branch_common): Check for v5T
1031 interworking.
1032 (Arm_relocate_functions::thumb_branch_common): Likewise.
1033 (Reloc_stub::stub_type_for_reloc): Likewise.
1034 (Target_arm::do_finalize_sections): Correct interworking checks.
1035 * testsuite/Makefile.am: Add new tests.
1036 * testsuite/Makefile.in: Regenerate.
1037 * testsuite/arm_farcall_arm_arm.s: New test.
1038 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1039 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1040 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1041 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1042 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1043 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1044 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1045
1046 2011-10-31 Cary Coutant <ccoutant@google.com>
1047
1048 PR gold/13023
1049 * expression.cc (Expression::eval_with_dot): Add
1050 is_section_dot_assignment parameter.
1051 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1052 absolute and assigning to dot within a section.
1053 * script-sections.cc
1054 (Output_section_element_assignment::set_section_addresses): Pass
1055 dot_section to set_if_absolute.
1056 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1057 as is_section_dot_assignment flag to eval_with_dot.
1058 (Output_section_element_dot_assignment::set_section_addresses):
1059 Likewise.
1060 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1061 parameter. Also set value if relative to dot_section; set the
1062 symbol's output_section.
1063 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1064 parameter. Adjust all callers.
1065 (Expression::eval_maybe_dot): Likewise.
1066 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1067 Adjust all callers.
1068 * testsuite/script_test_2.t: Test assignment of an absolute value
1069 to dot within an output section element.
1070
1071 2011-10-31 Cary Coutant <ccoutant@google.com>
1072
1073 * options.h (class General_options): Add --[no-]gnu-unique options.
1074 * symtab.cc (Symbol_table::sized_write_globals): Convert
1075 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1076
1077 2011-10-31 Cary Coutant <ccoutant@google.com>
1078
1079 PR gold/13359
1080 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1081 unnecessary assertion.
1082 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1083
1084 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1085
1086 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1087 gc_mark_symbol.
1088 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1089 gc_mark_symbol.
1090 Change to just keep the section associated with symbol.
1091 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1092 they are externally visible and --export-dynamic is turned on.
1093 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1094
1095 2011-10-19 Ian Lance Taylor <iant@google.com>
1096
1097 PR gold/13163
1098 * script-sections.cc
1099 (Output_section_element_dot_assignment::needs_output_section): New
1100 function.
1101
1102 2011-10-19 Ian Lance Taylor <iant@google.com>
1103
1104 PR gold/13204
1105 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1106 --section-start option was seen.
1107 * options.h (General_options::any_section_start): New function.
1108
1109 2011-10-18 David S. Miller <davem@davemloft.net>
1110
1111 PR binutils/13301
1112 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1113 member to track relocation locations that have moved during TLS
1114 reloc optimizations.
1115 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1116 (Target_sparc::Relocate::relocate): Adjust view down by 4
1117 bytes if it matches reloc_adjust_addr_.
1118 (Target_sparc::Relocate::relocate_tls): Always move the
1119 __tls_get_addr call delay slot instruction forward 4 bytes when
1120 performing relaxation.
1121
1122 2011-10-18 Cary Coutant <ccoutant@google.com>
1123
1124 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1125 (Output_file::map_no_anonymous): Check for non-zero
1126 return code from posix_fallocate.
1127
1128 2011-10-17 Cary Coutant <ccoutant@google.com>
1129
1130 PR gold/13245
1131 * plugin.cc (is_visible_from_outside): Check for symbols
1132 referenced from dynamic objects.
1133 * resolve.cc (Symbol_table::resolve): Don't count references
1134 from dynamic objects as references from real ELF files.
1135 * testsuite/plugin_test_2.sh: Adjust expected result.
1136
1137 2011-10-17 Cary Coutant <ccoutant@google.com>
1138
1139 * gold.cc: Include timer.h.
1140 (queue_middle_tasks): Stamp time.
1141 (queue_final_tasks): Likewise.
1142 * main.cc (main): Store timer in parameters. Print timers
1143 for each pass.
1144 * parameters.cc (Parameters::Parameters): Initialize timer_.
1145 (Parameters::set_timer): New function.
1146 (set_parameters_timer): New function.
1147 * parameters.h (Parameters::set_timer): New function.
1148 (Parameters::timer): New function.
1149 (Parameters::timer_): New data member.
1150 (set_parameters_timer): New function.
1151 * timer.cc (Timer::stamp): New function.
1152 (Timer::get_pass_time): New function.
1153 * timer.h (Timer::stamp): New function.
1154 (Timer::get_pass_time): New function.
1155 (Timer::pass_times_): New data member.
1156
1157 2011-10-17 Cary Coutant <ccoutant@google.com>
1158
1159 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1160 task for members of lib groups.
1161
1162 2011-10-17 Cary Coutant <ccoutant@google.com>
1163
1164 PR gold/13288
1165 * fileread.cc (File_read::find_view): Add assert.
1166 (File_read::make_view): Move bounds check (replace with assert)...
1167 (File_read::find_or_make_view): ... to here.
1168
1169 2011-10-12 Cary Coutant <ccoutant@google.com>
1170
1171 * output.cc (Output_file::open_base_file): Handle case where
1172 ::read returns less than requested size.
1173
1174 2011-10-10 Cary Coutant <ccoutant@google.com>
1175
1176 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1177 Initialize defined_count_.
1178 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1179 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1180 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1181 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1182 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1183 * incremental.h (Sized_relobj_incr::defined_count_): New data
1184 member.
1185 (Sized_incr_dynobj::defined_count_): New data member.
1186 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1187 Return zeroes instead of internal error.
1188
1189 2011-10-10 Cary Coutant <ccoutant@google.com>
1190
1191 PR gold/13249
1192 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1193 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1194 * output.h (class Output_reloc): Add use_plt_offset flag.
1195 (Output_reloc::type_): Adjust size of bit field.
1196 (Output_reloc::use_plt_offset_): New bit field.
1197 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1198 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1199 flag. Adjust all callers.
1200 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1201 creating RELATIVE relocations.
1202
1203 2011-10-10 Nick Clifton <nickc@redhat.com>
1204
1205 * po/es.po: Updated Spanish translation.
1206 * po/fi.po: Updated Finnish translation.
1207
1208 2011-10-03 Diego Novillo <dnovillo@google.com>
1209
1210 * options.cc (parse_uint): Fix dereference of RETVAL.
1211
1212 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1213
1214 * layout.h (section_order_map_): New member.
1215 (get_section_order_map): New member function.
1216 * output.cc (Output_section::add_input_section): Check for patterns
1217 only when --section-ordering-file is specified.
1218 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1219 output_sections have been formed.
1220 * layout.cc (Layout_Layout): Initialize section_order_map_.
1221 * plugin.cc (update_section_order): Store order in order_map. Do not
1222 update the order.
1223 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1224 * testsuite/Makefile.in: Regenerate.
1225 * testsuite/plugin_section_order.c: New file.
1226 * testsuite/plugin_final_layout.cc: New file.
1227 * testsuite/plugin_final_layout.sh: New file.
1228
1229 2011-09-29 Cary Coutant <ccoutant@google.com>
1230
1231 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1232 Check for NULL.
1233 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1234 symbols during incremental update.
1235 (Symbol_table::add_from_dynobj): Likewise.
1236
1237 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1238 Ian Lance Taylor <iant@google.com>
1239
1240 * symtab.cc (Symbol_table::define_special_symbol): Always
1241 canonicalize version string.
1242
1243 2011-09-26 Cary Coutant <ccoutant@google.com>
1244
1245 * gold.cc (queue_initial_tasks): Move option checks ...
1246 * options.cc (General_options::finalize): ... to here. Disable
1247 some options; make others fatal.
1248
1249 2011-09-26 Cary Coutant <ccoutant@google.com>
1250
1251 gcc PR lto/47247
1252 * plugin.cc (get_symbols_v2): New function.
1253 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1254 (is_referenced_from_outside): New function.
1255 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1256 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1257 (get_symbols): Pass version parameter.
1258 (get_symbols_v2): New function.
1259 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1260 parameter.
1261 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1262 (onload): Add LDPT_GET_SYMBOLS_V2.
1263 (all_symbols_read_hook): Use get_symbols_v2; check for
1264 LDPR_PREVAILING_DEF_IRONLY_EXP.
1265 * testsuite/plugin_test_3.sh: Update expected results.
1266
1267 2011-09-23 Simon Baldwin <simonb@google.com>
1268
1269 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1270 configuration options.
1271 * configure: Regenerate.
1272 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1273 * Makefile.in: Regenerate.
1274 * testsuite/Makefile.in: Regenerate.
1275
1276 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1277
1278 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1279
1280 2011-09-19 Cary Coutant <ccoutant@google.com>
1281
1282 * incremental.cc (can_incremental_update): Fix typo in comment.
1283 * incremental.h (can_incremental_update): Likewise.
1284
1285 2011-09-18 Cary Coutant <ccoutant@google.com>
1286
1287 * incremental.cc (can_incremental_update): New function.
1288 * incremental.h (can_incremental_update): New function.
1289 * layout.cc (Layout::init_fixed_output_section): Call it.
1290 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1291 * object.cc (Sized_relobj_file::do_layout): Call
1292 can_incremental_update.
1293
1294 2011-09-13 Cary Coutant <ccoutant@google.com>
1295
1296 * configure.ac: Check for glibc support for gnu_indirect_function
1297 support with static linking, setting automake conditional
1298 IFUNC_STATIC.
1299 * Makefile.in: Regenerate.
1300 * configure: Regenerate.
1301
1302 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1303 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1304 for IFUNC_STATIC.
1305 * testsuite/Makefile.in: Regenerate.
1306
1307 2011-09-13 Cary Coutant <ccoutant@google.com>
1308
1309 * incremental.cc (Sized_relobj_incr::do_layout): Call
1310 report_comdat_group for kept comdat sections.
1311 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1312 * testsuite/Makefile.in: Regenerate.
1313 * testsuite/incr_comdat_test_1.cc: New source file.
1314 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1315 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1316 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1317
1318 2011-09-13 Ian Lance Taylor <iant@google.com>
1319
1320 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1321 variable external_symbols_offset.
1322
1323 2011-09-12 Ian Lance Taylor <iant@google.com>
1324
1325 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1326 triggered if object has no symbols.
1327
1328 2011-09-09 David S. Miller <davem@davemloft.net>
1329
1330 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1331 (Output_fill_debug_line::do_write): Likewise.
1332
1333 2011-08-29 Cary Coutant <ccoutant@google.com>
1334
1335 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1336 casts to match formatting specs.
1337 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1338
1339 2011-08-26 Cary Coutant <ccoutant@google.com>
1340
1341 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1342 remaining hole size when allocating.
1343 (Layout::make_output_section): Set fill methods for debug sections.
1344 * layout.h (Free_list::Free_list_node): Move from private to
1345 public.
1346 (Free_list::set_min_hole_size): New function.
1347 (Free_list::begin, Free_list::end): New functions.
1348 (Free_list::min_hole_): New data member.
1349 * output.cc: Include dwarf.h.
1350 (Output_fill_debug_info::do_minimum_hole_size): New function.
1351 (Output_fill_debug_info::do_write): New function.
1352 (Output_fill_debug_line::do_minimum_hole_size): New function.
1353 (Output_fill_debug_line::do_write): New function.
1354 (Output_section::Output_section): Initialize new data member.
1355 (Output_section::set_final_data_size): Ensure patch space is larger
1356 than minimum hole size.
1357 (Output_section::do_write): Fill holes in debug sections.
1358 * output.h (Output_fill): New class.
1359 (Output_fill_debug_info): New class.
1360 (Output_fill_debug_line): New class.
1361 (Output_section::set_free_space_fill): New function.
1362 (Output_section::free_space_fill_): New data member.
1363 * testsuite/Makefile.am (incremental_test_3): Add
1364 --incremental-patch option.
1365 (incremental_test_4): Likewise.
1366 (incremental_test_5): Likewise.
1367 (incremental_test_6): Likewise.
1368 (incremental_copy_test): Likewise.
1369 (incremental_common_test_1): Likewise.
1370 * testsuite/Makefile.in: Regenerate.
1371
1372 2011-08-26 Nick Clifton <nickc@redhat.com>
1373
1374 * po/es.po: Updated Spanish translation.
1375
1376 2011-08-01 Cary Coutant <ccoutant@google.com>
1377
1378 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1379 * gold/testsuite/Makefile.in: Regenerate.
1380 * gold/testsuite/justsyms_exec.c: New source file.
1381 * gold/testsuite/justsyms_lib.c: New source file.
1382
1383 2011-08-01 Cary Coutant <ccoutant@google.com>
1384
1385 * layout.cc (Layout::set_segment_offsets): Don't realign text
1386 segment if -Ttext was specified.
1387 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1388 file type.
1389 * object.h (Sized_relobj_file::e_type): New function.
1390 (Sized_relobj_file::e_type_): New data member.
1391 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1392 base address for ET_EXEC files.
1393 * target.cc (Target::do_make_elf_object_implementation): Allow
1394 ET_EXEC files with --just-symbols option.
1395
1396 2011-07-28 Cary Coutant <ccoutant@google.com>
1397
1398 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1399 Add thread_number parameter.
1400 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1401 * workqueue-threads.cc
1402 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1403 current thread if its thread number is greater than desired thread
1404 count.
1405 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1406 Add thread_number parameter.
1407 (Workqueue::should_cancel_thread): Likewise.
1408 (Workqueue::find_runnable_or_wait): Pass thread_number to
1409 should_cancel_thread.
1410 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1411 parameter.
1412
1413 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1414
1415 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1416 only after checking if it cannot be forced local.
1417 * symtab.h (is_externally_visible): Check if the symbol is not forced
1418 local.
1419
1420 2011-07-15 Ian Lance Taylor <iant@google.com>
1421
1422 * options.h (class General_options): Add --print-output-format.
1423 Move -EL next to -EB, for better --help output.
1424 * target-select.cc: Include <cstdio>, "options.h", and
1425 "parameters.h".
1426 (Target_selector::do_target_bfd_name): New function.
1427 (print_output_format): New function.
1428 * target-select.h (class Target_selector): Update declarations.
1429 (Target_selector::target_bfd_name): New function.
1430 (print_output_format): Declare.
1431 * main.cc: Include "target-select.h".
1432 (main): Handle --print-output-format.
1433 * gold.cc: Include "target-select.h".
1434 (queue_initial_tasks): Handle --print-output-format when there are
1435 no input files.
1436 * parameters.cc (parameters_force_valid_target): Give a better
1437 error message if -EB/-EL does not match target.
1438 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1439 function.
1440
1441 2011-07-15 Ian Lance Taylor <iant@google.com>
1442
1443 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1444 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1445 (Output_data_plt_i386::do_write): Write address of .dynamic
1446 section to first entry in .got.plt section.
1447 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1448 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1449 Initialize layout_.
1450 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1451 section to first entry in .got.plt section.
1452 * layout.h (Layout::dynamic_section): New function.
1453
1454 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1455
1456 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1457 to claim_file call.
1458 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1459 input_section_position_, and input_section_glob_.
1460 (read_layout_from_file): Call function section_ordering_specified.
1461 * layout.h (is_section_ordering_specified): New function.
1462 (section_ordering_specified): New function.
1463 (section_ordering_specified_): New boolean member.
1464 * main.cc(main): Call load_plugins after layout object is defined.
1465 * output.cc (Output_section::add_input_section): Use
1466 function section_ordering_specified to check if section ordering is
1467 needed.
1468 * output.cc (Output_section::add_relaxed_input_section): Use
1469 function section_ordering_specified to check if section ordering is
1470 needed.
1471 (Output_section::update_section_layout): New function.
1472 (Output_section::sort_attached_input_sections): Check if input section
1473 must be reordered.
1474 * output.h (Output_section::update_section_layout): New function.
1475 * plugin.cc (get_section_count): New function.
1476 (get_section_type): New function.
1477 (get_section_name): New function.
1478 (get_section_contents): New function.
1479 (update_section_order): New function.
1480 (allow_section_ordering): New function.
1481 (Plugin::load): Add the new interfaces to the transfer vector.
1482 (Plugin_manager::load_plugins): New parameter.
1483 (Plugin_manager::all_symbols_read): New parameter.
1484 (Plugin_manager::claim_file): New parameter. Save the elf object for
1485 unclaimed objects.
1486 (Plugin_manager::get_elf_object): New function.
1487 (Plugin_manager::get_view): Change to directly use the bool to check
1488 if get_view is called from claim_file_hook.
1489 * plugin.h (input_objects): New function
1490 (Plugin__manager::load_plugins): New parameter.
1491 (Plugin_manager::claim_file): New parameter.
1492 (Plugin_manager::get_elf_object): New function.
1493 (Plugin_manager::in_claim_file_handler): New function.
1494 (Plugin_manager::in_claim_file_handler_): New member.
1495 (layout): New function.
1496 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1497 handler with an extra parameter. Make the elf object before calling
1498 claim_file handler.
1499 * testsuite/plugin_test.c (get_section_count): New function pointer.
1500 (get_section_type): New function pointer.
1501 (get_section_name): New function pointer.
1502 (get_section_contents): New function pointer.
1503 (update_section_order): New function pointer.
1504 (allow_section_ordering): New function pointer.
1505 (onload): Check if the new interfaces exist.
1506
1507 2011-07-13 Ian Lance Taylor <iant@google.com>
1508
1509 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1510 relro section.
1511 * x86_64.cc (Target_x86_64::got_section): Likewise.
1512 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1513 (relro_now_test_SOURCES): New variable.
1514 (relro_now_test_DEPENDENCIES): New variable.
1515 (relro_now_test_LDFLAGS): New variable.
1516 (relro_now_test_LDADD): New variable.
1517 (relro_now_test.so): New target.
1518 * testsuite/Makefile.in: Rebuild.
1519
1520 2011-07-12 Ian Lance Taylor <iant@google.com>
1521
1522 PR gold/12980
1523 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1524 GLOB_DAT relocation rather than a RELATIVE relocation for a
1525 protected symbol when creating a shared library.
1526 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1527 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1528 * testsuite/protected_main_1.cc (main): Test that protected
1529 function has same address.
1530
1531 2011-07-11 Ian Lance Taylor <iant@google.com>
1532
1533 PR gold/12979
1534 * options.h (class General_options): Add -Bgroup.
1535 * options.cc (General_options::finalize): If -Bgroup is set,
1536 default to --unresolved-symbols=report-all.
1537 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1538 * target-reloc.h (issue_undefined_symbol_error): Handle
1539 --unresolved-symbols=report-all.
1540
1541 2011-07-08 Ian Lance Taylor <iant@google.com>
1542
1543 PR gold/11985
1544 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1545 if linker script discards key sections.
1546 (Layout::create_dynamic_symtab): Likewise.
1547 (Layout::assign_local_dynsym_offsets): Likewise.
1548 (Layout::sized_create_version_sections): Likewise.
1549 (Layout::create_interp): Likewise.
1550 (Layout::finish_dynamic_section): Likewise.
1551 (Layout::set_dynamic_symbol_size): Likewise.
1552
1553 2011-07-08 Ian Lance Taylor <iant@google.com>
1554
1555 PR gold/12386
1556 * options.h (class General_options): Add --unresolved-symbols.
1557 * target-reloc.h (issue_undefined_symbol_error): Check
1558 --unresolved-symbols. Add comments.
1559
1560 2011-07-08 Ian Lance Taylor <iant@google.com>
1561
1562 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1563 expression more complex.
1564
1565 2011-07-08 Ian Lance Taylor <iant@google.com>
1566
1567 PR gold/11317
1568 * target-reloc.h (issue_undefined_symbol_error): New inline
1569 function, broken out of relocate_section.
1570 (relocate_section): Call issue_undefined_symbol_error.
1571 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1572 there is no TLS segment if we are about to issue an undefined
1573 symbol error.
1574 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1575
1576 2011-07-08 Ian Lance Taylor <iant@google.com>
1577
1578 PR gold/12279
1579 * resolve.cc (Symbol_table::should_override): Add fromtype
1580 parameter. Change all callers. Give error when linking together
1581 TLS and non-TLS symbol.
1582 (Symbol_table::should_override_with_special): Add fromtype
1583 parameter. Change all callers.
1584 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1585 there is no TLS segment if we have reported some errors.
1586 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1587
1588 2011-07-08 Ian Lance Taylor <iant@google.com>
1589
1590 PR gold/12372
1591 * target.h (Target::plt_address_for_global): New function.
1592 (Target::plt_address_for_local): New function.
1593 (Target::plt_section_for_global): Remove.
1594 (Target::plt_section_for_local): Remove.
1595 (Target::do_plt_address_for_global): New virtual function.
1596 (Target::do_plt_address_for_local): New virtual function.
1597 (Target::do_plt_section_for_global): Remove.
1598 (Target::do_plt_section_for_local): Remove.
1599 (Target::register_global_plt_entry): Add Symbol_table and Layout
1600 parameters.
1601 * output.cc (Output_data_got::Got_entry::write): Use
1602 plt_address_for_global and plt_address_for_local.
1603 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1604 address of output section.
1605 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1606 got_irelative_, and irelative_count_ fields. Update
1607 declarations.
1608 (Output_data_plt_i386::has_irelative_section): New function.
1609 (Output_data_plt_i386::entry_count): Add irelative_count_.
1610 (Output_data_plt_i386::set_final_data_size): Likewise.
1611 (class Target_i386): Add got_irelative_ and rel_irelative_
1612 fields. Update declarations.
1613 (Target_i386::Target_i386): Initialize new fields.
1614 (Target_i386::do_plt_address_for_global): New function replacing
1615 do_plt_section_for_global.
1616 (Target_i386::do_plt_address_for_local): New function replacing
1617 do_plt_section_for_local.
1618 (Target_i386::got_section): Create got_irelative_.
1619 (Target_i386::rel_irelative_section): New function.
1620 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1621 fields. Don't define __rel_iplt_{start,end}.
1622 (Output_data_plt_i386::add_entry): Add symtab and layout
1623 parameters. Change all callers. Use different PLT and GOT for
1624 IFUNC symbols.
1625 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1626 layout parameters. Change all callers. Use different PLT and
1627 GOT.
1628 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1629 (Output_data_plt_i386::rel_irelative): New function.
1630 (Output_data_plt_i386::address_for_global): New function.
1631 (Output_data_plt_i386::address_for_local): New function.
1632 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1633 IRELATIVE GOT when changing IFUNC GOT entries.
1634 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1635 reloc.
1636 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1637 if we didn't create an IRELATIVE GOT.
1638 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1639 plt_address_for_local.
1640 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1641 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1642 got_irelative_, and irelative_count_ fields. Update
1643 declarations.
1644 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1645 Initialize new fields. Remove symtab parameter. Change all
1646 callers.
1647 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1648 irelative_count_.
1649 (Output_data_plt_x86_64::has_irelative_section): New function.
1650 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1651 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1652 fields. Update declarations.
1653 (Target_x86_64::Target_x86_64): Initialize new fields.
1654 (Target_x86_64::do_plt_address_for_global): New function replacing
1655 do_plt_section_for_global.
1656 (Target_x86_64::do_plt_address_for_local): New function replacing
1657 do_plt_section_for_local.
1658 (Target_x86_64::got_section): Create got_irelative_.
1659 (Target_x86_64::rela_irelative_section): New function.
1660 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1661 all callers. Don't create __rel_iplt_{start,end}.
1662 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1663 parameters. Change all callers. Use different PLT and GOT for
1664 IFUNC symbols.
1665 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1666 layout parameters. Change all callers. Use different PLT and
1667 GOT.
1668 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1669 parameters. Change all callers. Use different PLT and GOT for
1670 IFUNC symbols.
1671 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1672 (Output_data_plt_x86_64::rela_irelative): New function.
1673 (Output_data_plt_x86_64::address_for_global): New function.
1674 (Output_data_plt_x86_64::address_for_local): New function.
1675 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1676 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1677 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1678 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1679 parameters.
1680 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1681 reloc.
1682 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1683 symbols if we didn't create an IRELATIVE GOT.
1684 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1685 plt_address_for_local.
1686 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1687 * testsuite/ifuncvar1.c: New test file.
1688 * testsuite/ifuncvar2.c: New test file.
1689 * testsuite/ifuncvar3.c: New test file.
1690 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1691 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1692 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1693 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1694 * testsuite/Makefile.in: Rebuild.
1695
1696 2011-07-07 Cary Coutant <ccoutant@google.com>
1697
1698 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1699 (two_file_test_1_ndebug.o): Likewise.
1700 (two_file_test_1b_ndebug.o): Likewise.
1701 (two_file_test_2_ndebug.o): Likewise.
1702 (two_file_test_main_ndebug.o): Likewise.
1703 (incremental_test_2): Link with no-debug versions.
1704
1705 2011-07-06 Cary Coutant <ccoutant@google.com>
1706
1707 * gold/incremental.cc
1708 (Output_section_incremental_inputs::write_info_blocks): Check for
1709 hidden and internal symbols.
1710
1711 2011-07-06 Cary Coutant <ccoutant@google.com>
1712
1713 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1714 Check disposition for startup file.
1715 (Incremental_inputs::report_command_line): Ignore
1716 --incremental-startup-unchanged option.
1717 * options.cc (General_options::parse_incremental_startup_unchanged):
1718 New function.
1719 (General_options::General_options): Initialize new data member.
1720 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1721 (General_options): Add --incremental-startup-unchanged option.
1722 (General_options::incremental_startup_disposition): New function.
1723 (General_options::incremental_startup_disposition_): New data member.
1724
1725 2011-07-06 Cary Coutant <ccoutant@google.com>
1726
1727 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1728 input file index to Script_info ctor.
1729 (Sized_incremental_binary::do_file_has_changed): Find the
1730 command-line argument for files named in scripts.
1731 * incremental.h (Script_info::Script_info): New ctor
1732 with input file index.
1733 (Script_info::input_file_index): New function.
1734 (Script_info::input_file_index_): New data member.
1735 (Incremental_binary::get_library): Add const.
1736 (Incremental_binary::get_script_info): Add const.
1737 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1738 * testsuite/Makefile.am (incremental_test_5): New test case.
1739 (incremental_test_6): New test case.
1740 * testsuite/Makefile.in: Regenerate.
1741
1742 2011-07-06 Cary Coutant <ccoutant@google.com>
1743
1744 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1745 debug output when command lines differ.
1746
1747 2011-07-06 Cary Coutant <ccoutant@google.com>
1748
1749 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1750 --incremental-patch option.
1751 * layout.cc (Free_list::allocate): Extend allocation beyond original
1752 end if enabled.
1753 (Layout::make_output_section): Mark sections that should get
1754 patch space.
1755 * options.cc (parse_percent): New function.
1756 * options.h (parse_percent): New function.
1757 (DEFINE_percent): New macro.
1758 (General_options): Add --incremental-patch option.
1759 * output.cc (Output_section::Output_section): Initialize new data
1760 members.
1761 (Output_section::add_input_section): Print section name when out
1762 of patch space.
1763 (Output_section::add_output_section_data): Likewise.
1764 (Output_section::set_final_data_size): Add patch space when
1765 doing --incremental-full.
1766 (Output_section::do_reset_address_and_file_offset): Remove patch
1767 space.
1768 (Output_segment::set_section_list_addresses): Print debug output
1769 only if --incremental-update.
1770 * output.h (Output_section::set_is_patch_space_allowed): New function.
1771 (Output_section::is_patch_space_allowed_): New data member.
1772 (Output_section::patch_space_): New data member.
1773 * parameters.cc (Parameters::incremental_full): New function.
1774 * parameters.h (Parameters::incremental_full): New function
1775 * testsuite/Makefile.am (incremental_test_2): Add test for
1776 --incremental-patch option.
1777 * testsuite/Makefile.in: Regenerate.
1778 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1779 (t18): Remove function body.
1780
1781 2011-07-05 Doug Kwan <dougkwan@google.com>
1782
1783 PR gold/12771
1784 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1785 Arm_Address type for relocation result.
1786 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1787 overflow check.
1788 (Arm_relocate_functions::abs32): Use unaligned access.
1789 (Arm_relocate_functions::rel32): Ditto.
1790 (Arm_relocate_functions::prel31): Ditto.
1791 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1792 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1793 static data relocations.
1794 * testsuite/Makefile.in: Regnerate.
1795 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1796
1797 2011-07-05 Ian Lance Taylor <iant@google.com>
1798
1799 PR gold/12392
1800 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1801 symbols if necessary.
1802 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1803
1804 2011-07-05 Ian Lance Taylor <iant@google.com>
1805
1806 PR gold/12952
1807 * resolve.cc (Symbol::override_base_with_special): Simply override
1808 version with special symbol version, ignoring previous version.
1809
1810 2011-07-05 Ian Lance Taylor <iant@google.com>
1811
1812 * object.cc (Sized_relobj_file::include_section_group): Add
1813 information to comment about signature location.
1814
1815 2011-07-02 Ian Lance Taylor <iant@google.com>
1816
1817 PR gold/12957
1818 * options.h (class General_options): Add -f and -F.
1819 * options.cc (General_options::finalize): Fatal error if -f/-F
1820 are used without -shared.
1821 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1822
1823 2011-07-02 Ian Lance Taylor <iant@google.com>
1824
1825 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1826
1827 2011-07-01 Ian Lance Taylor <iant@google.com>
1828
1829 PR gold/12525
1830 PR gold/12952
1831 * resolve.cc (Symbol::override_base_with_special): Don't override
1832 the version if the overriding symbol has a different name.
1833 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1834 all callers. If we give an error about an undefined version,
1835 define the base version if necessary.
1836 * dynobj.h (class Versions): Update declaration.
1837 * testsuite/weak_alias_test_5.cc: New file.
1838 * testsuite/weak_alias_test.script: New file.
1839 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1840 and versioned_alias have the right value, and call t2.
1841 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1842 weak_alias_test_5.so.
1843 (weak_alias_test_LDADD): Likewise.
1844 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1845 * testsuite/Makefile.in: Rebuild.
1846
1847 2011-07-01 Ian Lance Taylor <iant@google.com>
1848
1849 PR gold/12525
1850 * options.h (class General_options): Support -z notext.
1851 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1852 -Wl,-z,notext.
1853 (two_file_shared_nonpic.so): Likewise.
1854 (two_file_shared_mixed.so): Likewise.
1855 (two_file_shared_mixed_1.so): Likewise.
1856 (weak_undef_lib_nonpic.so): Likewise.
1857 (alt/weak_undef_lib_nonpic.so): Likewise.
1858 (tls_test_shared_nonpic.so): Likewise.
1859 * testsuite/Makefile.in: Rebuild.
1860
1861 2011-07-01 Ian Lance Taylor <iant@google.com>
1862
1863 PR gold/12525
1864 * configure.ac: Test whether static linking works, setting
1865 the automake conditional HAVE_STATIC.
1866 * testsuite/Makefile.am: Disable tests using -static if
1867 HAVE_STATIC is not true.
1868 * configure, testsuite/Makefile.in: Rebuild.
1869
1870 2011-07-01 Ian Lance Taylor <iant@google.com>
1871
1872 PR gold/12525
1873 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1874 Assert if we see DW_EH_PE_indirect.
1875 * target.h (Target::ehframe_datarel_base): New function.
1876 (Target::do_ehframe_datarel_base): New target function.
1877 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1878 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1879 function.
1880
1881 2011-07-01 Ian Lance Taylor <iant@google.com>
1882
1883 PR gold/12571
1884 * options.h (class General_options): Add
1885 --ld-generated-unwind-info.
1886 * ehframe.cc (Fde::write): Add address parameter. Change all
1887 callers. If associated with PLT, fill in address and size.
1888 (Cie::set_output_offset): Only add merge mapping if there is an
1889 object.
1890 (Cie::write): Add address parameter. Change all callers.
1891 (Eh_frame::add_ehframe_for_plt): New function.
1892 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1893 input_offset_ fields into union u_, with new plt field.
1894 (Fde::Fde): Adjust for new union field.
1895 (Fde::Fde) [Output_data version]: New constructor.
1896 (Fde::add_mapping): Only add merge mapping if there is an object.
1897 (class Cie): Update declarations.
1898 (class Eh_frame): Declare add_ehframe_for_plt.
1899 * layout.cc (Layout::layout_eh_frame): Break out code into
1900 make_eh_frame_section, and call it.
1901 (Layout::make_eh_frame_section): New function.
1902 (Layout::add_eh_frame_for_plt): New function.
1903 * layout.h (class Layout): Update declarations.
1904 * merge.cc (Merge_map::add_mapping): Add assertion.
1905 * i386.cc: Include "dwarf.h".
1906 (class Output_data_plt_i386): Make first_plt_entry,
1907 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1908 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1909 and plt_eh_frame_fde.
1910 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1911 boundary. Call add_eh_frame_for_plt if appropriate.
1912 * x86_64.cc: Include "dwarf.h".
1913 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1914 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1915 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1916 and plt_eh_frame_fde.
1917 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1918 appropriate.
1919
1920 2011-06-29 Ian Lance Taylor <iant@google.com>
1921
1922 PR gold/12629
1923 * object.cc (Sized_relobj_file::layout_section): Change shdr
1924 parameter to be const.
1925 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1926 out of do_layout.
1927 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1928 appropriate. Call layout_eh_frame_section.
1929 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1930 sections.
1931 * object.h (class Sized_relobj_file): Update declarations.
1932
1933 2011-06-29 Ian Lance Taylor <iant@google.com>
1934
1935 PR gold/12652
1936 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1937 modifier.
1938 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1939
1940 2011-06-29 Ian Lance Taylor <iant@google.com>
1941
1942 PR gold/12675
1943 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1944 SHT_X86_64_UNWIND.
1945 * layout.cc (Layout::layout_eh_frame): Likewise.
1946
1947 2011-06-29 Ian Lance Taylor <iant@google.com>
1948
1949 PR gold/12695
1950 * layout.cc (Layout::symtab_section_shndx): New function.
1951 * layout.h (class Layout): Declare symtab_section_shndx.
1952 * output.cc (Output_section::write_header): Call it.
1953
1954 2011-06-29 Ian Lance Taylor <iant@google.com>
1955
1956 PR gold/12818
1957 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1958 symbols which are not used in a relocation.
1959
1960 2011-06-28 Ian Lance Taylor <iant@google.com>
1961
1962 PR gold/12898
1963 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1964 script create indistinguishable segments.
1965 (Layout::set_segment_offsets): Use stable_sort when sorting
1966 segments. Pass this to Compare_segments constructor.
1967 * layout.h (class Layout): Make segment_precedes non-static.
1968 (class Compare_segments): Change from struct to class. Add
1969 layout_ field. Add constructor.
1970 * script-sections.cc
1971 (Script_sections::attach_sections_using_phdrs_clause): Rename
1972 local orphan to is_orphan. Don't report failure to put empty
1973 section in segment. On attachment failure, report name of
1974 section, and attach to first PT_LOAD segment.
1975
1976 2011-06-28 Ian Lance Taylor <iant@google.com>
1977
1978 PR gold/12934
1979 * target-select.cc (Target_selector::Target_selector): Add
1980 emulation parameter. Change all callers.
1981 (select_target_by_bfd_name): Rename from select_target_by_name.
1982 Change all callers.
1983 (select_target_by_emulation): New function.
1984 (supported_emulation_names): New function.
1985 * target-select.h (class Target_selector): Add emulation_ field.
1986 Update declarations.
1987 (Target_selector::recognize_by_bfd_name): Rename from
1988 recognize_by_name. Change all callers.
1989 (Target_selector::supported_bfd_names): Rename from
1990 supported_names. Change all callers.
1991 (Target_selector::recognize_by_emulation): New function.
1992 (Target_selector::supported_emulations): New function.
1993 (Target_selector::emulation): New function.
1994 (Target_selector::do_recognize_by_bfd_name): Rename from
1995 do_recognize_by_name. Change all callers.
1996 (Target_selector::do_supported_bfd_names): Rename from
1997 do_supported_names. Change all callers.
1998 (Target_selector::do_recognize_by_emulation): New function.
1999 (Target_selector::do_supported_emulations): New function.
2000 (select_target_by_bfd_name): Change name in declaration.
2001 (select_target_by_emulation): Declare.
2002 (supported_emulation_names): Declare.
2003 * parameters.cc (parameters_force_valid_target): Try to find
2004 target based on emulation from -m option.
2005 * options.h (class General_options): Change doc string for -m.
2006 * options.cc (help): Print emulations.
2007 (General_options::parse_V): Likewise.
2008 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2009 Add emulation parameter. Change all callers.
2010
2011 2011-06-28 Ian Lance Taylor <iant@google.com>
2012
2013 * target.h (class Target): Add osabi_ field.
2014 (Target::osabi): New function.
2015 (Target::set_osabi): New function.
2016 (Target::Target): Initialize osabi_.
2017 (Target::do_adjust_elf_header): Make pure virtual.
2018 (Sized_target::do_adjust_elf_header): Declare.
2019 * target.cc (Sized_target::do_adjust_elf_header): New function.
2020 (class Sized_target): Instantiate all versions.
2021 * freebsd.h (class Target_freebsd): Remove.
2022 (Target_selector_freebsd::do_recognize): Call set_osabi on
2023 Target.
2024 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2025 (Target_selector_freebsd::set_osabi): Remove.
2026 * i386.cc (class Target_i386): Inherit from Sized_target rather
2027 than Target_freebsd.
2028 * x86_64.cc (class Target_x86_64): Likewise.
2029
2030 2011-06-28 Ian Lance Taylor <iant@google.com>
2031
2032 * target.h (Target::can_check_for_function_pointers): Rewrite.
2033 Make non-virtual.
2034 (Target::can_icf_inline_merge_sections): Likewise.
2035 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2036 (Target::Target_info): Add can_icf_inline_merge_sections field.
2037 (Target::do_can_check_for_function_pointers): New virtual
2038 function.
2039 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2040 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2041 from can_check_for_function_pointers, move in file.
2042 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2043 section_may_have_icf_unsafe_poineters, move in file.
2044 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2045 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2046 Rename from can_check_for_function_pointers, move in file.
2047 (Target_i386::can_icf_inline_merge_sections): Remove.
2048 (Target_i386::i386_info): Initialize
2049 can_icf_inline_merge_sections.
2050 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2051 Initialize can_icf_inline_merge_sections.
2052 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2053 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2054 Rename from can_check_for_function_pointers, move in file.
2055 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2056 (Target_x86_64::x86_64_info): Initialize
2057 can_icf_inline_merge_sections.
2058 * testsuite/testfile.cc (Target_test::test_target_info):
2059 Likewise.
2060 * icf.cc (get_section_contents): Correct formatting.
2061
2062 2011-06-27 Ian Lance Taylor <iant@google.com>
2063
2064 * symtab.cc (Symbol::versioned_name): New function.
2065 (Symbol_table::add_to_final_symtab): Use versioned_name when
2066 appropriate.
2067 (Symbol_table::sized_write_symbol): Likewise.
2068 * symtab.h (class Symbol): Declare versioned_name.
2069 * stringpool.h (class Stringpool_template): Add variant of add
2070 which takes a std::basic_string.
2071 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2072 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2073 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2074 (ver_test_12.o): New target.
2075 * testsuite/Makefile.in: Rebuild.
2076
2077 2011-06-27 Doug Kwan <dougkwan@google.com>
2078
2079 * arm.cc (Arm_relocate_functions::thm_jump8,
2080 Arm_relocate_functions::thm_jump11): Use a wider signed
2081 type to compute offset.
2082 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2083 arm_thm_jump8.
2084 * testsuite/Makefile.in: Regenerate.
2085 * testsuite/arm_branch_in_range.sh: Check test results of
2086 arm_thm_jump11 and arm_thm_jump8.
2087 * testsuite/arm_thm_jump11.s: New test source file.
2088 * testsuite/arm_thm_jump11.t: New linker script.
2089 * testsuite/arm_thm_jump8.s: New test source file.
2090 * testsuite/arm_thm_jump8.t: New linker script.
2091
2092 2011-06-24 Ian Lance Taylor <iant@google.com>
2093
2094 * layout.cc: Include "object.h".
2095 (ctors_sections_in_init_array): New static variable.
2096 (Layout::is_ctors_in_init_array): New function.
2097 (Layout::layout): Add entry to ctors_sections_in_init_array if
2098 appropriate.
2099 * layout.h (class Layout): Declare is_ctors_in_init_array.
2100 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2101 is_ctors_reverse_view is set.
2102 (Sized_relobj_file::write_sections): Add layout parameter. Change
2103 all callers. Set is_ctors_reverse_view field of View_size.
2104 (Sized_relobj_file::reverse_words): New function.
2105 * object.h (Sized_relobj_file::View_size): Add
2106 is_ctors_reverse_view field.
2107 (class Sized_relobj_file): Update declarations.
2108 * testsuite/initpri3.c: New test.
2109 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2110 initpri3b.
2111 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2112 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2113 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2114 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2115 * testsuite/Makefile.in: Rebuild.
2116
2117 2011-06-24 Cary Coutant <ccoutant@google.com>
2118
2119 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2120 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2121 (debug_msg_cdebug.err): New targets.
2122 * testsuite/Makefile.in: Regenerate.
2123 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2124 Fix checks for link with shared library.
2125
2126 2011-06-24 Doug Kwan <dougkwan@google.com>
2127
2128 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2129 skip empty text sections.
2130 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2131
2132 2011-06-22 Ian Lance Taylor <iant@google.com>
2133
2134 PR gold/12910
2135 * options.h (class General_options): Add --ctors-in-init-array.
2136 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2137 friends as SHT_PROGBITS for merging sections.
2138 (Layout::layout): Remove special handling of .init_array and
2139 friends. Don't sort if doing relocatable link. Sort for .ctors
2140 and .dtors if ctors_in_init_array.
2141 (Layout::make_output_section): Force correct section types for
2142 .init_array and friends. Don't sort if doing relocatable link,
2143 Don't sort .ctors and .dtors if ctors_in_init_array.
2144 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2145 (Layout::output_section_name): Add relobj parameter. Change all
2146 callers. Handle .ctors. and .dtors. in code rather than table.
2147 Handle .ctors and .dtors if ctors_in_init_array.
2148 (Layout::match_file_name): New function, moved from output.cc.
2149 * layout.h (class Layout): Update declarations.
2150 * output.cc: Include "layout.h".
2151 (Input_section_sort_entry::get_priority): New function.
2152 (Input_section_sort_entry::match_file_name): Just call
2153 Layout::match_file_name.
2154 (Output_section::Input_section_sort_init_fini_compare::operator()):
2155 Handle .ctors and .dtors. Sort by explicit priority rather than
2156 by name.
2157 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2158 * testsuite/initpri2.c: New test.
2159 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2160 (check_PROGRAMS): Add initpri2.
2161 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2162 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2163 * configure, testsuite/Makefile.in: Rebuild.
2164
2165 2011-06-19 Ian Lance Taylor <iant@google.com>
2166
2167 PR gold/12880
2168 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2169 .interp section to a PT_INTERP segment even if we have seen a
2170 --dynamic-linker option. Don't do it if we have seen a PHDRS
2171 clause in a linker script.
2172 (Layout::finalize): Don't create a .interp section if we've
2173 already create a PT_INTERP segment.
2174 (Layout::create_interp): Always call choose_output_section (revert
2175 patch of 2011-06-17). Don't create PT_INTERP segment.
2176 * script-sections.cc
2177 (Script_sections::create_note_and_tls_segments): Add a .interp
2178 section to a PT_INTERP segment even if we have seen a
2179 --dynamic-linker option.
2180
2181 2011-06-18 Ian Lance Taylor <iant@google.com>
2182
2183 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2184 merely because a non-PT_LOAD segment has a dynamic reloc.
2185
2186 2011-06-18 Ian Lance Taylor <iant@google.com>
2187
2188 * layout.cc (Layout::finish_dynamic_section): Don't create
2189 DT_FLAGS entry if not needed.
2190
2191 2011-06-18 Ian Lance Taylor <iant@google.com>
2192
2193 PR gold/12745
2194 * layout.cc (Layout::layout_eh_frame): Correct handling of
2195 writable .eh_frame section.
2196
2197 2011-06-17 Ian Lance Taylor <iant@google.com>
2198
2199 PR gold/12893
2200 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2201 symbol is redefined with the exact same object and value.
2202
2203 2011-06-17 Ian Lance Taylor <iant@google.com>
2204
2205 PR gold/12880
2206 * layout.h (class Layout): Add interp_segment_ field.
2207 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2208 (Layout::attach_allocated_section_to_segment): If making shared
2209 library, put .interp section in PT_INTERP segment.
2210 (Layout::finalize): Also call create_interp if -dynamic-linker
2211 option was used.
2212 (Layout::create_interp): Assert that there is no PT_INTERP
2213 segment. If not using a SECTIONS clause, use make_output_section.
2214 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2215 * script-sections.cc
2216 (Script_sections::create_note_and_tls_segments): If making shared
2217 library, put .interp section in PT_INTERP segment.
2218
2219 2011-06-17 Ian Lance Taylor <iant@google.com>
2220
2221 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2222 when making a shared library.
2223
2224 2011-06-17 Ian Lance Taylor <iant@google.com>
2225
2226 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2227 parameter. Change all callers. Don't issue warning about PC32
2228 against locally defined symbol.
2229
2230 2011-06-16 Ian Lance Taylor <iant@google.com>
2231
2232 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2233 occurs in same object.
2234
2235 2011-06-14 Alan Modra <amodra@gmail.com>
2236
2237 * po/POTFILES.in: Regenerate.
2238
2239 2011-06-09 Ian Lance Taylor <iant@google.com>
2240
2241 * script-sections.cc
2242 (Orphan_output_section::set_section_addresses): For a relocatable
2243 link set address to 0.
2244
2245 2011-06-09 Cary Coutant <ccoutant@google.com>
2246
2247 PR gold/12804
2248 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2249 used with --compress-debug-sections.
2250 * gold/object.cc (Sized_relobj_file::do_layout): Report
2251 uncompressed size of compressed input sections.
2252
2253 2011-06-08 Cary Coutant <ccoutant@google.com>
2254
2255 PR gold/12804
2256 * testsuite/two_file_test_2_v1.cc: Change initialization of
2257 v2 to keep it in .data.
2258
2259 2011-06-07 Cary Coutant <ccoutant@google.com>
2260
2261 * common.cc (Symbol_table::do_allocate_commons_list): Call
2262 gold_fallback.
2263 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2264 (Errors::fallback): New function.
2265 (gold_fallback): New function.
2266 * errors.h (Errors::fallback): New function.
2267 * gold.cc (gold_exit): Change status parameter to enum; adjust
2268 all callers.
2269 (queue_initial_tasks): Call gold_fallback.
2270 * gold.h: Include cstdlib.
2271 (Exit_status): New enum type.
2272 (gold_exit): Change status parameter to enum.
2273 (gold_fallback): New function.
2274 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2275 (Layout::create_symtab_sections): Likewise.
2276 (Layout::create_shdrs): Likewise.
2277 * main.cc (main): Adjust call to gold_exit.
2278 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2279 (Output_data_got::add_got_entry_pair): Likewise.
2280 (Output_section::add_input_section): Likewise.
2281 (Output_section::add_output_section_data): Likewise.
2282 (Output_segment::set_section_list_addresses): Likewise.
2283 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2284
2285 2011-06-07 Cary Coutant <ccoutant@google.com>
2286
2287 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2288 for incremental links.
2289 * output.cc (Output_segment::set_section_list_addresses): Remove
2290 FIXME and test for TLS or BSS.
2291
2292 2011-06-07 Cary Coutant <ccoutant@google.com>
2293
2294 * testsuite/Makefile.am: Add incremental_copy_test,
2295 incremental_common_test_1.
2296 * testsuite/Makefile.in: Regenerate.
2297 * testsuite/common_test_1_v1.c: New source file.
2298 * testsuite/common_test_1_v2.c: New source file.
2299 * testsuite/copy_test_v1.cc: New source file.
2300
2301 2011-06-07 Cary Coutant <ccoutant@google.com>
2302
2303 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2304 update, allocate common from bss section's free list.
2305 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2306 linker-defined symbols.
2307 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2308 Skip GOT and PLT entries that are no longer referenced.
2309 (Output_section_incremental_inputs::write_info_blocks): Mark
2310 linker-defined symbols.
2311 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2312 * output.cc (Output_section::allocate): New function.
2313 * output.h (Output_section::allocate): New function.
2314 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2315 linker-defined symbols.
2316 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2317 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2318 (Symbol::init_base_output_data): Likewise.
2319 (Symbol::init_base_output_segment): Likewise.
2320 (Symbol::init_base_constant): Likewise.
2321 (Sized_symbol::init_output_data): Likewise.
2322 (Sized_symbol::init_output_segment): Likewise.
2323 (Sized_symbol::init_constant): Likewise.
2324 (Symbol_table::do_define_in_output_data): Likewise.
2325 (Symbol_table::do_define_in_output_segment): Likewise.
2326 (Symbol_table::do_define_as_constant): Likewise.
2327 * symtab.h (Symbol::is_predefined): New function.
2328 (Symbol::init_base_output_data): Add is_predefined parameter.
2329 (Symbol::init_base_output_segment): Likewise.
2330 (Symbol::init_base_constant): Likewise.
2331 (Symbol::is_predefined_): New data member.
2332 (Sized_symbol::init_output_data): Add is_predefined parameter.
2333 (Sized_symbol::init_output_segment): Likewise.
2334 (Sized_symbol::init_constant): Likewise.
2335 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2336
2337 2011-06-07 Cary Coutant <ccoutant@google.com>
2338
2339 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2340 instead of emit_copy_reloc.
2341 (Copy_relocs::emit_copy_reloc): Refactor.
2342 (Copy_relocs::make_copy_reloc): New function.
2343 (Copy_relocs::add_copy_reloc): Remove.
2344 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2345 section.
2346 (Copy_relocs::make_copy_reloc): New function.
2347 (Copy_relocs::add_copy_reloc): Remove.
2348 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2349 unchanged input files.
2350 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2351 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2352 Reserve BSS space for COPY relocations.
2353 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2354 (Output_section_incremental_inputs::write_info_blocks): Record
2355 whether a symbol is copied from a shared object.
2356 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2357 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2358 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2359 (Incremental_input_entry_reader::get_output_symbol_index): Add
2360 is_copy parameter.
2361 (Incremental_binary::emit_copy_relocs): New function.
2362 (Incremental_binary::do_emit_copy_relocs): New function.
2363 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2364 new data member.
2365 (Sized_incremental_binary::add_copy_reloc): New function.
2366 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2367 (Sized_incremental_binary::Copy_reloc): New struct.
2368 (Sized_incremental_binary::Copy_relocs): New typedef.
2369 (Sized_incremental_binary::copy_relocs_): New data member.
2370 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2371 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2372 * target.h (Sized_target::emit_copy_reloc): New function.
2373 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2374
2375 2011-06-02 Cary Coutant <ccoutant@google.com>
2376
2377 PR gold/12163
2378 * gold/archive.cc (Archive::Archive): Initialize new data member.
2379 (Archive::include_all_members): Return if archive has already been
2380 included.
2381 * gold/archive.h (Archive::include_all_members_): New data member.
2382
2383 2011-06-02 Nick Clifton <nickc@redhat.com>
2384
2385 * dynobj.h: Fix spelling mistake in comment.
2386 * output.cc: Likewise.
2387
2388 2011-05-31 Doug Kwan <dougkwan@google.com>
2389 Asier Llano
2390
2391 PR gold/12826
2392 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2393 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2394 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2395 redundant arm_exidx_test.so.
2396 * testsuite/Makefile.in: Regenerate.
2397 (check_SCRIPTS): Add pr12826.sh
2398 (check_DATA): Add pr12826.stdout
2399 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2400 * testsuite/pr12826.sh: New file.
2401 * testsuite/pr12826_1.s: Ditto.
2402 * testsuite/pr12826_1.s: Ditto.
2403
2404 2011-05-30 Ian Lance Taylor <iant@google.com>
2405
2406 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2407 sections.
2408
2409 2011-05-29 Ian Lance Taylor <iant@google.com>
2410
2411 PR gold/12804
2412 * testsuite/Makefile.am: Use different file name for two_file_test
2413 temporary file for each incremental test.
2414 * testsuite/Makefile.in: Rebuild.
2415
2416 2011-05-29 Ian Lance Taylor <iant@google.com>
2417
2418 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2419 binary input file is empty.
2420
2421 2011-05-27 Ian Lance Taylor <iant@google.com>
2422
2423 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2424 (ver_test_9.so): Likewise.
2425 * testsuite/Makefile.in: Rebuild.
2426
2427 2011-05-26 Cary Coutant <ccoutant@google.com>
2428
2429 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2430 * incremental.cc (Incremental_inputs::report_input_section): Fix
2431 comment, indentation.
2432 (Incremental_inputs::report_comdat_group): New function.
2433 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2434 of data for incremental input file entry.
2435 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2436 group count, COMDAT group signatures.
2437 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2438 an unchanged input file.
2439 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2440 Initialize new data member.
2441 (Incremental_object_entry::add_comdat_group): New function.
2442 (Incremental_object_entry::get_comdat_group_count): New function.
2443 (Incremental_object_entry::get_comdat_signature_key): New function.
2444 (Incremental_object_entry::groups_): New data member.
2445 (Incremental_inputs::report_comdat_group): New function.
2446 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2447 data for incremental input file entry.
2448 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2449 (Incremental_input_entry_reader::get_input_section): Adjust size of
2450 data for incremental input file entry.
2451 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2452 (Incremental_input_entry_reader::get_comdat_group_signature): New
2453 function.
2454 * object.cc (Sized_relobj::include_section_group): Report kept
2455 COMDAT groups for incremental links.
2456
2457 2011-05-24 David Meyer <pdox@google.com>
2458
2459 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2460 with name parameter. Add found_name parameter.
2461 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2462 * dirsearch.h (class Dirsearch): Update declaration.
2463
2464 2011-05-24 Ian Lance Taylor <iant@google.com>
2465
2466 * archive.cc (Library_base::should_include_member): Pull in object
2467 from archive if it defines the entry symbol.
2468 * parameters.cc (Parameters::entry): New function.
2469 * parameters.h (class Parameters): Declare entry.
2470 * output.h (class Output_file_header): Remove entry_ field.
2471 * output.cc (Output_file_header::Output_file_header): Remove entry
2472 parameter. Change all callers.
2473 (Output_file_header::entry): Use parameters->entry.
2474 * gold.cc (queue_middle_tasks): Likewise.
2475 * plugin.cc (Plugin_hook::run): Likewise.
2476
2477 2011-05-24 Cary Coutant <ccoutant@google.com>
2478
2479 * gold.cc (queue_initial_tasks): Pass incremental base filename
2480 to Output_file::open_base_file; don't print error message.
2481 * incremental-dump.cc (main): Adjust call to
2482 Output_file::open_for_modification.
2483 * incremental-dump.cc (main): Likewise.
2484 * incremental.cc (Incremental_inputs::report_command_line):
2485 Ignore --incremental-base option when comparing command lines.
2486 Ignore parameter when given as separate argument.
2487 * options.h (class General_options): Add --incremental-base.
2488 * output.cc (Output_file::Output_file):
2489 (Output_file::open_base_file): Add base_name and writable parameters;
2490 read base file into new file; print error message here.
2491 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2492 callers.
2493 * output.h (Output_file::open_for_modification): Rename to...
2494 (Output_file::open_base_file): ...this; add base_name and
2495 writable parameters; adjust all callers.
2496 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2497 callers.
2498 * testsuite/Makefile.am (incremental_test_4): Test
2499 --incremental-base.
2500 * testsuite/Makefile.in: Regenerate.
2501
2502 2011-05-24 Cary Coutant <ccoutant@google.com>
2503
2504 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2505 incremental_test_4.
2506 * testsuite/Makefile.in: Regenerate.
2507 * testsuite/two_file_test_1_v1.cc: New test source file.
2508 * testsuite/two_file_test_1b_v1.cc: New test source file.
2509 * testsuite/two_file_test_2_v1.cc: New test source file.
2510
2511 2011-05-24 Cary Coutant <ccoutant@google.com>
2512
2513 * dynobj.h (Dynobj::do_dynobj): New function.
2514 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2515 flag and soname for shared objects.
2516 * incremental.cc (Incremental_inputs::report_object): Make
2517 either Incremental_object_entry or Incremental_dynobj_entry; add
2518 soname to string table.
2519 (Incremental_inputs::report_input_section): Add assertion.
2520 (Output_section_incremental_inputs::set_final_data_size): Adjust
2521 type of input file entry for shared libraries; adjust size of
2522 shared library info entry.
2523 (Output_section_incremental_inputs::write_input_files): Write
2524 as_needed flag for shared libraries.
2525 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2526 of input file entry for shared libraries; write soname.
2527 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2528 soname from incremental info.
2529 * incremental.h (enum Incremental_input_flags): Add
2530 INCREMENTAL_INPUT_AS_NEEDED.
2531 (Incremental_input_entry::Incremental_input_entry): Initialize new
2532 data member.
2533 (Incremental_input_entry::set_as_needed): New function.
2534 (Incremental_input_entry::as_needed): New function.
2535 (Incremental_input_entry::do_dynobj_entry): New function.
2536 (Incremental_input_entry::as_needed_): New data member.
2537 (Incremental_object_entry::Incremental_object_entry): Don't check
2538 for shared library.
2539 (Incremental_object_entry::do_type): Likewise.
2540 (class Incremental_dynobj_entry): New class.
2541 (Incremental_input_entry_reader::as_needed): New function.
2542 (Incremental_input_entry_reader::get_soname): New function.
2543 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2544 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2545 size of shared library info entry.
2546 * layout.cc (Layout::finish_dynamic_section): Don't test for
2547 incremental link when adding DT_NEEDED entries.
2548 * object.h (Object::Object): Initialize new data member.
2549 (Object::dynobj): New function.
2550 (Object::set_as_needed): New function.
2551 (Object::as_needed): New function.
2552 (Object::do_dynobj): New function.
2553 (Object::as_needed_): New data member.
2554
2555 2011-05-24 Cary Coutant <ccoutant@google.com>
2556
2557 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2558 info; adjust display of GOT entries.
2559 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2560 vector of input objects; remove file_status_.
2561 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2562 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2563 got_plt reader; call target hooks to reserve GOT entries.
2564 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2565 of input file info header and GOT info entry.
2566 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2567 relocation info.
2568 (Got_plt_view_info::got_descriptor): Remove.
2569 (Got_plt_view_info::sym_index): New data member.
2570 (Got_plt_view_info::input_index): New data member.
2571 (Local_got_offset_visitor::visit): Write input file index.
2572 (Global_got_offset_visitor::visit): Write 0 for input file index.
2573 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2574 with sym_index and input_index.
2575 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2576 incremental info GOT entry; replace got_descriptor with input_index.
2577 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2578 map from input file index to object.
2579 (Sized_relobj_incr::do_layout): Replace direct data member reference
2580 with accessor function.
2581 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2582 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2583 Adjust size of input file info header.
2584 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2585 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2586 (Incremental_input_entry_reader::get_input_section): Adjust size of
2587 input file info header.
2588 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2589 of incremental info GOT entry.
2590 (Incremental_got_plt_reader::get_got_desc): Remove.
2591 (Incremental_got_plt_reader::get_got_symndx): New function.
2592 (Incremental_got_plt_reader::get_got_input_index): New function.
2593 (Sized_incremental_binary::Sized_incremental_binary): Remove
2594 file_status_; add input_objects_.
2595 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2596 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2597 (Sized_incremental_binary::file_is_unchanged): Remove.
2598 (Sized_incremental_binary::set_input_object): New function.
2599 (Sized_incremental_binary::input_object): New function.
2600 (Sized_incremental_binary::file_status_): Remove.
2601 (Sized_incremental_binary::input_objects_): New data member.
2602 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2603 references.
2604 (Sized_relobj_incr::invalid_address): Move to base class.
2605 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2606 class.
2607 (Sized_relobj_incr::do_output_section_offset): Likewise.
2608 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2609 (Sized_relobj_incr::section_offsets_): Likewise.
2610 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2611 function.
2612 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2613 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2614 with accessor function.
2615 (Sized_relobj_file::do_layout): Likewise.
2616 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2617 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2618 (Sized_relobj_file::compute_final_local_value): Replace refs to
2619 section_offsets_ with accessor function.
2620 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2621 * object.h (Relobj::Relobj): Initialize new data members.
2622 (Relobj::add_dyn_reloc): New function.
2623 (Relobj::first_dyn_reloc): New function.
2624 (Relobj::dyn_reloc_count): New function.
2625 (Relobj::first_dyn_reloc_): New data member.
2626 (Relobj::dyn_reloc_count_): New data member.
2627 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2628 references.
2629 (Sized_relobj::Address): New typedef.
2630 (Sized_relobj::invalid_address): Move here from child class.
2631 (Sized_relobj::Sized_relobj): Initialize new data members.
2632 (Sized_relobj::sized_relobj): New function.
2633 (Sized_relobj::is_output_section_offset_invalid): Move here from
2634 child class.
2635 (Sized_relobj::get_output_section_offset): Likewise.
2636 (Sized_relobj::local_has_got_offset): Likewise.
2637 (Sized_relobj::local_got_offset): Likewise.
2638 (Sized_relobj::set_local_got_offset): Likewise.
2639 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2640 (Sized_relobj::clear_got_offsets): New function.
2641 (Sized_relobj::section_offsets): Move here from child class.
2642 (Sized_relobj::do_output_section_offset): Likewise.
2643 (Sized_relobj::do_set_section_offset): Likewise.
2644 (Sized_relobj::Local_got_offsets): Likewise.
2645 (Sized_relobj::local_got_offsets_): Likewise.
2646 (Sized_relobj::section_offsets_): Likewise.
2647 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2648 references.
2649 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2650 class.
2651 (Sized_relobj_file::sized_relobj): New function
2652 (Sized_relobj_file::local_has_got_offset): Move to base class.
2653 (Sized_relobj_file::local_got_offset): Likewise.
2654 (Sized_relobj_file::set_local_got_offset): Likewise.
2655 (Sized_relobj_file::get_output_section_offset): Likewise.
2656 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2657 (Sized_relobj_file::do_output_section_offset): Likewise.
2658 (Sized_relobj_file::do_set_section_offset): Likewise.
2659 (Sized_relobj_file::Local_got_offsets): Likewise.
2660 (Sized_relobj_file::local_got_offsets_): Likewise.
2661 (Sized_relobj_file::section_offsets_): Likewise.
2662 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2663 (all constructors).
2664 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2665 (Output_reloc::get_symbol_index): Likewise.
2666 (Output_reloc::local_section_offset): Likewise.
2667 (Output_reloc::get_address): Likewise.
2668 (Output_reloc::symbol_value): Likewise.
2669 (Output_data_got::reserve_slot): Move to class definition.
2670 (Output_data_got::reserve_local): New function.
2671 (Output_data_got::reserve_slot_for_global): Remove.
2672 (Output_data_got::reserve_global): New function.
2673 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2674 (all constructors, two instantiations).
2675 (Output_reloc::get_relobj): New function (two instantiations).
2676 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2677 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2678 (Output_data_reloc::add_global): Adjust type of relobj.
2679 (Output_data_reloc::add_global_relative): Likewise.
2680 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2681 (Output_data_reloc::add_local): Likewise.
2682 (Output_data_reloc::add_local_relative): Likewise.
2683 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2684 (Output_data_reloc::add_local_section): Likewise.
2685 (Output_data_reloc::add_output_section): Likewise.
2686 (Output_data_reloc::add_absolute): Likewise.
2687 (Output_data_reloc::add_target_specific): Likewise.
2688 (Output_data_got::reserve_slot): Move definition here.
2689 (Output_data_got::reserve_local): New function.
2690 (Output_data_got::reserve_global): New function.
2691 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2692 section_offsets_ with accessor function.
2693 (Sized_relobj_file::write_sections): Likewise.
2694 (Sized_relobj_file::do_relocate_sections): Likewise.
2695 * target.h (Sized_target::reserve_local_got_entry): New function.
2696 (Sized_target::reserve_global_got_entry): New function.
2697 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2698 (Target_x86_64::reserve_global_got_entry): New function.
2699 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2700
2701 2011-05-23 Cary Coutant <ccoutant@google.com>
2702
2703 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2704 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2705 bit when checking got_type.
2706 * incremental.cc (Sized_incremental_binary::setup_readers):
2707 Store symbol table and string table locations; initialize bit vector
2708 of file status flags.
2709 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2710 unchanged files.
2711 (Sized_incremental_binary::do_process_got_plt): New function.
2712 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2713 (Output_section_incremental_inputs::set_final_data_size): Record
2714 file index for each input file.
2715 (Output_section_incremental_inputs::write_got_plt): Store file index
2716 instead of input entry offset for each GOT entry.
2717 * incremental.h
2718 (Incremental_input_entry::Incremental_input_entry): Initialize new
2719 data member.
2720 (Incremental_input_entry::set_offset): Store file index.
2721 (Incremental_input_entry::get_file_index): New function.
2722 (Incremental_input_entry::file_index_): New data member.
2723 (Incremental_binary::process_got_plt): New function.
2724 (Incremental_binary::do_process_got_plt): New function.
2725 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2726 data members.
2727 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2728 (Sized_incremental_binary::set_file_is_unchanged): New function.
2729 (Sized_incremental_binary::file_is_unchanged): New function.
2730 (Sized_incremental_binary::do_process_got_plt): New function.
2731 (Sized_incremental_binary::file_status_): New data member.
2732 (Sized_incremental_binary::main_symtab_loc_): New data member.
2733 (Sized_incremental_binary::main_strtab_loc_): New data member.
2734 * output.cc (Output_data_got::Got_entry::write): Add case
2735 RESERVED_CODE.
2736 (Output_data_got::add_global): Call add_got_entry.
2737 (Output_data_got::add_global_plt): Likewise.
2738 (Output_data_got::add_global_with_rel): Likewise.
2739 (Output_data_got::add_global_with_rela): Likewise.
2740 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2741 (Output_data_got::add_global_pair_with_rela): Likewise.
2742 (Output_data_got::add_local): Call add_got_entry.
2743 (Output_data_got::add_local_plt): Likewise.
2744 (Output_data_got::add_local_with_rel): Likewise.
2745 (Output_data_got::add_local_with_rela): Likewise.
2746 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2747 (Output_data_got::add_local_pair_with_rela): Likewise.
2748 (Output_data_got::reserve_slot): New function.
2749 (Output_data_got::reserve_slot_for_global): New function.
2750 (Output_data_got::add_got_entry): New function.
2751 (Output_data_got::add_got_entry_pair): New function.
2752 (Output_section::add_output_section_data): Edit FIXME.
2753 * output.h
2754 (Output_section_data_build::Output_section_data_build): New
2755 constructor with size parameter.
2756 (Output_data_space::Output_data_space): Likewise.
2757 (Output_data_got::Output_data_got): Initialize new data member; new
2758 constructor with size parameter.
2759 (Output_data_got::add_constant): Call add_got_entry.
2760 (Output_data_got::reserve_slot): New function.
2761 (Output_data_got::reserve_slot_for_global): New function.
2762 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2763 (Output_data_got::add_got_entry): New function.
2764 (Output_data_got::add_got_entry_pair): New function.
2765 (Output_data_got::free_list_): New data member.
2766 * target.h (Sized_target::init_got_plt_for_update): New function.
2767 (Sized_target::register_global_plt_entry): New function.
2768 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2769 Initialize new data member; call init; add constructor with PLT count.
2770 (Output_data_plt_x86_64::init): New function.
2771 (Output_data_plt_x86_64::add_relocation): New function.
2772 (Output_data_plt_x86_64::reserve_slot): New function.
2773 (Output_data_plt_x86_64::free_list_): New data member.
2774 (Target_x86_64::init_got_plt_for_update): New function.
2775 (Target_x86_64::register_global_plt_entry): New function.
2776 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2777 incremental updates.
2778 (Output_data_plt_x86_64::add_relocation): New function.
2779 * testsuite/object_unittest.cc (Object_test): Set default options.
2780
2781 2011-05-16 Ian Lance Taylor <iant@google.com>
2782
2783 * options.h (class General_options): Make -i a synonym for -r.
2784
2785 2011-05-16 Ian Lance Taylor <iant@google.com>
2786
2787 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2788
2789 2011-05-10 Cary Coutant <ccoutant@google.com>
2790
2791 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2792 strip_all (-s).
2793
2794 2011-05-06 Ian Lance Taylor <iant@google.com>
2795
2796 * layout.cc (Layout::layout): If the output section flags change,
2797 update the ordering.
2798
2799 2011-04-25 Cary Coutant <ccoutant@google.com>
2800
2801 * incremental-dump.cc (dump_incremental_inputs): Print local
2802 symbol info for each input file.
2803 * incremental.cc
2804 (Output_section_incremental_inputs::set_final_data_size): Add local
2805 symbol info to input file entries in incremental info.
2806 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2807 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2808 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2809 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2810 implementation.
2811 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2812 (Sized_incr_relobj::do_relocate): Write the local symbols.
2813 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2814 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2815 Adjust size of input file header.
2816 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2817 (Incremental_inputs_reader::get_local_symbol_count): New function.
2818 (Incremental_inputs_reader::get_input_section): Adjust size of input
2819 file header.
2820 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2821 (Sized_incr_relobj::This): New typedef.
2822 (Sized_incr_relobj::sym_size): New const data member.
2823 (Sized_incr_relobj::Local_symbol): New struct.
2824 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2825 (Sized_incr_relobj::do_local_symbol_offset): New function.
2826 (Sized_incr_relobj::local_symbol_count_): New data member.
2827 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2828 (Sized_incr_relobj::local_symbol_index_): New data member.
2829 (Sized_incr_relobj::local_symbol_offset_): New data member.
2830 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2831 (Sized_incr_relobj::local_symbols_): New data member.
2832 * object.h (Relobj::output_local_symbol_count): New function.
2833 (Relobj::local_symbol_offset): New function.
2834 (Relobj::do_output_local_symbol_count): New function.
2835 (Relobj::do_local_symbol_offset): New function.
2836 (Sized_relobj::do_output_local_symbol_count): New function.
2837 (Sized_relobj::do_local_symbol_offset): New function.
2838
2839 2011-04-22 Vladimir Simonov <sv@sw.ru>
2840
2841 * descriptors.cc (set_close_on_exec): New function.
2842 (Descriptors::open): Use set_close_on_exec.
2843 * output.cc (S_ISLNK): Define if not defined.
2844
2845 2011-04-22 Cary Coutant <ccoutant@google.com>
2846
2847 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2848 global symbol map.
2849 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2850 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2851 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2852 relocations.
2853 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2854 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2855 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2856 * incremental.h
2857 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2858 function.
2859 (Incremental_binary::apply_incremental_relocs): New function.
2860 (Incremental_binary::do_apply_incremental_relocs): New function.
2861 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2862 data member.
2863 (Sized_incremental_binary::add_global_symbol): New function.
2864 (Sized_incremental_binary::global_symbol): New function.
2865 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2866 (Sized_incremental_binary::symbol_map_): New data member.
2867 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2868 * target.h (Sized_target::apply_relocation): New function.
2869 * target-reloc.h (apply_relocation): New function.
2870 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2871
2872 2011-04-22 Doug Kwan <dougkwan@google.com>
2873
2874 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2875 flag of a SHT_ARM_EXIDX section.
2876 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2877 * testsuite/Makefile.in: Regenerate.
2878 * testsuite/arm_exidx_test.s: New file.
2879 * testsuite/arm_exidx_test.sh: Same.
2880
2881 2011-04-20 Cary Coutant <ccoutant@google.com>
2882
2883 PR gold/12689
2884 * archive.h (Incremental_archive_entry::Archive_member):
2885 Initialize arg_serial_ (second constructor).
2886
2887 2011-04-17 Ian Lance Taylor <iant@google.com>
2888
2889 * object.cc (Relocate_info::location): Simplify location string.
2890 * errors.cc (Errors::error_at_location): Don't print program
2891 name.
2892 (Errors::warning_at_location): Likewise.
2893 (Errors::undefined_symbol): Likewise.
2894 * testsuite/debug_msg.sh: Update accordingly.
2895
2896 2011-04-14 Cary Coutant <ccoutant@google.com>
2897
2898 * gold/layout.cc (Layout::symtab_section_offset): New function.
2899 * gold/layout.h (Layout::symtab_section_offset): New function.
2900 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2901
2902 2011-04-12 Ian Lance Taylor <iant@google.com>
2903
2904 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2905 with MREMAP_MAYMOVE.
2906 * output.h (class Output_file): Add map_is_allocated_ field.
2907 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2908 not available, provide stubs. If mremap is not available, #define
2909 it to gold_mremap.
2910 (MREMAP_MAYMOVE): Define if not defined.
2911 (Output_file::Output_file): Initialize map_is_allocated_.
2912 (Output_file::resize): Check map_is_allocated_.
2913 (Output_file::map_anonymous): If mmap fails, use malloc.
2914 (Output_file::unmap): Don't do anything for an anonymous map.
2915 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2916 is not available, provide stubs.
2917 (File_read::View::~View): Use free rather than delete[].
2918 (File_read::make_view): Use malloc rather than new[]. If mmap
2919 fails, use malloc.
2920 (File_read::find_or_make_view): Use malloc rather than new[].
2921 * gold.h: Remove HAVE_REMAP code.
2922 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2923 exists. Rename mremap to gold_mremap. If mmap is not available
2924 don't do anything.
2925 * configure, config.in: Rebuild.
2926
2927 2011-04-11 Ian Lance Taylor <iant@google.com>
2928
2929 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2930 initialize local variable v.
2931
2932 2011-04-11 Cary Coutant <ccoutant@google.com>
2933
2934 * archive.cc (Archive::include_member): Adjust call to
2935 report_object.
2936 (Add_archive_symbols::run): Track argument serial numbers.
2937 (Lib_group::include_member): Likewise.
2938 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2939 * archive.h (Incremental_archive_entry::Archive_member):
2940 Initialize arg_serial_.
2941 (Archive_member::arg_serial_): New data member.
2942 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2943 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2944 incremental link.
2945 (Sized_dynobj::do_for_all_local_got_entries): New function.
2946 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2947 function.
2948 * fileread.cc (get_mtime): New function.
2949 * fileread.h (get_mtime): New function.
2950 * gold.cc (queue_initial_tasks): Check for incremental update.
2951 (process_incremental_input): New function.
2952 (queue_middle_tasks): Don't force valid target for incremental
2953 update.
2954 * incremental-dump.cc (find_input_containing_global): Adjust
2955 size of symbol info entry.
2956 (dump_incremental_inputs): Dump argument serial number and
2957 in_system_directory flag; bias shndx by 1; print symbol names
2958 when dumping per-file symbol lists; use new symbol info readers.
2959 * incremental.cc
2960 (Output_section_incremental_inputs:update_data_size): New function.
2961 (Sized_incremental_binary::setup_readers): Setup input readers
2962 for each input file; build maps for files added from libraries
2963 and scripts.
2964 (Sized_incremental_binary::check_input_args): New function.
2965 (Sized_incremental_binary::do_check_inputs): Build map of argument
2966 serial numbers to input arguments.
2967 (Sized_incremental_binary::do_file_has_changed): Rename
2968 do_file_is_unchanged to this; compare file modification times.
2969 (Sized_incremental_binary::do_init_layout): New function.
2970 (Sized_incremental_binary::do_reserve_layout): New function.
2971 (Sized_incremental_binary::do_get_input_reader): Remove.
2972 (Sized_incremental_binary::get_symtab_view): New function.
2973 (Incremental_checker::can_incrementally_link_output_file): Remove.
2974 (Incremental_inputs::report_command_line): Exclude --debug options.
2975 (Incremental_inputs::report_archive_begin): Add parameter; track
2976 argument serial numbers; don't put input file entry for archive
2977 before archive members.
2978 (Incremental_inputs::report_archive_end): Put input file entry
2979 for archive after archive members.
2980 (Incremental_inputs::report_object): Add parameter; track argument
2981 serial numbers and in_system_directory flag.
2982 (Incremental_inputs::report_script): Add parameter; track argument
2983 serial numbers.
2984 (Output_section_incremental_inputs::set_final_data_size): Adjust
2985 size of symbol info entry; check for forwarding symbols.
2986 (Output_section_incremental_inputs::write_input_files): Write
2987 in_system_directory flag and argument serial number.
2988 (Output_section_incremental_inputs::write_info_blocks): Map section
2989 indices between incremental info and original input file; store
2990 input section index for each symbol.
2991 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2992 change operator() to visit().
2993 (class Global_got_offset_visitor): Likewise.
2994 (class Global_symbol_visitor_got_plt):
2995 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2996 classes.
2997 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2998 (Sized_incr_relobj::do_read_symbols): New function.
2999 (Sized_incr_relobj::do_layout): New function.
3000 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3001 (Sized_incr_relobj::do_add_symbols): New function.
3002 (Sized_incr_relobj::do_should_include_member): New function.
3003 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3004 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3005 (Sized_incr_relobj::do_section_size): New function.
3006 (Sized_incr_relobj::do_section_name): New function.
3007 (Sized_incr_relobj::do_section_contents): New function.
3008 (Sized_incr_relobj::do_section_flags): New function.
3009 (Sized_incr_relobj::do_section_entsize): New function.
3010 (Sized_incr_relobj::do_section_address): New function.
3011 (Sized_incr_relobj::do_section_type): New function.
3012 (Sized_incr_relobj::do_section_link): New function.
3013 (Sized_incr_relobj::do_section_info): New function.
3014 (Sized_incr_relobj::do_section_addralign): New function.
3015 (Sized_incr_relobj::do_initialize_xindex): New function.
3016 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3017 (Sized_incr_relobj::do_read_relocs): New function.
3018 (Sized_incr_relobj::do_gc_process_relocs): New function.
3019 (Sized_incr_relobj::do_scan_relocs): New function.
3020 (Sized_incr_relobj::do_count_local_symbols): New function.
3021 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3022 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3023 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3024 (Sized_incr_relobj::do_relocate): New function.
3025 (Sized_incr_relobj::do_set_section_offset): New function.
3026 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3027 (Sized_incr_dynobj::do_read_symbols): New function.
3028 (Sized_incr_dynobj::do_layout): New function.
3029 (Sized_incr_dynobj::do_add_symbols): New function.
3030 (Sized_incr_dynobj::do_should_include_member): New function.
3031 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3032 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3033 (Sized_incr_dynobj::do_section_size): New function.
3034 (Sized_incr_dynobj::do_section_name): New function.
3035 (Sized_incr_dynobj::do_section_contents): New function.
3036 (Sized_incr_dynobj::do_section_flags): New function.
3037 (Sized_incr_dynobj::do_section_entsize): New function.
3038 (Sized_incr_dynobj::do_section_address): New function.
3039 (Sized_incr_dynobj::do_section_type): New function.
3040 (Sized_incr_dynobj::do_section_link): New function.
3041 (Sized_incr_dynobj::do_section_info): New function.
3042 (Sized_incr_dynobj::do_section_addralign): New function.
3043 (Sized_incr_dynobj::do_initialize_xindex): New function.
3044 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3045 (make_sized_incremental_object): New function.
3046 (Incremental_library::copy_unused_symbols): New function.
3047 (Incremental_library::do_for_all_unused_symbols): New function.
3048 * incremental.h (enum Incremental_input_flags): New type.
3049 (class Incremental_checker): Remove.
3050 (Incremental_input_entry::Incremental_input_entry): Add argument
3051 serial number.
3052 (Incremental_input_entry::arg_serial): New function.
3053 (Incremental_input_entry::set_is_in_system_directory): New function.
3054 (Incremental_input_entry::is_in_system_directory): New function.
3055 (Incremental_input_entry::arg_serial_): New data member.
3056 (Incremental_input_entry::is_in_system_directory_): New data member.
3057 (class Script_info): Move here from script.h.
3058 (Script_info::Script_info): Add filename parameter.
3059 (Script_info::filename): New function.
3060 (Script_info::filename_): New data member.
3061 (Incremental_script_entry::Incremental_script_entry): Add argument
3062 serial number.
3063 (Incremental_object_entry::Incremental_object_entry): Likewise.
3064 (Incremental_object_entry::add_input_section): Build list of input
3065 sections with map to original shndx.
3066 (Incremental_object_entry::get_input_section_index): New function.
3067 (Incremental_object_entry::shndx_): New data member.
3068 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3069 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3070 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3071 serial number.
3072 (Incremental_inputs::report_archive_begin): Likewise.
3073 (Incremental_inputs::report_object): Likewise.
3074 (Incremental_inputs::report_script): Likewise.
3075 (class Incremental_global_symbol_reader): New class.
3076 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3077 and store flags and input file type.
3078 (Incremental_input_entry_reader::arg_serial): New function.
3079 (Incremental_input_entry_reader::type): Extract type from flags.
3080 (Incremental_input_entry_reader::is_in_system_directory): New function.
3081 (Incremental_input_entry_reader::get_input_section_count): Call
3082 accessor function for type.
3083 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3084 function for type; adjust size of global symbol entry.
3085 (Incremental_input_entry_reader::get_global_symbol_count): Call
3086 accessor function for type.
3087 (Incremental_input_entry_reader::get_object_count): Likewise.
3088 (Incremental_input_entry_reader::get_object_offset): Likewise.
3089 (Incremental_input_entry_reader::get_member_count): Likewise.
3090 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3091 (Incremental_input_entry_reader::get_member_offset): Likewise.
3092 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3093 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3094 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3095 (Incremental_input_entry_reader::get_global_symbol_reader): New
3096 function.
3097 (Incremental_input_entry_reader::get_output_symbol_index): New
3098 function.
3099 (Incremental_input_entry_reader::type_): Remove.
3100 (Incremental_input_entry_reader::flags_): New data member.
3101 (Incremental_inputs_reader::input_file_offset): New function.
3102 (Incremental_inputs_reader::input_file_index): New function.
3103 (Incremental_inputs_reader::input_file): Call input_file_offset.
3104 (Incremental_inputs_reader::input_file_at_offset): New function.
3105 (Incremental_relocs_reader::get_r_type): Reformat.
3106 (Incremental_relocs_reader::get_r_shndx): Reformat.
3107 (Incremental_relocs_reader::get_r_offset): Reformat.
3108 (Incremental_relocs_reader::data): New function.
3109 (Incremental_binary::Incremental_binary): Initialize new data members.
3110 (Incremental_binary::check_inputs): Add cmdline parameter.
3111 (Incremental_binary::file_is_unchanged): Remove.
3112 (Input_reader::arg_serial): New function.
3113 (Input_reader::get_unused_symbol_count): New function.
3114 (Input_reader::get_unused_symbol): New function.
3115 (Input_reader::do_arg_serial): New function.
3116 (Input_reader::do_get_unused_symbol_count): New function.
3117 (Input_reader::do_get_unused_symbol): New function.
3118 (Incremental_binary::input_file_count): New function.
3119 (Incremental_binary::get_input_reader): Change signature to use
3120 index instead of filename.
3121 (Incremental_binary::file_has_changed): New function.
3122 (Incremental_binary::get_input_argument): New function.
3123 (Incremental_binary::get_library): New function.
3124 (Incremental_binary::get_script_info): New function.
3125 (Incremental_binary::init_layout): New function.
3126 (Incremental_binary::reserve_layout): New function.
3127 (Incremental_binary::output_file): New function.
3128 (Incremental_binary::do_check_inputs): New function.
3129 (Incremental_binary::do_file_is_unchanged): Remove.
3130 (Incremental_binary::do_file_has_changed): New function.
3131 (Incremental_binary::do_init_layout): New function.
3132 (Incremental_binary::do_reserve_layout): New function.
3133 (Incremental_binary::do_input_file_count): New function.
3134 (Incremental_binary::do_get_input_reader): Change signature.
3135 (Incremental_binary::input_args_map_): New data member.
3136 (Incremental_binary::library_map_): New data member.
3137 (Incremental_binary::script_map_): New data member.
3138 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3139 new data members.
3140 (Sized_incremental_binary::output_section): New function.
3141 (Sized_incremental_binary::inputs_reader): Add const.
3142 (Sized_incremental_binary::symtab_reader): Add const.
3143 (Sized_incremental_binary::relocs_reader): Add const.
3144 (Sized_incremental_binary::got_plt_reader): Add const.
3145 (Sized_incremental_binary::get_symtab_view): New function.
3146 (Sized_incremental_binary::Inputs_reader): New typedef.
3147 (Sized_incremental_binary::Input_entry_reader): New typedef.
3148 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3149 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3150 (Sized_incremental_binary::do_file_has_changed): New function.
3151 (Sized_incremental_binary::do_init_layout): New function.
3152 (Sized_incremental_binary::do_reserve_layout): New function.
3153 (Sized_input_reader::Inputs_reader): Remove.
3154 (Sized_input_reader::Input_entry_reader): Remove.
3155 (Sized_input_reader::do_arg_serial): New function.
3156 (Sized_input_reader::do_get_unused_symbol_count): New function.
3157 (Sized_input_reader::do_get_unused_symbol): New function.
3158 (Sized_incremental_binary::do_input_file_count): New function.
3159 (Sized_incremental_binary::do_get_input_reader): Change signature;
3160 use index instead of filename.
3161 (Sized_incremental_binary::section_map_): New data member.
3162 (Sized_incremental_binary::input_entry_readers_): New data member.
3163 (class Sized_incr_relobj): New class.
3164 (class Sized_incr_dynobj): New class.
3165 (make_sized_incremental_object): New function.
3166 (class Incremental_library): New class.
3167 * layout.cc (Free_list::num_lists): New static data member.
3168 (Free_list::num_nodes): New static data member.
3169 (Free_list::num_removes): New static data member.
3170 (Free_list::num_remove_visits): New static data member.
3171 (Free_list::num_allocates): New static data member.
3172 (Free_list::num_allocate_visits): New static data member.
3173 (Free_list::init): New function.
3174 (Free_list::remove): New function.
3175 (Free_list::allocate): New function.
3176 (Free_list::dump): New function.
3177 (Free_list::print_stats): New function.
3178 (Layout_task_runner::run): Resize output file for incremental updates.
3179 (Layout::Layout): Initialize new data members.
3180 (Layout::set_incremental_base): New function.
3181 (Layout::init_fixed_output_section): New function.
3182 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3183 incremental updates.
3184 (Layout::create_gold_note): Do not create gold note section for
3185 incremental updates.
3186 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3187 for incremental updates.
3188 (Layout::set_section_offsets): For incremental updates, allocate space
3189 from free list.
3190 (Layout::create_symtab_sections): Layout with offsets relative to
3191 start of section; for incremental updates, allocate space from free
3192 list.
3193 (Layout::create_shdrs): For incremental updates, allocate space from
3194 free list.
3195 (Layout::finish_dynamic_section): For incremental updates, do not
3196 check --as-needed (fixed in subsequent patch).
3197 * layout.h (class Free_list): New class.
3198 (Layout::set_incremental_base): New function.
3199 (Layout::incremental_base): New function.
3200 (Layout::init_fixed_output_section): New function.
3201 (Layout::allocate): New function.
3202 (Layout::incremental_base_): New data member.
3203 (Layout::free_list_): New data member.
3204 * main.cc (main): Print Free_list statistics.
3205 * object.cc (Relobj::finalize_incremental_relocs): Add
3206 clear_counts parameter; clear counts only when clear_counts is set.
3207 (Sized_relobj::Sized_relobj): Initialize new base class.
3208 (Sized_relobj::do_layout): Don't report special sections.
3209 (Sized_relobj::do_for_all_local_got_entries): New function.
3210 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3211 symtab_off to all symbol table offsets.
3212 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3213 * object.h (class Got_offset_list): Move to top of file.
3214 (Object::Object): Allow case where input_file == NULL.
3215 (Object::~Object): Likewise.
3216 (Object::input_file): Assert that input_file != NULL.
3217 (Object::lock): Allow case where input_file == NULL.
3218 (Object::unlock): Likewise.
3219 (Object::is_locked): Likewise.
3220 (Object::token): Likewise.
3221 (Object::release): Likewise.
3222 (Object::is_incremental): New function.
3223 (Object::get_mtime): New function.
3224 (Object::for_all_local_got_entries): New function.
3225 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3226 (Object::set_is_in_system_directory): New function.
3227 (Object::is_in_system_directory): New function.
3228 (Object::do_is_incremental): New function.
3229 (Object::do_get_mtime): New function.
3230 (Object::do_for_all_local_got_entries): New function.
3231 (Object::is_in_system_directory_): New data member.
3232 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3233 (class Sized_relobj_base): New class.
3234 (class Sized_relobj): Derive from Sized_relobj_base.
3235 (class Sized_relobj::Symbols): Redeclare from base class.
3236 (class Sized_relobj::local_got_offset_list): Remove.
3237 (class Sized_relobj::Output_sections): Redeclare from base class.
3238 (class Sized_relobj::do_for_all_local_got_entries): New function.
3239 (class Sized_relobj::write_local_symbols): Add offset parameter.
3240 (class Sized_relobj::local_symbol_offset_): Update comment.
3241 (class Sized_relobj::local_dynsym_offset_): Update comment.
3242 * options.cc (Input_arguments::add_file): Remove const.
3243 * options.h (Input_file_argument::Input_file_argument):
3244 Initialize arg_serial_ (all constructors).
3245 (Input_file_argument::set_arg_serial): New function.
3246 (Input_file_argument::arg_serial): New function.
3247 (Input_file_argument::arg_serial_): New data member.
3248 (Input_arguments::Input_arguments): Initialize file_count_.
3249 (Input_arguments::add_file): Remove const.
3250 (Input_arguments::number_of_input_files): New function.
3251 (Input_arguments::file_count_): New data member.
3252 (Command_line::number_of_input_files): Call
3253 Input_arguments::number_of_input_files.
3254 * output.cc (Output_segment_headers::Output_segment_headers):
3255 Set current size.
3256 (Output_section::Input_section::current_data_size): New function.
3257 (Output_section::Output_section): Initialize new data members.
3258 (Output_section::add_input_section): Don't do merge sections for
3259 an incremental link; allocate space from free list for an
3260 incremental update.
3261 (Output_section::add_output_section_data): Allocate space from
3262 free list for an incremental update.
3263 (Output_section::update_data_size): New function.
3264 (Output_section::set_fixed_layout): New function.
3265 (Output_section::reserve): New function.
3266 (Output_segment::set_section_addresses): Remove const.
3267 (Output_segment::set_section_list_addresses): Remove const; allocate
3268 space from free list for an incremental update.
3269 (Output_segment::set_offset): Adjust size of RELRO segment for an
3270 incremental update.
3271 * output.h (Output_data::current_data_size): Move here from
3272 child classes.
3273 (Output_data::pre_finalize_data_size): New function.
3274 (Output_data::update_data_size): New function.
3275 (Output_section_headers::update_data_size): new function.
3276 (Output_section_data_build::current_data_size): Move to Output_data.
3277 (Output_data_strtab::update_data_size): New function.
3278 (Output_section::current_data_size): Move to Output_data.
3279 (Output_section::set_fixed_layout): New function.
3280 (Output_section::has_fixed_layout): New function.
3281 (Output_section::reserve): New function.
3282 (Output_section::update_data_size): New function.
3283 (Output_section::has_fixed_layout_): New data member.
3284 (Output_section::free_list_): New data member.
3285 (Output_segment::set_section_addresses): Remove const.
3286 (Output_segment::set_section_list_addresses): Remove const.
3287 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3288 New function.
3289 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3290 New function.
3291 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3292 parameter when calling Add_symbols constructor; store argument
3293 serial number for members of a lib group.
3294 (Add_symbols::locks): Allow case where token == NULL.
3295 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3296 (Read_member::~Read_member): New function.
3297 (Read_member::is_runnable): New function.
3298 (Read_member::locks): New function.
3299 (Read_member::run): New function.
3300 (Check_script::~Check_script): New function.
3301 (Check_script::is_runnable): New function.
3302 (Check_script::locks): New function.
3303 (Check_script::run): New function.
3304 (Check_library::~Check_library): New function.
3305 (Check_library::is_runnable): New function.
3306 (Check_library::locks): New function.
3307 (Check_library::run): New function.
3308 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3309 (Add_symbols::library_): New data member.
3310 (class Read_member): New class.
3311 (class Check_script): New class.
3312 (class Check_library): New class.
3313 * reloc.cc (Read_relocs::is_runnable): Allow case where
3314 token == NULL.
3315 (Read_relocs::locks): Likewise.
3316 (Scan_relocs::locks): Likewise.
3317 (Relocate_task::locks): Likewise.
3318 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3319 to clear counters.
3320 (Sized_relobj::incremental_relocs_scan): Fix comment.
3321 (Sized_relobj::do_relocate): Pass output file offset to
3322 write_local_symbols.
3323 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3324 from class declaration.
3325 * script.cc (read_input_script): Allocate Script_info; pass
3326 argument serial number to report_script.
3327 * script.h (class Script_info): Move to incremental.h.
3328 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3329 * symtab.h (Symbol_table::add_from_incrobj): New function.
3330 (Symbol_table::set_file_offset): New function.
3331
3332 2011-04-05 Cary Coutant <ccoutant@google.com>
3333
3334 * incremental-dump.cc (dump_incremental_inputs): Change signature
3335 to take a Sized_incremental_binary; change caller. Use readers
3336 in Sized_incremental_binary.
3337 * incremental.cc
3338 (Sized_incremental_binary::find_incremental_inputs_sections):
3339 Rename do_find_incremental_inputs_sections to this.
3340 (Sized_incremental_binary::setup_readers): New function.
3341 (Sized_incremental_binary::do_check_inputs): Check
3342 has_incremental_info_ flag; move setup code to setup_readers;
3343 use input readers.
3344 (Sized_incremental_binary::do_file_is_unchanged): New function.
3345 (Sized_incremental_binary::do_get_input_reader): New function.
3346 * incremental.h (class Incremental_binary): Move to end of file.
3347 (Incremental_binary::file_is_unchanged): New function.
3348 (Incremental_binary::do_file_is_unchanged): New function.
3349 (Incremental_binary::Input_reader): New class.
3350 (Incremental_binary::get_input_reader): New function.
3351 (class Sized_incremental_binary): Move to end of file.
3352 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3353 input section reader classes.
3354 (Sized_incremental_binary::has_incremental_info): New function.
3355 (Sized_incremental_binary::inputs_reader): New function.
3356 (Sized_incremental_binary::symtab_reader): New function.
3357 (Sized_incremental_binary::relocs_reader): New function.
3358 (Sized_incremental_binary::got_plt_reader): New function.
3359 (Sized_incremental_binary::do_file_is_unchanged): New function.
3360 (Sized_incremental_binary::Sized_input_reader): New class.
3361 (Sized_incremental_binary::get_input_reader): New function.
3362 (Sized_incremental_binary::find_incremental_inputs_sections):
3363 Rename do_find_incremental_inputs_sections to this.
3364 (Sized_incremental_binary::setup_readers): New function.
3365 (Sized_incremental_binary::has_incremental_info_): New data member.
3366 (Sized_incremental_binary::inputs_reader_): New data member.
3367 (Sized_incremental_binary::symtab_reader_): New data member.
3368 (Sized_incremental_binary::relocs_reader_): New data member.
3369 (Sized_incremental_binary::got_plt_reader_): New data member.
3370 (Sized_incremental_binary::current_input_file_): New data member.
3371
3372 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3373
3374 PR gold/12640
3375 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3376 violation.
3377
3378 2011-03-30 Cary Coutant <ccoutant@google.com>
3379
3380 * archive.cc (Archive::include_member): Adjust call to report_object.
3381 (Add_archive_symbols::run): Add script_info to call to
3382 report_archive_begin.
3383 (Lib_group::include_member): Adjust call to report_object.
3384 (Add_lib_group_symbols::run): Adjust call to report_object.
3385 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3386 blocks. Add object count for script input files.
3387 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3388 script_info parameter; change all callers.
3389 (Incremental_inputs::report_object): Add script_info parameter;
3390 change all callers.
3391 (Incremental_inputs::report_script): Store backpointer to
3392 incremental info entry.
3393 (Output_section_incremental_inputs::set_final_data_size): Record
3394 additional information for scripts.
3395 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3396 * incremental.h (Incremental_script_entry::add_object): New function.
3397 (Incremental_script_entry::get_object_count): New function.
3398 (Incremental_script_entry::get_object): New function.
3399 (Incremental_script_entry::objects_): New data member; adjust
3400 constructor.
3401 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3402 (Incremental_inputs::report_object): Add script_info parameter.
3403 (Incremental_inputs_reader::get_object_count): New function.
3404 (Incremental_inputs_reader::get_object_offset): New function.
3405 * options.cc (Input_arguments::add_file): Return reference to
3406 new input argument.
3407 * options.h (Input_argument::set_script_info): New function.
3408 (Input_argument::script_info): New function.
3409 (Input_argument::script_info_): New data member; adjust all
3410 constructors.
3411 (Input_file_group::add_file): Return reference to new input argument.
3412 (Input_file_lib::add_file): Likewise.
3413 (Input_arguments::add_file): Likewise.
3414 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3415 * script.cc (Parser_closure::Parser_closure): Add script_info
3416 parameter; adjust all callers.
3417 (Parser_closure::script_info): New function.
3418 (Parser_closure::script_info_): New data member.
3419 (read_input_script): Report scripts earlier to incremental info.
3420 (script_add_file): Set script_info in Input_argument.
3421 (script_add_library): Likewise.
3422 * script.h (Script_options::Script_info): Rewrite class.
3423
3424 2011-03-29 Cary Coutant <ccoutant@google.com>
3425
3426 * archive.cc (Library_base::should_include_member): Move
3427 method here from class Archive.
3428 (Archive::Archive): Initialize base class.
3429 (Archive::should_include_member): Move to base class.
3430 (Archive::do_for_all_unused_symbols): New function.
3431 (Add_archive_symbols::run): Remove redundant access to
3432 incremental_inputs.
3433 (Lib_group::Lib_group): Initialize base class.
3434 (Lib_group::do_filename): New function.
3435 (Lib_group::include_member): Pass pointer to Lib_group to
3436 report_object.
3437 (Lib_group::do_for_all_unused_symbols): New function.
3438 (Add_lib_group_symbols::run): Report archive information for
3439 incremental links.
3440 * archive.h (class Library_base): New base class.
3441 (class Archive): Derive from Library_base.
3442 (Archive::filename): Move to base class.
3443 (Archive::set_incremental_info): Likewise.
3444 (Archive::incremental_info): Likewise.
3445 (Archive::Should_include): Likewise.
3446 (Archive::should_include_member): Likewise.
3447 (Archive::Armap_entry): Remove.
3448 (Archive::Unused_symbol_iterator): Remove.
3449 (Archive::unused_symbols_begin): Remove.
3450 (Archive::unused_symbols_end): Remove.
3451 (Archive::do_filename): New function.
3452 (Archive::do_get_mtime): New function.
3453 (Archive::do_for_all_unused_symbols): New function.
3454 (Archive::task_): Move to base class.
3455 (Archive::incremental_info_): Likewise.
3456 (class Lib_group): Derive from Library_base.
3457 (Lib_group::do_filename): New function.
3458 (Lib_group::do_get_mtime): New function.
3459 (Lib_group::do_for_all_unused_symbols): New function.
3460 (Lib_group::task_): Move to base class.
3461 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3462 function.
3463 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3464 function.
3465 * incremental.cc (Incremental_inputs::report_archive_begin):
3466 Use Library_base; call library's get_mtime; add incremental inputs
3467 entry before members.
3468 (class Unused_symbol_visitor): New class.
3469 (Incremental_inputs::report_archive_end): Use Library_base; use
3470 visitor class to record unused symbols; don't add incremental inputs
3471 entry after members.
3472 (Incremental_inputs::report_object): Use Library_base.
3473 * incremental.h
3474 (Incremental_archive_entry::Incremental_archive_entry): Remove
3475 unused Archive parameter.
3476 (Incremental_inputs::report_archive_begin): Use Library_base.
3477 (Incremental_inputs::report_archive_end): Likewise.
3478 (Incremental_inputs::report_object): Likewise.
3479 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3480 function.
3481 * object.h (Object::for_all_global_symbols): New function.
3482 (Object::do_for_all_global_symbols): New function.
3483 (Sized_relobj::do_for_all_global_symbols): New function.
3484 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3485 function.
3486 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3487 function.
3488
3489 2011-03-27 Ian Lance Taylor <iant@google.com>
3490
3491 * archive.cc (Archive::interpret_header): Return -1 if something
3492 goes wrong. Change callers accordingly.
3493
3494 2011-03-25 Cary Coutant <ccoutant@google.com>
3495
3496 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3497 * testsuite/Makefile.in: Regenerate.
3498
3499 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3500
3501 * plugin.cc (get_view): New.
3502 (Plugin::load): Pass get_view to the plugin.
3503 (Plugin_manager::get_view): New.
3504
3505 2011-03-21 Ian Lance Taylor <iant@google.com>
3506
3507 * testsuite/final_layout.sh: Rewrite to not use dc.
3508 * testsuite/relro_test.sh: Fail if dc is not present.
3509
3510 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3511
3512 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3513 Change == to -eq.
3514 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3515 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3516 Change == to -eq.
3517 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3518 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3519
3520 2011-03-14 Ian Lance Taylor <iant@google.com>
3521
3522 * script-sections.cc (Sort_output_sections::script_compare):
3523 Rename from is_before, change return type.
3524 (Sort_output_sections::operator()): Adjust accordingly.
3525
3526 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3527
3528 PR gold/12572
3529 * testsuite/odr_violation2.cc: Add comment to make all error line
3530 numbers double digits.
3531 * testsuite/debug_msg.sh: Adjust expected errors.
3532
3533 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3534
3535 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3536 but mark earlier ones as non-canonical
3537 (offset_to_iterator): Update search target and example
3538 (do_addr2line): Return extra lines in a vector*
3539 (format_file_lineno): Extract from do_addr2line
3540 (one_addr2line): Add vector* out-param
3541 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3542 when a lineno entry appeared last for its instruction
3543 (Dwarf_line_info): Add vector* out-param
3544 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3545 * symtab.cc (Odr_violation_compare): Include the lineno in the
3546 comparison again.
3547 (linenos_from_loc): New. Combine the canonical line for an
3548 address with its other lines.
3549 (True_if_intersect): New. Helper functor to make
3550 std::set_intersection a query.
3551 (detect_odr_violations): Compare sets of lines instead of just
3552 one line for each function. This became less deterministic, but
3553 has fewer false positives.
3554 * symtab.h: Declarations.
3555 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3556 mix an optimized and non-optimized object in the same binary
3557 (odr_violation2.so): Same.
3558 * testsuite/Makefile.in: Regenerate from Makefile.am.
3559 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3560 * testsuite/debug_msg.sh: Update line numbers and add
3561 assertions.
3562 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3563 non-optimized context.
3564 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3565 isn't inlined, and use OdrDerived in an optimized context.
3566 * testsuite/odr_header1.h: Defines OdrDerived, where
3567 optimization will change the
3568 first-instruction-in-the-destructor's file and line number.
3569 * testsuite/odr_header2.h: Defines OdrBase.
3570
3571 2011-03-09 Ian Lance Taylor <iant@google.com>
3572
3573 * fileread.cc (File_read::clear_views): Don't delete the whole
3574 file view.
3575
3576 2011-03-08 Ian Lance Taylor <iant@google.com>
3577
3578 PR gold/12525
3579 * fileread.cc: #include <climits>.
3580 (GOLD_IOV_MAX): Define.
3581 (File_read::read_multiple): Limit number of entries by iov_max.
3582 * fileread.h (class File_read): Always set max_readv_entries to
3583 128.
3584
3585 2011-03-07 Ian Lance Taylor <iant@google.com>
3586
3587 PR gold/12525
3588 * options.h (class General_options): Add -dy and -dn.
3589
3590 2011-03-02 Cary Coutant <ccoutant@google.com>
3591
3592 * testsuite/script_test_9.t: Add TLS segment.
3593
3594 2011-03-02 Simon Baldwin <simonb@google.com>
3595
3596 * configure.ac: Add check for gnu_indirect_function support in
3597 the toolchain building binutils.
3598 * configure: Rebuild.
3599
3600 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3601
3602 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3603 plugin only symbols.
3604 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3605 in plugin files as not needed in the symbol table.
3606
3607 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3608
3609 * output.cc (Output_section::add_input_section): Delay fill
3610 generation for section ordering.
3611
3612 2011-02-09 Ian Lance Taylor <iant@google.com>
3613
3614 PR gold/12316
3615 * object.h (class Sized_relobj): Remove clear_local_symbols.
3616 * reloc.cc (Sized_relobj::do_relocate): Don't call
3617 clear_local_symbols.
3618
3619 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3620
3621 * plugin.cc (is_visible_from_outside): Return true for symbols
3622 in the -u option.
3623
3624 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3625
3626 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3627 filename.
3628
3629 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3630
3631 * icf.h (is_section_foldable_candidate): Change type of parameter
3632 to std::string.
3633 * icf.cc (Icf::find_identical_sections): Change type of local variable
3634 section_name to be std::string.
3635 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3636
3637 2011-01-25 Ian Lance Taylor <iant@google.com>
3638
3639 * script.cc (script_add_extern): Rewrite to use
3640 add_symbol_reference.
3641
3642 2011-01-25 Doug Kwan <dougkwan@google.com>
3643
3644 * icf.cc (get_section_contents): Always lock section's object.
3645
3646 2011-01-24 Ian Lance Taylor <iant@google.com>
3647
3648 * options.h (class General_options): Accept
3649 --no-detect-odr-violations.
3650
3651 2011-01-24 Ian Lance Taylor <iant@google.com>
3652
3653 * version.cc (version_string): Bump to 1.11.
3654
3655 2011-01-24 Ian Lance Taylor <iant@google.com>
3656
3657 * plugin.cc (class Plugin_rescan): Define new class.
3658 (Plugin_manager::claim_file): Set any_claimed_.
3659 (Plugin_manager::save_archive): New function.
3660 (Plugin_manager::save_input_group): New function.
3661 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3662 necessary.
3663 (Plugin_manager::new_undefined_symbol): New function.
3664 (Plugin_manager::rescan): New function.
3665 (Plugin_manager::rescannable_defines): New function.
3666 (Plugin_manager::add_input_file): Set any_added_.
3667 * plugin.h (class Plugin_manager): define new fields rescannable_,
3668 undefined_symbols_, any_claimed_, and any_added_. Declare
3669 Plugin_rescan as friend. Declare new functions.
3670 (Plugin_manager::Rescannable): Define type.
3671 (Plugin_manager::Rescannable_list): Define type.
3672 (Plugin_manager::Undefined_symbol_list): Define type.
3673 (Plugin_manager::Plugin_manager): Initialize new fields.
3674 * archive.cc (Archive::defines_symbol): New function.
3675 (Add_archive_symbols::run): Pass archive to plugins if any.
3676 * archive.h (class Archive): Declare defines_symbol.
3677 * readsyms.cc (Input_group::~Input_group): New function.
3678 (Finish_group::run): Pass input_group to plugins if any.
3679 * readsyms.h (class Input_group): Declare destructor.
3680 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3681 any.
3682
3683 2011-01-10 Ian Lance Taylor <iant@google.com>
3684
3685 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3686 section as relro.
3687 (Layout::set_segment_offsets): Reset increase_relro before calling
3688 set_section_addresses a second time.
3689
3690 2011-01-04 Cary Coutant <ccoutant@google.com>
3691
3692 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3693 sections before NOBITS sections.
3694
3695 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3696
3697 * version.cc (print_version): Update copyright to 2011.
3698
3699 2010-12-23 Cary Coutant <ccoutant@google.com>
3700
3701 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3702 of OS to this->add. Add OD parameter to second form of the function.
3703
3704 2010-12-20 Ian Lance Taylor <iant@google.com>
3705
3706 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3707 second of two consecutive entries with same offset.
3708
3709 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3710
3711 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3712 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3713 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3714 to avoid unneeded links against $(LDADD).
3715 * testsuite/Makefile.in: Regenerate.
3716
3717 2010-12-15 Ian Lance Taylor <iant@google.com>
3718
3719 PR gold/12324
3720 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3721 for R_X86_64_32 and R_X86_64_PC32.
3722 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3723 ver_matching_def_pic.o.
3724 (ver_matching_def_pic.o): New target.
3725
3726 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3727
3728 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3729 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3730 Move definition before File_read::View member definitions.
3731 (File_read::View::~View): Initialize and hold lock before
3732 updating current_mapped_bytes.
3733
3734 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3735
3736 * dwarf_reader.cc: Remove outdated comment.
3737 * gold-threads.cc: Fix typo in error message.
3738 * archive.cc: Fix typos in comments.
3739 * archive.h: Likewise.
3740 * arm-reloc-property.cc: Likewise.
3741 * arm-reloc-property.h: Likewise.
3742 * arm-reloc.def: Likewise.
3743 * arm.cc: Likewise.
3744 * attributes.h: Likewise.
3745 * cref.cc: Likewise.
3746 * ehframe.cc: Likewise.
3747 * fileread.h: Likewise.
3748 * gold.h: Likewise.
3749 * i386.cc: Likewise.
3750 * icf.cc: Likewise.
3751 * incremental.h: Likewise.
3752 * int_encoding.cc: Likewise.
3753 * layout.h: Likewise.
3754 * main.cc: Likewise.
3755 * merge.h: Likewise.
3756 * object.cc: Likewise.
3757 * object.h: Likewise.
3758 * options.cc: Likewise.
3759 * readsyms.cc: Likewise.
3760 * reduced_debug_output.cc: Likewise.
3761 * reloc.cc: Likewise.
3762 * script-sections.cc: Likewise.
3763 * sparc.cc: Likewise.
3764 * symtab.h: Likewise.
3765 * target-reloc.h: Likewise.
3766 * target.cc: Likewise.
3767 * target.h: Likewise.
3768 * timer.cc: Likewise.
3769 * timer.h: Likewise.
3770 * x86_64.cc: Likewise.
3771
3772 2010-12-09 Cary Coutant <ccoutant@google.com>
3773
3774 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3775 stack.
3776 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3777 parameter; change all callers.
3778 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3779 * options.h (warn_execstack): New option.
3780
3781 2010-12-07 Doug Kwan <dougkwan@google.com>
3782
3783 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3784 like function call relocations.
3785
3786 2010-12-07 Ian Lance Taylor <iant@google.com>
3787
3788 * archive.cc (Archive::get_elf_object_for_member): Permit
3789 punconfigured to be NULL.
3790 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3791 (Archive::include_member): Pass NULL to get_elf_object_for_member
3792 if we searched for the archive and this is the first included
3793 object.
3794
3795 2010-12-01 Ian Lance Taylor <iant@google.com>
3796
3797 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3798 track_relocs_type_ field.
3799 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3800 Set track_relocs_type_.
3801 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3802 contents when using RELA relocs.
3803 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3804 reloc_map_.
3805 * reloc.cc (Track_relocs::next_addend): New function.
3806 * reloc.h (class Track_relocs): Declare next_addend.
3807
3808 2010-12-01 Ian Lance Taylor <iant@google.com>
3809
3810 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3811 virtual destructor.
3812
3813 2010-12-01 Ian Lance Taylor <iant@google.com>
3814
3815 * README: Update compilers known to work and fail.
3816
3817 2010-11-23 Matthias Klose <doko@ubuntu.com>
3818
3819 * configure.in: For --enable-gold, handle value `default' instead of
3820 `both*'. Always install ld as ld.bfd, install as ld if gold is
3821 not the default.
3822 * configure: Regenerate.
3823
3824 2010-11-18 Doug Kwan <dougkwan@google.com>
3825
3826 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3827 and right_alignment to be zero. Store result alignment only if it is
3828 greater than existing alignment.
3829
3830 2010-11-16 Cary Coutant <ccoutant@google.com>
3831
3832 PR gold/12220
3833 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3834 Check for ".zdebug_line".
3835
3836 2010-11-16 Doug Kwan <dougkwan@google.com>
3837 Cary Coutant <ccoutant@google.com>
3838
3839 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3840 by reference; adjust all callers.
3841 * output.cc (Output_segment::set_section_addresses): Adjust references
3842 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3843 list is empty.
3844 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3845 end at page boundary.
3846
3847 2010-11-16 Cary Coutant <ccoutant@google.com>
3848
3849 PR gold/12220
3850 * layout.cc (Layout::choose_output_section): Transform names of
3851 compressed sections even when using a script with a SECTIONS clause.
3852 (Layout::output_section_name): Remove code to transform
3853 compressed debug section names.
3854 * output.cc (Output_section::add_input_section): Use uncompressed
3855 section size when tracking input sections.
3856
3857 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3858
3859 * symtab.h (Symbol::NON_PIC_REF): Remove.
3860 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3861 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3862 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3863 (Symbol::use_plt_offset): Take a flags argument and pass it
3864 directly to needs_dynamic_reloc. Restrict check for undefined
3865 weak symbols to function calls.
3866 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3867 (Target_arm::Scan::global): Use it.
3868 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3869 (Target_arm::Relocate::relocate): Likewise.
3870 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3871 parameter with an r_type parameter. Use get_reference_flags
3872 to get the flags.
3873 (Target_arm::Relocate::relocate): Update accordingly.
3874 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3875 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3876 (Target_i386::Scan::global): Likewise.
3877 (Target_i386::Relocate::relocate): Likewise.
3878 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3879 parameter with an r_type parameter. Use get_reference_flags
3880 to get the flags.
3881 (Target_i386::Relocate::relocate): Update accordingly.
3882 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3883 (Target_powerpc::Scan::global): Use it.
3884 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3885 (Target_powerpc::Relocate::relocate): Likewise.
3886 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3887 (Target_sparc::Scan::global): Use it.
3888 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3889 (Target_sparc::Relocate::relocate): Likewise.
3890 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3891 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3892 (Target_x86_64::Scan::global): Likewise.
3893 (Target_x86_64::Relocate::relocate): Likewise.
3894
3895 2010-11-08 Doug Kwan <dougkwan@google.com>
3896 Cary Coutant <ccoutant@google.com>
3897
3898 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3899 (Arm_exidx_merge_section::section_contents_): New data member.
3900 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3901 (Arm_input_section::~Arm_input_section): De-allocate memory.
3902 (Arm_input_section::original_contents_): New data member.
3903 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3904 in parameters instead of calling Object::section_contents without
3905 locking.
3906 (Arm_output_section::group_section): New parameter TASK. Pass it
3907 to callees that need locking objects.
3908 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3909 to lock EXIDX input sections. Fix a formatting issue. Call
3910 Arm_exidx_merged_section::build_contents to create merged section
3911 contents.
3912 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3913 to lock object of stub table owner.
3914 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3915 TEXT_SIZE to initialize data member TEXT_SIZE_.
3916 (Arm_exidx_input_section::addralign): Fix typo in comment.
3917 (Arm_exidx_input_section::text_size): New method.
3918 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3919 that require locking objects. Lock objects before scanning for stubs
3920 and updating local symbols.
3921 (Arm_input_section<big_endian>::init): Copy contents of original
3922 input section.
3923 (Arm_input_section<big_endian>::do_write): Use saved contents of
3924 original input section instead of calling Object::section_contents
3925 without locking.
3926 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3927 size without calling Object::section_size().
3928 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3929 for size. Allocate a buffer for merged EXIDX entries.
3930 (Arm_exidx_merged_section::build_contents): New method.
3931 (Arm_exidx_merged_section::do_write): Move merge section contents
3932 building code to Arm_exidx_merged_section::build_contetns. Write
3933 out contetns in buffer instead of building it on the fly.
3934 (Arm_relobj::make_exidx_input_section): Also pass text section size
3935 to Arm_exidx_input_section constructor.
3936 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3937 (Arm_dynobj::do_read_symbols): Fix memory leak.
3938 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3939 * target.h: (class Task): Add forward declaration.
3940 (Target::relax): Add new parameter TASK and pass it to
3941 Target::do_relax().
3942 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3943
3944 2010-11-05 Cary Coutant <ccoutant@google.com>
3945
3946 PR gold/10708
3947 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3948 object when reading from the file.
3949 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3950 second layout pass.
3951 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3952 when reading section contents.
3953 (get_section_contents): Likewise.
3954 (icf::find_identical_sections): Likewise.
3955 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3956 object when reading from the file.
3957 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3958 the object when doing deferred section layout.
3959
3960 2010-11-03 Nick Clifton <nickc@redhat.com>
3961
3962 PR gold/12001
3963 * script.h (class Symbol_assignment: name): New member. Returns
3964 the name of the symbol.
3965 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3966 Returns true if the given symbol name is on the list of
3967 assignments wating to be processed.
3968 * archive.cc (should_incldue_member): If the symbol is undefined,
3969 check to see if it is on the list of symbols pending assignment.
3970
3971 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3972
3973 * script-sections.cc (Script_sections::find_memory_region): Check
3974 for a NULL output section pointer.
3975
3976 2010-10-29 Doug Kwan <dougkwan@google.com>
3977
3978 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3979 Output_section::add_relaxed_input_section.
3980 * output.cc (Output_section::add_relaxed_input_section): Add new
3981 arguments LAYOUT and NAME. Set section order index.
3982 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3983 Copy section order index.
3984 * output.h (Output_section::add_relaxed_input_section): Add new
3985 arguments LAYOUT and NAME.
3986
3987 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3988
3989 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3990 NATIVE_OR_CROSS_LINKER.
3991 * testsuite/Makefile.in: Regenerate.
3992
3993 2010-10-20 Doug Kwan <dougkwan@google.com>
3994
3995 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3996 without SHF_LINK_ORDER flags.
3997 * layout.cc (Layout::choose_output_section): Do not filter
3998 SHF_LINK_ORDER flag in a relocatable link.
3999
4000 2010-10-17 Cary Coutant <ccoutant@google.com>
4001
4002 * output.h (Output_segment::set_section_addresses): Change function
4003 signature. Update all callers.
4004 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4005 sections.
4006 (Output_segment::set_section_addresses): Align after last TLS
4007 section. Add padding before last relro section instead of after.
4008
4009 2010-10-17 Doug Kwan <dougkwan@google.com>
4010
4011 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4012 GOT output section to be writable.
4013
4014 2010-10-14 Cary Coutant <ccoutant@google.com>
4015
4016 * debug.h (DEBUG_INCREMENTAL): New flag.
4017 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4018 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4019 mode.
4020 * incremental.cc (report_command_line): Ignore all forms of
4021 --incremental.
4022 * layout.cc (Layout::Layout): Check parameters for incremental link
4023 mode.
4024 * options.cc (General_options::parse_incremental): New function.
4025 (General_options::parse_no_incremental): New function.
4026 (General_options::parse_incremental_full): New function.
4027 (General_options::parse_incremental_update): New function.
4028 (General_options::incremental_mode_): New data member.
4029 (General_options::finalize): Check incremental_mode_.
4030 * options.h (General_options): Update help text for --incremental.
4031 Add --no-incremental, --incremental-full, --incremental-update.
4032 (General_options::Incremental_mode): New enum type.
4033 (General_options::incremental_mode): New function.
4034 (General_options::incremental_mode_): New data member.
4035 * parameters.cc (Parameters::incremental_mode_): New data member.
4036 (Parameters::set_options): Set incremental_mode_.
4037 (Parameters::set_incremental_full): New function.
4038 (Parameters::incremental): New function.
4039 (Parameters::incremental_update): New function.
4040 (set_parameters_incremental_full): New function.
4041 * parameters.h (Parameters::set_incremental_full): New function.
4042 (Parameters::incremental): New function.
4043 (Parameters::incremental_update): New function.
4044 (Parameters::incremental_mode_): New data member.
4045 (set_parameters_incremental_full): New function.
4046 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4047 incremental link mode.
4048 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4049 (Sized_relobj::do_relocate_sections): Likewise.
4050 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4051 option.
4052 * testsuite/Makefile.in: Regenerate.
4053 * testsuite/incremental_test.sh: Filter all forms of --incremental.
4054
4055 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4056
4057 * script-sections.h (class Script_sections): Make
4058 Sections_elements typedef public.
4059 * script-sections.cc (class Sort_output_sections): Add elements_
4060 field. Add constructor which sets it; change all callers.
4061 (Sort_output_sections::is_before): New function.
4062 (Sort_output_sections::operator()): Call is_before.
4063 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4064 conditional.
4065 * testsuite/script_test_10.sh: New test. Test script section
4066 order.
4067 * testsuite/script_test_10.t: Likewise.
4068 * testsuite/script_test_10.s: Likewise.
4069 * testsuite/Makefile.am: Wrap the cross linker tests and the
4070 common tests into NATIVE_OR_CROSS_LINKER.
4071 (check_SCRIPTS): Add script_test_10.sh.
4072 (check_DATA): Add script_test_10.stdout.
4073 (script_test_10.o, script_test_10): New targets.
4074 (script_test_10.stdout): New target.
4075 * configure, testsuite/Makefile.in: Regenerate.
4076
4077 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4078
4079 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4080 error for the deprecated relocations.
4081 (Target_arm::Scan::global): Likewise.
4082 (Target_arm::Relocate::relocate): Likewise.
4083
4084 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4085
4086 * fileread.cc (Input_file::find_file): Initialize *found_name
4087 and *namep when using the fallback search for case 4.
4088
4089 2010-10-11 Cary Coutant <ccoutant@google.com>
4090
4091 * options.h (class General_options): Redefine -z lazy as an alias for
4092 the negation of -z now.
4093
4094 2010-10-11 Ian Lance Taylor <iant@google.com>
4095
4096 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4097 binding.
4098
4099 2010-10-06 Nick Clifton <nickc@redhat.com>
4100
4101 * script-sections.cc(class Memory_region): Remove
4102 current_lma_offset_ field. Rename current_vma_offset_ to
4103 current_offset_. Add last_section_ field.
4104 (Memory_region::get_current_vma_address): Rename to
4105 get_current_address.
4106 (Memory_region::get_current_lma_address): Delete.
4107 (Memory_region::increment_vma_offset): Rename to
4108 increment_offset.
4109 (Memory_region::increment_lma_offset): Delete.
4110 (Memory_region::attributes_compatible): New method. Returns
4111 true if the provided section is compatible with the region.
4112 (Memory_region::get_last_section): New method. Returns the last
4113 section to use the region.
4114 (Memory_region::set_last_section): New method. Stores the last
4115 section to use the region.
4116 (Script_sections::block_in_region): New method. Returns true if
4117 a block of memory is contained within a region.
4118 (Script_sections::find_memory_region): New method. Locates a
4119 memory region to be used to set a VMA or LMA address.
4120 (Output_section_definition::set_section_addresses): Add code to
4121 check for addresses set by memory regions.
4122 (Output_segment::set_section_addresses): Remove memory region
4123 walking code.
4124 (Script_sections::create_segment): Add a warning if a header
4125 segment is created outside of any region.
4126 * script-sections.h (class Script_sections): Add prototypes for
4127 find_memory_region and block_in_region methods.
4128 * testsuite/memory_test.s: Use .long instead of .word.
4129 * testsuite/memory_test.t: Add some more output sections.
4130 * testsuite/memory_test.sh: Update expected output.
4131
4132 2010-10-02 Doug Kwan <dougkwan@google.com>
4133
4134 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4135 defintion to symtab.h
4136 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4137 declaration to defintion.
4138
4139 2010-10-01 Nick Clifton <nickc@redhat.com>
4140
4141 * expression.cc (eval): Replace dummy argument with NULL.
4142 (eval_maybe_dot): Check for a NULL result section pointer.
4143 (Symbol_expression::value): Likewise.
4144 (Dot_expression::value): Likewise.
4145 (BINARY_EXPRESSION): Likewise.
4146 (Max_expression::value): Likewise.
4147 (Min_expression::value): Likewise.
4148 (Absolute_expression::value): Likewise.
4149 (Addr_expression::value_from_output_section): Likewise.
4150 (Loaddddr_expression::value_from_output_section): Likewise.
4151 (Segment_start_expression::value): Likewise.
4152 * script-sections.cc
4153 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4154 argument with NULL.
4155 (Sections_elememt_dot_assignment::set_section_addresses):
4156 Likewise.
4157 (Output_data_expression::do_write_to_buffer): Likewise.
4158 (Output_section_definition::finalize_symbols): Likewise.
4159 (Output_section_definition::set_section_addresses): Likewise.
4160
4161 2010-09-30 Doug Kwan <dougkwan@google.com>
4162
4163 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4164
4165 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4166
4167 * target.h (Target::can_icf_inline_merge_sections): New virtual
4168 function.
4169 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4170 virtual function.
4171 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4172 virtual function.
4173 * icf.cc (get_section_contents): Inline merge sections only when
4174 target allows it.
4175
4176 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4177
4178 * configure: Regenerate.
4179
4180 2010-09-17 Ian Lance Taylor <iant@google.com>
4181
4182 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4183 * testsuite/Makefile.am (memory_test.o): New target.
4184 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4185 memory_test.t.
4186 * testsuite/Makefile.in: Rebuild.
4187
4188 2010-09-17 Doug Kwan <dougkwan@google.com>
4189
4190 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4191 defintion if relocation uses GOT entries of the symbol.
4192 * testsuite/icf_safe_test.sh: Fix test.
4193 * testsuite/icf_safe_so_test.sh: Fix test.
4194
4195 2010-09-16 Cary Coutant <ccoutant@google.com>
4196
4197 * script_sections.cc (class Memory_region): Remove "NULL" from
4198 vector initializations.
4199
4200 2010-09-15 Cary Coutant <ccoutant@google.com>
4201
4202 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4203 Resolve forwarding symbols.
4204
4205 2010-09-15 Doug Kwan <dougkwan@google.com>
4206
4207 * gold/testsuite/script_test_3.t: Add ARM special sections.
4208 * gold/testsuite/script_test_4.t: Same.
4209 * gold/testsuite/script_test_5.t: Same.
4210 * gold/testsuite/script_test_6.t: Same.
4211 * gold/testsuite/script_test_7.t: Same.
4212 * gold/testsuite/script_test_7.t: Same.
4213 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4214
4215 2010-09-14 Cary Coutant <ccoutant@google.com>
4216
4217 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4218 (Target_x86_64::Relocate::relocate_tls): Replace check for
4219 saw_tls_block_reloc_ with test for executable section.
4220
4221 2010-09-12 Cary Coutant <ccoutant@google.com>
4222
4223 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4224 position-independent executables to shared libraries need dynamic
4225 relocations.
4226 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4227 position-independent executables.
4228 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4229 * testsuite/Makefile.in: Regenerate.
4230
4231 2010-09-10 Nick Clifton <nickc@redhat.com>
4232
4233 PR gold/11997
4234 * testsuite/memory_test.t: Discard any sections that are not
4235 needed.
4236
4237 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4238
4239 PR gold/11996
4240 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4241 "This::" to work around a bug in gcc 4.2.
4242
4243 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4244
4245 2010-09-09 Rafael Espindola <espindola@google.com>
4246
4247 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4248 sections with different PF_X flags in the same segment.
4249 (Layout::find_first_load_seg): Search all segments to find the first
4250 one.
4251 * options.h (rosegment): New.
4252
4253 2010-09-08 Rafael Espindola <espindola@google.com>
4254
4255 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4256
4257 2010-09-08 Doug Kwan <dougkwan@google.com>
4258
4259 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4260 (Arm_relobj::do_relocate_sections): Add new parameter for output
4261 file to match the parent.
4262 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4263 of local symbols instead of input values. Update code to track
4264 changes in gold::relocate_section.
4265 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4266 (Sized_relobj::compute_final_local_value_internal): New methods.
4267 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4268 body into private version of Sized_relobj::compute_final_local_value.
4269 Call the inline method.
4270 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4271 merged symbol value if there is one.
4272 (Symbol_value::has_output_value): New method defintiion.
4273 (Sized_relobj::Compute_final_local_value_status): New enum type.
4274 (Sized_relobj::compute_final_local_value): New methods.
4275 (Sized_relobj::compute_final_local_value_internal): New methods.
4276 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4277 and arm_cortex_a8.sh.
4278 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4279 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4280 New tests.
4281 * Makefile.in: Regenerate.
4282 * testsuite/arm_bl_out_of_range.s: Update test.
4283 * testsuite/thumb_bl_out_of_range.s: Ditto.
4284 * testsuite/thumb_blx_out_of_range.s: Ditto.
4285 * testsuite/arm_branch_out_of_range.sh: New file.
4286 * testsuite/arm_cortex_a8.sh: Ditto.
4287 * testsuite/arm_cortex_a8_b.s: Ditto.
4288 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4289 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4290 * testsuite/arm_cortex_a8_bl.s: Ditto.
4291 * testsuite/arm_cortex_a8_blx.s: Ditto.
4292 * testsuite/arm_cortex_a8_local.s: Ditto.
4293 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4294 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4295
4296 2010-09-08 Rafael Espindola <espindola@google.com>
4297
4298 * Makefile.am (memory_test.stdout): Run readelf with -W.
4299 * Makefile.in: Regenerate.
4300 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4301 64 bit output.
4302
4303 2010-09-08 Rafael Espindola <espindola@google.com>
4304
4305 * script-sections.cc (Script_sections::add_memory_region): Convert
4306 field precision to int.
4307 * script.cc (script_set_section_region, script_set_section_region):
4308 Convert field precision to int.
4309
4310 2010-09-08 Rafael Espindola <espindola@google.com>
4311
4312 * arm.cc (do_finalize_sections): Create the __exidx_start and
4313 __exdix_end symbols even when the section is missing.
4314
4315 2010-09-08 Nick Clifton <nickc@redhat.com>
4316
4317 * README: Remove claim that MEMORY is not supported.
4318 * expression.cc (script_exp_function_origin)
4319 (script_exp_function_length): Move from here to ...
4320 * script.cc: ... here.
4321 (script_set_section_region, script_add_memory)
4322 (script_parse_memory_attr, script_include_directive): New
4323 functions.
4324 * script-sections.cc
4325 (class Memory_region): New class.
4326 (class Output_section_definition): Add set_memory_region,
4327 set_section_vma, set_section_lma and get_section_name methods.
4328 (class Script_Sections): Add add_memory_region,
4329 find_memory_region, find_memory_region_origin,
4330 find_memory_region_length and set_memory_region methods.
4331 Have set_section_addresses method walk the list of set memory
4332 regions.
4333 Extend the print methos to display memory regions.
4334 * script-sections.h: Add prototypes for new methods.
4335 Add enum for MEMORY region attributes.
4336 * yyscript.y: Add support for parsing MEMORY regions.
4337 * script-c.h: Add prototypes for new functions.
4338 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4339 * testsuite/Makefile.in: Regenerate.
4340 * testsuite/memory_test.sh: New script.
4341 * testsuite/memory_test.s: New assembler source file.
4342 * testsuite/memory_test.t: New linker script.
4343
4344 2010-08-27 Doug Kwan <dougkwan@google.com>
4345
4346 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4347 reference override an existing dynamic weak reference.
4348 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4349 * testsuite/Makefile.in: Regenerate.
4350 * testsuite/dyn_weak_ref.sh: New file.
4351 * testsuite/dyn_weak_ref_1.c: Ditto.
4352 * testsuite/dyn_weak_ref_2.c: Ditto.
4353
4354 2010-08-27 Ian Lance Taylor <iant@google.com>
4355
4356 * incremental.h (class Incremental_input_entry): Add virtual
4357 destructor.
4358
4359 2010-08-27 Ian Lance Taylor <iant@google.com>
4360
4361 * testsuite/start_lib_test_3.c: Mark t3 as used.
4362
4363 2010-08-27 Nick Clifton <nickc@redhat.com>
4364
4365 * options.cc (version_script): Fix small typo in previous
4366 whitespace tidyup.
4367
4368 2010-08-25 Nick Clifton <nickc@redhat.com>
4369
4370 * archive.cc: Formatting fixes: Remove whitespace between
4371 typename and following asterisk. Remove whitespace between
4372 function name and opening parenthesis.
4373 * archive.h: Likewise.
4374 * arm.cc: Likewise.
4375 * attributes.cc: Likewise.
4376 * attributes.h: Likewise.
4377 * common.cc: Likewise.
4378 * copy-relocs.cc: Likewise.
4379 * dirsearch.h: Likewise.
4380 * dynobj.cc: Likewise.
4381 * ehframe.cc: Likewise.
4382 * ehframe.h: Likewise.
4383 * expression.cc: Likewise.
4384 * fileread.cc: Likewise.
4385 * fileread.h: Likewise.
4386 * gc.h: Likewise.
4387 * gold-threads.cc: Likewise.
4388 * gold.cc: Likewise.
4389 * i386.cc: Likewise.
4390 * icf.h: Likewise.
4391 * incremental-dump.cc: Likewise.
4392 * incremental.cc: Likewise.
4393 * layout.cc: Likewise.
4394 * layout.h: Likewise.
4395 * main.cc: Likewise.
4396 * merge.cc: Likewise.
4397 * merge.h: Likewise.
4398 * object.cc: Likewise.
4399 * object.h: Likewise.
4400 * options.cc: Likewise.
4401 * options.h: Likewise.
4402 * output.cc: Likewise.
4403 * output.h: Likewise.
4404 * plugin.cc: Likewise.
4405 * plugin.h: Likewise.
4406 * powerpc.cc: Likewise.
4407 * reloc.cc: Likewise.
4408 * script-c.h: Likewise.
4409 * script-sections.cc: Likewise.
4410 * script.cc: Likewise.
4411 * stringpool.cc: Likewise.
4412 * symtab.cc: Likewise.
4413 * symtab.h: Likewise.
4414 * target.cc: Likewise.
4415 * timer.cc: Likewise.
4416 * timer.h: Likewise.
4417 * version.cc: Likewise.
4418 * x86_64.cc: Likewise.
4419
4420 2010-08-24 Nick Clifton <nickc@redhat.com>
4421
4422 PR 11899
4423 * layout.cc (segment_precedes): Sort segments by their physical
4424 addresses, if they have been set.
4425
4426 2010-08-23 Cary Coutant <ccoutant@google.com>
4427
4428 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4429 symbols data.
4430 (Lib_group::include_member): Unlock object after deleting its
4431 symbols data.
4432 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4433 the bug fixed here.
4434
4435 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4436 Cary Coutant <ccoutant@google.com>
4437
4438 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4439 constructor, and set_blocker.
4440 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4441 readsyms_blocker_.
4442 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4443 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4444 * testsuite/Makefile.am (start_lib_test): New test case.
4445 * testsuite/Makefile.in: Regenerate.
4446 * testsuite/start_lib_test_main.c: New file.
4447 * testsuite/start_lib_test_1.c: New file.
4448 * testsuite/start_lib_test_2.c: New file.
4449 * testsuite/start_lib_test_3.c: New file.
4450
4451 2010-08-19 Ian Lance Taylor <iant@google.com>
4452
4453 * Makefile.in: Rebuild with automake 1.11.1.
4454 * aclocal.m4: Likewise.
4455 * testsuite/Makefile.in: Likewise.
4456
4457 2010-08-19 Ian Lance Taylor <iant@google.com>
4458
4459 PR 10893
4460 * i386.cc (class Output_data_plt_i386): Update declarations.
4461 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4462 local_ifuncs_ fields.
4463 (Target_i386::do_plt_section_for_global): New function.
4464 (Target_i386::do_plt_section_for_local): New function.
4465 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4466 parameter; change all callers. Initialize global_ifuncs_ and
4467 local_ifuncs_. If doing a static link define __rel_iplt_start and
4468 __rel_iplt_end.
4469 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4470 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4471 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4472 symbols.
4473 (Target_i386::make_plt_section): New function, broken out of
4474 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4475 (Target_i386::make_plt_entry): Call make_plt_section.
4476 (Target_i386::make_local_ifunc_plt_entry): New function.
4477 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4478 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4479 R_386_IRELATIVE to switch.
4480 (Target_i386::Scan::global): Likewise.
4481 (Target_i386::Relocate::relocate): Likewise.
4482 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4483 switch.
4484 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4485 (Target_x86_64::do_plt_section_for_global): New function.
4486 (Target_x86_64::do_plt_section_for_local): New function.
4487 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4488 parameter; change all callers. If doing a static link define
4489 __rela_iplt_start and __rela_iplt_end.
4490 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4491 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4492 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4493 to point to .plt.
4494 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4495 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4496 switch.
4497 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4498 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4499 R_X86_64_IRELATIVE to switch.
4500 (Target_x86_64::Scan::global): Likewise.
4501 (Target_x86_64::Relocate::relocate): Likewise.
4502 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4503 switch.
4504 * target.h (class Target): Add plt_section_for_global and
4505 plt_section_for_local functions. Add do_plt_section_for_global
4506 and do_plt_section_for_local virtual functions.
4507 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4508 clarifying comments.
4509 (Symbol::use_plt_offset): Handle IFUNC symbol.
4510 * object.cc (Sized_relobj::Sized_relobj): Initialize
4511 local_plt_offsets_.
4512 (Sized_relobj::local_has_plt_offset): New function.
4513 (Sized_relobj::local_plt_offset): New function.
4514 (Sized_relobj::set_local_plt_offset): New function.
4515 (Sized_relobj::do_count): Handle IFUNC symbol.
4516 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4517 a bit away from input_shndx_ field. Add set_is_func_symbol and
4518 is_ifunc_symbol functions.
4519 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4520 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4521 local_plt_offsets_ field.
4522 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4523 * output.h (class Output_section_data): Add non-const
4524 output_section function.
4525 (class Output_data_got): Update declarations.
4526 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4527 Add use_plt_offset parameter to global and local constructors.
4528 Change all callers. Change local_sym_index_ field to 31 bits.
4529 Change GSYM_CODE and CONSTANT_CODE accordingly.
4530 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4531 doing a static link don't set sh_link field.
4532 (Output_data_got::Got_entry::write): Use PLT offset if
4533 appropriate.
4534 (Output_data_got::add_global_plt): New function.
4535 (Output_data_got::add_local_plt): New function.
4536 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4537 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4538 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4539 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4540 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4541 IFUNC conditional.
4542 * testsuite/ifunc-sel.h: New file.
4543 * testsuite/ifuncmain1.c: New file.
4544 * testsuite/ifuncmain1vis.c: New file.
4545 * testsuite/ifuncmod1.c: New file.
4546 * testsuite/ifuncdep2.c: New file.
4547 * testsuite/ifuncmain2.c: New file.
4548 * testsuite/ifuncmain3.c: New file.
4549 * testsuite/ifuncmod3.c: New file.
4550 * testsuite/ifuncmain4.c: New file.
4551 * testsuite/ifuncmain5.c: New file.
4552 * testsuite/ifuncmod5.c: New file.
4553 * testsuite/ifuncmain6pie.c: New file.
4554 * testsuite/ifuncmod6.c: New file.
4555 * testsuite/ifuncmain7.c: New file.
4556 * configure, testsuite/Makefile.in: Rebuild.
4557
4558 2010-08-18 Ian Lance Taylor <iant@google.com>
4559
4560 * incremental.cc
4561 (Output_section_incremental_inputs::write_input_files): Add cast
4562 to avoid signed/unsigned comparison warning.
4563 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4564
4565 2010-08-12 Cary Coutant <ccoutant@google.com>
4566
4567 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4568
4569 2010-08-13 Ian Lance Taylor <iant@google.com>
4570
4571 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4572
4573 2010-08-12 Cary Coutant <ccoutant@google.com>
4574 Doug Kwan <dougkwan@google.com>
4575
4576 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4577 defintion overrides non-weak undef, remember that the original undef
4578 is not weak.
4579 * symtab.cc (Symbol_table::sized_write_global): For undef without
4580 an original weak binding, set binding to global in output.
4581 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4582 * testsuite/Makefile.in: Regenerate.
4583 * testsuite/strong_ref_weak_def.sh: New file.
4584 * testsuite/strong_ref_weak_def_1.c: Ditto.
4585 * testsuite/strong_ref_weak_def_2.c: Ditto.
4586
4587 2010-08-12 Cary Coutant <ccoutant@google.com>
4588
4589 * testsuite/incremental_test.sh: Rewrite.
4590 * testsuite/incremental_test_1.c: Rewrite.
4591 * testsuite/incremental_test_2.c: Rewrite.
4592
4593 2010-08-12 Cary Coutant <ccoutant@google.com>
4594
4595 * arm.cc (Target_arm::got_size): Add const.
4596 (Target_arm::got_entry_count): New function.
4597 (Target_arm::plt_entry_count): New function.
4598 (Target_arm::first_plt_entry_offset): New function.
4599 (Target_arm::plt_entry_size): New function.
4600 (Output_data_plt_arm::entry_count): New function.
4601 (Output_data_plt_arm::first_plt_entry_offset): New function.
4602 (Output_data_plt_arm::get_plt_entry_size): New function.
4603 * i386.cc (Target_i386::got_size): Add const.
4604 (Target_i386::got_entry_count): New function.
4605 (Target_i386::plt_entry_count): New function.
4606 (Target_i386::first_plt_entry_offset): New function.
4607 (Target_i386::plt_entry_size): New function.
4608 (Output_data_plt_i386::entry_count): New function.
4609 (Output_data_plt_i386::first_plt_entry_offset): New function.
4610 (Output_data_plt_i386::get_plt_entry_size): New function.
4611 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4612 find_incremental_inputs_sections. Dump incremental_got_plt section.
4613 * incremental.cc: Include target.h.
4614 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4615 parameter. Adjust all callers. Find incremental_got_plt section.
4616 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4617 section.
4618 (Output_section_incremental_inputs::set_final_data_size): Calculate
4619 size of incremental_got_plt section.
4620 (Output_section_incremental_inputs::do_write): Write the
4621 incremental_got_plt section.
4622 (Got_plt_view_info): New struct.
4623 (Local_got_offset_visitor): New class.
4624 (Global_got_offset_visitor): New class.
4625 (Global_symbol_visitor_got_plt): New class.
4626 (Output_section_incremental_inputs::write_got_plt): New function.
4627 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4628 Add parameter. Adjust all callers.
4629 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4630 (Incremental_inputs::got_plt_section): New function.
4631 (Incremental_inputs::got_plt_section_): New data member.
4632 (Incremental_got_plt_reader): New class.
4633 * layout.cc (Layout::create_incremental_info_sections): Add the
4634 incremental_got_plt section.
4635 * object.h (Got_offset_list::get_list): New function.
4636 (Got offset_list::for_all_got_offsets): New function.
4637 (Sized_relobj::local_got_offset_list): New function.
4638 * powerpc.cc (Target_powerpc::got_size): Add const.
4639 (Target_powerpc::got_entry_count): New function.
4640 (Target_powerpc::plt_entry_count): New function.
4641 (Target_powerpc::first_plt_entry_offset): New function.
4642 (Target_powerpc::plt_entry_size): New function.
4643 (Output_data_plt_powerpc::entry_count): New function.
4644 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4645 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4646 * sparc.cc (Target_sparc::got_size): Add const.
4647 (Target_sparc::got_entry_count): New function.
4648 (Target_sparc::plt_entry_count): New function.
4649 (Target_sparc::first_plt_entry_offset): New function.
4650 (Target_sparc::plt_entry_size): New function.
4651 (Output_data_plt_sparc::entry_count): New function.
4652 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4653 (Output_data_plt_sparc::get_plt_entry_size): New function.
4654 * symtab.h (Symbol::got_offset_list): New function.
4655 (Symbol_table::for_all_symbols): New function.
4656 * target.h (Sized_target::got_entry_count): New function.
4657 (Sized_target::plt_entry_count): New function.
4658 (Sized_target::plt_entry_size): New function.
4659 * x86_64.cc (Target_x86_64::got_size): Add const.
4660 (Target_x86_64::got_entry_count): New function.
4661 (Target_x86_64::plt_entry_count): New function.
4662 (Target_x86_64::first_plt_entry_offset): New function.
4663 (Target_x86_64::plt_entry_size): New function.
4664 (Output_data_plt_x86_64::entry_count): New function.
4665 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4666 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4667
4668 2010-08-12 Cary Coutant <ccoutant@google.com>
4669
4670 * archive.cc: Include incremental.h.
4671 (Archive::Archive): Initialize incremental_info_.
4672 (Archive::include_member): Record archive members in incremental info.
4673 (Add_archive_symbols::run): Record begin and end of an archive in
4674 incremental info.
4675 (Lib_group::include_member): Record objects in incremental info.
4676 * archive.h (Incremental_archive_entry): Forward declaration.
4677 (Archive::set_incremental_info): New member function.
4678 (Archive::incremental_info): New member function.
4679 (Archive::Unused_symbol_iterator): New class.
4680 (Archive::unused_symbols_begin): New member function.
4681 (Archive::unused_symbols_end): New member function.
4682 (Archive::incremental_info_): New data member.
4683 * incremental-dump.cc (find_input_containing_global): New function.
4684 (dump_incremental_inputs): Dump new incremental info sections.
4685 * incremental.cc: Include symtab.h.
4686 (Output_section_incremental_inputs): New class.
4687 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4688 new incremental info sections.
4689 (Sized_incremental_binary::do_check_inputs): Likewise.
4690 (Incremental_inputs::report_archive): Remove.
4691 (Incremental_inputs::report_archive_begin): New function.
4692 (Incremental_inputs::report_archive_end): New function.
4693 (Incremental_inputs::report_object): New function.
4694 (Incremental_inputs::finalize_inputs): Remove.
4695 (Incremental_inputs::report_input_section): New function.
4696 (Incremental_inputs::report_script): Rewrite.
4697 (Incremental_inputs::finalize): Do nothing but finalize string table.
4698 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4699 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4700 (Incremental_inputs::create_data_sections): New function.
4701 (Incremental_inputs::relocs_entsize): New function.
4702 (Output_section_incremental_inputs::set_final_data_size): New function.
4703 (Output_section_incremental_inputs::do_write): New function.
4704 (Output_section_incremental_inputs::write_header): New function.
4705 (Output_section_incremental_inputs::write_input_files): New function.
4706 (Output_section_incremental_inputs::write_info_blocks): New function.
4707 (Output_section_incremental_inputs::write_symtab): New function.
4708 * incremental.h (Incremental_script_entry): Forward declaration.
4709 (Incremental_object_entry): Forward declaration.
4710 (Incremental_archive_entry): Forward declaration.
4711 (Incremental_inputs): Forward declaration.
4712 (Incremental_inputs_header_data): Remove.
4713 (Incremental_inputs_header): Remove.
4714 (Incremental_inputs_header_write): Remove.
4715 (Incremental_inputs_entry_data): Remove.
4716 (Incremental_inputs_entry): Remove.
4717 (Incremental_inputs_entry_write): Remove.
4718 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4719 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4720 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4721 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4722 Likewise.
4723 (Incremental_input_entry): New class.
4724 (Incremental_script_entry): New class.
4725 (Incremental_object_entry): New class.
4726 (Incremental_archive_entry): New class.
4727 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4728 (Incremental_inputs::report_inputs): Remove.
4729 (Incremental_inputs::report_archive): Remove.
4730 (Incremental_inputs::report_archive_begin): New function.
4731 (Incremental_inputs::report_archive_end): New function.
4732 (Incremental_inputs::report_object): Change prototype.
4733 (Incremental_inputs::report_input_section): New function.
4734 (Incremental_inputs::report_script): Change prototype.
4735 (Incremental_inputs::get_reloc_count): New function.
4736 (Incremental_inputs::set_reloc_count): New function.
4737 (Incremental_inputs::create_data_sections): New function.
4738 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4739 (Incremental_inputs::inputs_section): New function.
4740 (Incremental_inputs::symtab_section): New function.
4741 (Incremental_inputs::relocs_section): New function.
4742 (Incremental_inputs::get_stringpool): Add const.
4743 (Incremental_inputs::command_line): Add const.
4744 (Incremental_inputs::inputs): Remove.
4745 (Incremental_inputs::command_line_key): New function.
4746 (Incremental_inputs::input_file_count): New function.
4747 (Incremental_inputs::input_files): New function.
4748 (Incremental_inputs::relocs_entsize): New function.
4749 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4750 (Incremental_inputs::finalize_inputs): Remove.
4751 (Incremental_inputs::Input_info): Remove.
4752 (Incremental_inputs::lock_): Remove.
4753 (Incremental_inputs::inputs_): Change type.
4754 (Incremental_inputs::inputs_map_): Remove.
4755 (Incremental_inputs::current_object_entry_): New data member.
4756 (Incremental_inputs::inputs_section_): New data member.
4757 (Incremental_inputs::symtab_section_): New data member.
4758 (Incremental_inputs::relocs_section_): New data member.
4759 (Incremental_inputs::reloc_count_): New data member.
4760 (Incremental_inputs_reader): New class.
4761 (Incremental_symtab_reader): New class.
4762 (Incremental_relocs_reader): New class.
4763 * layout.cc (Layout::finalize): Move finalization of incremental info
4764 and creation of incremental info sections to follow finalization of
4765 symbol table. Set offsets for postprocessing sections.
4766 (Layout::create_incremental_info_sections): Call
4767 Incremental_inputs::create_data_sections. Add incremental symtab
4768 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4769 sections to layout after input sections.
4770 * layout.h (struct Timespec): Forward declaration.
4771 (Layout::incremental_inputs): Add const.
4772 (Layout::create_incremental_info_sections): Add parameter.
4773 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4774 * object.cc: Include incremental.h.
4775 (Relobj::finalize_incremental_relocs): New function.
4776 (Sized_relobj::do_layout): Record input sections in incremental info.
4777 * object.h (Object::output_section): New function.
4778 (Object::output_section_offset): Moved from Relobj.
4779 (Object::get_incremental_reloc_base): New function.
4780 (Object::get_incremental_reloc_count): New function.
4781 (Object::do_output_section): New function.
4782 (Object::do_output_section_offset): Moved from Relobj.
4783 (Object::do_get_incremental_reloc_base): New function.
4784 (Object::do_get_incremental_reloc_count): New function.
4785 (Object::Object): Initialize new data members.
4786 (Relobj::output_section): Renamed do_output_section and moved to
4787 protected.
4788 (Relobj::output_section_offset): Moved to Object.
4789 (Relobj::do_get_incremental_reloc_base): New function.
4790 (Relobj::do_get_incremental_reloc_count): New function.
4791 (Relobj::allocate_incremental_reloc_counts): New function.
4792 (Relobj::count_incremental_reloc): New function.
4793 (Relobj::finalize_incremental_relocs): New function.
4794 (Relobj::next_incremental_reloc_index): New function.
4795 (Relobj::reloc_counts_): New data member.
4796 (Relobj::reloc_bases_): New data member.
4797 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4798 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4799 (Sized_relobj::incremental_relocs_scan): New function.
4800 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4801 (Sized_relobj::incremental_relocs_write): New function.
4802 (Sized_relobj::incremental_relocs_write_reltype): New function.
4803 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4804 incremental link.
4805 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4806 archives and object files elsewhere.
4807 (Add_symbols::run): Report object files here.
4808 (Finish_group::run): Report end of archive at end of group.
4809 * reloc.cc: Include layout.h, incremental.h.
4810 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4811 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4812 (Sized_relobj::incremental_relocs_scan): New function.
4813 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4814 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4815 (Sized_relobj::incremental_relocs_write): New function.
4816 (Sized_relobj::incremental_relocs_write_reltype): New function.
4817 * script.cc (read_input_script): Rewrite test for incremental link.
4818 Change call to Incremental_inputs::report_script.
4819 * symtab.h (Symbol_table::first_global_index): New function.
4820 (Symbol_table::output_count): New function.
4821
4822 2010-08-12 Doug Kwan <dougkwan@google.com>
4823
4824 * arm.cc (Target_arm::merge_object_attributes): Check command line
4825 options --no-wchar-size-warning and --no-enum-size-warning.
4826 * options.h (General_options): Add ld-compatible options
4827 --no-enum-size-warning and --no-wchar-size-warning.
4828
4829 2010-08-04 Ian Lance Taylor <iant@google.com>
4830
4831 * x86_64.cc (Target_x86_64::Scan::local): Use
4832 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4833 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4834 (Target_x86_64::Scan::global): Likewise.
4835 (Target_x86_64::Relocate::relocate): Likewise.
4836 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4837 Likewise.
4838
4839 2010-08-03 Cary Coutant <ccoutant@google.com>
4840
4841 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4842 to reserve space in merged_strings vector. Keep total input size
4843 for stats.
4844 (Output_merge_string::do_print_merge_stats): Print total input size.
4845 * merge.h (Output_merge_string): Add input_size_ field.
4846 * stringpool.cc (Stringpool_template::string_length): Move
4847 implementations out of Stringpool_template class and place in
4848 stringpool.h.
4849 * stringpool.h (string_length): Move out of Stringpool_template.
4850
4851 2010-08-03 Ian Lance Taylor <iant@google.com>
4852
4853 PR 11712
4854 * layout.cc (relaxation_loop_body): If address of load segment is
4855 set, adjust address to include headers if possible.
4856
4857 2010-08-03 Ian Lance Taylor <iant@google.com>
4858
4859 * version.cc (version_string): Bump to 1.10.
4860
4861 2010-08-03 Ian Lance Taylor <iant@google.com>
4862
4863 PR 11805
4864 * layout.h (enum Output_section_order): Define.
4865 (class Layout): Update declarations.
4866 * layout.cc (Layout::get_output_section): Add order parameter.
4867 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4868 is_first_non_relro parameters. Change all callers.
4869 (Layout::choose_output_section): Likewise.
4870 (Layout::add_output_section_data): Likewise.
4871 (Layout::make_output_section): Likewise. Set order.
4872 (Layout::default_section_order): New function.
4873 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4874 * output.cc (Output_section::Output_section): Initialize order_.
4875 Don't initialize deleted fields.
4876 (Output_segment::Output_segment): Don't initialize deleted
4877 fields.
4878 (Output_segment::add_output_section_to_load): New function
4879 replacing add_output_section. Change all callers to call this or
4880 add_output_section_to_nonload.
4881 (Output_segment::add_output_section_to_nonload): New function.
4882 (Output_segment::remove_output_section): Rewrite.
4883 (Output_segment::add_initial_output_data): Likewise.
4884 (Output_segment::has_any_data_sections): Likewise.
4885 (Output_segment::is_first_section_relro): Likewise.
4886 (Output_segment::maximum_alignment): Likewise.
4887 (Output_segment::has_dynamic_reloc): New function replacing
4888 dynamic_reloc_count. Change all callers.
4889 (Output_segment::has_dynamic_reloc_list): New function replacing
4890 dynamic_reloc_count_list. Change all callers.
4891 (Output_segment::set_section_addresses): Rewrite.
4892 (Output_segment::set_offset): Rewrite.
4893 (Output_segment::find_first_and_last_list): Remove.
4894 (Output_segment::set_tls_offsets): Rewrite.
4895 (Output_segment::first_section_load_address): Likewise.
4896 (Output_segment::output_section_count): Likewise.
4897 (Output_segment::section_with_lowest_load_address): Likewise.
4898 (Output_segment::write_section_headers): Likewise.
4899 (Output_segment::print_sections_to_map): Likewise.
4900 * output.h (class Output_data): Remove dynamic_reloc_count_
4901 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4902 (Output_data::add_dynamic_reloc): Rewrite.
4903 (Output_data::has_dynamic_reloc): New function.
4904 (Output_data::dynamic_reloc_count): Remove.
4905 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4906 is_last_relro_, is_first_non_relro_, is_interp_,
4907 is_dynamic_linker_section_ fields. Add order and set_order
4908 functions. Remove is_relro_local, set_is_relro_local,
4909 is_last_relro, set_is_last_relro, is_first_non_relro,
4910 set_is_first_non_relro functions, is_interp, set_is_interp,
4911 is_dynamic_linker_section, and set_is_dynamic_linker_section
4912 functions.
4913 (class Output_segment): Change Output_data_list from std::list to
4914 std:;vector. Add output_lists_ field. Remove output_data_ and
4915 output_bss_ fields. Update declarations.
4916
4917 2010-08-02 Ian Lance Taylor <iant@google.com>
4918
4919 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4920 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4921 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4922
4923 2010-08-02 Ian Lance Taylor <iant@google.com>
4924
4925 PR 11855
4926 * script.cc (Script_options::Script_options): Initialize
4927 symbol_definitions_ and symbol_references_.
4928 (Script_options::add_symbol_assignment): Update
4929 symbol_definitions_ and symbol_references_.
4930 (Script_options::add_symbol_reference): New function.
4931 (script_symbol): New function.
4932 * script.h (class Script_options): Add symbol_definitions_ and
4933 symbol_references_ fields.
4934 (Script_options::referenced_const_iterator): New type.
4935 (Script_options::referenced_begin): New function.
4936 (Script_options::referenced_end): New function.
4937 (Script_options::is_referenced): New function.
4938 (Script_options::any_unreferenced): New function.
4939 * script-c.h (script_symbol): Declare.
4940 * yyscript.y (exp): Call script_symbol.
4941 * symtab.cc: Include "script.h".
4942 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4943 Change all callers. Check symbols referenced by scripts.
4944 (Symbol_table::add_undefined_symbols_from_command_line): Add
4945 layout parameter. Change all callers.
4946 (Symbol_table::do_add_undefined_symbols_from_command_line):
4947 Likewise. Break out loop body. Check symbols referenced by
4948 scripts.
4949 (Symbol_table::add_undefined_symbol_from_command_line): New
4950 function broken out of
4951 do_add_undefined_symbols_from_command_line.
4952 * symtab.h (class Symbol_table): Update declarations.
4953 * archive.cc: Include "layout.h".
4954 (Archive::should_include_member): Add layout parameter. Change
4955 all callers. Check for symbol mentioned in expression.
4956 * archive.h (class Archive): Update declaration.
4957 * object.cc (Sized_relobj::do_should_include_member): Add layout
4958 parameter.
4959 * object.h (Object::should_include_member): Add layout parameter.
4960 Change all callers.
4961 (Object::do_should_include_member): Add layout parameter.
4962 (class Sized_relobj): Update declaration.
4963 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4964 parameter.
4965 * dynobj.h (class Sized_dynobj): Update declaration.
4966 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4967 layout parameter.
4968 * plugin.h (class Sized_pluginobj): Update declaration.
4969
4970 2010-08-02 Ian Lance Taylor <iant@google.com>
4971
4972 PR 11866
4973 * output.cc (Output_segment::set_offset): Search for the first and
4974 last sections rather than assuming that the list is in order.
4975 (Output_segment::find_first_and_last_list): New function.
4976 * output.h (class Output_segment): Update declarations.
4977 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4978 (relro_strip_test_SOURCES): New variable.
4979 (relro_strip_test_DEPENDENCIES): New variable.
4980 (relro_strip_test_LDFLAGS): New variable.
4981 (relro_strip_test_LDADD): New variable.
4982 (relro_strip_test.so): New target.
4983
4984 2010-08-02 Ian Lance Taylor <iant@google.com>
4985
4986 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4987 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4988 (Target_i386::got_tlsdesc_section): New function.
4989 (Target_i386::got_section): Create space for GOT entries for
4990 TLSDESC relocations.
4991 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4992 R_386_TLS_GOTDESC.
4993 (Target_i386::Scan::global): Likewise.
4994 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4995 using TLSDESC GOT.
4996 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4997 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4998 (Target_x86_64::got_tlsdesc_section): New function.
4999 (Target_x86_64::got_section): Create space for GOT entries for
5000 TLSDESC relocations.
5001 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5002 R_386_TLS_GOTDESC.
5003 (Target_x86_64::Scan::global): Likewise.
5004 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5005 using TLSDESC GOT.
5006
5007 2010-08-02 Ian Lance Taylor <iant@google.com>
5008
5009 * testsuite/final_layout.sh: Use dc to convert from hex to
5010 decimal.
5011
5012 2010-07-29 Sriraman Tallam <tmsriram@google.com>
5013
5014 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5015 paramter to the call to gold::gc_process_relocs.
5016 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5017 paramter to the call to gold::gc_process_relocs.
5018 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5019 parameter to the call to gold::gc_process_relocs.
5020 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5021 template parameter to the call to gold::gc_process_relocs.
5022 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5023 paramter to the call to gold::gc_process_relocs.
5024 * gc.h (get_embedded_addend_size): New function.
5025 (gc_process_relocs): Save the size of the reloc for use by ICF.
5026 * icf.cc (get_section_contents): Get the addend from the text section
5027 for SHT_REL relocation sections.
5028 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5029 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5030 * int_encoding.h (read_from_pointer): New overloaded function.
5031 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5032 * testsuite/icf_sht_rel_addend_test.sh: New file.
5033 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5034 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5035
5036 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5037
5038 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5039 * Makefile.in: Regenerate.
5040 * testsuite/Makefile.in: Regenerate.
5041
5042 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5043
5044 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5045 * gold/testsuite/debug_msg.cc: Likewise.
5046 * gold/testsuite/odr_violation1.cc
5047 * gold/testsuite/odr_violation2.cc
5048
5049 2010-07-21 Cary Coutant <ccoutant@google.com>
5050
5051 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5052 string, and length fields.
5053 (Output_merge_string::Merged_strings_list): New type.
5054 (Output_merge_string::Merged_strings_lists): New typedef.
5055 (Output_merge_string): Replace merged_strings_ with
5056 merged_strings_lists_.
5057 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5058 Merged_strings_list per input object and section. Don't store pointer
5059 to the string. Don't store length with each merged string entry.
5060 (Output_merge_string::finalize_merged_data): Loop over list of merged
5061 strings lists. Recompute length of each merged string.
5062
5063 2010-07-15 Cary Coutant <ccoutant@google.com>
5064
5065 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5066 here.
5067
5068 2010-07-14 Ian Lance Taylor <iant@google.com>
5069
5070 * descriptors.cc (Descriptors::open): Report correct name in error
5071 message.
5072
5073 2010-07-13 Doug Kwan <dougkwan@google.com>
5074
5075 * arm.cc (Arm_input_section::Arm_input_section): For a
5076 SHT_ARM_EXIDX section, always keeps the input sections.
5077 (Arm_input_section::set_exidx_section_link): New method.
5078 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5079 has_errors_ to false.
5080 (Arm_exidx_input_section::has_errors,
5081 Arm_exidx_input_section::set_has_errors): New methods.
5082 (Arm_exidx_input_section::has_errors_): New data member.
5083 (Arm_relobj::get_exidx_shndx_list): New method.
5084 (Arm_output_section::append_text_sections_to_list): Do not skip
5085 section without SHF_EXECINSTR.
5086 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5087 errors.
5088 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5089 section header. Make error messages more verbose. Check for
5090 a non-executable section linked to an EXIDX section.
5091 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5092 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5093 check that there is no deferred EXIDX section if we exit early.
5094 Instead of not making an EXIDX section in case of an error, make one
5095 and set the has_errors flag of it.
5096 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5097 in a relocatable link.
5098 (Target_arm::do_relax): Look for the EXIDX output section instead of
5099 assuming that it is called .ARM.exidx.
5100 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5101 section list. Do not check for SHF_EXECINSTR section flags but
5102 skip any input section with errors.
5103 * output.cc (Output_section::Output_section): Initialize
5104 always_keeps_input_sections_ to false.
5105 (Output_section::add_input_section): Check for
5106 always_keeps_input_sections_.
5107 * output.h (Output_section::always_keeps_input_sections,
5108 Output_section::set_always_keeps_input_sections): New methods.
5109 (Output_section::always_keeps_input_sections): New data member.
5110
5111 2010-07-13 Rafael Espindola <espindola@google.com>
5112
5113 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5114 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5115
5116 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5117 Ian Lance Taylor <iant@google.com>
5118
5119 * output.h (Output_section_lookup_maps::add_merge_section):
5120 Correct check of whether value was inserted.
5121 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5122 (Output_section_lookup_maps::add_relaxed_input_section):
5123 Likewise.
5124 * arm.cc (Target_arm::got_section): Remove used local os.
5125 * i386.cc (Target_i386::got_section): Likewise.
5126 * x86_64.cc (Target_x86_64::got_section): Likewise.
5127 * sparc.cc (Target_sparc::got_section): Likewise.
5128 (Target_sparc::relocate): Remove unused local have_got_offset.
5129 * powerpc.cc (Target_powerpc::relocate): Likewise.
5130
5131 2010-07-13 Ian Lance Taylor <iant@google.com>
5132
5133 * compressed_output.cc (zlib_decompress): Fix signature in
5134 !HAVE_ZLIB_H case.
5135
5136 * archive.cc (Archive::include_member): Unlock an external member
5137 of a thin archive. Don't bother to delete an object we know is
5138 NULL.
5139
5140 2010-07-12 Cary Coutant <ccoutant@google.com>
5141
5142 * compressed_output.cc (zlib_decompress): New function.
5143 (get_uncompressed_size): New function.
5144 (decompress_input_section): New function.
5145 * compressed_output.h (get_uncompressed_size): New function.
5146 (decompress_input_section): New function.
5147 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5148 Handle compressed debug sections.
5149 * layout.cc (is_compressed_debug_section): New function.
5150 (Layout::output_section_name): Map compressed section names to
5151 canonical names.
5152 * layout.h (is_compressed_debug_section): New function.
5153 (is_debug_info_section): Recognize compressed debug sections.
5154 * merge.cc: Include compressed_output.h.
5155 (Output_merge_data::do_add_input_section): Handle compressed
5156 debug sections.
5157 (Output_merge_string::do_add_input_section): Handle compressed
5158 debug sections.
5159 * object.cc: Include compressed_output.h.
5160 (Sized_relobj::Sized_relobj): Initialize new data members.
5161 (build_compressed_section_map): New function.
5162 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5163 * object.h (Object::section_is_compressed): New method.
5164 (Object::do_section_is_compressed): New method.
5165 (Sized_relobj::Compressed_section_map): New type.
5166 (Sized_relobj::do_section_is_compressed): New method.
5167 (Sized_relobj::compressed_sections_): New data member.
5168 * output.cc (Output_section::add_input_section): Handle compressed
5169 debug sections.
5170 * reloc.cc: Include compressed_output.h.
5171 (Sized_relobj::write_sections): Handle compressed debug sections.
5172
5173 2010-07-08 Cary Coutant <ccoutant@google.com>
5174
5175 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5176 weak when resolving to a dynamic def.
5177 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5178 for weak undef/dynamic def cases. Adjust callers.
5179 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5180 undef_binding_weak_.
5181 (Symbol_table::sized_write_globals): Adjust symbol binding.
5182 (Symbol_table::sized_write_symbol): Add binding parameter.
5183 * symtab.h (Symbol::set_undef_binding): New method.
5184 (Symbol::is_undef_binding_weak): New method.
5185 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5186 (Symbol_table::should_override): Add new parameter.
5187 (Symbol_table::sized_write_symbol): Add new parameter.
5188
5189 * testsuite/weak_undef_file1.cc: Add new test case.
5190 * testsuite/weak_undef_file2.cc: Fix header comment.
5191 * testsuite/weak_undef_test.cc: Add new test case.
5192
5193 2010-06-29 Doug Kwan <dougkwan@google.com>
5194
5195 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5196 Initialize USE_SYMBOL_.
5197 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5198 definition.
5199 (Arm_reloc_property::uses_symbol_): New data member declaration.
5200 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5201 uses symbol value and symbol is undefined but not weakly undefined.
5202
5203 2010-06-28 Rafael Espindola <espindola@google.com>
5204
5205 * plugin.cc (Plugin::load): Use dlerror.
5206
5207 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5208
5209 * symtab.cc (detect_odr_violations): When reporting an ODR
5210 violation, report an object where the symbol is defined.
5211
5212 2010-06-25 Doug Kwan <dougkwan@google.com>
5213
5214 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5215 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5216 definition.
5217 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5218 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5219 target hook to detect function points.
5220 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5221 * icf.h (Icf::check_section_for_function_pointers): Change type of
5222 parameter SECTION_NAME to const reference to std::string. Use
5223 target hook to determine if section may have unsafe pointers.
5224 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5225 method definition.
5226
5227 2010-06-21 Rafael Espindola <espindola@google.com>
5228
5229 * fileread.cc (Input_file::find_fie): New
5230 (Input_file::open): Use Input_file::find_fie.
5231 * fileread.h (Input_file::find_fie): New
5232 * plugin.cc (set_extra_library_path): New.
5233 (Plugin::load): Add set_extra_library_path to the transfer vector.
5234 (Plugin_manager::set_extra_library_path): New.
5235 (Plugin_manager::add_input_file): Use the extra search path if set.
5236 (set_extra_library_path(): New.
5237 * plugin.h (Plugin_manager): Add set_extra_library_path and
5238 extra_search_path_.
5239
5240 2010-06-19 Cary Coutant <ccoutant@google.com>
5241
5242 * layout.cc (gdb_sections): Add .debug_types.
5243 (lines_only_debug_sections): Likewise.
5244
5245 2010-06-18 Rafael Espindola <espindola@google.com>
5246
5247 * plugin.cc (add_input_file,add_input_library)
5248 (Plugin_manager::add_input_file): Make filename arguments const.
5249 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5250 const.
5251
5252 2010-06-16 Doug Kwan <dougkwan@google.com>
5253
5254 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5255 .ARM.attributes section if we have not merged any input
5256 attributes sections.
5257
5258 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5259
5260 * arm.cc: Allow combining objects with no EABI version
5261 information.
5262
5263 2010-06-15 Rafael Espindola <espindola@google.com>
5264
5265 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5266
5267 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5268
5269 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5270 (struct iovec): Correct !HAVE_READV definition.
5271
5272 2010-06-10 Cary Coutant <ccoutant@google.com>
5273
5274 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5275 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5276 reloc sections.
5277 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5278
5279 PR 11683
5280 * symtab.h (Symbol::is_placeholder): New member function.
5281 * target-reloc.h (relocate_section): Check for placeholder symbols.
5282
5283 * testsuite/Makefile.am (plugin_test_8): New test.
5284 (plugin_test_9): New test.
5285 * testsuite/Makefile.in: Regenerate.
5286
5287 2010-06-09 Nick Clifton <nickc@redhat.com>
5288
5289 * yyscript.y (input_list_element): Allow strings prefixed with
5290 the '-' character. Treat these as libraries.
5291 * script.cc (script_add_library): New function. Adds a library
5292 specified by "-l<name>" found in an input script.
5293 * script-c.h: Add prototype for script_add_library.
5294
5295 2010-06-07 Doug Kwan <dougkwan@google.com>
5296
5297 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5298 Restrict stub-group size to be within long conditional branch
5299 range when working around cortex-A8 erratum.
5300
5301 2010-06-07 Damien Diederen <dd@crosstwine.com>
5302
5303 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5304 #ifdef typo.
5305
5306 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5307
5308 PR gold/11658
5309 * output.cc
5310 (Output_section::Input_section_sort_entry::compare_section_ordering):
5311 Change to return non-zero correctly.
5312 (Output_section::Input_section_sort_section_order_index_compare
5313 ::operator()): Change to fix ambiguity in comparisons.
5314
5315 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5316
5317 * gold.h (is_wildcard_string): New function.
5318 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5319 (Layout::layout_eh_frame): Ditto.
5320 (Layout::find_section_order_index): New method.
5321 (Layout::read_layout_from_file): New method.
5322 * layout.h (Layout::find_section_order_index): New method.
5323 (Layout::read_layout_from_file): New method.
5324 (Layout::input_section_position_): New private member.
5325 (Layout::input_section_glob_): New private member.
5326 * main.cc (main): Call read_layout_from_file here.
5327 * options.h (--section-ordering-file): New option.
5328 * output.cc (Output_section::input_section_order_specified_): New
5329 member.
5330 (Output_section::Output_section): Initialize new member.
5331 (Output_section::add_input_section): Add new parameter.
5332 Keep input sections when --section-ordering-file is used.
5333 (Output_section::set_final_data_size): Sort input sections when
5334 section ordering file is specified.
5335 (Output_section::Input_section_sort_entry): Add new parameter.
5336 Check sorting type.
5337 (Output_section::Input_section_sort_entry::compare_section_ordering):
5338 New method.
5339 (Output_section::Input_section_sort_compare::operator()): Change to
5340 consider section_order_index.
5341 (Output_section::Input_section_sort_init_fini_compare::operator()):
5342 Change to consider section_order_index.
5343 (Output_section::Input_section_sort_section_order_index_compare
5344 ::operator()): New method.
5345 (Output_section::sort_attached_input_sections): Change to sort
5346 according to section order when specified.
5347 (Output_section::add_input_section<32, true>): Add new parameter.
5348 (Output_section::add_input_section<64, true>): Add new parameter.
5349 (Output_section::add_input_section<32, false>): Add new parameter.
5350 (Output_section::add_input_section<64, false>): Add new parameter.
5351 * output.h (Output_section::add_input_section): Add new parameter.
5352 (Output_section::input_section_order_specified): New
5353 method.
5354 (Output_section::set_input_section_order_specified): New method.
5355 (Input_section::Input_section): Initialize section_order_index_.
5356 (Input_section::section_order_index): New method.
5357 (Input_section::set_section_order_index): New method.
5358 (Input_section::section_order_index_): New member.
5359 (Input_section::Input_section_sort_section_order_index_compare): New
5360 struct.
5361 (Output_section::input_section_order_specified_): New member.
5362 * script-sections.cc (is_wildcard_string): Delete and move modified
5363 method to gold.h.
5364 (Output_section_element_input::Output_section_element_input): Modify
5365 call to is_wildcard_string.
5366 (Output_section_element_input::Input_section_pattern
5367 ::Input_section_pattern): Ditto.
5368 (Output_section_element_input::Output_section_element_input): Ditto.
5369 * testsuite/Makefile.am (final_layout): New test case.
5370 * testsuite/Makefile.in: Regenerate.
5371 * testsuite/final_layout.cc: New file.
5372 * testsuite/final_layout.sh: New file.
5373
5374 2010-06-01 Rafael Espindola <espindola@google.com>
5375
5376 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5377
5378 2010-06-01 Rafael Espindola <espindola@google.com>
5379
5380 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5381 visibility of symbols.
5382
5383 2010-05-27 Doug Kwan <dougkwan@google.com>
5384
5385 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5386 from start of output section instead of address for a local symbol
5387 in a merged or relaxed section when doing a relocatable link.
5388
5389 2010-05-26 Rafael Espindola <espindola@google.com>
5390
5391 PR 11604
5392 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5393 adding sections the garbage collector removed.
5394 * gold/testsuite/Makefile.am: Add test.
5395 * gold/testsuite/Makefile.in: Regenerate.
5396 * gold/testsuite/plugin_test_7.sh: New.
5397 * gold/testsuite/plugin_test_7_1.c: New.
5398 * gold/testsuite/plugin_test_7_2.c: New.
5399
5400 2010-05-26 Rafael Espindola <espindola@google.com>
5401
5402 * script-sections.cc (Output_section_definition::set_section_addresses):
5403 Check for --section-start.
5404
5405 2010-05-26 Doug Kwan <dougkwan@google.com>
5406
5407 * arm.cc (Arm_scan_relocatable_relocs): New class.
5408 (Target_arm::relocate_special_relocatable): New method.
5409 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5410 (Arm_relocate_functions::thumb_branch_common): Same.
5411 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5412 instead of Default_scan_relocatable_relocs.
5413 * target-reloc.h (relocate_for_relocatable): Let target handle
5414 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5415 * target.h (Sized_target::relocate_special_relocatable): New method.
5416
5417 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5418
5419 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5420
5421 2010-05-23 Doug Kwan <dougkwan@google.com>
5422
5423 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5424 instead of a cast.
5425 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5426 with a direct branch, not a conditional branch, to a stub.
5427 * merge.cc (Output_merge_base::record_input_section): New method
5428 defintion.
5429 (Output_merge_data::do_add_input_section): Record input section if
5430 keeps-input-sections flag is set.
5431 (Output_merge_string::do_add_input_section): Ditto.
5432 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5433 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5434 INPUT_SECTIONS_.
5435 (Output_merge_base::keeps_input_sections,
5436 Output_merge_base::set_keeps_input_sections,
5437 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5438 method definitions.
5439 (Output_merge_base::Input_sections): New type declaration.
5440 (Output_merge_base::input_sections_begin,
5441 Output_merge_base::input_sections_end,
5442 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5443 (Output_merge_base::bool keeps_input_sections_,
5444 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5445 Output_merge_base::input_sections_): New data members.
5446 (Output_merge_data::do_set_keeps_input_sections): New method
5447 defintion.
5448 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5449 * output.cc (Output_section::Input_section::relobj): Move method
5450 defintion from class declaration to here and handle merge sections.
5451 (Output_section::Input_section::shndx): Ditto.
5452 (Output_section::Output_section): Remove initializations of removed
5453 data members and initialize new data member LOOKUP_MAPS_.
5454 (Output_section::add_input_section): Set keeps-input-sections flag
5455 for a newly created merge output section as appropriate. Adjust code
5456 to use Output_section_lookup_maps class.
5457 (Output_section::add_relaxed_input_section): Adjst code for lookup
5458 maps code refactoring.
5459 (Output_section::add_merge_input_section): Add a new parameter
5460 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5461 class. If adding input section to a newly created merge output
5462 section fails, remove the new merge section.
5463 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5464 Adjust code for use of the Output_section_lookup_maps class.
5465 (Output_section::find_merge_section): Ditto.
5466 (Output_section::build_lookup_maps): New method defintion.
5467 (Output_section::find_relaxed_input_section): Adjust code to use
5468 Output_section_lookup_maps class.
5469 (Output_section::get_input_sections): Export merge sections. Adjust
5470 code to use Output_section_lookup_maps class.
5471 (Output_section:::add_script_input_section): Adjust code to use
5472 Output_section_lookup_maps class. Update lookup maps for merge
5473 sections also.
5474 (Output_section::discard_states): Use Output_section_lookup_maps.
5475 (Output_section::restore_states): Same.
5476 * output.h (Merge_section_properties): Move class defintion out of
5477 Output_section.
5478 (Output_section_lookup_maps): New class.
5479 (Output_section::Input_section::is_merge_section): New method
5480 defintion.
5481 (Output_section::Input_section::relobj): Move defintion out of class
5482 defintion. Declare method only.
5483 (Output_section::Input_section::shndx): Ditto.
5484 (Output_section::Input_section::output_merge_base): New method defintion.
5485 (Output_section::Input_section::u2_.pomb): New union field.
5486 (Output_section::Merge_section_by_properties_map,
5487 Output_section::Output_section_data_by_input_section_map,
5488 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5489 Remove types.
5490 (Output_section::add_merge_input_section): Add new parameter
5491 KEEPS_INPUT_SECTIONS.
5492 (Output_section::build_lookup_maps): New method declaration.
5493 (Output_section::merge_section_map_,
5494 Output_section::merge_section_by_properties_map_,
5495 Output_section::relaxed_input_section_map_,
5496 Output_section::is_relaxed_input_section_map_valid_): Remove data
5497 members.
5498 (Output_section::lookup_maps_): New data member.
5499
5500 2010-05-21 Doug Kwan <dougkwan@google.com>
5501
5502 PR gold/11619
5503 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5504 avoid a compilation error.
5505
5506 2010-05-19 Rafael Espindola <espindola@google.com>
5507
5508 * script-sections.cc (Output_section_definition::allocate_to_segment):
5509 Update the phdrs_list even when the output section is NULL.
5510 * testsuite/Makefile.am: Add test.
5511 * testsuite/Makefile.in: Regenerate.
5512 * testsuite/script_test_9.cc: New.
5513 * testsuite/script_test_9.sh: New.
5514 * testsuite/script_test_9.t: New.
5515
5516 2010-05-19 Doug Kwan <dougkwan@google.com>
5517
5518 * arm.cc (Arm_input_section::original_size): New method.
5519 (Arm_input_section::do_addralign): Add a cast.
5520 (Arm_input_section::do_output_offset): Remove static cast.
5521 (Arm_input_section::original_addralign,
5522 Arm_input_section::original_size_): Change type to uint32_t.
5523 (Arm_input_section::init): Add safe casts for section alignment
5524 and size.
5525 (Arm_input_section::set_final_data_size): Do not set address and
5526 offset of stub table.
5527 (Arm_output_section::fix_exidx_coverage): Change use of of
5528 Output_section::Simple_input_section to that of
5529 Output_section::Input_section.
5530 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5531 except for the first pass.
5532 * output.cc (Output_section::get_input_sections): Change type of
5533 input_sections to std::list<Input_section>.
5534 (Output_section::add_script_input_section): Rename from
5535 Output_section::add_simple_input_section. Change type of SIS
5536 parameter from Simple_input_section to Input_section.
5537 * output.h (Output_section::Simple_input_section): Remove class.
5538 (Output_section::Input_section): Change class visibility to public.
5539 (Output_section::Input_section::addralign): Use stored alignments
5540 for special input sections if set.
5541 (Output_section::Input_section::set_addralign): New method.
5542 (Output_section::get_input_sections): Change parameter type from
5543 list of Simple_input_section to list of Input_section.
5544 (Output_section::add_script_input_section): Rename from
5545 Output_section::add_simple_input_section. Change first parameter's
5546 type from Simple_input_section to Input_section and remove the
5547 second and third parameters.
5548 * script-sections.cc (Input_section::Input_section_list): Change
5549 type to list of Output_section::Input_section/
5550 (Input_section_info::Input_section_info): Change parameter type of
5551 INPUT_SECTION to Output_section::Input_section.
5552 (Input_section_info::input_section): Change return type.
5553 (Input_section_info::input_section_): Change type to
5554 Output_section::Input_section.
5555 (Output_section_element_input::set_section_addresses): Adjust code
5556 to use Output_section::Input_section instead of
5557 Output_section::Simple_input_section. Adjust code for renaming
5558 of Output_section::add_simple_input_section.
5559 (Orphan_output_section::set_section_addresses): Ditto.
5560
5561 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5562
5563 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5564 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5565
5566 2010-05-18 Rafael Espindola <espindola@google.com>
5567
5568 * options.cc (General_options::finalize): Handle -nostdlib.
5569 * options.h (nostdlib): New option.
5570 * script.cc (script_add_search_dir): Handle -nostdlib.
5571
5572 2010-05-12 Doug Kwan <dougkwan@google.com>
5573
5574 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5575 attributes section only if there no attributes section after merging.
5576 (Target_arm::merge_object_attributes): Move value of
5577 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5578 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5579 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5580 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5581 and arm_attr_merge_7.stdout.
5582 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5583 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5584 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5585 arm_attr_merge_7b.o): New rules.
5586 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5587 arm_attr_merge_7
5588 * testsuite/Makefile.in: Regenerate.
5589 * testsuite/arm_attr_merge.sh: New file.
5590 * testsuite/arm_attr_merge_[67][ab].s: Same.
5591
5592 2010-05-05 Nick Clifton <nickc@redhat.com>
5593
5594 * po/es.po: Updated Spanish translation.
5595
5596 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5597
5598 * Makefile.am (install-exec-local): Properly install gold as
5599 default cross linker.
5600 * Makefile.in: Regenerated.
5601
5602 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5603 Nick Clifton <nickc@redhat.com>
5604
5605 * configure.ac (install_as_default): Define and set to false
5606 unless --enable-gold or --enable-gold=both/gold has been
5607 specified.
5608 * configure: Regenerate.
5609
5610 * Makefile.am (install-exec-local): Install the executable as
5611 'ld.gold'. If install_as_default is true then also install it as
5612 'ld'.
5613 * Makefile.in: Regenerated.
5614
5615 2010-04-24 Ian Lance Taylor <iant@google.com>
5616
5617 * layout.cc (Layout::layout_reloc): In relocatable link don't
5618 combine reloc sections for grouped sections.
5619
5620 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5621
5622 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5623 sections that are not ordinary to icf.
5624 * icf.cc (get_section_contents): Handle relocation pointing to section
5625 with no object or shndx information.
5626 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5627 * testsuite/Makefile.in: Regenerate.
5628 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5629 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5630
5631 2010-04-22 Ian Lance Taylor <iant@google.com>
5632
5633 * expression.cc (Expression::Expression_eval_info): Add
5634 result_alignment_pointer field.
5635 (Expression::eval_with_dot): Add result_alignment_pointer
5636 parameter. Change all callers.
5637 (Expression::eval_maybe_dot): Likewise.
5638 (class Binary_expression): Add alignment_pointer parameter to
5639 left_value and right_value. Change all callers.
5640 (BINARY_EXPRESSION): Set result alignment.
5641 (class Trinary_expression): Add alignment_pointer parameter to
5642 arg2_value and arg3_value. Change all callers.
5643 (Trinary_cond::value): Set result alignment.
5644 (Max_expression::value, Min_expression::value): Likewise.
5645 (Align_expression::value): Likewise.
5646 * script-sections.cc (class Sections_element): Add dot_alignment
5647 parameter to set_section_addresses virtual function. Update
5648 instantiations.
5649 (class Output_section_element): Likewise.
5650 (Script_sections::create_segments): Add dot_alignment parameter.
5651 Change all callers.
5652 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5653 (Script_sections::set_phdrs_clause_addresses): Likewise.
5654 * script-sections.h: Update declarations.
5655 * script.h: Update declarations.
5656 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5657 min_p_align.
5658 * testsuite/script_test_3.t: Set large alignment.
5659 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5660 segment has expected alignment.
5661
5662 2010-04-22 Nick Clifton <nickc@redhat.com>
5663
5664 * po/gold.pot: Updated by the Translation project.
5665 * po/vi.po: Updated Vietnamese translation.
5666
5667 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5668
5669 * testsuite/Makefile.am (check_PROGRAMS): Add
5670 icf_virtual_function_folding_test.
5671 * testsuite/Makefile.in: Regenerated.
5672
5673 2010-04-15 Andrew Haley <aph@redhat.com>
5674
5675 * options.h (merge_exidx_entries): New option.
5676 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5677 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5678 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5679 (Target_arm::merge_exidx_entries): New function.
5680 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5681 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5682 to Arm_exidx_fixup constructor.
5683 Add new arg, merge_exidx_entries.
5684 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5685 Arm_output_section::fix_exidx_coverage.
5686
5687 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5688
5689 * icf.cc (get_section_contents): Check for preemptible functions.
5690 Ignore addend when appropriate.
5691 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5692 section folded.
5693 (add_from_relobj): Check for section folded.
5694 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5695 * symtab.h (should_add_dynsym_entry): Add new parameter.
5696 * target-reloc.h (scan_relocs): Check for section folded.
5697 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5698 Check reloc types for function pointers in shared objects.
5699 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5700 case.
5701 (icf_preemptible_functions_test): New test case.
5702 (icf_string_merge_test): New test case.
5703 * testsuite.Makefile.in: Regenerate.
5704 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5705 bar_glob. Refactor code.
5706 * testsuite/icf_preemptible_functions_test.cc: New file.
5707 * testsuite/icf_preemptible_functions_test.sh: New file.
5708 * testsuite/icf_string_merge_test.cc: New file.
5709 * testsuite/icf_string_merge_test.sh: New file.
5710 * testsuite/icf_virtual_function_folding_test.cc: New file.
5711 * testsuite/icf_virtual_function_folding_test.sh: New file.
5712
5713 2010-04-14 Doug Kwan <dougkwan@google.com>
5714
5715 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5716 for local symbol recounting if we remove a section due to ICF.
5717 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5718 there are no regular objects in input.
5719
5720 2010-04-13 Doug Kwan <dougkwan@google.com>
5721
5722 * arm.cc (Arm_input_section::set_final_data_size): Compute
5723 accurate final data size instead of using current data size.
5724
5725 2010-04-09 Doug Kwan <dougkwan@google.com>
5726
5727 * layout.cc (Layout::choose_output_section): Handle script section
5728 types.
5729 (Layout::make_output_section_for_script): Add section type parameter.
5730 Handle script section types.
5731 * layout.h (Layout::make_output_section_for_script): Add section
5732 type parameter.
5733 * output.cc (Output_section::Output_section): Initialize data member
5734 is_noload_.
5735 (Output_section::do_reset_address_and_file_offset): Do not set address
5736 to 0 if section is a NOLOAD section.
5737 * output.h (Output_section::is_noload): New method.
5738 (Output_section::set_is_noload): Ditto.
5739 (Output_section::is_noload_): New data member.
5740 * script-c.h (Script_section_type): New enum type.
5741 (struct Parser_output_section_header): Add new file section_type.
5742 * script-sections.cc (Sections_element::output_section_name): Add
5743 parameter for returning script section type.
5744 (Output_section_definition::output_section_name): Ditto.
5745 (Output_section_definition::section_type)P; New method.
5746 (Output_section_definiton::script_section_type_name): Ditto.
5747 (Output_section_definition::script_section_type_): New data member.
5748 (Output_section_definition::Output_section_definition): Initialize
5749 data member Output_section_definition::script_section_type_.
5750 (Output_section_definition::create_sections): Pass script section type
5751 to Layout::make_output_section_for_script.
5752 (Output_section_definition::output_section_name): Return script
5753 section type to caller.
5754 (Output_section_definition::set_section_address): Do not advance
5755 dot value and load address if section type is NOLOAD. Set address
5756 of NOLOAD sections regardless of section flags.
5757 (Output_section_definition::print): Print section type if it is
5758 not SCRIPT_SECTION_TYPE_NONE.
5759 (Output_section_definition::section_type): New method.
5760 (Output_section_definition::script_section_type_name): Ditto.
5761 (Script_sections::output_section_name): Add new parameter
5762 PSECTION_TYPE for returning script section type. Pass it to
5763 section elements. Handle discard sections.
5764 (Sort_output_sections::operator()): Handle NOLOAD sections.
5765 * script-sections.h (Script_sections::Section_type): New enum type.
5766 (Script_sections::output_section_name): Add a new parameter for
5767 returning script section type.
5768 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5769 INFO and NOLOAD.
5770 * yyscript.y (union): Add new field SECTION_TYPE.
5771 (COPY, DSECT, INFO, NOLOAD): New tokens.
5772 (opt_address_and_section_type): Change type to output_section_header.
5773 (section_type): New non-terminal
5774 (section_header): Handle section type.
5775 (opt_address_and_section_type): Return section type value.
5776
5777 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5778
5779 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5780 * testsuite/plugin_common_test_2.c (foo): Likewise.
5781
5782 2010-04-08 Doug Kwan <dougkwan@google.com>
5783
5784 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5785 Output_merge_data.
5786 * output.cc (Output_section::add_merge_input_section): Simplify
5787 code and return status of Output_merge_base::add_input_section.
5788 Update merge section map only if Output_merge_base::add_input_section
5789 returns true.
5790
5791 2010-04-07 Doug Kwan <dougkwan@google.com>
5792
5793 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5794 if section is marked as containing instructions but has no mapping
5795 symbols.
5796 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5797 correct section index.
5798 (Arm_relobj::find_linked_text_section): Ditto.
5799
5800 2010-04-07 Cary Coutant <ccoutant@google.com>
5801
5802 * archive.cc (include_member): Destroy Read_symbols_data object before
5803 releasing file.
5804 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5805 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5806 (Read_symbols_data::~Read_symbols_data) New destructor.
5807 (Section_relocs::Section_relocs) New constructor.
5808 (Section_relocs::~Section_relocs) New destructor.
5809 (Read_relocs_data::Read_relocs_data) New constructor.
5810 (Read_relocs_data::~Read_relocs_data) New destructor.
5811 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5812 pointers to NULL after deleting.
5813
5814 2010-04-07 Doug Kwan <dougkwan@google.com>
5815
5816 * arm.cc: Replace "endianity" with "endianness" in comments.
5817 (Arm_exidx_cantunwind): Ditto.
5818 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5819 (Arm_relobj::merge_flags_and_attributes): New method.
5820 (Arm_relobj::merge_flags_and_attributes_): New data member.
5821 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5822 (Arm_relobj::scan_sections_for_stubs): Ditto.
5823 (Arm_relobj::do_read_symbols): Check to see if we really want to
5824 merge processor-specific flags and attributes. Exit early if
5825 an object is empty except for section names and the undefined symbol.
5826 (Target_arm::do_finalize_sections): Move check for ELF format to
5827 Arm_relobj::do_read_symbols. Merge processor specific flags and
5828 attributes from a regular object only when we have determined that
5829 it is aapropriate. Do not create an .ARM.attributes section in
5830 output if there is no regular input object.
5831 (Target_arm::merge_processor_specific_flags): Check
5832 --warn-mismatch before printing any error.
5833 (Target_arm::merge_object_attributes): Ditto.
5834 * gold.cc (queue_middle_tasks): Handle the case in which there is
5835 no regular object in input.
5836 * options.cc (General_options::parse_EB): New method.
5837 (General_options::parse_EL): Same.
5838 (General_options::General_options): Initialize endianness_.
5839 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5840 New options.
5841 (General_options::Endianness): New enum.
5842 (General_options::endianness): New method.
5843 (General_options::endianness_): New data member.
5844 * parameters.cc (Parameters::set_options): Check target endianness.
5845 (Parameters::set_target_once): Ditto.
5846 (Parameters::check_target_endianness): New method.
5847 (parameters_force_valid_target): If either -EL or -EB is specified,
5848 use it to define endianness of default target.
5849 * parameters.h (Parameters::check_target_endianness): New method
5850 declaration.
5851 * target.h (class Target): Change "endianity" to "endianness"
5852 in comments.
5853
5854 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5855
5856 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5857 * configure: Regenerate.
5858 * Makefile.in: Regenerate.
5859 * testsuite/Makefile.in: Regenerate.
5860
5861 2010-04-06 Cary Coutant <ccoutant@google.com>
5862
5863 gcc PR lto/42757
5864 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5865 prevailing definitions of common symbols.
5866 * testsuite/plugin_test_6.sh: New test case.
5867 * testsuite/plugin_common_test_1.c: New test case.
5868 * testsuite/plugin_common_test_2.c: New test case.
5869 * testsuite/Makefile.am (plugin_test_6): New test case.
5870 * testsuite/Makefile.in: Regenerate.
5871
5872 2010-04-06 Nick Clifton <nickc@redhat.com>
5873
5874 * po/vi.po: New Vietnamese translation.
5875
5876 2010-03-30 Doug Kwan <dougkwan@google.com>
5877
5878 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5879
5880 2010-03-25 Doug Kwan <dougkwan@google.com>
5881
5882 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5883 to avoid a conversion warning on a 32-bit host.
5884
5885 2010-03-24 Ian Lance Taylor <iant@google.com>
5886
5887 * testsuite/script_test_3.t: Add a TLS segment.
5888 * testsuite/Makefile.am (check_PROGRAMS): Add
5889 tls_phdrs_script_test.
5890 (tls_phdrs_script_test_SOURCES): Define.
5891 (tls_phdrs_script_test_DEPENDENCIES): Define.
5892 (tls_phdrs_script_test_LDFLAGS): Define.
5893 (tls_phdrs_script_test_LDADD): Define.
5894 * testsuite/Makefile.in: Rebuild.
5895
5896 2010-03-23 Cary Coutant <ccoutant@google.com>
5897
5898 * fileread.cc (find_or_make_view): Fix comment.
5899
5900 2010-03-23 Ian Lance Taylor <iant@google.com>
5901
5902 * script-sections.cc (class Orphan_section_placement): Define
5903 PLACE_TLS and PLACE_TLS_BSS.
5904 (Orphan_section_placement::Orphan_section_placement): Initialize
5905 new places.
5906 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5907 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5908 (tls_script_test_SOURCES): Define.
5909 (tls_script_test_DEPENDENCIES): Define.
5910 (tls_script_test_LDFLAGS): Define.
5911 (tls_script_test_LDADD): Define.
5912 * testsuite/Makefile.in: Rebuild.
5913
5914 2010-03-22 Doug Kwan <dougkwan@google.com>
5915
5916 * arm.cc (Arm_relocate_functions::abs8,
5917 Arm_relocate_functions::abs16): Use correct check for overflow
5918 specified in the ARM ELF specs.
5919 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5920 target of a BLX instruction specially.
5921 (Reloc_stub::stub_type_for_reloc): Ditto.
5922 (Relocate::relocate): Use symbolic names instead of numeric relocation
5923 codes to report error.
5924 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5925 workaround.
5926 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5927 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5928 thumb2_blx_out_of_range.stdout
5929 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5930 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5931 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5932 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5933 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5934 thumb2_blx_in_range, thumb2_blx_in_range.o,
5935 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5936 thumb2_blx_out_of_range.o): New rules.
5937 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5938 thumb2_blx_in_range and thumb2_blx_out_of_range.
5939 * testsuite/Makefile.in: Regenerate.
5940 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5941 * testsuite/thumb_blx_in_range.s: New file.
5942 * testsuite/thumb_blx_out_of_range.s: New file.
5943
5944 2010-03-22 Rafael Espindola <espindola@google.com>
5945
5946 * archive.cc (Should_include): Move to archive.h.
5947 (should_include_member): Make it a member of Archive.
5948 (Lib_group): New.
5949 (Add_lib_group_symbols): New.
5950 * archive.h: Include options.h.
5951 (Archive_member): Moved from Archive.
5952 (Should_include): Moved from archive.cc.
5953 (Lib_group): New.
5954 (Add_lib_group_symbols): New.
5955 * dynobj.cc (do_should_include_member): New.
5956 * dynobj.h (do_should_include_member): New.
5957 * gold.cc (queue_initial_tasks): Update call to queue.
5958 * main.cc (main): Print lib group stats.
5959 * object.cc (do_should_include_member): New.
5960 * object.h: Include archive.h.
5961 (Object::should_include_member): New.
5962 (Object::do_should_include_member): New.
5963 (Sized_relobj::do_should_include_member): New.
5964 * options.cc (General_options::parse_start_lib): New.
5965 (General_options::parse_end_lib): New.
5966 (Input_arguments::add_file): Handle lib groups.
5967 (Input_arguments::start_group): Check we are not in a lib.
5968 (Input_arguments::start_lib): New.
5969 (Input_arguments::end_lib): New.
5970 * options.h (General_options): Add start_lib and end_lib.
5971 (Input_argument::lib_): New.
5972 (Input_argument::lib): New.
5973 (Input_argument::is_lib): New.
5974 (Input_file_lib): New.
5975 (Input_arguments::in_lib_): New.
5976 (Input_arguments::in_lib): New.
5977 (Input_arguments::start_lib): New.
5978 (Input_arguments::end_lib_): New.
5979 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5980 in unused members as preempted.
5981 (Sized_pluginobj::do_should_include_member): New.
5982 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5983 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5984 return the blocker.
5985 (Read_symbols::do_whole_lib_group): New.
5986 (Read_symbols::do_lib_group): New.
5987 (Read_symbols::do_read_symbols): Handle lib groups.
5988 (Read_symbols::get_name): Handle lib groups.
5989 * readsyms.h (Read_symbols): Add an archive member pointer.
5990 (Read_symbols::do_whole_lib_group): New.
5991 (Read_symbols::do_lib_group): New.
5992 (Read_symbols::member_): New.
5993 * script.cc (read_input_script): Update call to queue_soon.
5994
5995 2010-03-19 Doug Kwan <dougkwan@google.com>
5996
5997 * arm.cc (Stub_table::Stub_table): Initialize new data members
5998 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5999 (Stub_table::add_reloc_stub): Assign stub offset and update
6000 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6001 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6002 New data members.
6003 (Stub_table::update_data_size_and_addralign): Use
6004 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6005 instead of going over all reloc stubs.
6006 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
6007 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6008 Stringpool_template::offset_ to size of Stringpool_char.
6009 (Stringpool_template::new_key_offset): Remove code to initialize
6010 Stringpool_template::offset_.
6011 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6012 Stringpool_template::offset_ to zero.
6013
6014 2010-03-15 Doug Kwan <dougkwan@google.com>
6015
6016 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6017 offset_.
6018 (Stringpool_template::new_key_offset): New method.
6019 (Stringpool_template::add_string): Assign offsets when adding new
6020 strings.
6021 (Stringpool_template::set_string_offsets): Do not set string offsets
6022 when not optimizing.
6023 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6024 member size_.
6025 (Chunked_vector::clear): Clear size_.
6026 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6027 (Chunked_vector::size): Return size_.
6028 (Chunked_vector::push_back): Use size_ to find insert position.
6029 (Chunked_vector::size_): New data member.
6030 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6031 (Stringpool_template::new_key_offset): New method declaration.
6032 (Stringpool_template::offset_): New data member.
6033
6034 2010-03-15 Rafael Espindola <espindola@google.com>
6035
6036 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6037 Add_symbols' constructor.
6038 * readsyms.h (Add_symbols): Remove the input_group member.
6039
6040 2010-03-10 Ian Lance Taylor <iant@google.com>
6041
6042 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6043 target to ask whether a reference to a symbol requires a stack
6044 split.
6045 * target.h (Target::is_call_to_non_split): New function.
6046 (Target::do_is_call_to_non_split): Declare virtual function.
6047 * target.cc: Include "symtab.h".
6048 (Target::do_is_call_to_non_split): New function.
6049 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6050
6051 2010-03-10 Cary Coutant <ccoutant@google.com>
6052
6053 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6054 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6055 (File_read::open[2]): Add whole_file_view_ to list of views.
6056 (File_read::make_view): Remove test of whole_file_view_.
6057 (File_read::find_or_make_view): Create whole_file_view_ if
6058 necessary.
6059 (File_read::clear_views): Replace bool parameter with enum;
6060 adjust all callers. Don't delete views with permanent data;
6061 do delete cached views and views from archives if
6062 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6063 if clearing the corresponding view.
6064 * fileread.h (File_read::Clear_views_mode): New enum.
6065 (File_read::View::is_permanent_view): New method.
6066 (File_read::clear_views): Replace bool parameter
6067 with enum; adjust all callers.
6068 * options.h (General_options): Change keep_files_mapped option;
6069 add map_whole_files.
6070 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6071 releasing the file.
6072 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6073 the file.
6074
6075 2010-03-10 David S. Miller <davem@davemloft.net>
6076
6077 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6078
6079 2010-03-09 Sriraman Tallam <tmsriram@google.com>
6080
6081 * icf.cc (get_section_contents): Add '@' marker after processing the
6082 merge reloc.
6083
6084 2010-03-08 Doug Kwan <dougkwan@google.com>
6085
6086 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6087 due to a conversion warning.
6088 (Arm_relobj::update_output_local_symbol_count): Check for local
6089 symbol with unset output index.
6090
6091 2010-03-05 Ian Lance Taylor <iant@google.com>
6092
6093 * options.h (class General_options): Add --spare-dynamic-tags.
6094 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6095 --spare-dynamic-tags.
6096
6097 2010-03-05 Ian Lance Taylor <iant@google.com>
6098
6099 * incremental.cc: Include "libiberty.h".
6100
6101 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6102
6103 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6104 function, is_info_ member.
6105 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6106 (Versions::Versions): Update caller.
6107 (Versions::define_base_version): Likewise.
6108 (Versions::add_def): Likewise.
6109
6110 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6111
6112 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6113 (Scan::possible_function_pointer_reloc): New function.
6114 (Scan::local_reloc_may_be_function_pointer): Change to call
6115 possible_function_pointer_reloc.
6116 (Scan::global_reloc_may_be_function_pointer): Ditto.
6117 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6118 relocations in ".data.rel.ro._ZTV" section.
6119 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6120 * testsuite/icf_safe_so_test.cc: Ditto.
6121 * testsuite/icf_safe_test.cc: Ditto.
6122 * testsuite/icf_safe_test.sh: Ditto.
6123
6124 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6125 Ian Lance Taylor <iant@google.com>
6126
6127 * target-reloc.h (relocate_section): Check the symbol table index
6128 for -1U before setting the local symbol index.
6129 (scan_relocatable_relocs): If copying the relocation, record that
6130 the local symbol is required.
6131 * object.h (Symbol_value::is_output_symtab_index_set): New
6132 function.
6133 (Symbol_value::may_be_discarded_from_output_symtab): New
6134 function.
6135 (Symbol_value::has_output_symtab_entry): New function.
6136 (Symbol_value::needs_output_symtab_entry): Remove.
6137 (Symbol_value::output_symtab_index): Make sure the symbol index is
6138 set.
6139 (Symbol_value::set_output_symtab_index): Make sure the symbol
6140 index is not set. Make sure the new index is valid.
6141 (Symbol_value::set_must_have_output_symtab_entry): New function.
6142 (Symbol_value::has_output_dynsym_entry): New function.
6143 (Symbol_value::set_output_dynsym_index): Make sure the new index
6144 is valid.
6145 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6146 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6147 local symbol if permitted.
6148 (Sized_relobj::do_finalize_local_symbols): Call
6149 is_output_symtab_index_set rather than needs_output_symtab_entry.
6150 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6151 rather than needs_output_symtab_entry. Call
6152 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6153 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6154 is_output_symtab_index_set rather than needs_output_symtab_entry.
6155 * testsuite/discard_locals_relocatable_test.c: New file.
6156 * testsuite/discard_locals_test.sh: Test -r.
6157 * testsuite/Makefile.am (check_DATA): Add
6158 discard_locals_relocatable_test1.syms,
6159 discard_local_relocatable_test2.syms.
6160 (MOSTLYCLEANFILES): Likewise. Also add
6161 discard_locals_relocatable_test1.lout and
6162 discard_locals_relocatable_test2.out.
6163 (discard_locals_relocatable_test1.syms): New target.
6164 (discard_locals_relocatable_test.o): New target.
6165 (discard_locals_relocatable_test1.out): New target.
6166 (discard_locals_relocatable_test2.syms): New target.
6167 (discard_locals_relocatable_test2.out): New target.
6168 (various): Add missing ../ld-new dependencies.
6169 * testsuite/Makefile.in: Rebuild.
6170
6171 2010-03-03 Nick Clifton <nickc@redhat.com>
6172
6173 * po/fi.po: New Finnish translation.
6174
6175 2010-03-01 Doug Kwan <dougkwan@google.com>
6176
6177 * layout.cc (Layout::Layout): Force section types of .init_array*,
6178 .preinit_array* and .fini_array* sections.
6179 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6180 Fix check of return value of std::string::find.().
6181 (Output_section::Input_section_sort_compare::operator()): Remove
6182 comment about .init_array.
6183 (Output_section::Input_section_sort_init_fini_compare::operator()):
6184 New method.
6185 (Output_section::sort_attached_input_sections): Handle .init_array
6186 and .fini_array specially.
6187 * output.h (Output_section::Inut_section_sort_compare): Update
6188 comment.
6189 (Output_section::Input_section_sort_init_fini_compare): New struct.
6190
6191 2010-02-26 Doug Kwan <dougkwan@google.com>
6192
6193 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6194 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6195 * testsuite/debug_msg.sh: Avoid matching source line number for
6196 use of global variable undef_int.
6197
6198 2010-02-26 Doug Kwan <dougkwan@google.com>
6199
6200 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6201 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6202 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6203 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6204 * options.cc (General_options::General_options): Initialize member
6205 fix_v4bx_.
6206 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6207 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6208 and rm_no_fix_v4bx.stdout
6209 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6210 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6211 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6212 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6213 and arm_no_fix_v4bx.
6214 * Makefile.in: Regenerate.
6215 * testsuite/arm_fix_v4bx.s: New file.
6216 * testsuite/arm_fix_v4bx.sh: Ditto.
6217
6218 2010-02-24 Doug Kwan <dougkwan@google.com>
6219
6220 * arm.cc (Target_arm::got_section): Make the .got section the first
6221 non RELRO section in the data segment.
6222 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6223 suffixes of section names.
6224
6225 2010-02-24 Doug Kwan <dougkwan@google.com>
6226
6227 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6228 flags and attributes merging if an input file is a binary file.
6229 * fileread.cc (Input_file::open): Record format of original file.
6230 * fileread.h (Input_file::Format): New enum type.
6231 (Input_file::Input_file): Initialize data member format_.
6232 (Input_file::format): New method definition.
6233 (Input_file::format_):: New data member.
6234
6235 2010-02-24 Doug Kwan <dougkwan@google.com>
6236
6237 * arm.cc (Arm_output_data_got): New class.
6238 (ARM_TCB_SIZE): New constant
6239 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6240 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6241 If user uses a script with a SECTIONS clause, issue only a warning
6242 for a misplaced EXIDX input section. Otherwise, issue an error.
6243 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6244 garbage collection.
6245 (Target_arm::got_mode_index_entry): Handle static linking.
6246 (Target_arm::Scan::local): Ditto.
6247 (Target_arm::Scan::global): Ditto.
6248 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6249 all incorrectly implemented relocations.
6250 (Target_arm::fix_exidx_coverage): Pass layout to
6251 Arm_output_section::fix_exidx_coverage.
6252 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6253 from ".ARM.exidx." and ".ARM.extab.".
6254
6255 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6256
6257 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6258 section if it does not already exist.
6259 * attributes.cc (Attributes_section_data::Attributes_section_data):
6260 Don't crash if size is zero.
6261
6262 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6263 Ian Lance Taylor <iant@google.com>
6264
6265 * gold.cc (queue_middle_tasks): If no input files were opened,
6266 exit.
6267 * workqueue.h (Task_function::Task_function): Assert that there is
6268 a blocker.
6269
6270 2010-02-22 Doug Kwan <dougkwan@google.com>
6271
6272 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6273 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6274 types to avoid warnings due to different uint64_t implementations
6275 on different hosts.
6276
6277 2010-02-21 Doug Kwan <dougkwan@google.com>
6278
6279 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6280 handling of the maximum backward branch offset.
6281 (Arm_relocate_functions::thumb_branch_common): Ditto.
6282 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6283 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6284 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6285 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6286 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6287 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6288 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6289 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6290 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6291 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6292 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6293 thumb2_bl_out_of_range.o): New rules.
6294 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6295 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6296 thumb2_bl_out_of_range
6297 * testsuite/Makefile.in: Regenerate.
6298 * testsuite/arm_bl_in_range.s: New file.
6299 * testsuite/arm_bl_out_of_range.s: Ditto.
6300 * testsuite/arm_branch_in_range.sh: Ditto.
6301 * testsuite/arm_branch_range.t: Ditto.
6302 * testsuite/thumb2_branch_range.t: Ditto.
6303 * testsuite/thumb_bl_in_range.s: Ditto.
6304 * testsuite/thumb_bl_out_of_range.s: Ditto.
6305 * testsuite/thumb_branch_range.t: Ditto.
6306
6307 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6308
6309 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6310 Add reloc offset information.
6311 * icf.cc (get_section_contents): Change iterators to point to the new
6312 vectors. Add reloc offset information to the contents.
6313 * icf.h (Icf::Sections_reachable_info): New typedef.
6314 (Icf::Sections_reachable_list): New typedef.
6315 (Icf::Offset_info): New typedef.
6316 (Icf::Reloc_info): New struct typedef.
6317 (Icf::Reloc_info_list): New typedef.
6318 (Icf::symbol_reloc_list): Delete method.
6319 (Icf::addend_reloc_list): Delete method.
6320 (Icf::section_reloc_list): Delete method.
6321 (Icf::reloc_info_list): New method.
6322 (Icf::reloc_info_list_): New member.
6323
6324 2010-02-19 Doug Kwan <dougkwan@google.com>
6325
6326 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6327 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6328 * arm.cc (Arm_relocation_functions): New forward declaration.
6329 (Target_arm::Target_arm): Initialize new data members
6330 got_mod_index_offset_ and tls_base_symbol_defined_.
6331 (Target_arm::Relocate::relocate_tls): New method.
6332 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6333 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6334 New methods.
6335 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6336 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6337 (Target_arm::got_mod_index_offset_,
6338 Target_arm::tls_base_symbol_defined_): New data members.
6339 (Target_arm::Scan::local, Target::Scan::global,
6340 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6341 relocations.
6342
6343 2010-02-18 Doug Kwan <dougkwan@google.com>
6344
6345 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6346 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6347 text section as a parameter becuase some broken tools may not set
6348 the link in section header.
6349 (Target_arm::has_got_section): New method.
6350 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6351 without any mapping symbol as data only. Remove warning.
6352 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6353 link in its section header, try to discover the link by inspecting the
6354 REL31 relocation at the beginning of the section.
6355 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6356 in error message.
6357 (Target_arm::Scan::global): Treat any reference to the symbol
6358 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6359
6360 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6361
6362 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6363 (Scan::global_reloc_may_be_function_pointer): New function.
6364 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6365 (Scan::global_reloc_may_be_function_pointer): New function.
6366 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6367 (Scan::global_reloc_may_be_function_pointer): New function.
6368 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6369 (Scan::global_reloc_may_be_function_pointer): New function.
6370 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6371 (Scan::global_reloc_may_be_function_pointer): New function.
6372 (Scan::possible_function_pointer_reloc): New function.
6373 (Target_x86_64::can_check_for_function_pointers): New function.
6374 * gc.h (gc_process_relocs): Scan relocation types to determine if
6375 function pointers were taken for targets that support it.
6376 * icf.cc (Icf::find_identical_sections): Include functions for
6377 folding in safe ICF whose pointer is not taken.
6378 * icf.h (Secn_fptr_taken_set): New typedef.
6379 (fptr_section_id_): New member.
6380 (section_has_function_pointers): New function.
6381 (set_section_has_function_pointers): New function.
6382 (check_section_for_function_pointers): New function.
6383 * options.h: Fix comment for safe ICF option.
6384 * target.h (can_check_for_function_pointers): New function.
6385 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6386 Modify icf_safe_test for X86-64.
6387 * testsuite/Makefile.in: Regenerate.
6388 * testsuite/icf_safe_so_test.cc: New file.
6389 * testsuite/icf_safe_so_test.sh: New file.
6390 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6391 (main): Change to take pointer to function kept_func_3.
6392 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6393 folding is done correctly for X86-64.
6394
6395 2010-02-12 David S. Miller <davem@davemloft.net>
6396
6397 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6398 is_symbolless parameter.
6399 (Output_reloc<SHT_REL>::is_symbolless): New.
6400 (Output_reloc<SHT_REL>::is_symbolless_): New.
6401 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6402 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6403 (Output_reloc<SHT_RELA>::is_symbolless): New.
6404 (Output_data_reloc::add_global): Handle is_symbolless.
6405 (Output_data_reloc::add_global_relative): Likewise.
6406 (Output_data_reloc::add_local): Likewise.
6407 (Output_data_reloc::add_local_relative): Likewise.
6408 (Output_data_reloc::add_symbolless_global_addend): New.
6409 (Output_data_reloc::add_symbolless_local_addend): New.
6410 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6411 is_symbolless.
6412 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6413 instead of ->is_relative_
6414 (Output_reloc::write): Likewise.
6415 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6416 (Output_reloc::write_rel): Simplify.
6417
6418 * sparc.cc (Target_sparc::Scan::local): Use
6419 ->add_symbolless_local_addend as needed.
6420 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6421 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6422 based upon relocation offset.
6423
6424 2010-02-11 Doug Kwan <dougkwan@google.com>
6425
6426 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6427 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6428 beginning of function.
6429 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6430 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6431 parameter is_32bit in calls to should_apply_static_reloc.
6432 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6433 (check_DATA): Add arm_abs_global.stdout.
6434 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6435 arm_abs_global.stdout): New rules.
6436 (MOSTLLYCLEANFILES): Add arm_abs_global
6437 * Makefile.in: Regenerate.
6438 * testsuite/arm_abs_global.s: New file.
6439 * testsuite/arm_abs_global.sh: Ditto.
6440 * testsuite/arm_abs_lib.s: Ditto.
6441
6442 2010-02-11 Ian Lance Taylor <iant@google.com>
6443
6444 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6445 Read_relocs task.
6446 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6447 Allocate_commons_task first.
6448 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6449 task, rather than symtab_lock_.
6450 (Gc_process_relocs::~Gc_process_relocs): New function.
6451 (Gc_process_relocs::is_runnable): Check this_blocker_.
6452 (Gc_process_relocs::locks): Use next_blocker_ rather than
6453 blocker_.
6454 (Scan_relocs::~Scan_relocs): New function.
6455 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6456 symtab_lock_.
6457 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6458 next_blocker_.
6459 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6460 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6461 constructor accordingly.
6462 (class Gc_process_relocs): Likewise.
6463 (class Scan_relocs): Likewise.
6464 * common.h (class Allocate_commons_task): Remove symtab_lock_
6465 field, and corresponding constructor parameter.
6466 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6467 symtab_lock_.
6468 (Allocate_commons_task::locks): Likewise.
6469
6470 2010-02-11 Ian Lance Taylor <iant@google.com>
6471
6472 * gold-threads.h (class Once): Define.
6473 (class Initialize_lock): Rewrite as child of Once.
6474 * gold-threads.cc (class Once_initialize): Define.
6475 (once_pointer_control): New static variable.
6476 (once_pointer, once_arg): New static variables.
6477 (c_run_once): New static function.
6478 (Once::Once, Once::run_once, Once::internal_run): New functions.
6479 (class Initialize_lock_once): Remove.
6480 (initialize_lock_control): Remove.
6481 (initialize_lock_pointer): Remove.
6482 (initialize_lock_once): Remove.
6483 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6484 (Initialize_lock::initialize): Rewrite.
6485 (Initialize_lock::do_run_once): New function.
6486 * archive.cc (Archive::interpret_header): Only clear name if it is
6487 not already empty.
6488 * fileread.cc: Include "gold-threads.h"
6489 (file_counts_lock): New static variable.
6490 (file_counts_initialize_lock): Likewise.
6491 (File_read::release): Only increment counts when using --stats.
6492 Use a lock around the increment.
6493 * parameters.cc (class Set_parameters_target_once): Define.
6494 (set_parameters_target_once): New static variable.
6495 (Parameters::Parameters): Move here from parameters.h.
6496 (Parameters::set_target): Rewrite.
6497 (Parameters::set_target_once): New function.
6498 (Parameters::clear_target): Move here and rewrite.
6499 * parameters.h (class Parameters): Update declarations. Add
6500 set_parameters_target_once_ field.
6501 (Parameters::Parameters): Move to parameters.cc.
6502 (Parameters::clear_target): Likewise.
6503 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6504 task.
6505 (Start_group::~Start_group): New function.
6506 (Start_group::is_runnable): New function.
6507 (Start_group::locks, Start_group::run): New functions.
6508 (Finish_group::run): Change saw_undefined to size_t.
6509 * readsyms.h (class Start_group): Define.
6510 (class Finish_group): Change saw_undefined_ field to size_t.
6511 (Finish_group::Finish_group): Remove saw_undefined and
6512 this_blocker parameters. Change all callers.
6513 (Finish_group::set_saw_undefined): New function.
6514 (Finish_group::set_blocker): New function.
6515 * symtab.h (class Symbol_table): Change saw_undefined to return
6516 size_t. Change saw_undefined_ field to size_t.
6517 * target-select.cc (Set_target_once::do_run_once): New function.
6518 (Target_selector::Target_selector): Initialize set_target_once_
6519 field. Don't initialize lock_ and initialize_lock_ fields.
6520 (Target_selector::instantiate_target): Rewrite.
6521 (Target_selector::set_target): New function.
6522 * target-select.h (class Set_target_once): Define.
6523 (class Target_selector): Update declarations. Make
6524 Set_target_once a friend. Remove lock_ and initialize_lock_
6525 fields. Add set_target_once_ field.
6526
6527 2010-02-10 Ian Lance Taylor <iant@google.com>
6528
6529 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6530 queueing any tasks.
6531 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6532 (queue_middle_tasks): Add all blockers before queueing any tasks.
6533 (queue_final_tasks): Likewise.
6534 * token.h (Task_token::add_blockers): New function.
6535 * object.h (Input_objects::number_of_relobjs): New function.
6536
6537 2010-02-10 Ian Lance Taylor <iant@google.com>
6538
6539 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6540 shared, not if not position independent.
6541 * x86_64.cc (Relocate::relocate_tls): Likewise.
6542 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6543 (tls_pie_pic_test): New target.
6544 * testsuite/Makefile.in: Rebuild.
6545
6546 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6547 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6548 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6549 * testsuite/Makefile.in: Rebuild.
6550
6551 2010-02-09 David S. Miller <davem@davemloft.net>
6552
6553 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6554 R_SPARC_RELATIVE using ->add_local_relative().
6555 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6556
6557 * output.h (Output_data_dynamic::add_section_size): New method
6558 that takes two Output_data objects.
6559 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6560 entry param. Handle it in initializers.
6561 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6562 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6563 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6564 arg.
6565 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6566 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6567 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6568 for dynrel_includes_plt.
6569 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6570 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6571 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6572 before .rela.plt
6573 (Target_sparc::do_finalize_sections): Update to pass true for
6574 dynrel_includes_plt.
6575 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6576 output before .rela.plt
6577 (Target_powerpc::do_finalize_sections): Update to pass true for
6578 dynrel_includes_plt when 32-bit.
6579
6580 2010-02-08 Doug Kwan <dougkwan@google.com>
6581
6582 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6583 method.
6584 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6585 Arm_relobj::scan_section_for_cortex_a8_stubs,
6586 Arm_relobj::do_relocation_section): Instead of calling
6587 Output_section::output_address, use faster
6588 Arm_relobj::simple_input_section_output_address.
6589
6590 2010-02-08 David S. Miller <davem@davemloft.net>
6591
6592 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6593 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6594 relocation helper function.
6595
6596 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6597 just like R_SPARC_GOT{10,13,22}.
6598 (Target_sparc::Scan::local): Likewise.
6599 (Target_sparc::Relocate:relocate): Likewise.
6600
6601 2010-02-06 Ian Lance Taylor <iant@google.com>
6602
6603 * configure.ac: Rewrite targetobjs duplicate removal code to use
6604 only shell constructs.
6605 * configure: Rebuild.
6606
6607 2010-02-05 Doug Kwan <dougkwan@google.com>
6608
6609 PR 11247
6610 * arm.cc (Arm_relobj::section_is_scannable): New method.
6611 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6612 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6613
6614 2010-02-04 Doug Kwan <dougkwan@google.com>
6615
6616 PR 11247
6617 * arm-reloc-property.cc (cstdio): Include.
6618 * configure.ac (targetobjs): Remove duplicates.
6619 * configure: Regenerate.
6620 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6621 big and little endian version for a given address size.
6622
6623 2010-02-03 Doug Kwan <dougkwan@google.com>
6624
6625 * arm-reloc-property.cc
6626 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6627 definition.
6628 * arm-reloc-property.h
6629 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6630 New method definition.
6631 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6632 declaration.
6633 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6634 overflow to N.
6635 (GOT_PREL): Change implemented to Y.
6636 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6637 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6638 (Arm_relocate_functions::movw_abs_nc): Remove method.
6639 (Arm_relocate_functions::movt_abs): Ditto.
6640 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6641 (Arm_relocate_functions::thm_movt_abs): Ditto.
6642 (Arm_relocate_functions::movw_rel_nc): Ditto.
6643 (Arm_relocate_functions::movw_rel): Ditto.
6644 (Arm_relocate_functions::movt_rel): Ditto.
6645 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6646 (Arm_relocate_functions:thm_movw_rel): Ditto.
6647 (Arm_relocate_functions:thm_movt_rel): Ditto.
6648 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6649 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6650 New method definitions.
6651 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6652 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6653 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6654 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6655 (Target_arm::Relocate::relocate): Check for non-static or
6656 unimplemented relocation code and exit early. Change calls to
6657 Target_arm::reloc_uses_thumb_bit and
6658 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6659 instead. Refactor code to handle similar relocations to increase
6660 code sharing. Remove check for unsupported relocation code in switch
6661 statement.
6662 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6663 relocation property table to find out size. Change error message to
6664 print out the name of a relocation code instead of the numeric value.
6665 (Target_arm::scan_reloc_for_stub): Use relocation property table
6666 instead of calling Target_arm::reloc_uses_thumb_bit().
6667
6668 2010-02-02 Doug Kwan <dougkwan@google.com>
6669
6670 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6671 types of relaxed input section.
6672
6673 2010-02-02 Doug Kwan <dougkwan@google.com>
6674
6675 * Makefile.am (HFILES): Add arm-reloc-property.h.
6676 (DEFFILES): New.
6677 (TARGETSOURCES): Add arm-reloc-property.cc
6678 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6679 (libgold_a_SOURCES): $(DEFFILES)
6680 * Makefile.in: Regenerate.
6681 * arm-reloc-property.cc: New file.
6682 * arm-reloc-property.h: New file.
6683 * arm-reloc.def: New file.
6684 * arm.cc: Update comments.
6685 (arm-reloc-property.h): New included header.
6686 (arm_reloc_property_table): New global variable.
6687 (Target_arm::do_select_as_default_target): New method definition.
6688 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6689 arm-reloc-property to targ_extra_obj.
6690 * parameters.cc (set_parameters_target): Call
6691 Target::select_as_default_target().
6692 * target.h (Target::select_as_default_target): New method definition.
6693 (Target::do_select_as_default_target): Same.
6694
6695 2010-02-01 Doug Kwan <dougkwan@google.com>
6696
6697 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6698 first_output_text_section_.
6699 (Arm_exidx_fixup::first_output_text_section): New method definition.
6700 (Arm_exidx_fixup::first_output_text_section_): New data member.
6701 (Arm_exidx_fixup::process_exidx_section): Record the first text
6702 output section seen.
6703 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6704 and entsize in output section header.
6705
6706 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6707
6708 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6709 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6710 (Arm_relocate_functions::thm_alu11): New Method.
6711 (Arm_relocate_functions::thm_pc8): New Method.
6712 (Arm_relocate_functions::thm_pc12): New Method.
6713 (Target_arm::Scan::local): Handle the relocations.
6714 (Target_arm::Scan::global): Likewise.
6715 (Target_arm::Relocate::relocate): Likewise.
6716 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6717
6718 2010-01-29 Doug Kwan <dougkwan@google.com>
6719
6720 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6721 of relocation types as ld.
6722
6723 2010-01-29 Doug Kwan <dougkwan@google.com>
6724
6725 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6726 to public.
6727 (Arm_relocate_functions::thumb_branch_common): Ditto.
6728 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6729 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6730 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6731 Arm_relocate_functions::jump24): Remove.
6732 (Target_arm::Relocate::relocate): Adjust code to call
6733 Arm_relocation_functions::arm_branch_common and
6734 Arm_relocation_functions::thumb_branch_common instead of their removed
6735 wrappers. Merge switch-cases together to reduce source code size.
6736
6737 2010-01-29 Doug Kwan <dougkwan@google.com>
6738
6739 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6740 output_local_symbol_count_needs_update_.
6741 (Arm_relobj::output_local_symbol_count_needs_update,
6742 Arm_relobj::set_output_local_symbol_count_needs_update,
6743 Arm_relobj::update_output_local_symbol_count): New methods.
6744 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6745 member.
6746 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6747 of pointed function as in a R_ARM_PREL31 relocation.
6748 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6749 for output local symbol count updating.
6750 (Target_arm::do_relax): Update output local symbol counts in objects
6751 if necessary.
6752 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6753
6754 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6755
6756 * arm.cc: Added support for the ARM relocations:
6757 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6758 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6759 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6760 movw_prel_nc).
6761 (Arm_relocate_functions::movw_rel): New method.
6762 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6763 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6764 thm_movw_prel_nc).
6765 (Arm_relocate_functions::thm_movw_rel): New method.
6766 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6767 thm_movt_prel).
6768 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6769 relocations.
6770 (Target_arm::Scan::global): Likewise.
6771 (Target_arm::Relocate::relocate): Likewise.
6772 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6773 Likewise.
6774
6775 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6776
6777 * arm.cc: Added support for ARM group relocations.
6778 (Target_arm::reloc_needs_sym_origin): New method.
6779 (Arm_relocate_functions::calc_grp_kn): New method.
6780 (Arm_relocate_functions::calc_grp_residual): New method.
6781 (Arm_relocate_functions::calc_grp_gn): New method.
6782 (Arm_relocate_functions::arm_grp_alu): New Method.
6783 (Arm_relocate_functions::arm_grp_ldr): New Method.
6784 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6785 (Arm_relocate_functions::arm_grp_ldc): New Method.
6786 (Target_arm::Scan::local): Handle the ARM group relocations.
6787 (Target_arm::Scan::global): Likewise.
6788 (Target_arm::Relocate::relocate): Likewise.
6789 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6790 Likewise.
6791
6792 2010-01-26 Doug Kwan <dougkwan@google.com>
6793
6794 * arm.cc (set): Include.
6795 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6796 pointer type.
6797 (Arm_output_section::Text_section_list): New type.
6798 (Arm_output_section::append_text_sections_to_list): New method.
6799 (Arm_output_section::fix_exidx_coverage): Ditto.
6800 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6801 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6802 Relobj::set_section_offset() instead of
6803 Sized_relobj::invalidate_section_offset().
6804 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6805 parameter for section headers. Ignore relocation sections for
6806 unallocated sections and EXIDX sections.
6807 (Target_arm::fix_exidx_coverage): New method.
6808 (Target_arm::output_section_address_less_than): New type.
6809 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6810 linked text section instead of the EXIDX section.
6811 (Arm_output_section::create_stub_group): Add an assertion to check
6812 that this is not an EXIDX output section.
6813 (Arm_output_section::append_text_sections_to_list): New method.
6814 (Arm_output_section::fix_exidx_coverage): Ditto.
6815 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6816 Arm_relobj::section_needs_reloc_stub_scanning.
6817 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6818 first pass.
6819 (Target_arm::fix_exidx_coverage): New method.
6820 * object.h (Relobj::set_output_section): New method.
6821 (Sized_relobj::invalidate_section_offset): Remove method.
6822 (Sized_relobj::do_invalidate_section_offset): Remove method.
6823 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6824
6825 2010-01-25 Doug Kwan <dougkwan@google.com>
6826
6827 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6828 Fix warning due to signed and unsigned comparison on a 32-bit host.
6829
6830 2010-01-22 Doug Kwan <dougkwan@google.com>
6831
6832 * arm.cc (Target_arm::do_relax): Record an output section for section
6833 offset adjustment it contains any stub table that has changed.
6834 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6835 offsets in an output section if necessary.
6836 * output.cc (Output_section::Output_section): Initialize
6837 section_offsets_need_adjustments_.
6838 (Output_section::add_input_section_for_script): Renamed to
6839 Output_section::add_simple_input_section.
6840 (Output_section::save_states): Add a comment.
6841 (Output_section::discard_states): New method defintion.
6842 (Output_section::adjust_section_offsets): Same.
6843 * output.h (Output_section::add_input_section_for_script): Renamed to
6844 Output_section::add_simple_input_section.
6845 (Output_section::discard_states): New method declaration.
6846 (Output_section::adjust_section_offsets): Same.
6847 (Output_section::section_offsets_need_adjustment,
6848 Output_section::set_section_offsets_need_adjustment): New method
6849 definitions.
6850 (Output_section::section_offsets_need_adjustment_): New data member.
6851 * script-sections.cc
6852 (Output_section_element_input::set_section_address): Adjust code for
6853 renaming of Output_section::add_input_section_for_script.
6854 (Orphan_output_section::set_section_address): Same.
6855
6856 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6857
6858 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6859 Fix_v4bx enum values .
6860 * gold/options.h (General_options): New option definitions.
6861 (General_options::fix_v4bx): New method.
6862 (General_options::Fix_v4bx): New enum.
6863 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6864 (General_options::parse_fix_v4bx_interworking): New method.
6865
6866 2010-01-22 Doug Kwan <dougkwan@google.com>
6867
6868 * arm.cc (Arm_exidx_fixup): New class.
6869
6870 2010-01-21 Doug Kwan <dougkwan@google.com>
6871
6872 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6873 classes.
6874 (Arm_exidx_section_offset_map): New type.
6875
6876 2010-01-21 Doug Kwan <dougkwan@google.com>
6877
6878 * arm.cc (Arm_exidx_input_section): New class.
6879 (Arm_relobj::exidx_input_section_by_link,
6880 Arm_relobj::exidx_input_section_by_shndx,
6881 Arm_relobj::make_exidx_input_section): New methods.
6882 (read_arm_attributes_section): Remove.
6883 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6884 information about them.
6885 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6886 to here.
6887
6888 2010-01-20 Doug Kwan <dougkwan@google.com>
6889
6890 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6891 Input_section_specifier to Section_id.
6892 (Target_arm::new_arm_input_section: Adjust code for change of key
6893 type.
6894 (Target_arm::find_arm_input_section): Ditto.
6895 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6896 (Section_id): Remove.
6897 (Garbage_collection::Section_id_hash): Remove.
6898 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6899 (Section_id): Remove.
6900 (Icf::Section_id_hash): Remove.
6901 * object.h (Section_id, Const_section_id, Section_id_hash,
6902 Const_section_id_hash): New type definitions.
6903 * output.cc (Output_section::add_relaxed_input_section): Change to
6904 use Const_section_id instead of Input_section_specifier as key type.
6905 (Output_section::add_merge_input_section): Ditto.
6906 (Output_section::build_relaxation_map): Change to use Section_id
6907 instead of Input_section_specifier as key type.
6908 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6909 Ditto.
6910 (Output_section::convert_input_sections_to_relaxed_sections): Change
6911 to use Const_section_id instead of Input_section_specifier as key type.
6912 (Output_section::find_merge_section): Ditto.
6913 (Output_section::find_relaxed_input_section): Ditto.
6914 * output.h (Input_section_specifier): Remove class.
6915 (Output_section::Output_section_data_by_input_section_map): Change
6916 key type to Const_section_id.
6917 (Output_section::Output_relaxed_input_section_by_input_section_map):
6918 Ditto.
6919 (Output_section::Relaxation_map): Change key type to Section_id.
6920
6921 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6922
6923 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6924 (class Arm_v4bx_stub): New class.
6925 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6926 (Stub_factory::make_arm_v4bx_stub): New method.
6927 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6928 (Stub_table::empty): Handle v4bx stubs.
6929 (Stub_table::add_arm_v4bx_stub): New method.
6930 (Stub_table::find_arm_v4bx_stub): New method.
6931 (Arm_relocate_functions::v4bx): New method.
6932 (Target_arm::fix_v4bx): New method.
6933 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6934 (Stub_table::relocate_stubs): Likewise.
6935 (Stub_table::do_write): Likewise.
6936 (Stub_table::update_data_size_and_addralign): Likewise.
6937 (Stub_table::finalize_stubs): Likewise.
6938 (Target_arm::Scan::local): Likewise.
6939 (Target_arm::Scan::global): Likewise.
6940 (Target_arm::do_finalize_sections): Likewise.
6941 (Target_arm::Relocate::relocate): Likewise.
6942 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6943 Likewise.
6944 (Target_arm::scan_reloc_for_stub): Likewise.
6945 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6946
6947 2010-01-19 Ian Lance Taylor <iant@google.com>
6948
6949 * output.cc (Output_section_headers::do_sized_write): Write large
6950 segment count to sh_info field.
6951 (Output_file_header::do_sized_write): For large segment count,
6952 write PN_XNUM to e_phnum field.
6953
6954 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6955
6956 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6957 (Arm_relocate_functions::thm_jump8): New function.
6958 (Arm_relocate_functions::thm_jump11): New function.
6959 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6960 R_ARM_THM_JUMP11.
6961 (Target_arm::Scan::global): Likewise.
6962 (Target_arm::Relocate::relocate): Likewise.
6963 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6964 Likewise.
6965
6966 2010-01-14 Doug Kwan <dougkwan@google.com>
6967
6968 * arm.cc (map, utility): Include headers.
6969 (Target_arm::apply_cortex_a8_workaround): New method.
6970 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6971 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6972 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6973 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6974 the --[no-]fix-cortex-a8 command line options.
6975 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6976 (Target_arm::relocate_stub): Use addend in instruction template.
6977 * options.h (DEFINE_bool): Set the user-set flag.
6978 (General_options): Add --[no-]-fix-cortex options.
6979 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
6980 : Update fast look-up map after conversion.
6981
6982 2010-01-14 Sriraman Tallam <tmsriram@google.com>
6983
6984 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6985 in the first pass of do_layout.
6986
6987 2010-01-13 Doug Kwan <dougkwan@google.com>
6988
6989 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6990 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6991 apparent compiler problem of not folding static constant integral
6992 data members of elfcpp::Elf_sizes<32>.
6993
6994 2010-01-13 Doug Kwan <dougkwan@google.com>
6995
6996 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6997 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6998 Arm_relobj::scan_section_for_cortex_a8_erratum,
6999 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7000 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7001 sections to scan for relocation stubs into a new method
7002 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7003 relocation and Cortex-A8 stub scanning.
7004 (Target_arm::do_relax): Force stubs to be after stubbed sections
7005 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
7006 the beginning of a new relaxation pass. Update a comment.
7007 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7008
7009 2010-01-12 Ian Lance Taylor <iant@google.com>
7010
7011 * target-reloc.h (visibility_error): New inline function.
7012 (relocate_section): Call visibility_error.
7013 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7014 (MOSTLYCLEANFILES): Likewise.
7015 (protected_4_pic.o, protected_3.err): New targets.
7016 * testsuite/protected_4.cc: New file.
7017
7018 2010-01-12 Doug Kwan <dougkwan@google.com>
7019
7020 * arm.cc (Cortex_a8_reloc): New class.
7021 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7022 and cortex_a8_relocs_info_.
7023 (Target_arm::fix_cortex_a8): New method definition.
7024 (Target_arm::Cortex_a8_relocs_info): New type.
7025 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7026 New data member declarations.
7027 (Target_arm::scan_reloc_for_stub): Record information about
7028 relocations for THUMB branches that might be exempted from the
7029 Cortex-A8 workaround.
7030 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7031 at the beginning of a relaxation pass.
7032
7033 2010-01-12 Doug Kwan <dougkwan@google.com>
7034
7035 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7036 (Arm_relobj::Mapping_symbol_position,
7037 Arm_reloj::Mapping_symbol_position_less,
7038 Arm_relobj::Mapping_symbols_info): New types.
7039 (Target_arm::is_mapping_symbol_name): New method definition.
7040 (Arm_relobj::do_count_local_symbols): Save information about mapping
7041 symbols.
7042
7043 2010-01-11 Doug Kwan <dougkwan@google.com>
7044
7045 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7046 Arm_relocate_functions::thumb32_branch_upper,
7047 Arm_relocate_functions::thumb32_branch_lower,
7048 Arm_relocate_functions::thumb32_cond_branch_offset,
7049 Arm_relocate_functions::thumb32_cond_branch_upper,
7050 Arm_relocate_functions::thumb32_cond_branch_lower,
7051 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7052 branch offset encoding.
7053 (Arm_relocate_functions::thumb_branch_common): Use new branch
7054 offset encoding methods to avoid code duplication.
7055 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7056 (Stub_addend_reader::operator()): Use new branch encoding method
7057 to avoid code duplication.
7058
7059 2010-01-11 Doug Kwan <dougkwan@google.com>
7060
7061 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7062 (Target_arm::do_finalize_sections): Define special EXIDX section
7063 symbols only if referenced.
7064 * gc.h (Garbage_collection::add_reference): New method.
7065 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7066 code duplication.
7067
7068 2010-01-11 Ian Lance Taylor <iant@google.com>
7069
7070 * script.cc (Version_script_info::build_expression_list_lookup):
7071 Change complaing about duplicate wildcard match from error to
7072 warning.
7073
7074 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7075 of 2009-12-30.
7076 (Version_script_info::Version_script_info): Initialize globs_,
7077 default_version_, default_is_global_, and exact_. Don't
7078 initialize globals_ or locals_.
7079 (Version_script_info::build_lookup_tables): Build local symbols
7080 first.
7081 (Version_script_info::unquote): New function.
7082 (Version_script_info::add_exact_match): New function.
7083 (Version_script_info::build_expression_list_lookup): Remove lookup
7084 parameter. Add is_global parameter. Change all callers. Handle
7085 wildcard pattern specially. Unquote pattern. Call
7086 add_exact_match.
7087 (Version_script_info::get_name_to_match): New function.
7088 (Version_script_info::get_symbol_version): New function.
7089 (Version_script_info::get_symbol_version_helper): Remove.
7090 (Version_script_info::check_unmatched_names): Call unquote.
7091 * script.h (class Version_script_info): Change get_symbol_version
7092 to be non-inline and add is_global parameter; change all callers.
7093 Rewrite symbol_is_local. Update declarations. Define struct
7094 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7095 Remove globals_ and locals_ members. Add exact_, globs_,
7096 default_version_, is_global_.
7097 (Version_script_info::Glob): Remove pattern, add expression and
7098 is_global. Update constructor. Change all callers.
7099 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7100 default version.
7101 (Versions::symbol_section_contents): If a symbol is undefined, or
7102 defined in a dynamic object, set the version index to
7103 VER_NDX_LOCAL.
7104 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7105 symbol_is_local.
7106 (Symbol_table::add_from_pluginobj): Likewise.
7107 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7108
7109 2010-01-11 Doug Kwan <dougkwan@google.com>
7110
7111 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7112 (incremental_dump_LDADD): Add linking option for libintl.
7113 * Makefile.in: Regenerate.
7114
7115 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7116
7117 PR gold/11144
7118 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7119 instead of -Ds.
7120 * testsuite/Makefile.in: Regenerated.
7121
7122 2010-01-10 Doug Kwan <dougkwan@google.com>
7123
7124 * options.h (DEFINE_var): Use parentheses around argument varname__
7125 in macro body to avoid any unintended subsequent substitutions.
7126
7127 2010-01-10 Ian Lance Taylor <iant@google.com>
7128
7129 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7130 candidates before doing symbol resolution.
7131
7132 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7133 ODR candidates if only one is weak.
7134
7135 2010-01-08 Ian Lance Taylor <iant@google.com>
7136
7137 * script.cc (Version_script_info::build_expression_list_lookup):
7138 Don't warn about ambiguous version, just record the ambiguity.
7139 (Version_script_info::get_symbol_version_helper): Give error if
7140 version is ambiguous.
7141
7142 2010-01-08 Doug Kwan <dougkwan@google.com>
7143
7144 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7145 prev_data_size_ and prev_addralign_. Remove initializer for
7146 deleted data member has_been_changed_.
7147 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7148 to determine if the table is empty.
7149 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7150 Remove.
7151 (Stub_table::add_reloc_stub): Define method in class definition
7152 instead of just declaring it there.
7153 (Stub_table::add_cortex_a8_stub): New method definition.
7154 (Stub_table::update_data_size_and_addralign): Ditto.
7155 (Stub_table::finalize_stubs): Ditto.
7156 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7157 (Stub_table::do_addralign_): Return address alignment in the
7158 (Stub_table::do_reset_address_and_file_offset): Define method in
7159 class definition instead of declaring it there. Set current data
7160 size to be the data size of the previous pass.
7161 (Stub_table::set_final_data_size): Use current data size as the
7162 final data size.
7163 (Stub_table::relocate_stub): Change parameter type of stub from
7164 Reloc_stub pointer to Stub pointer.
7165 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7166 (Stub_table::Cortex_a8_stub_list): New typedef.
7167 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7168 Stub_table::prev_addralign_): New data member.
7169 (Arm_relobj::Arm_relobj): Initialize data member
7170 section_has_cortex_a8_workaround_.
7171 (Arm_relobj::section_has_cortex_a8_workaround,
7172 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7173 definitions.
7174 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7175 declarations.
7176 (Target_arm::relocate_stub): Change parameter type of stub from
7177 Reloc_stub pointer to Stub pointer.
7178 (Insn_template::size, Insn_template::alignment): Handle
7179 THUMB16_SPECIAL_TYPE.
7180 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7181 Stub_table::update_data_size_and_addralign,
7182 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7183 definitions.
7184 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7185 (Stub_table::do_write): Ditto.
7186 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7187
7188 2010-01-08 Ian Lance Taylor <iant@google.com>
7189
7190 PR 11108
7191 * symtab.h (class Symbol): Remove fields is_target_special_ and
7192 has_plt_offset_. Add field is_defined_in_discarded_section_.
7193 (Symbol::is_defined_in_discarded_section): New function.
7194 (Symbol::set_is_defined_in_discarded_section): New function.
7195 (Symbol::has_plt_offset): Rewrite.
7196 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7197 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7198 Don't initialize is_target_special_ or has_plt_offset_.
7199 Initialize is_defined_in_discarded_section_.
7200 (Symbol_table::add_from_relobj): If appropriate, set
7201 is_defined_in_discarded_section.
7202 * resolve.cc (Symbol::override_base_with_special): Don't test
7203 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7204 * target-reloc.h (relocate_section): Do special handling for
7205 symbols defined in discarded sections for global symbols as well
7206 as local symbols.
7207
7208 2010-01-08 Ian Lance Taylor <iant@google.com>
7209
7210 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7211 the SHT_SYMTAB case.
7212
7213 2010-01-08 Ian Lance Taylor <iant@google.com>
7214
7215 * object.cc (Sized_relobj::do_layout): Don't get confused if
7216 layout_eh_frame returns NULL.
7217
7218 2010-01-08 Ian Lance Taylor <iant@google.com>
7219
7220 PR 11084
7221 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7222 dynamic symbol table, use the normal symbol table.
7223 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7224 symbol table.
7225
7226 2010-01-08 Ian Lance Taylor <iant@google.com>
7227
7228 PR 11072
7229 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7230 sections.
7231
7232 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7233
7234 * version.cc (print_version): Change to "Copyright 2010".
7235
7236 2010-01-08 Ian Lance Taylor <iant@google.com>
7237
7238 PR 10287
7239 PR 11063
7240 * i386.cc (class Target_i386): Change return type of plt_section
7241 to be non-const.
7242 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7243 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7244 tls_desc_rel_ field.
7245 (Output_data_plt_i386::rel_tls_desc): New function.
7246 (Target_i386::rel_tls_desc_section): New function.
7247 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7248 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7249 R_386_TLS_DESC reloc in rel_tls_desc_section.
7250 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7251 Define struct Tlsdesc_info.
7252 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7253 (Target_x86_64::do_reloc_symbol_index): New function.
7254 (Target_x86_64::add_tlsdesc_info): New function.
7255 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7256 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7257 tlsdesc_rel_ field.
7258 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7259 all callers.
7260 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7261 (Target_x86_64::rela_tlsdesc_section): New function.
7262 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7263 handling.
7264 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7265 (Target_x86_64::do_reloc_addend): New function.
7266 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7267 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7268 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7269 (Output_reloc::type): New function.
7270 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7271 (Output_reloc::is_target_specific): New function.
7272 (Output_reloc::target_arg): New function.
7273 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7274 absolute relocs and target specific relocs.
7275 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7276 add_target_specific.
7277 (class Output_data_reloc) [SHT_RELA]: Likewise.
7278 * output.cc (Output_reloc::Output_reloc): Add four new versions
7279 for absolute relocs and target specific relocs.
7280 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7281 (Output_reloc::get_symbol_index): Likewise.
7282 (Output_reloc::local_section_offset): Check that local_sym_index_
7283 is not TARGET_CODE or 0.
7284 (Output_reloc::symbol_value): Likewise.
7285 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7286 reloc.
7287 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7288 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7289 functions.
7290 * layout.cc (add_target_dynamic_tags): Use output section for
7291 DT_PLTRELSZ and DT_JMPREL.
7292
7293 2010-01-07 Ian Lance Taylor <iant@google.com>
7294
7295 PR 11061
7296 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7297 function.
7298 (class Output_data_reloc_generic): Define.
7299 (class Output_data_reloc_base): Change base class to
7300 Output_data_reloc_generic. Change add() method to call
7301 bump_relative_reloc_count for a relative reloc. Remove
7302 sort_relocs_ field.
7303 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7304 to sort_relocs().
7305 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7306 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7307 appropriate.
7308 * layout.h (class Layout): Update declaration.
7309
7310 2010-01-07 Ian Lance Taylor <iant@google.com>
7311
7312 * output.h (class Output_data): Add const version of
7313 output_section and do_output_section.
7314 (class Output_section_data): Add const version of
7315 do_output_section.
7316 (class Output_section): Likewise.
7317 * layout.cc (Layout::add_target_dynamic_tags): New function.
7318 * layout.h (class Layout): Update declarations.
7319 * arm.cc (Target_arm::do_finalize_sections): Use
7320 add_target_dynamic_tags.
7321 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7322 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7323 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7324 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7325
7326 2010-01-07 Ian Lance Taylor <iant@google.com>
7327
7328 PR 11042
7329 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7330 object as needed.
7331
7332 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7333 Ian Lance Taylor <iant@google.com>
7334
7335 PR 11019
7336 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7337 Xindex::read_symtab_xindex.
7338
7339 2010-01-07 Doug Kwan <dougkwan@google.com>
7340
7341 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7342 (Insn_template::thumb16_bcond_insn): New method declaration.
7343 (Insn_template): Fix spelling.
7344 (Stub::thumb16_special): New method declaration.
7345 (Stub::do_write): Define virtual method which was previously pure
7346 virtual.
7347 (Stub::do_thumb16_special): New method declaration.
7348 (Stub::do_fixed_endian_write): New template member.
7349 (Reloc_stub::do_write): Remove.
7350 (Reloc_stub::do_fixed_endian_write): Remove.
7351 (Cortex_a8_stub): New class definition.
7352 (Stub_factory::make_cortex_a8_stub): New method definition.
7353 (Stub_factory::Stub_factory): Add missing static storage class
7354 qualifier for elf32_arm_stub_a8_veneer_blx.
7355
7356 2010-01-07 Ian Lance Taylor <iant@google.com>
7357
7358 PR 10980
7359 * options.h (class General_options): Add --warn-unresolved-symbols
7360 and --error-unresolved-symbols.
7361 * errors.cc (Errors::undefined_symbol): Implement
7362 --warn-unresolved-symbols.
7363
7364 * options.h (class General_options): Add -z text and -z textoff.
7365 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7366
7367 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7368
7369 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7370 (Garbage_collection::cident_sections): New function.
7371 (Garbage_collection::add_cident_section): New function.
7372 (Garbage_collection::cident_sections_): New member.
7373 (gc_process_relocs): Add references to sections whose names are C
7374 identifiers.
7375 * gold.h (cident_section_start_prefix): New constant.
7376 (cident_section_stop_prefix): New constant.
7377 (is_cident): New function.
7378 * layout.cc (Layout::define_section_symbols): Replace string constants
7379 with the newly defined constants.
7380 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7381 C identifiers.
7382 * testsuite/Makefile.am: Add gc_orphan_section_test.
7383 * testsuite/Makefile.in: Regenerate.
7384 * testsuite/gc_orphan_section_test.cc: New file.
7385 * testsuite/gc_orphan_section_test.sh: New file.
7386
7387 2010-01-06 Ian Lance Taylor <iant@google.com>
7388
7389 PR 10980
7390 * options.h (class General_options): Add --warn-shared-textrel.
7391 * layout.cc (Layout::finish_dynamic_section): Implement
7392 --warn-shared-textrel.
7393
7394 PR 10980
7395 * options.h (class General_options): Add --warn-multiple-gp.
7396
7397 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7398
7399 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7400 $(THREADSLIB) and $(LIBDL).
7401 * Makefile.in: Rebuild.
7402
7403 2010-01-06 Ian Lance Taylor <iant@google.com>
7404
7405 PR 10980
7406 * options.cc (General_options::parse_section_start): New function.
7407 (General_options::section_start): New function.
7408 (General_options::General_options): Initialize all members.
7409 * options.h: Include <map>
7410 (class General_options): Add --section-start. Add section_starts_
7411 member.
7412 * layout.cc (Layout::attach_allocated_section_to_segment): If
7413 --section-start was used, set the address of the segment. Remove
7414 local sort_sections.
7415 (Layout::relaxation_loop_body): If the address of the load segment
7416 has been set by --section-start, don't use it.
7417 * output.h (Output_segment::update_flags_for_output_section): New
7418 function.
7419 * output.cc (Output_segment::add_output_section): Call
7420 update_flags_for_output_section.
7421
7422 2010-01-05 Ian Lance Taylor <iant@google.com>
7423
7424 PR 10980
7425 * options.h (class General_options): Add --undefined-version.
7426 * script.cc (struct Version_expression): Add was_matched_by_symbol
7427 field.
7428 (Version_script_info::matched_symbol): New function.
7429 (Version_script_info::get_symbol_version_helper): Call
7430 matched_symbol.
7431 (Version_script_info::check_unmatched_names): New function.
7432 * script.h (class Version_script_info): Update declarations.
7433 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7434
7435 * options.h (class General_options): Use DEFINE_bool_alias for
7436 allow_multiple_definition.
7437 * resolve.cc (Symbol_table::should_override): Don't test
7438 allow_multiple_definition.
7439
7440 PR 10980
7441 * options.h (class General_options): Add --cref.
7442 * main.cc (main): Print cref table if --cref. Don't close mapfile
7443 until after printing cref table.
7444 * cref.cc: Include "symtab.h".
7445 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7446 (Cref_table_compare::operator()): New function.
7447 (Cref_inputs::gather_cref): New function.
7448 (filecol): New static const.
7449 (Cref_inputs::print_cref): New function.
7450 (Cref::print_cref): New function.
7451 * cref.h: Include <cstdio>.
7452 (class Cref): Update declarations.
7453 * mapfile.h (Mapfile::file): New function.
7454 * object.h (class Object): Define Symbols. Declare virtual
7455 do_get_global_symbols.
7456 (Object::get_global_symbols): New function.
7457 * object.cc (Input_objects::add_object): Pass object to cref_ if
7458 --cref.
7459 (Input_objects::archive_start): Likewise.
7460 (Input_objects::archive_stop): Likewise.
7461 (Input_objects::print_cref): New function.
7462 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7463 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7464 --cref.
7465 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7466 function.
7467 * plugin.h (class Sized_pluginobj): Update declarations.
7468
7469 2010-01-05 Ian Lance Taylor <iant@google.com>
7470
7471 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7472 to is_default_version. Rename insdef to insdefault.
7473 (Symbol_table::add_from_relobj): Rename def to is_default_version
7474 and local to is_forced_local.
7475 (Symbol_table::add_from_pluginobj): Likewise.
7476 (Symbol_table::add_from_dynobj): Likewise.
7477 (Symbol_table::define_special_symbol): Rename insdef to
7478 insdefault.
7479
7480 2010-01-04 Ian Lance Taylor <iant@google.com>
7481
7482 PR 10980
7483 * options.h (class General_options): Add
7484 --allow-multiple-definition and -z muldefs.
7485 * resolve.cc (Symbol_table::should_override): Don't warn about a
7486 multiple symbol definition if --allow-multiple-definition or -z
7487 muldefs.
7488
7489 PR 10980
7490 * options.h (class General_options): Add --add-needed and
7491 --copy-dt-needed-entries. Tweak --as-needed help entry.
7492 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7493 error if --copy-dt-needed-entries aka --add-needed is used and
7494 would cause a change in behaviour.
7495
7496 PR 10980
7497 * options.h (class General_options): Add -G as a short version of
7498 --shared. Add no-op options -assert, -g, and -i.
7499
7500 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7501
7502 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7503 check for .text or .gnu.linkonce.t sections.
7504 * icf.cc (Icf::find_identical_sections): Ditto.
7505 Change the detection for mangled function name within the section
7506 name.
7507 * icf.h (is_section_foldable_candidate): New function.
7508
7509 2009-12-30 Ian Lance Taylor <iant@google.com>
7510
7511 PR 10980
7512 * options.h (class General_options): Permit two dashes with
7513 --retain-symbols-file.
7514
7515 2009-12-30 Ian Lance Taylor <iant@google.com>
7516
7517 PR 10979
7518 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7519 don't put the file header and segment headers in the text
7520 segment.
7521
7522 PR 10979
7523 * common.cc (Sort_commons::operator()): Stabilize sort when both
7524 entries are NULL.
7525 (Symbol_table::do_allocate_commons_list): When allocating common
7526 symbols, skip a symbol which is no longer common.
7527 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7528 an object before checking its type.
7529 * testsuite/common_test_2.c: New file.
7530 * testsuite/common_test_3.c: New file.
7531 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7532 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7533 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7534 (common_test_2_pic.o, common_test_2.so): New targets.
7535 (common_test_3_pic.o, common_test_3.so): New targets.
7536 * testsuite/Makefile.in: Rebuild.
7537
7538 PR 10979
7539 * script.cc (read_input_script): If we see a new SECTIONS clause,
7540 and we have added an input section, give an error.
7541 * layout.h (class Layout): Add have_added_input_section function.
7542 Add have_added_input_section_ field.
7543 * layout.cc (Layout::Layout): Initialize
7544 have_added_input_section_.
7545 (Layout::layout): Set have_added_input_section_.
7546 (Layout::layout_eh_frame): Likewise.
7547
7548 2009-12-30 Ian Lance Taylor <iant@google.com>
7549
7550 PR 10931
7551 * options.h (class General_options): Add --sort-common option.
7552 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7553 * common.cc (Sort_common): Add sort_order parameter to
7554 constructor. Add sort_order_ field.
7555 (Sort_commons::operator): Check sort_order_.
7556 (Symbol_table::allocate_commons): Determine the sort order.
7557 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7558 Change all callers.
7559 (Symbol_table::do_allocate_commons_list): Likewise.
7560
7561 2009-12-30 Ian Lance Taylor <iant@google.com>
7562
7563 PR 10916
7564 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7565 symbols from this object, don't change the visibility of an
7566 undefined symbol.
7567 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7568
7569 2009-12-30 Ian Lance Taylor <iant@google.com>
7570
7571 PR 10861
7572 * script.h (class Version_script_info): Define Language enum.
7573 Update declarations. Define Glob, Exact, and Lookup types. Add
7574 new fields globals_, locals_, and is_finalized_.
7575 * script.cc: Various formatting fixes.
7576 (class Parser_closure): Change language_stack_ from a vector of
7577 std::string to one of Version_script_info::Language. Adjust all
7578 uses accordingly.
7579 (class Lazy_demangler): Remove.
7580 (struct Version_expression): Change language from std::string to
7581 Version_script_info::Language.
7582 (Version_script_info::Version_script_info): New function.
7583 (Version_script_info::~Version_script_info): Don't call clear.
7584 (Version_script_info::finalize): New function.
7585 (Version_script_info::build_lookup_tables): New function.
7586 (Version_script_info::build_expression_list_lookup): New
7587 function.
7588 (Version_script_info::get_symbol_version_helper): Rewrite to use
7589 lookup tables.
7590 (Version_script_info::print_expression_list): Adjust to use
7591 Version_script_info::Language.
7592 (script_push_lex_into_version_mode): Check that the version script
7593 has not been finalized.
7594 (version_script_push_lang): Change language string to
7595 Version_script_info::Language.
7596 * options.cc (Command_line::version_script): New function.
7597 * options.h (class General_options): Add finalize_dynamic_list
7598 function. Change version_script from declaration to definition.
7599 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7600 * testsuite/version_script.map: Remove duplicate def of foo.
7601 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7602 version_script.map.
7603 * testsuite/Makefile.in: Rebuild.
7604
7605 2009-12-30 Ian Lance Taylor <iant@google.com>
7606
7607 PR 10843
7608 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7609 if the input symbol index is 0, make the output symbol index 0.
7610
7611 2009-12-30 Ian Lance Taylor <iant@google.com>
7612
7613 PR 10670
7614 * options.h (class General_options): Add -x/--discard-all.
7615 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7616 --discard-all. If the local symbol needs a dynamic entry, check
7617 that before handling --discard-locals.
7618
7619 2009-12-30 Ian Lance Taylor <iant@google.com>
7620
7621 PR 10450
7622 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7623 flags to PF_R.
7624 (Output_segment::add_output_section): Don't change the flags if
7625 the type is PT_TLS.
7626
7627 PR 10450
7628 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7629 GNU hash table if they need a dynamic value. Otherwise, don't add
7630 them if they are defined in a dynamic object or are forced local.
7631
7632 2009-12-29 Ian Lance Taylor <iant@google.com>
7633
7634 PR 10450
7635 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7636 .gnu.hash table for a 32-bit target.
7637
7638 PR 10450
7639 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7640 regular and a dynamic object only needs a dynamic symbol table
7641 entry if it is externally visible.
7642
7643 PR 10450
7644 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7645 constructor. Add global_offset_table_ field.
7646 (Target_i386::got_section): Set global_offset_table_.
7647 (Target_i386::do_finalize_sections): Set global_offset_table_
7648 size.
7649 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7650 in constructor. Add global_offset_table_ field.
7651 (Target_x86_64::got_section): Set global_offset_table_.
7652 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7653 size.
7654
7655 * layout.cc (Layout::Layout): Initialize increase_relro_.
7656 (Layout::get_output_section): Add is_relro, is_last_relro, and
7657 is_first_non_relro parameters. Change all callers.
7658 (Layout::choose_output_section): Likewise.
7659 (Layout::add_output_section_data): Likewise.
7660 (Layout::make_output_section): Likewise.
7661 (Layout::set_segment_offsets): Clear increase_relro when using a
7662 linker script.
7663 * layout.h (class Layout): Add increase_relro method. Add
7664 increase_relro_ field. Update declarations.
7665 * output.cc (Output_section::Output_section): Initialize
7666 is_last_relro_ and is_first_non_relro_.
7667 (Output_segment::add_output_section): Group relro sections is
7668 do_sort is true. Handle is_last_relro and is_first_non_relro.
7669 (Output_segment::maximum_alignment): Remove relro handling.
7670 (Output_segment::set_section_addresses): Add increase_relro
7671 parameter. Change all callers. Add initial alignment to align
7672 relro sections on separate page. Remove old relro handling.
7673 (Output_segment::set_section_list_addresses): Remove in_relro
7674 parameter. Change all callers.
7675 (Output_segment::set_offset): Add increase parameter. Change all
7676 callers. Remove old relro handling.
7677 * output.h (class Output_section): Add new methods: is_last_relro,
7678 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7679 Add is_last_relro_ and is_first_non_relro_ fields.
7680 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7681 Create separate .got.plt section. Call increase_relro.
7682 * x86_64.cc (Target_x86_64::got_section): Likewise.
7683 * testsuite/relro_script_test.t: Add .got.plt.
7684
7685 PR 10450
7686 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7687 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7688 (Layout::finalize): Call set_dynamic_symbol_size.
7689 (Layout::set_dynamic_symbol_size): New function.
7690 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7691 set_dynamic_symbol_size.
7692
7693 PR 10450
7694 * output.h (class Output_section): Add is_entsize_zero_ field.
7695 * output.cc (Output_section::Output_section): Initialize
7696 is_entsize_zero_.
7697 (Output_section::set_entsize): If two different entsizes are
7698 requested, force it to zero.
7699 (Output_section::add_input_section): Set flags for .debug_str
7700 before updating section flags. Set entsize.
7701 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7702 and SHF_STRING if all input sections have those flags.
7703
7704 2009-12-29 Rafael Espindola <espindola@google.com>
7705
7706 * main.cc (main): Fix the sys time reporting.
7707 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7708 reporting.
7709
7710 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7711
7712 * options.cc (General_options::parse_version): Allow -v to exit
7713 without an error if there is nothing to link.
7714
7715 2009-12-29 Ian Lance Taylor <iant@google.com>
7716
7717 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7718 using a version of gcc before 4.1.
7719 * configure: Rebuild.
7720
7721 2009-12-28 Chris Demetriou <cgd@google.com>
7722
7723 * attributes.cc (Output_attributes_section_data::do_write): Use
7724 std::vector::front rather than std::vector::data.
7725
7726 2009-12-28 Ian Lance Taylor <iant@google.com>
7727
7728 * symtab.h (class Symbol_table): Add enum Defined.
7729 * resolve.cc (Symbol_table::should_override): Add defined
7730 parameter. Change all callers. Test whether object is NULL
7731 before calling a method on it.
7732 (Symbol_table::report_resolve_problem): Add defined parameter.
7733 Change all callers.
7734 (Symbol_table::should_override_with_special): Likewise.
7735 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7736 parameter. Change all callers.
7737 (Symbol_table::do_define_in_output_data): Likewise.
7738 (Symbol_table::define_in_output_segment): Likewise.
7739 (Symbol_table::do_define_in_output_segment): Likewise.
7740 (Symbol_table::define_as_constant): Likewise.
7741 (Symbol_table::do_define_as_constant): Likewise.
7742 * script.h (class Symbol_assignment): Add is_defsym parameter to
7743 constructor; change all callers.
7744 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7745 parameter. Change all callers. Add is_defsym_ field.
7746 (class Parser_closure): Add parsing_defsym parameter to
7747 constructor; change all callers. Add parsing_defsym accessor
7748 function. Add parsing_defsym_ field.
7749
7750 2009-12-28 Ian Lance Taylor <iant@google.com>
7751
7752 * gold.cc (queue_middle_tasks): Fix formatting.
7753 * object.cc (Relobj::is_section_name_included): Likewise.
7754
7755 2009-12-23 Ian Lance Taylor <iant@google.com>
7756
7757 * i386.cc (Target_i386::do_calls_non_split): Recognize
7758 -fsplit-stack prologue for a function with a static chain.
7759 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7760 -fsplit-stack prologue when using %r11.
7761
7762 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7763
7764 * options.cc (General_options::parse_version): Make -v continue and do
7765 the link like GNU ld does.
7766
7767 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7768
7769 * Makefile.am (CCFILES): Add timer.cc.
7770 (HFILES): Add timer.h.
7771 * configure.ac: Check for sysconf and times.
7772 * main.cc: include timer.h.
7773 (main): Use Timer instead of get_run_time.
7774 * timer.cc: New.
7775 * timer.h: New.
7776 * workqueue.cc: include timer.h.
7777 (Workqueue::find_and_run_task):
7778 Report user, sys and wall time.
7779 * Makefile.in: Regenerate.
7780 * config.in: Regenerate.
7781 * configure: Regenerate.
7782
7783 2009-12-16 Doug Kwan <dougkwan@google.com>
7784
7785 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7786 sections.
7787 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7788 relaxed input sections.
7789 * output.cc (Output_section::find_relaxed_input_section): Change
7790 return type to Output_relaxed_input_section pointer. Adjust code
7791 for new type of relaxed_input_section_map_.
7792 * output.h (Output_section::find_relaxed_input_section): Change
7793 return type to Output_relaxed_input_section pointer.
7794 (Output_section::Output_relaxed_input_section_by_input_section_map):
7795 New type.
7796 (Output_section::relaxed_input_section_map_): Change type to
7797 Output_section::Output_relaxed_input_section_by_input_section_map.
7798 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7799 input section.
7800
7801 2009-12-15 Ian Lance Taylor <iant@google.com>
7802
7803 * layout.cc (Layout::create_shstrtab): Only write out after input
7804 sections if we are compressing debug sections.
7805
7806 2009-12-15 Ian Lance Taylor <iant@google.com>
7807
7808 * archive.cc (Archive::add_symbols): Only look up a symbol without
7809 a version if there is, in fact, a version.
7810
7811 2009-12-14 Ian Lance Taylor <iant@google.com>
7812
7813 Revert -Wshadow changes, all changes from:
7814 2009-12-11 Doug Kwan <dougkwan@google.com>
7815 2009-12-11 Nick Clifton <nickc@redhat.com>
7816 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7817
7818 2009-12-11 Doug Kwan <dougkwan@google.com>
7819
7820 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7821 due to -Wshadow.
7822 * attributes.cc (Object_attribute::size): Ditto.
7823 (Attributes_section_data::size): Ditto.
7824 (Attributes_section_data::Attributes_section_data): Ditto.
7825 (Output_attributes_section_data::do_write): Ditto.
7826 * attributes.h (Object_attribute::set_type): Ditto.
7827 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7828
7829 2009-12-11 Nick Clifton <nickc@redhat.com>
7830
7831 * archive.cc: Fix shadowed variable warnings.
7832 * arm.cc: Likewise.
7833 * compressed_output.cc: Likewise.
7834 * compressed_output.h: Likewise.
7835 * configure: Likewise.
7836 * dwarf_reader.cc: Likewise.
7837 * dynobj.cc: Likewise.
7838 * dynobj.h: Likewise.
7839 * ehframe.cc: Likewise.
7840 * ehframe.h: Likewise.
7841 * errors.cc: Likewise.
7842 * expression.cc: Likewise.
7843 * fileread.cc: Likewise.
7844 * fileread.h: Likewise.
7845 * freebsd.h: Likewise.
7846 * i386.cc: Likewise.
7847 * icf.cc: Likewise.
7848 * incremental.h: Likewise.
7849 * layout.cc: Likewise.
7850 * layout.h: Likewise.
7851 * mapfile.cc: Likewise.
7852 * merge.cc: Likewise.
7853 * merge.h: Likewise.
7854 * object.cc: Likewise.
7855 * object.h: Likewise.
7856 * options.h: Likewise.
7857 * output.cc: Likewise.
7858 * output.h: Likewise.
7859 * parameters.cc: Likewise.
7860 * plugin.cc: Likewise.
7861 * powerpc.cc: Likewise.
7862 * reduced_debug_output.cc: Likewise.
7863 * reduced_debug_output.h: Likewise.
7864 * reloc.cc: Likewise.
7865 * reloc.h: Likewise.
7866 * resolve.cc: Likewise.
7867 * script-sections.cc: Likewise.
7868 * script.cc: Likewise.
7869 * script.h: Likewise.
7870 * sparc.cc: Likewise.
7871 * symtab.cc: Likewise.
7872 * symtab.h: Likewise.
7873 * target-select.cc: Likewise.
7874 * target-select.h: Likewise.
7875 * token.h: Likewise.
7876 * workqueue.cc: Likewise.
7877 * workqueue.h: Likewise.
7878 * x86_64.cc: Likewise.
7879
7880 2009-12-10 Doug Kwan <dougkwan@google.com>
7881
7882 * arm.cc (attributes.h): New include.
7883 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7884 (Arm_relobj::~Arm_relobj): Delete object pointed by
7885 attributes_section_data_.
7886 (Arm_relobj::attributes_section_data): New method definition.
7887 (Arm_relobj::attributes_section_data_): New data member declaration.
7888 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7889 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7890 attributes_section_data_.
7891 (Arm_dynobj::attributes_section_data): New method definition.
7892 (Arm_dynobj::attributes_section_data_): New data member declaration.
7893 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7894 initialization value of may_use_blx_ to false.
7895 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7896 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7897 object attributes to compute results instead of hard-coding.
7898 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7899 Target_arm::get_secondary_compatible_arch,
7900 Target_arm::set_secondary_compatible_arch
7901 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7902 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7903 New method declarations.
7904 (Target_arm::get_aeabi_object_attribute): New method definition.
7905 (Target_arm::attributes_section_data_): New data member declaration.
7906 (read_arm_attributes_section): New template definition.
7907 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7908 (Arm_dynobj::do_read_symbols): Ditto.
7909 (Target_arm::do_finalize_sections): Merge attributes sections from
7910 input. Check for BLX use after attributes section merging.
7911 Fix __exidx_start and __exidx_end visibility. Create an
7912 .ARM.attributes section if necessary.
7913 (Target_arm::get_secondary_compatible_arch,
7914 Target_arm::set_secondary_compatible_arch,
7915 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7916 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7917 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7918 New method definitions.
7919
7920 2009-12-09 Ian Lance Taylor <iant@google.com>
7921
7922 * plugin.cc (Plugin::load): Don't cast from void* to a function
7923 pointer.
7924
7925 2009-12-09 Ian Lance Taylor <iant@google.com>
7926
7927 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7928 information fields.
7929
7930 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7931
7932 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7933 Replace two_file_shared_1.so with two_file_shared_2.so.
7934 * testsuite/Makefile.in: Regenerated.
7935
7936 2009-12-08 Doug Kwan <dougkwan@google.com>
7937
7938 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7939 (HFILES): Add attributes.h and int_encoding.h.
7940 * Makefile.in: Regenerate.
7941 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7942 function definitions to int_encoding.cc
7943 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7944 prototypes to int_encoding.h
7945 * reduced_debug_output.cc (int_encoding.h): New include.
7946 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7947 function definitions to int_encoding.cc
7948 (insert_into_vector, read_from_pointer): Move template definitions to
7949 int_encoding.h
7950 * attributes.cc: New file.
7951 * attributes.h: New file.
7952 * int_encoding.cc: New file.
7953 * int_encoding.h: New file.
7954
7955 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7956
7957 PR gold/11055
7958 * incremental-dump.cc (dump_incremental_inputs): New.
7959 (main): Use dump_incremental_inputs.
7960
7961 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7962
7963 PR gold/10893
7964 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7965 checking elfcpp::STT_FUNC.
7966 (Target_i386::Relocate::relocate): Likewise.
7967 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7968
7969 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7970 symbols from shared libraries into normal FUNC symbols.
7971
7972 * symtab.h (Symbol): Add is_func and use it.
7973
7974 2009-12-05 Doug Kwan <dougkwan@google.com>
7975
7976 * arm.cc (Target_arm::arm_info): Initialize new fields
7977 attributes_section and attributes_vendor.
7978 * i386.cc (Target_i386::i386_info): Same.
7979 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7980 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7981 fields attributes_section and attributes_vendor.
7982 * sparc.cc (Target_sparc::sparc_info): Same.
7983 * target.h (Target::attributes_section, Target::attributes_vendor,
7984 Target::is_attributes_section, Target::attribute_arg_type,
7985 Target::attributes_order): New method definitions.
7986 (Target::Target_info::attributes_section,
7987 Target::Target_info::attributes_vendor): New fields.
7988 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7989 virtual method definitions.
7990 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7991 attributes_section and attributes_vendor.
7992 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7993
7994 2009-12-05 Doug Kwan <dougkwan@google.com>
7995
7996 * arm.cc: Update comments about interworking and stub generation.
7997 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7998 considered as non-PIC.
7999 (Arm_relocate_functions::base_abs): Fix formatting.
8000 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8001 of function to use GOT entry address instead of offset.
8002 (Target_arm::Scan::global): Issue an error if a symbol would need a
8003 PLT does not get one because it is untyped. Remove code to create
8004 dynamic symbols for relative branches.
8005 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8006 takes unsigned integer instead of boolean.
8007
8008 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8009
8010 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8011 (two_file_test_LDADD): Likewise.
8012 (common_test_1_LDADD): Likewise.
8013 (exception_test_LDADD) Likewise.
8014 (weak_test_LDADD): Likewise.
8015 (many_sections_test_LDADD): Likewise.
8016 (initpri1_LDADD): Likewise.
8017 (script_test_1_LDADD): Likewise.
8018 (script_test_2_LDADD): Likewise.
8019 (justsyms_LDADD): Likewise.
8020 (binary_test_LDADD): Likewise.
8021 (large_LDADD): Likewise.
8022 * testsuite/Makefile.in: Regenerated.
8023
8024 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
8025
8026 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8027 (Symbol_table::override_with_special): Likewise.
8028 (Symbol_table::add_from_object): Likewise.
8029
8030 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8031
8032 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8033 Don't set the data_offset twice.
8034
8035 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8036
8037 * testsuite/Makefile.in: Regenerate.
8038
8039 2009-12-03 Doug Kwan <dougkwan@google.com>
8040
8041 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8042 (Target_arm::do_finalize_sections): Add parameter for symbol table
8043 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8044 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8045 parameter for symbol table pointer.
8046 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8047 an additional parameter for a pointer to symbol table.
8048 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8049 parameter for a symbol table pointer.
8050 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8051 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8052 Ditto.
8053 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8054 parameter for a symbol table pointer.
8055
8056 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
8057
8058 * incremental.cc (Incremental_inputs_header)
8059 (Incremental_inputs_header_write, Incremental_inputs_entry)
8060 (Incremental_inputs_entry_write): Move ...
8061 * incremental.h (Incremental_inputs_header)
8062 (Incremental_inputs_header_write, Incremental_inputs_entry)
8063 (Incremental_inputs_entry_write): here.
8064
8065 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8066
8067 * incremental.cc (make_sized_incremental_binary): Set the target.
8068 Error if it is incompatible.
8069 * output.h (Output_file): Add filename method.
8070
8071 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8072
8073 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8074 from the get_* methods.
8075
8076 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8077
8078 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8079 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8080 Write 0 for the data_offset of scripts.
8081
8082 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8083
8084 * testsuite/Makefile.am: Add the incremental_test.sh test.
8085 * testsuite/incremental_test.sh: New.
8086 * testsuite/incremental_test_1.c: New.
8087 * testsuite/incremental_test_2.c: New.
8088
8089 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8090
8091 * incremental-dump.cc (main): Fix typos.
8092
8093 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8094
8095 PR gold/11025
8096 * incremental-dump.cc (main): Use llu to print 64 bit values.
8097
8098 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8099 H.J. Lu <hongjiu.lu@intel.com>
8100
8101 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8102 $(LIBDL).
8103 (incremental_dump_LDADD): Likewise.
8104 * Makefile.in: Regenerated.
8105
8106 2009-11-25 Doug Kwan <dougkwan@google.com>
8107
8108 Revert:
8109
8110 2009-11-25 Doug Kwan <dougkwan@google.com>
8111
8112 * arm.cc (Target_arm::Target_arm): Move method definition
8113 outside of class definition. Add code to handle
8114 --target1-rel, --target1-abs and --target2= options.
8115 (Target_arm::get_reloc_reloc_type): Change method to be
8116 non-static and const.
8117 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8118 New data member declaration.
8119 (Target_arm::Scan::local, Target_arm::Scan::global,
8120 Target_arm::Relocate::relocate,
8121 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8122 Adjust call to Target_arm::get_real_reloc_type.
8123 (Target_arm::get_real_reloc_type): Use command line options
8124 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8125 * options.h (--target1-rel, --target1-abs, --target2): New
8126 ARM-only options.
8127
8128 2009-11-25 Doug Kwan <dougkwan@google.com>
8129
8130 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8131 class definition. Add code to handle --target1-rel, --target1-abs
8132 and --target2= options.
8133 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8134 and const.
8135 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8136 member declaration.
8137 (Target_arm::Scan::local, Target_arm::Scan::global,
8138 Target_arm::Relocate::relocate,
8139 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8140 call to Target_arm::get_real_reloc_type.
8141 (Target_arm::get_real_reloc_type): Use command line options to
8142 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8143 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8144 options.
8145
8146 2009-11-25 Doug Kwan <dougkwan@google.com>
8147
8148 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8149 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8150 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8151 formatting.
8152 (Arm_relocate_functions::thm_call): Replace body with a call to
8153 Arm_relocate_functions::thumb_branch_common.
8154 (Arm_relocate_functions::thm_jump24,
8155 Arm_relocate_functions::thm_xpc22): New method definitions.
8156 (Arm_relocate_functions::thumb_branch_common): New method definition.
8157 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8158 operator.
8159 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8160 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8161
8162 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8163
8164 * Makefile.am: Build incremental-dump
8165 * Makefile.in: Regenerate.
8166 * incremental-dump.cc: New.
8167 * incremental.cc (Incremental_inputs_header_data,
8168 Incremental_inputs_entry_data): Move to incremental.h
8169 * incremental.h: (Incremental_inputs_header_data,
8170 Incremental_inputs_entry_data): Move from incremental.cc
8171
8172 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8173
8174 * incremental.cc (Incremental_inputs_header,
8175 Incremental_inputs_header_write, Incremental_inputs_entry,
8176 Incremental_inputs_entry_write): Add a typedef with the data type.
8177
8178 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8179
8180 * incremental.cc (Incremental_inputs_header,
8181 Incremental_inputs_header_write, Incremental_inputs_entry,
8182 Incremental_inputs_entry_write): Update comment about which
8183 type has the filed descriptions.
8184
8185 2009-11-15 Doug Kwan <dougkwan@google.com>
8186
8187 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8188 (Arm_relocate_functions::arm_branch_common): Change method defintion
8189 in class definition to a method declaration and update list of formal
8190 parameters.
8191 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8192 Arm_relocation_functions::jump24): Adjust call to
8193 Arm_relocate_functions::arm_branch_common. Update list of formal
8194 parameters.
8195 (Arm_relocate_functions::xpc25): New method definition.
8196 (Arm_relocate_functions::arm_branch_common): Move method defintion
8197 out from class definition. Use stubs for mode-switching and extending
8198 branch ranges.
8199 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8200 specially. Change code to enable use of stubs in ARM branches.
8201
8202 2009-11-10 Doug Kwan <dougkwan@google.com>
8203
8204 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8205 in method declaration.
8206 (Target_arm::relocate_stub): New method declaration.
8207 (Target_arm::default_target): Change to return a pointer instead of
8208 a const reference.
8209 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8210 Target_arm::default_target.
8211 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8212 method definition.
8213 (Target_arm::relocate_section): Adjust view.
8214 (Target_arm::relocate_stub): New method definition.
8215
8216 2009-11-10 Doug Kwan <dougkwan@google.com>
8217
8218 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8219 a format warning.
8220 * incremental.cc (open_incremental_binary): Initialized local
8221 variables to avoid warnings.
8222 * object.cc (make_elf_object): Ditto.
8223 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8224 a format warning.
8225
8226 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8227
8228 PR gold/10930
8229 * testsuite/plugin_test.c: Include "config.h".
8230
8231 2009-11-09 Doug Kwan <dougkwan@google.com>
8232
8233 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8234 (arm_symbol_value): Remove.
8235 (Arm_relocate_functions::arm_branch_common,
8236 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8237 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8238 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8239 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8240 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8241 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8242 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8243 Arm_relocate_functions::thm_mobw_abs_nc,
8244 Arm_relocate_functions::thm_mov_abs,
8245 Arm_relocate_functions::movw_prel_nc,
8246 Arm_relocate_functions::thm_movt_abs,
8247 Arm_relocate_functions::movt_prel,
8248 Arm_relocate_functions::thm_movw_prel_nc,
8249 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8250 (Target_arm::Relocate::relocate): Only decompose address into two
8251 parts if relocation type uses the thumb-bit and pass the actual
8252 bit instead of a flag indicating that the thumb-bit is used. Adjust
8253 calls to methods in Arm_relocate_functions for this change.
8254
8255 2009-11-08 Ian Lance Taylor <iant@google.com>
8256
8257 PR 10925
8258 * reloc.cc: Instantiate
8259 Sized_relobj::initialize_input_to_output_maps and
8260 Sized_relobj:free_input_to_output_maps.
8261
8262 2009-11-06 Ian Lance Taylor <iant@google.com>
8263
8264 PR 10876
8265 * defstd.cc (in_segment): Set only_if_ref true for "end".
8266
8267 2009-11-06 Doug Kwan <dougkwan@google.com>
8268
8269 * arm.cc (class Reloc_stub): Correct a comment.
8270 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8271 (Target_arm::scan_section_for_stubs): New method declaration.
8272 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8273 Change methods from private to protected.
8274 (Target_arm::do_may_relax): New method definition.
8275 (Target_arm::do_relax, Target_arm::group_sections,
8276 Target_arm::scan_reloc_for_stub,
8277 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8278 (Target_arm::arm_input_section_map_): New data member declaration.
8279 (Target_arm::scan_reloc_for_stub,
8280 Target_arm::scan_reloc_section_for_stubs,
8281 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8282 Target_arm::do_relax): New method definitions.
8283
8284 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8285
8286 * configure.ac: Check for (struct stat)::st_mtim
8287 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8288 * config.in: Regenerate.
8289 * configure: Regenerate.
8290
8291 2009-11-05 Ian Lance Taylor <iant@google.com>
8292
8293 PR 10910
8294 * output.cc (Output_segment::add_output_section): Add missing
8295 return statement.
8296
8297 2009-11-04 Ian Lance Taylor <iant@google.com>
8298
8299 PR 10880
8300 * object.h (class Object): Add is_needed and set_is_needed
8301 methods. Add is_needed_ field. Make bool fields into bitfields.
8302 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8303 defined in a dynamic object and referenced by a regular object,
8304 set is_needed for the dynamic object.
8305 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8306 if the file is marked with as_needed and it is not needed.
8307
8308 2009-11-04 Ian Lance Taylor <iant@google.com>
8309
8310 PR 10887
8311 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8312 tags if data is discarded by linker script.
8313 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8314 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8315 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8316 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8317
8318 2009-11-04 Ian Lance Taylor <iant@google.com>
8319
8320 * layout.cc (Layout::get_output_section): Add is_interp and
8321 is_dynamic_linker_section parameters. Change all callers.
8322 (Layout::choose_output_section): Likewise.
8323 (Layout::make_output_section): Likewise.
8324 (Layout::add_output_section_data): Add is_dynamic_linker_section
8325 parameter. Change all callers.
8326 * layout.h (class Layout): Update declarations.
8327 * output.h (class Output_section): Add is_interp, set_is_interp,
8328 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8329 Add is_interp_, is_dynamic_linker_section_ fields. Change
8330 generate_code_fills_at_write_ to a bitfield.
8331 * output.cc (Output_section::Output_sections): Initialize new
8332 fields.
8333 (Output_segment::add_output_section): Add do_sort parameter.
8334 Change all callers.
8335
8336 2009-11-03 Ian Lance Taylor <iant@google.com>
8337
8338 PR 10860
8339 * options.h (class General_options): Add --warn-common.
8340 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8341 merging two common symbols.
8342 (Symbol_table::should_override): Handle --warn-common when merging
8343 a common symbol with a defined symbol. Use report_resolve_problem
8344 for multiple definitions.
8345 (Symbol_table::report_resolve_problem): New function.
8346 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8347
8348 2009-11-03 Doug Kwan <dougkwan@google.com>
8349
8350 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8351 stub_factory_.
8352 (Target_arm::stub_factory): New method definition.
8353 (Target_arm::new_arm_input_section,
8354 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8355 Target_arm::reloc_uses_thumb_bit): New method declarations.
8356 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8357 New type definitions.
8358 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8359 member declarations.
8360 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8361 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8362 New method definitions.
8363
8364 2009-11-03 Ian Lance Taylor <iant@google.com>
8365
8366 * options.h (class General_options): Add --warn_constructors.
8367
8368 2009-11-03 Ian Lance Taylor <iant@google.com>
8369
8370 PR 10893
8371 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8372 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8373
8374 2009-11-03 Ian Lance Taylor <iant@google.com>
8375
8376 PR 10895
8377 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8378 --msgid-bugs-address.
8379 (install-pdf): New target.
8380 (install-data_yes): Look up one directory to find mkinstalldirs.
8381
8382 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8383
8384 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8385 tree.
8386
8387 2009-10-30 Doug Kwan <dougkwan@google.com>
8388
8389 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8390
8391 2009-10-30 Doug Kwan <dougkwan@google.com>
8392
8393 * arm.cc (Stub_addend_reader): New struct template definition
8394 and partial specializations.
8395 (Stub_addend_reader::operator()): New method definition for a
8396 partially specialized template.
8397
8398 2009-10-30 Doug Kwan <dougkwan@google.com>
8399
8400 * arm.cc (Arm_relobj::processor_specific_flags): New method
8401 definition.
8402 (Arm_relobj::do_read_symbols): New method declaration.
8403 (Arm_relobj::processor_specific_flags_): New data member declaration.
8404 (Arm_dynobj): New class definition.
8405 (Target_arm::do_finalize_sections): Add input_objects parameter.
8406 (Target_arm::do_adjust_elf_header): New method declaration.
8407 (Target_arm::are_eabi_versions_compatible,
8408 (Target_arm::merge_processor_specific_flags): New method declaration.
8409 (Target_arm::do_make_elf_object): New overloaded method definitions
8410 and declaration.
8411 (Arm_relobj::do_read_symbols): New method definition.
8412 (Arm_dynobj::do_read_symbols): Ditto.
8413 (Target_arm::do_finalize_sections): Add input_objects parameters.
8414 Merge processor-specific flags from all input objects.
8415 (Target_arm::are_eabi_versions_compatible,
8416 Target_arm::merge_processor_specific_flags,
8417 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8418 New method definitions.
8419 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8420 Input_objects pointer type parameter.
8421 * layout.cc (Layout::finalize): Pass input objects to target's.
8422 finalize_sections function.
8423 * output.cc (Output_file_header::do_sized_write): Set ELF file
8424 header's processor-specific flags.
8425 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8426 Input_objects pointer type parameter.
8427 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8428 * target.h (Input_objects): New forward class declaration.
8429 (Target::processor_specific_flags,
8430 Target::are_processor_specific_flags_sect): New method definitions.
8431 (Target::finalize_sections): Add input_objects parameter.
8432 (Target::Target): Initialize processor_specific_flags_ and
8433 are_processor_specific_flags_set_.
8434 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8435 parameter.
8436 (Target::set_processor_specific_flags): New method definition.
8437 (Target::processor_specific_flags_,
8438 Target::are_processor_specific_flags_set_): New data member
8439 declarations.
8440 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8441 Input_objects pointer type parameter.
8442
8443 2009-10-30 Doug Kwan <dougkwan@google.com>
8444
8445 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8446
8447 2009-10-28 Ian Lance Taylor <iant@google.com>
8448
8449 * object.h (class Relobj): Drop options parameter from
8450 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8451 do_scan_relocs, do_relocate. Change all callers.
8452 (class Sized_relobj): Drop options parameters from
8453 do_gc_process_relocs, do_scan_relocs, do_relocate,
8454 do_relocate_sections, relocate_sections, emit_relocs_scan,
8455 emit_relocs_scan_reltype. Change all callers.
8456 (struct Relocate_info): Remove options field and all references to
8457 it.
8458 * reloc.h (class Read_relocs): Remove options constructor
8459 parameter and options_ field. Change all callers.
8460 (class Gc_process_relocs, class Scan_relocs): Likewise.
8461 (class Relocate_task): Likewise.
8462 * target-reloc.h (scan_relocs): Remove options parameter. Change
8463 all callers.
8464 (scan_relocatable_relocs): Likewise.
8465 * target.h (class Sized_target): Remove options parameter from
8466 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8467 all callers.
8468 * gc.h (gc_process_relocs): Remove options parameter. Change all
8469 callers.
8470 * arm.cc: Update functions to remove options parameters.
8471 * i386.cc: Likewise.
8472 * powerpc.cc: Likewise.
8473 * sparc.cc: Likewise.
8474 * x86_64.cc: Likewise.
8475 * testsuite/testfile.cc: Likewise.
8476
8477 2009-10-28 Doug Kwan <dougkwan@google.com>
8478
8479 * arm.cc (Arm_relobj): New class definition.
8480 (Arm_relobj::scan_sections_for_stubs,
8481 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8482 New method definitions.
8483
8484 2009-10-28 Cary Coutant <ccoutant@google.com>
8485
8486 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8487 (Plugin::cleanup_done_): New member.
8488 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8489 (Plugin_manager::cleanup_done_): Remove.
8490 (Plugin_manager::add_input_file): Edit error message.
8491 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8492 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8493
8494 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8495
8496 * fileread.cc: (File_read::View::~View): Use the new
8497 data_ownership_ filed.
8498 (File_read::~File_read): Dispose the new whole_file_view_.
8499 (File_read::open): Mmap the whole file if needed.
8500 (File_read::open): Use whole_file_view_ instead of contents_.
8501 (File_read::find_view): Use whole_file_view_ if applicable.
8502 (File_read::do_read): Use whole_file_view_ instead of contents_.
8503 (File_read::make_view): Use whole_file_view_ instead of contents_,
8504 update File_read::View::View call.
8505 (File_read::find_or_make_view): Update File_read::View::View
8506 call.
8507 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8508 remove contents_
8509 (File_read::View::Data_ownership): New enum.
8510 (File_read::View::View): Replace bool mapped_ with Data_ownership
8511 argument.
8512 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8513 (File_read::View::data_ownership_): New field.
8514 (File_read::contents_): Remove (replaced by whole_file_view_).
8515 (File_read::whole_file_view_): New field.
8516 * options.h (class General_options): Add --keep-files-mapped.
8517
8518 2009-10-27 Cary Coutant <ccoutant@google.com>
8519
8520 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8521 * testsuite/Makefile.am (plugin_test_5): New test case.
8522 * testsuite/Makefile.in: Regenerate.
8523
8524 2009-10-25 Doug Kwan <dougkwan@google.com>
8525
8526 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8527 from private to protected to allow access by child class.
8528 (Sized_relobj::do_relocate_sections): New method declaration.
8529 (Sized_relobj::relocate_sections): Virtualize.
8530 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8531 Sized_relobj::relocate_sections. Instantiate template explicitly
8532 for different target sizes and endianity.
8533
8534 2009-10-24 Doug Kwan <dougkwan@google.com>
8535
8536 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8537 (Arm_input_section::as_arm_input_section): New method.
8538 (Arm_output_section): New class definition.
8539 (Arm_output_section::create_stub_group,
8540 Arm_output_section::group_sections): New method definitions.
8541
8542 2009-10-22 Doug Kwan <dougkwan@google.com>
8543
8544 * arm.cc (Arm_input_section): New class definition.
8545 (Arm_input_section::init, Arm_input_section:do_write,
8546 Arm_input_section::set_final_data_size,
8547 Arm_input_section::do_reset_address_and_file_offset): New method
8548 definitions.
8549
8550 2009-10-21 Doug Kwan <dougkwan@google.com>
8551
8552 * arm.cc (Stub_table, Arm_input_section): New forward class
8553 declarations.
8554 (Stub_table): New class defintion.
8555 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8556 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8557 New method definition.
8558
8559 2009-10-21 Doug Kwan <dougkwan@google.com>
8560
8561 * arm.cc: Update copyright comments.
8562 (Target_arm): New forward class template declaration.
8563 (Arm_address): New type.
8564 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8565 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8566 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8567 constants.
8568 (Insn_template): Same.
8569 (DEF_STUBS): New macro.
8570 (Stub_type): New enum type.
8571 (Stub_template): New class definition.
8572 (Stub): Same.
8573 (Reloc_stub): Same.
8574 (Stub_factory): Same.
8575 (Target_arm::Target_arm): Initialize may_use_blx_ and
8576 should_force_pic_veneer_.
8577 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8578 Target_arm::should_force_pic_veneer,
8579 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8580 Target_arm::using_thumb_only, Target_arm:;default_target): New
8581 method defintions.
8582 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8583 New data member declarations.
8584 (Insn_template::size, Insn_template::alignment): New method defintions.
8585 (Stub_template::Stub_template): New method definition.
8586 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8587 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8588 (Stub_factory::Stub_factory): New method definition.
8589 * gold.h (string_hash): New template.
8590 * output.h (Input_section_specifier::hash_value): Use
8591 gold::string_hash.
8592 (Input_section_specifier::string_hash): Remove.
8593 * stringpool.cc (Stringpool_template::string_hash): Use
8594 gold::string_hash.
8595
8596 2009-10-20 Doug Kwan <dougkwan@google.com>
8597
8598 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8599 symbols of relaxed input sections.
8600 * output.h (Output_section::find_relaxed_input_section): Make
8601 method public.
8602
8603 2009-10-16 Doug Kwan <dougkwan@google.com>
8604
8605 * dynobj.cc (Versions::Versions): Initialize version_script_.
8606 Only insert base version symbol definition for a shared object
8607 if version script defines any version versions.
8608 (Versions::define_base_version): New method definition.
8609 (Versions::add_def): Check that base version is not needed.
8610 (Versions::add_need): Define base version lazily.
8611 * dynobj.h (Versions::define_base_version): New method declaration.
8612 (Versions::needs_base_version_): New data member declaration.
8613 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8614 (check_DATA): Add no_version_test.stdout.
8615 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8616 New make rules.
8617 * testsuite/Makefile.in: Regenerate.
8618 * testsuite/no_version_test.c: New file.
8619 * testsuite/no_version_test.sh: Ditto.
8620
8621 2009-10-16 Doug Kwan <dougkwan@google.com>
8622
8623 * expression.cc (class Segment_start_expression): New class definition.
8624 (Segment_start_expression::value): New method definition.
8625 (script_exp_function_segment_start): Return a new
8626 Segment_start_expression.
8627 * gold/script-c.h (script_saw_segment_start_expression): New function
8628 prototype.
8629 * script-sections.cc (Script_sections::Script_sections): Initialize
8630 SAW_SEGMENT_START_EXPRESSION_ to false.
8631 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8632 and -Tbbs options to specify section addresses if given in
8633 command line and no SEGMENT_START expression is seen in a script.
8634 * script-sections.h (Script_sections::saw_segment_start_expression,
8635 Script_sections::set_saw_segment_start_expression): New method
8636 definition.
8637 (Script_sections::saw_segment_start_expression_): New data member
8638 declaration.
8639 * script.cc (script_saw_segment_start_expression): New function.
8640 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8641 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8642 script_test_7.sh and script_test_8.sh.
8643 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8644 script_test_8.stdout.
8645 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8646 (script_test_6, script_test_6.stdout, script_test_7,
8647 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8648 * Makefile.in: Regenerate.
8649 * testsuite/script_test_6.sh: New file.
8650 * testsuite/script_test_6.t: Same.
8651 * testsuite/script_test_7.sh: Same.
8652 * testsuite/script_test_7.t: Same.
8653 * testsuite/script_test_8.sh: Same.
8654
8655 2009-10-16 Doug Kwan <dougkwan@google.com>
8656
8657 * output.cc (Output_segment::set_section_list_address): Cast
8658 expressions to unsigned long long type to avoid format warnings.
8659
8660 2009-10-15 Ian Lance Taylor <iant@google.com>
8661
8662 * script.cc (Script_options::add_symbol_assignment): Always add a
8663 dot assignment to script_sections_.
8664 * script-sections.cc (Script_sections::add_dot_assignment):
8665 Initialize if necessary.
8666
8667 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8668 program headers with no load segment if there is a linker script.
8669
8670 * layout.cc (Layout::set_segment_offsets): Align the file offset
8671 to the segment aligment for -N or -n with no load segment.
8672 * output.cc (Output_segment::add_output_section): Don't crash if
8673 the first section is a TLS section.
8674 (Output_segment::set_section_list_addresses): Print an error
8675 message if the address moves backward in a linker script.
8676 * script-sections.cc
8677 (Output_section_element_input::set_section_addresses): Don't
8678 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8679 (Orphan_output_section::set_section_addresses): Likewise.
8680
8681 2009-10-15 Doug Kwan <dougkwan@google.com>
8682
8683 * layout.cc (Layout::finish_dynamic_section): Generate tags
8684 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8685 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8686 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8687
8688 2009-10-14 Ian Lance Taylor <iant@google.com>
8689
8690 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8691 fields.
8692 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8693 data_shdr fields of relinfo.
8694 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8695 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8696 R_386_TLS_LDO_32, adjust based on section flags.
8697 (Target_i386::Relocate::fix_up_ldo): Remove.
8698
8699 2009-10-13 Ian Lance Taylor <iant@google.com>
8700
8701 Add support for -pie.
8702 * options.h (class General_options): Add -pie and
8703 --pic-executable.
8704 (General_options::output_is_position_independent): Test -pie.
8705 (General_options::output_is_executable): Return true if not shared
8706 and not relocatable.
8707 (General_options::output_is_pie): Remove.
8708 * options.cc (General_options::finalize): Reject incompatible uses
8709 of -pie.
8710 * gold.cc (queue_middle_tasks): A -pie link is not static.
8711 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8712 * symtab.cc (Symbol::final_value_is_known): Return false if
8713 output_is_position_independent.
8714 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8715 output_is_position_independent.
8716 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8717 output_is_position_independent.
8718 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8719 output_is_position_independent.
8720 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8721 two_file_pie_test.
8722 (basic_pie_test.o, basic_pie_test): New targets.
8723 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8724 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8725 (two_file_pie_test): New target.
8726 * testsuite/Makefile.in: Rebuild.
8727 * README: Remove note saying that -pie is not supported.
8728
8729 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8730
8731 * options.h (class General_options): Add -init and -fini.
8732 * layout.cc (Layout::finish_dynamic_section): Emit
8733 given init and fini functions.
8734
8735 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8736
8737 * gc.h (gc_process_relocs): Check if icf is enabled using new
8738 function.
8739 * gold.cc (queue_initial_tasks): Likewise.
8740 (queue_middle_tasks): Likewise.
8741 * object.cc (do_layout): Likewise.
8742 * symtab.cc (is_section_folded): Likewise.
8743 * main.cc (main): Likewise.
8744 * reloc.cc (Read_relocs::run): Likewise.
8745 (Sized_relobj::do_scan_relocs): Likewise.
8746 * icf.cc (is_function_ctor_or_dtor): New function.
8747 (Icf::find_identical_sections): Check if function is ctor or dtor when
8748 safe icf is chosen.
8749 * options.h (General_options::icf): Change option to be an enum.
8750 (Icf_status): New enum.
8751 (icf_enabled): New method.
8752 (icf_safe_folding): New method.
8753 (set_icf_status): New method.
8754 (icf_status_): New variable.
8755 * (options.cc) (General_options::finalize): Set icf_status_.
8756 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8757 icf_test and icf_keep_unique_test to use the --icf enum flag.
8758 * testsuite/icf_safe_test.sh: New file.
8759 * testsuite/icf_safe_test.cc: New file.
8760
8761 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8762
8763 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8764 includes to gc.h and icf.h.
8765 * arm.cc: Include gc.h.
8766 * gold.cc: Likewise.
8767 * i386.cc: Likewise.
8768 * powerpc.cc: Likewise.
8769 * sparc.cc: Likewise.
8770 * x86_64.cc: Likewise.
8771 * gc.h: Include icf.h.
8772
8773 2009-10-11 Ian Lance Taylor <iant@google.com>
8774
8775 * plugin.cc: Include "gold.h" before other header files.
8776
8777 2009-10-10 Chris Demetriou <cgd@google.com>
8778
8779 * options.h (Input_file_argument::Input_file_type): New enum.
8780 (Input_file_argument::is_lib_): Replace with...
8781 (Input_file_argument::type_): New member.
8782 (Input_file_argument::Input_file_argument): Take Input_file_type
8783 'type' rather than boolean 'is_lib' as second argument.
8784 (Input_file_argument::is_lib): Use type_.
8785 (Input_file_argument::is_searched_file): New function.
8786 (Input_file_argument::may_need_search): Handle is_searched_file.
8787 * options.cc (General_options::parse_library): Support -l:filename.
8788 (General_options::parse_just_symbols): Update for Input_file_argument
8789 changes.
8790 (Command_line::process): Likewise.
8791 * archive.cc (Archive::get_file_and_offset): Likewise.
8792 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8793 * script.cc (read_script_file, script_add_file): Likewise.
8794 * fileread.cc (Input_file::Input_file): Likewise.
8795 (Input_file::will_search_for): Handle is_searched_file.
8796 (Input_file::open): Likewise.
8797 * readsyms.cc (Read_symbols::get_name): Likewise.
8798 * testsuite/Makefile.am (searched_file_test): New test.
8799 * testsuite/Makefile.in: Regenerate.
8800 * testsuite/searched_file_test.cc: New file.
8801 * testsuite/searched_file_test_lib.cc: New file.
8802
8803 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8804 Ian Lance Taylor <iant@google.com>
8805
8806 * descriptor.cc: Include <cstdio> and "binary-io.h".
8807 (Descriptors::open): Open the files in binary mode always.
8808 * script.cc (Lex::get_token): Treat \r as whitespace.
8809
8810 2009-10-09 Ian Lance Taylor <iant@google.com>
8811
8812 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8813
8814 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8815 Ian Lance Taylor <iant@google.com>
8816
8817 * configure.ac: Check for readv function also.
8818 * fileread.cc (readv): Define if not HAVE_READV.
8819 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8820 does not exist.
8821 * config.in: Regenerate.
8822 * configure: Regenerate.
8823
8824 2009-10-09 Doug Kwan <dougkwan@google.com>
8825
8826 * layout.cc (Layout::make_output_section): Call target hook to make
8827 ordinary output section.
8828 (Layout::finalize): Adjust parameter list of call the
8829 Target::may_relax().
8830 * layout.h (class Layout::section_list): New method.
8831 * merge.h (Output_merge_base::entsize): Change visibility to public.
8832 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8833 New methods.
8834 (Output_merge_string::do_is_string): New method.
8835 * object.cc (Sized_relobj::do_setup): renamed from
8836 Sized_relobj::set_up.
8837 * object.h (Sized_relobj::adjust_shndx,
8838 Sized_relobj::initializ_input_to_output_maps,
8839 Sized_relobj::free_input_to_output_maps): Change visibilities to
8840 protected.
8841 (Sized_relobj::setup): Virtualize.
8842 (Sized_relobj::do_setup): New method declaration.
8843 (Sized_relobj::invalidate_section_offset,
8844 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8845 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8846 * options.cc (parse_int): New function.
8847 * options.h (parse_int): New declaration.
8848 (DEFINE_int): New macro.
8849 (stub_group_size): New option.
8850 * output.cc (Output_section::Output_section): Initialize memebers
8851 merge_section_map_, merge_section_by_properties_map_,
8852 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8853 (Output_section::add_input_section): Handled deferred code-fill
8854 generation and remove an old comment.
8855 (Output_section::add_relaxed_input_section): New method definition.
8856 (Output_section::add_merge_input_section): Use merge section by
8857 properties map to speed to search. Update merge section maps
8858 as appropriate.
8859 (Output_section::build_relaxation_map): New method definition.
8860 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8861 Same.
8862 (Output_section::relax_input_section): Renamed to
8863 Output_section::convert_input_sections_to_relaxed_sections and change
8864 interface to take a vector of pointers to relaxed sections.
8865 (Output_section::find_merge_section,
8866 Output_section::find_relaxed_input_section): New method definitions.
8867 (Output_section::is_input_address_mapped,
8868 Output_section::output_offset, Output_section::output_address):
8869 Use output section data maps to speed up searching.
8870 (Output_section::find_starting_output_address): Add comments.
8871 (Output_section::do_write,
8872 Output_section::write_to_postprocessing_buffer): Do code-fill
8873 generation as appropriate.
8874 (Output_section::get_input_sections): Invalidate relaxed input section
8875 map.
8876 (Output_section::restore_states): Adjust type of checkpoint .
8877 Invalidate relaxed input section map.
8878 * output.h (Output_merge_base): New class declaration.
8879 (Input_section_specifier): New class defintion.
8880 (class Output_relaxed_input_section) Change base class to
8881 Output_section_data_build.
8882 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8883 base class initializer.
8884 (Output_section::add_relaxed_input_section): New method declaration.
8885 (Output_section::Input_section): Change visibility to protected.
8886 (Output_section::Input_section::relobj,
8887 Output_section::Input_section::shndx): Handle relaxed input sections.
8888 Output_section::input_sections) Change visibility to protected. Also
8889 define overload to return a non-const pointer.
8890 (Output_section::Merge_section_properties): New class defintion.
8891 (Output_section::Merge_section_by_properties_map,
8892 Output_section::Output_section_data_by_input_section_map,
8893 Output_section::Relaxation_map): New types.
8894 (Output_section::relax_input_section): Rename method to
8895 Output_section::convert_input_sections_to_relaxed_sections and change
8896 interface to take a vector of relaxed section pointers.
8897 (Output_section::find_merge_section,
8898 Output_section::find_relaxed_input_section,
8899 Output_section::build_relaxation_map,
8900 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8901 New method declarations.
8902 (Output_section::merge_section_map_
8903 Output_section::merge_section_by_properties_map_,
8904 Output_section::relaxed_input_section_map_,
8905 Output_section::is_relaxed_input_section_map_valid_,
8906 Output_section::generate_code_fills_at_write_): New data members.
8907 * script-sections.cc
8908 (Output_section_element_input::set_section_addresses): Call
8909 current_data_size and addralign methods of relaxed input sections.
8910 (Orphan_output_section::set_section_addresses): Call current_data_size
8911 and addralign methods of relaxed input sections.
8912 * symtab.cc (Symbol_table::compute_final_value): Extract template
8913 from the body of Symbol_table::sized_finalize_symbol.
8914 (Symbol_table::sized_finalized_symbol): Call
8915 Symbol_table::compute_final_value.
8916 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8917 (Symbol_table::compute_final_value): New templated method declaration.
8918 * target.cc (Target::do_make_output_section): New method defintion.
8919 * target.h (Target::make_output_section): New method declaration.
8920 (Target::relax): Add more parameters for input objects, symbol table
8921 and layout. Adjust call to do_relax.
8922 (Target::do_make_output_section): New method declaration.
8923 (Target::do_relax): Add parameters for input objects, symbol table
8924 and layout.
8925
8926 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8927
8928 * pread.c: Include stdio.h.
8929
8930 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8931
8932 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8933 defined.
8934
8935 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8936
8937 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8938 Change read_shndx type to unsigned int.
8939 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8940 int.
8941 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8942 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8943 Change read_shndx type to unsigned int.
8944 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8945 int.
8946 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8947 * layout.cc (Layout::create_symtab_sections): Cast the result of
8948 local_symcount * symsize to off_t in the gold_assert.
8949
8950 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8951
8952 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8953 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8954 R_ARM_BASE_ABS.
8955 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8956 (Arm_relocate_functions::thm_abs5): New function.
8957 (Arm_relocate_functions::abs12): New function.
8958 (Arm_relocate_functions::abs16): New function.
8959 (Arm_relocate_functions::base_abs): New function.
8960 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8961 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8962 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8963 R_ARM_BASE_ABS.
8964 (Scan::global): Likewise.
8965 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8966 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8967 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8968 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8969 R_ARM_BASE_ABS.
8970
8971 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8972
8973 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8974 (Arm_relocate_functions::movt_prel): New function.
8975 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8976 (Arm_relocate_functions::thm_movt_prel): New function.
8977 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8978 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8979 (Scan::global, Relocate::relocate): Likewise.
8980 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8981
8982 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8983
8984 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8985 Incremental_checker.
8986 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8987 unsigned int.
8988 (class Incremental_inputs_header): New class.
8989 (Incremental_inputs_header_writer): Edit comment.
8990 (Incremental_inputs_entry): New class.
8991 (Incremental_inputs_entry_writer): Edit comment.
8992 (Sized_incremental_binary::do_find_incremental_inputs_section):
8993 Add *strtab_shndx parameter, fill it.
8994 (Sized_incremental_binary::do_check_inputs): New method.
8995 (Incremental_checker::can_incrementally_link_output_file): Use
8996 Sized_incremental_binary::check_inputs.
8997 (Incremental_inputs::report_command_line): Save command line in
8998 command_line_.
8999 * incremental.h:
9000 (Incremental_binary::find_incremental_inputs_section): New
9001 method.
9002 (Incremental_binary::do_find_incremental_inputs_section): Add
9003 strtab_shndx parameter.
9004 (Incremental_binary::do_check_inputs): New pure virtual method.
9005 (Sized_incremental_binary::do_check_inputs): Declare.
9006 (Incremental_checker::Incremental_checker): Add incremental_inputs
9007 parameter, use it to initialize incremental_inputs_.
9008 (Incremental_checker::incremental_inputs_): New field.
9009 (Incremental_checker::command_line): New method.
9010 (Incremental_checker::inputs): New method.
9011 (Incremental_checker::command_line_): New field.
9012
9013 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9014
9015 * incremental.cc: Include <cstdarg> and "target-select.h".
9016 (vexplain_no_incremental): New function.
9017 (explain_no_incremental): New function.
9018 (Incremental_binary::error): New method.
9019 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9020 method.
9021 (make_sized_incremental_binary): New function.
9022 (open_incremental_binary): New function.
9023 (can_incrementally_link_file): Add checks if output is ELF and has
9024 inputs section.
9025 * incremental.h: Include "elfcpp_file.h" and "output.h".
9026 (Incremental_binary): New class.
9027 (Sized_incremental_binary): New class.
9028 (open_incremental_binary): Declare.
9029 * object.cc (is_elf_object): Use
9030 elfcpp::Elf_recognizer::is_elf_file.
9031 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9032 * output.h (Output_file::filesize): New method.
9033
9034 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9035
9036 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9037 New function.
9038 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9039 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9040 function.
9041 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9042 function.
9043 (Arm_relocate_functions::movw_abs_nc): New function.
9044 (Arm_relocate_functions::movt_abs): New function.
9045 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9046 (Arm_relocate_functions::thm_movt_abs): New function.
9047 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9048 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9049 (Scan::global): Likewise.
9050 (Relocate::relocate): Likewise.
9051 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9052
9053 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9054
9055 * arm.cc (Arm_relocate_functions::got_prel) New function.
9056 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9057 (Relocate::relocate): Likewise.
9058 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9059
9060 2009-10-06 Ian Lance Taylor <iant@google.com>
9061
9062 * options.h (class General_options): Define
9063 split_stack_adjust_size parameter.
9064 * object.h (class Object): Add uses_split_stack_ and
9065 has_no_split_stack_ fields. Add uses_split_stack and
9066 has_no_split_stack accessor functions. Declare
9067 handle_split_stack_section.
9068 (class Reloc_symbol_changes): Define.
9069 (class Sized_relobj): Define Function_offsets. Declare
9070 split_stack_adjust, split_stack_adjust_reltype, and
9071 find_functions.
9072 * object.cc (Object::handle_split_stack_section): New function.
9073 (Sized_relobj::do_layout): Call handle_split_stack_section.
9074 * dynobj.cc (Sized_dynobj::do_layout): Call
9075 handle_split_stack_section.
9076 * reloc.cc (Sized_relobj::relocate_sections): Call
9077 split_stack_adjust for executable sections in split_stack
9078 objects. Pass reloc_map to relocate_section.
9079 (Sized_relobj::split_stack_adjust): New function.
9080 (Sized_relobj::split_stack_adjust_reltype): New function.
9081 (Sized_relobj::find_functions): New function.
9082 * target-reloc.h: Include "object.h".
9083 (relocate_section): Add reloc_symbol_changes parameter. Change
9084 all callers.
9085 * target.h (class Target): Add calls_non_split method. Declare
9086 do_calls_non_split virtual method. Declare match_view and
9087 set_view_to_nop.
9088 * target.cc: Include "elfcpp.h".
9089 (Target::do_calls_non_split): New function.
9090 (Target::match_view): New function.
9091 (Target::set_view_to_nop): New function.
9092 * gold.cc (queue_middle_tasks): Give an error if mixing
9093 split-stack and non-split-stack objects with -r.
9094 * i386.cc (Target_i386::relocate_section): Add
9095 reloc_symbol_changes parameter.
9096 (Target_i386::do_calls_non_split): New function.
9097 * x86_64.cc (Target_x86_64::relocate_section): Add
9098 reloc_symbol_changes parameter.
9099 (Target_x86_64::do_calls_non_split): New function.
9100 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9101 parameter.
9102 * powerpc.cc (Target_powerpc::relocate_section): Add
9103 reloc_symbol_changes parameter.
9104 * sparc.cc (Target_sparc::relocate_section): Add
9105 reloc_symbol_changes parameter.
9106 * configure.ac: Call AM_CONDITIONAL for the default target.
9107 * configure: Rebuild.
9108 * testsuite/Makefile.am (TEST_AS): New variable.
9109 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9110 (check_DATA): Add split_i386 and split_x86_64 files.
9111 (SPLIT_DEFSYMS): Define.
9112 (split_i386_[1234n].o): New targets.
9113 (split_i386_[124]): New targets.
9114 (split_i386_[1234r].stdout): New targets.
9115 (split_x86_64_[1234n].o): New targets.
9116 (split_x86_64_[124]): New targets.
9117 (split_x86_64_[1234r].stdout): New targets.
9118 (MOSTLYCLEANFILES): Add new executables.
9119 * testsuite/split_i386.sh: New file.
9120 * testsuite/split_x86_64.sh: New file.
9121 * testsuite/split_i386_1.s: New file.
9122 * testsuite/split_i386_2.s: New file.
9123 * testsuite/split_i386_3.s: New file.
9124 * testsuite/split_i386_4.s: New file.
9125 * testsuite/split_i386_n.s: New file.
9126 * testsuite/split_x86_64_1.s: New file.
9127 * testsuite/split_x86_64_2.s: New file.
9128 * testsuite/split_x86_64_3.s: New file.
9129 * testsuite/split_x86_64_4.s: New file.
9130 * testsuite/split_x86_64_n.s: New file.
9131 * testsuite/testfile.cc (Target_test): Update relocation_section
9132 function.
9133 * testsuite/Makefile.in: Rebuild.
9134
9135 2009-10-06 Ian Lance Taylor <iant@google.com>
9136
9137 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9138 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9139 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9140 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9141 the address on ldo_addrs_.
9142 (Target_i386::Relocate::fix_up_ldo): New function.
9143
9144 2009-10-06 Rafael Espindola <espindola@google.com>
9145
9146 * plugin.cc (add_input_library): New.
9147 (Plugin::load): Add add_input_library to tv.
9148 (Plugin_manager::add_input_file): Add the is_lib argument.
9149 (add_input_file): Update call to Plugin_manager::add_input_file.
9150 (add_input_library): New.
9151 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9152
9153 2009-09-30 Doug Kwan <dougkwan@google.com>
9154
9155 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9156 symbol and call Symbol::may_need_copy_reloc to determine if
9157 a copy reloc is needed.
9158 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9159 nocopyreloc is given in command line.
9160 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9161 given in command line.
9162 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9163 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9164 of the removed Target_i386::may_need_copy_reloc.
9165 * options.h (copyreloc): New option with default value false.
9166 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9167 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9168 instead of the removed Target_powerpc::may_need_copy_reloc.
9169 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9170 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9171 instead of the removed Target_sparc::may_need_copy_reloc.
9172 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9173 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9174 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9175 instead of the removed Target_x86_64::may_need_copy_reloc.
9176
9177 2009-09-30 Ian Lance Taylor <iant@google.com>
9178
9179 * object.h (class Object): Remove target_ field, and target,
9180 sized_target, and set_target methods.
9181 (Object::sized_target): Remove.
9182 (class Sized_relobj): Update declarations. Remove sized_target.
9183 * object.cc (Sized_relobj::setup): Remove target parameter.
9184 Change all callers.
9185 (Input_objects::add_object): Don't do anything with the target.
9186 (make_elf_sized_object): Add punconfigured parameter. Change all
9187 callers. Set or test parameter target.
9188 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9189 Change all callers.
9190 * parameters.cc (Parameters::set_target): Change parameter type to
9191 be non-const.
9192 (Parameters::default_target): Remove.
9193 (set_parameters_target): Change parameter type to be non-const.
9194 (parameters_force_valid_target): New function.
9195 (parameters_clear_target): New function.
9196 * parameters.h (class Parameters): Update declarations. Remove
9197 default_target method. Add sized_target and clear_target
9198 methods. Change target_ to be non-const.
9199 (set_parameters_target): Update declaration.
9200 (parameters_force_valid_target): Declare.
9201 (parameters_clear_target): Declare.
9202 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9203 as NULL if we aren't searching.
9204 (Add_symbols::run): Don't check for compatible target.
9205 * fileread.cc (Input_file::open_binary): Call
9206 parameters_force_valid_target.
9207 * gold.cc (queue_middle_tasks): Likewise.
9208 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9209 set_target on object.
9210 * dynobj.h (class Sized_dynobj): Update declarations.
9211 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9212 make_elf_object returns NULL.
9213 (Archive::include_member): Don't check whether object target is
9214 compatible.
9215 * output.cc (Output_section::add_input_section): Get target from
9216 parameters.
9217 (Output_section::relax_input_section): Likewise.
9218 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9219 parameters.
9220 (Sized_relobj::do_scan_relocs): Likewise.
9221 (Sized_relobj::relocate_sections): Likewise.
9222 * resolve.cc (Symbol_table::resolve): Likewise.
9223 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9224 parameter. Change all callers.
9225 (Symbol_table::add_from_object): Get target from parameters.
9226 (Symbol_table::add_from_relobj): Don't check object target.
9227 (Symbol_table::add_from_dynobj): Likewise.
9228 (Symbol_table::define_special_symbol): Get target from
9229 parameters.
9230 * symtab.h (class Symbol_table): Update declaration.
9231 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9232 parameter. Change all callers. Clear parameter target.
9233 (Binary_test): Test target here.
9234 * testsuite/object_unittest.cc (gold_testsuite): Remove
9235 target_test_pointer parameter. Change all callers.
9236 (Object_test): Test target here.
9237
9238 2009-09-26 Ian Lance Taylor <iant@google.com>
9239
9240 * testsuite/initpri1.c: Don't try to use constructor priorities if
9241 compiling with gcc before 4.3.
9242
9243 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9244
9245 * testsuite/retain_symbols_file_test.sh (check_present): Change
9246 output file name to retain_symbols_file_test.stdout.
9247 (check_absent): Likewise.
9248
9249 2009-09-18 Craig Silverstein <csilvers@google.com>
9250
9251 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9252 * options.cc: Include <cerrno> and <fstream>.
9253 (General_options::finalize): Parse -retain-symbols-file tag.
9254 * options.h: New flag.
9255 (General_options): New method should_retain_symbol, new
9256 variable symbols_to_retain.
9257 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9258 should_retain_symbol map.
9259 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9260 * testsuite/Makefile.in: Regenerate.
9261 * testsuite/retain_symbols_file_test.sh: New file.
9262
9263 2009-09-18 Nick Clifton <nickc@redhat.com>
9264
9265 * po/es.po: Updated Spanish translation.
9266
9267 2009-09-17 Doug Kwan <dougkwan@google.com>
9268
9269 * debug.h (DEBUG_RELAXATION): New constant.
9270 (DEBUG_ALL): Add DEBUG_RELAXATION.
9271 (debug_string_to_enum): Add relaxation debug option.
9272 * layout.cc
9273 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9274 Layout::Relaxation_debug_check::read_sections,
9275 Layout::Relaxation_debug_check::read_sections): New method definitions.
9276 (Layout::Layout): Initialize data members
9277 record_output_section_data_from_scrips_,
9278 script_output_section_data_list_ and relaxation_debug_check_.
9279 (Layout::save_segments, Layout::restore_segments,
9280 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9281 Layout::relaxation_loop_body): New method definitions.
9282 (Layout::finalize): Support relaxation. Move section layout code to
9283 Layout::relaxation_loop_body.
9284 (Layout::set_asection_address_from_script): Move code for orphan
9285 section placement out.
9286 (Layout::place_orphan_sections_in_script): New method definition.
9287 * layout.h (Output_segment_headers, Output_file_header):
9288 New forward class declarations.
9289 (Layout::~Layout): Define.
9290 (Layout::new_output_section_data_from_script): New method definition.
9291 (Layout::place_orphan_sections_in_script): New method declaration.
9292 (Layout::Segment_states): New type declaration.
9293 (Layout::save_segments, Layout::restore_segments,
9294 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9295 Layout::relaxation_loop_body): New method declarations.
9296 (Layout::Output_section_data_list): New type declaration.
9297 (Layout::Relaxation_debug_check): New class definition.
9298 (Layout::record_output_section_data_from_script_,
9299 Layout::script_output_section_data_list_, Layout::segment_states_,
9300 Layout::relaxation_debug_check_): New data members.
9301 * output.cc: (Output_section_headers::do_size): New method definition.
9302 (Output_section_headers::Output_section_headers): Move size
9303 computation to Output_section_headers::do_size.
9304 (Output_segment_headers::do_size): New method definition.
9305 (Output_file_header::Output_file_header): Move size computation to
9306 Output_file_header::do_size and call it.
9307 (Output_file_header::do_size): New method definition.
9308 (Output_data_group::Output_data_group): Adjust call to
9309 Output_section_data.
9310 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9311 (Output_symtab_xindex::do_write): Add array bound check.
9312 (Output_section::Input_section::print_to_mapfile): Handle
9313 RELAXED_INPUT_SECTION_CODE.
9314 (Output_section::Output_section): Initialize data member checkpoint_.
9315 (Output_section::~Output_section): Delete checkpoint object pointed
9316 by checkpoint_.
9317 (Output_section::add_input_section): Always add an Input_section if
9318 relaxing.
9319 (Output_section::add_merge_input_section): Add assert.
9320 (Output_section::relax_input_section): New method definition.
9321 (Output_section::set_final_data_size): Set load address to zero for
9322 an unallocated section.
9323 (Output_section::do_address_and_file_offset_have_reset_values):
9324 New method definition.
9325 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9326 Handle relaxed input section.
9327 (Output_section::sort_attached_input_sections): Checkpoint input
9328 section list lazily.
9329 (Output_section::get_input_sections): Change type of input_sections to
9330 list of Simple_input_section pointers. Checkpoint input section list
9331 lazily. Also handle relaxed input sections.
9332 (Output_section::add_input_section_for_script): Take a reference to
9333 a Simple_input_section object instead of Relobj pointer and section
9334 index as parameter. Handle relaxed input sections.
9335 (Output_section::save_states, Output_section::restore_states): New
9336 method definitions.
9337 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9338 (Output_data::is_data_size_fixed): New method definition.
9339 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9340 if it is fixed.
9341 (Output_data::address_and_file_offset_have_reset_values): New method
9342 definition.
9343 (Output_data::do_address_and_file_offset_have_reset_values): New method
9344 definition.
9345 (Output_data::set_data_size): Check that data size is not fixed.
9346 (Output_data::fix_data_size): New method definition.
9347 (Output_data::is_data_size_fixed_): New data member.
9348 (Output_section_headers::set_final_data_size): New method definition.
9349 (Output_section_headers::do_size): New method declaration.
9350 (Output_segment_headers::set_final_data_size): New method definition.
9351 (Output_segment_headers::do_size): New method declaration.
9352 (Output_file_header::set_final_data_size)::New method definition.
9353 (Output_file_header::do_size)::New method declaration.
9354 (Output_section_data::Output_section_data): Add new parameter
9355 is_data_size_fixed and use it to fix data size.
9356 (Output_data_const::Output_data_const): Adjust call to base class
9357 constructor and fix data size.
9358 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9359 base class constructor and fix data size.
9360 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9361 base class constructor and fix data size.
9362 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9363 class constructor and fix data size.
9364 (Output_data_group::set_final_data_size): New method definition.
9365 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9366 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9367 class constructor and fix data size.
9368 (Output_relaxed_input_section): New class definition.
9369 (Output_section::Simple_input_section): New class definition.
9370 (Output_section::get_input_sections): Adjust parameter list.
9371 (Output_section::add_input_section_for_script): Same.
9372 (Output_section::save_states, Output_section::restore_states,
9373 Output_section::do_address_and_file_offset_have_reset_values,
9374 (Output_section::Input_section::Input_section): Handle
9375 RELAXED_INPUT_SECTION_CODE. Add new overload for
9376 Output_relaxed_input_section.
9377 (Output_section::Input_section::is_input_section,
9378 Output_section::Input_section::set_output_section): Handle relaxed
9379 input section.
9380 (Output_section::Input_section::is_relaxed_input_section,
9381 Output_section::Input_section::output_section_data,
9382 Output_section::Input_section::relaxed_input_section): New method
9383 definitions.
9384 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9385 value.
9386 (Output_section::Input_section::u1_): Update comments.
9387 (Output_section::Input_section::u2_): Add new union member poris.
9388 (Output_section::Checkpoint_output_section): New classs definition.
9389 (Output_section::relax_input_section): New method declaration.
9390 (Output_section::checkpoint_): New data member.
9391 (Output_segment): Update comments.
9392 (Output_segment::Output_segment): Un-privatize copy constructor.
9393 (Output_segment::operator=): Un-privatize.
9394 * script-sections.cc (Output_section_element::Input_section_list):
9395 Change element type to Output_section::Simple_input_section.
9396 (Output_section_element_dot_assignment::set_section_addresses):
9397 Register output section data for relaxation clean up.
9398 (Output_data_exression::Output_data_expression): Adjust call to base
9399 constructor to fix data size.
9400 (Output_section_element_data::set_section_addresses): Register
9401 Output_data_expression object for relaxation clean up.
9402 (struct Input_section_info): Replace Relobj pointer and section index
9403 pair with Output_section::Simple_input_section and Convert struct to a
9404 class.
9405 (Input_section_sorter::operator()): Adjust access to
9406 Input_section_info data member to use accessors.
9407 (Output_section_element_input::set_section_addresses): Use layout
9408 parameter. Adjust code to use Output_section::Simple_input_section
9409 and Input_secction_info classes. Register filler for relaxation
9410 clean up.
9411 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9412 and section index pair with Output_section::Simple_input_section
9413 class. Adjust code accordingly.
9414 (Phdrs_element::release_segment): New method definition.
9415 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9416 segment list.
9417 (Script_sections::release_segments): New method definition.
9418 * gold/script-sections.h (Script_sections::release_segments): New
9419 method declaration.
9420 * gold/target.h (Target::may_relax, Target::relax,
9421 Target::do_may_relax, Target::do_relax): New method definitions.
9422
9423 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9424
9425 * arm.cc (has_signed_unsigned_overflow): New function.
9426 (Arm_relocate_functions::abs8): New function.
9427 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9428 (Target_arm::Scan::global): Likewise.
9429 (Target_arm::relocate::relocate): Likewise.
9430 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9431 Likewise.
9432
9433 2009-09-16 Cary Coutant <ccoutant@google.com>
9434
9435 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9436 * testsuite/Makefile.in: Regenerate.
9437
9438 2009-09-11 Nick Clifton <nickc@redhat.com>
9439
9440 * po/gold.pot: Updated by the Translation project.
9441
9442 2009-09-08 Cary Coutant <ccoutant@google.com>
9443
9444 * output.cc (Output_file::open): Add execute permission to empty file.
9445 * testsuite/Makefile.am (permission_test): New test.
9446 * testsuite/Makefile.in: Regenerate.
9447
9448 2009-09-02 Ian Lance Taylor <iant@google.com>
9449
9450 * output.cc (Output_file::resize): Call map_no_anonymous rather
9451 than map.
9452
9453 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9454
9455 * gold.cc: Include "incremental.h".
9456 (queue_initial_tasks): Call Incremental_checker methods.
9457 * incremental.cc: Include "output.h".
9458 (Incremental_checker::can_incrementally_link_output_file): New
9459 method.
9460 * incremental.h (Incremental_checker): New class.
9461
9462 * output.cc (Output_file::open_for_modification): New method.
9463 (Output_file::map_anonymous): Changed return type to bool. Record
9464 map in base_ field.
9465 (Output_file::map_no_anonymous): New method, broken out of map.
9466 (Output_file::map): Use map_no_anonymous and map_anonymous.
9467 * output.h (class Output_file): Update declarations.
9468
9469 2009-08-24 Cary Coutant <ccoutant@google.com>
9470
9471 * options.h (Command_line::Pre_options): New class.
9472 (Command_line::pre_options): New member.
9473 * options.cc (gold::options::ready_to_register): New variable.
9474 (One_option::register_option): Do nothing if not registering options.
9475 Assert if same short option registered twice.
9476 (General_options::General_options): Turn off option registration when
9477 done constructing.
9478 (Command_line::Pre_options::Pre_options): New constructor.
9479
9480 2009-08-24 Cary Coutant <ccoutant@google.com>
9481
9482 * options.h (General_options::no_keep_memory): Remove incorrect
9483 short option.
9484
9485 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9486
9487 * Makefile.am (am__skiplex, am__skipyacc): New.
9488 * Makefile.in: Regenerate.
9489
9490 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9491
9492 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9493 (INCLUDES): ... this.
9494 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9495 (AM_CPPFLAGS): Renamed from ...
9496 (INCLUDE): ... this.
9497 * Makefile.in, testsuite/Makefile.in: Regenerate.
9498
9499 * Makefile.in: Regenerate.
9500 * aclocal.m4: Likewise.
9501 * config.in: Likewise.
9502 * configure: Likewise.
9503 * testsuite/Makefile.in: Likewise.
9504
9505 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9506 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9507 * Makefile.in: Regenerate.
9508 * testsuite/Makefile.in: Regenerate.
9509
9510 2009-08-19 Cary Coutant <ccoutant@google.com>
9511
9512 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9513 symbols in shared libraries overridden by hidden or internal symbols
9514 in the main program.
9515
9516 2009-08-19 Chris Demetriou <cgd@google.com>
9517
9518 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9519 checking source file names in error messages.
9520
9521 2009-08-18 Doug Kwan <dougkwan@google.com>
9522
9523 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9524 an elcpp::Ehdr as parameter. Adjust call to set_target.
9525 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9526 an elfcpp::Ehdr as parameter.
9527 * object.cc (Object::set_target): Remove the version that looks up
9528 a target and sets it.
9529 (Sized_relobj::setup): Take a Target object instead of
9530 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9531 (make_elf_sized_object): Find target and ask target to
9532 make an ELF object.
9533 * object.h: (Object::set_target): Remove the version that looks up
9534 a target and sets it.
9535 (Sized_relobj::setup): Take a Target object instead of
9536 an elfcpp:Ehdr as parameter.
9537 * target.cc: Include dynobj.h.
9538 (Target::do_make_elf_object_implementation): New.
9539 (Target::do_make_elf_object): New.
9540 * target.h (Target::make_elf_object): New template declaration.
9541 (Target::do_make_elf_object): New method declarations.
9542 (Target::do_make_elf_object_implementation): New template declaration.
9543
9544 2009-08-14 Ian Lance Taylor <iant@google.com>
9545
9546 * gold.h (FUNCTION_NAME): Define.
9547 (gold_unreachable): Use FUNCTION_NAME.
9548
9549 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9550
9551 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9552 symbol in the --keep-unique list is not found.
9553
9554 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9555
9556 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9557 been maked as --keep-unique.
9558 (Icf::unfold_section): New function.
9559 * icf.h (Icf::unfold_section): New function.
9560 * options.h (General_options::keep_unique): New option.
9561 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9562 * testsuite/Makefile.in: Regenerate.
9563 * testsuite/icf_keep_unique_test.sh: New file.
9564 * testsuite/icf_keep_unique_test.cc: New file.
9565
9566 2009-08-12 Cary Coutant <ccoutant@google.com>
9567
9568 PR 10471
9569 * resolve.cc (Symbol_table::resolve): Check for references from
9570 dynamic objects to hidden and internal symbols.
9571 * testsuite/Makefile.am (hidden_test.sh): New test.
9572 * testsuite/Makefile.in: Regenerate.
9573 * testsuite/hidden_test.sh: New script.
9574 * testsuite/hidden_test_1.c: New test source.
9575 * testsuite/hidden_test_main.c: New test source.
9576
9577 2009-08-11 Doug Kwan <dougkwan@google.com>
9578
9579 * arm.cc: Update comments.
9580 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9581 segment to locate the .ARM.exidx section if present.
9582
9583 2009-08-09 Doug Kwan <dougkwan@google.com>
9584
9585 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9586 patch.
9587
9588 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9589 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9590 compiler warnings.
9591
9592 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9593
9594 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9595 valid tls_segment only for non-debug-section relocations.
9596 * testsuite/Makefile.am: Add gc_tls_test.
9597 * testsuite/Makefile.in: Regenerate.
9598 * testsuite/gc_tls_test.cc: New file.
9599 * testsuite/gc_tls_test.sh: New file.
9600
9601 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9602
9603 * icf.cc: New file.
9604 * icf.h: New file.
9605 * Makefile.am (CCFILES): Add icf.cc.
9606 (HFILES): Add icf.h
9607 * Makefile.in: Regenerate.
9608 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9609 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9610 section, symbol and addend information for the relocs.
9611 * gold.cc (queue_middle_tasks): Call identical code folding.
9612 * gold.h: Add defines for multimap.
9613 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9614 to the call of finalize_local_symbols.
9615 * main.cc (main): Create object of class Icf.
9616 * object.cc (Sized_relobj::do_layout): Allow this function to be
9617 called twice during icf.
9618 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9619 to sections marked as identical by icf.
9620 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9621 when available.
9622 (Sized_relobj::do_section_entsize): New function.
9623 * object.h (Object::section_entsize): New function.
9624 (Object::do_section_entsize): New pure virtual function.
9625 (Relobj::finalize_local_symbols): Add new parameter.
9626 (Relobj::do_section_entsize): New function.
9627 * options.h (General_options::icf): New option.
9628 (General_options::icf_iterations): New option.
9629 (General_options::print_icf_sections): New option.
9630 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9631 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9632 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9633 icf.
9634 * symtab.cc (Symbol_table::is_section_folded): New function.
9635 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9636 to sections marked as identical by icf.
9637 * symtab.h (Symbol_table::set_icf): New function.
9638 (Symbol_table::icf): New function.
9639 (Symbol_table::is_section_folded): New function.
9640 (Symbol_table::icf_): New data member.
9641 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9642 * testsuite/Makefile.am: Add commands to build icf_test.
9643 * testsuite/Makefile.in: Regenerate.
9644 * testsuite/icf_test.sh: New file.
9645 * testsuite/icf_test.cc: New file.
9646
9647 2009-07-24 Chris Demetriou <cgd@google.com>
9648
9649 * layout.cc (is_compressible_debug_section): Fix incorrect
9650 comment about compressed section names.
9651
9652 2009-07-20 Ian Lance Taylor <ian@airs.com>
9653
9654 PR 10419
9655 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9656
9657 2009-07-16 Ian Lance Taylor <iant@google.com>
9658
9659 PR 10400
9660 * layout.h: #include <map>.
9661 (class Kept_section): Change from struct to class. Add accessors
9662 and setters. Add section size to Comdat_group mapping. Change
9663 Comdat_group to std::map. Add is_comdat_ field. Add
9664 linkonce_size field in union.
9665 (class Layout): Update declaration of find_or_add_kept_section.
9666 Don't declare find_kept_object.
9667 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9668 parameter. Add object, shndx, is_comdat, and is_group_name
9669 parameters. Change all callers. Adjust for new Kept_section.
9670 (Layout::find_kept_object): Remove.
9671 * object.cc (Sized_relobj::include_section_group): Update use of
9672 Kept_section. Rename secnum to shndx. Only record
9673 Kept_comdat_section if sections are the same size.
9674 (Sized_relobj::include_linkonce_section): Update use of
9675 Kept_section. Only record Kept_comdat_section if sections are the
9676 same size. Set size of linkonce section.
9677 (Sized_relobj::map_to_kept_section): Update call to
9678 get_kept_comdat_section.
9679 * object.h (class Sized_relobj): Rename fields in
9680 Kept_comdat_section to drop trailing underscores; change object
9681 field to Relobj*. Change Kept_comdat_section_table to store
9682 struct rather than pointer.
9683 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9684 Add kept_object and kept_shndx parameters. Change all callers.
9685 (Sized_relobj::get_kept_comdat_section): Change return type to
9686 bool. Add kept_object and kept_shndx parameters. Change all
9687 callers.
9688 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9689 Layout::find_or_add_kept_section.
9690
9691 2009-07-09 Ian Lance Taylor <iant@google.com>
9692
9693 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9694 Reserve space in the hash table.
9695
9696 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9697
9698 * fileread.cc (File_read::get_mtime): New method.
9699 * fileread.h (Timespec): New structure.
9700 (File_read::get_mtime): New method.
9701 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9702 Renamed from timestamp_nsec.
9703 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9704 Elf_Xword.
9705 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9706 timestamp_nsec.
9707 (Incremental_inputs::report_archive): Save mtime; style fix.
9708 (Incremental_inputs::report_obejct): Save mtime; style fix.
9709 (Incremental_inputs::report_script): Save mtime; style fix.
9710 (Incremental_inputs::finalize_inputs): Style fix.
9711 (Incremental_inputs::finalize): Style fix.
9712 (Incremental_inputs::create_input_section_data): Store inputs
9713 mtime.
9714 * incremental.h (Incremental_inputs::report_script): Add mtime
9715 argument.
9716 (Incremental_inputs::Input_info::Input_info): Intialize only one
9717 union member.
9718 (Incremental_inputs::Input_info::archive): Move to nameless
9719 union.
9720 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9721 (Incremental_inputs::Input_info::script): Move to nameless union.
9722 (Incremental_inputs::mtime): New field.
9723 * script.cc (read_input_script): Pass file mtime to
9724 Incremental_input.
9725 * script.h (Script_info::inputs): Style fix.
9726
9727 2009-07-01 Ian Lance Taylor <ian@airs.com>
9728
9729 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9730 instead of 32.
9731
9732 2009-06-24 Ian Lance Taylor <iant@google.com>
9733
9734 PR 10156
9735 * layout.cc (Layout::choose_output_section): If we find an
9736 existing section, update the flags.
9737 (Layout::create_notes): New function, broken out of
9738 Layout::finalize.
9739 (Layout::finalize): Don't create note sections.
9740 (Layout::create_note): Don't crash if linker script discards
9741 section.
9742 (Layout::create_gold_note): Likewise.
9743 (Layout::create_build_id): Likewise. Don't set
9744 after_input_sections on the section.
9745 (Layout::create_executable_stack_info): Remove target parameter.
9746 Change caller.
9747 * layout.h (class Layout): Declare create_notes. Update
9748 declaration of create_executable_stack_info.
9749 * gold.cc (queue_middle_tasks): Call create_notes.
9750 * output.cc (Output_section::update_flags_for_input_section): Move
9751 here from output.h. If SHF_ALLOC flag is newly set, mark address
9752 invalid.
9753 * output.h (Output_data::mark_address_invalid): New function.
9754 (class Output_section): Only declare, not define,
9755 update_flags_for_input_section. Remove set_flags.
9756
9757 2009-06-24 Ian Lance Taylor <iant@google.com>
9758
9759 * script-sections.cc (Output_section_definition::
9760 set_section_addresses): Rename shadowing local load_address to
9761 laddr.
9762
9763 2009-06-24 Ian Lance Taylor <iant@google.com>
9764
9765 PR 10244
9766 * reloc.cc (relocate_sections): Skip empty relocation sections.
9767
9768 2009-06-23 Ian Lance Taylor <iant@google.com>
9769
9770 PR 10156
9771 * layout.cc (Layout::create_note): Use choose_output_section
9772 rather than make_output_section.
9773
9774 2009-06-23 Ian Lance Taylor <iant@google.com>
9775
9776 PR 10237
9777 * options.cc (General_options::parse_V): Set printed_version_.
9778 (General_options::General_options): Initialize printed_version_.
9779 * options.h (class General_options): Add printed_version_ field.
9780 * gold.cc (queue_initial_tasks): If there are no input files,
9781 don't give a fatal error if we printed the version information.
9782 (queue_middle_tasks): If using -r with a shared object, give a
9783 fatal error rather than an ordinary error.
9784
9785 2009-06-23 Ian Lance Taylor <iant@google.com>
9786
9787 PR 10219
9788 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9789 (Layout::make_output_section): Set have_stabstr_section_ if we see
9790 a .stab*str section.
9791 (Layout::finalize): Call link_stabs_sections.
9792 (Layout::link_stabs_sections): New file.
9793 * layout.h (class Layout): Add have_stabstr_section_ field.
9794 Declare link_stabs_sections.
9795
9796 2009-06-23 Doug Kwan <dougkwan@google.com>
9797
9798 * Makefile.am (libgold_a_LIBADD): New.
9799 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9800 * Makefile.in: Regenerate.
9801 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9802 * configure: Regenerate.
9803 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9804 * fileread.cc: Include sys/state.h
9805 * gold.h: Declare memmem and strndup if found missing.
9806 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9807
9808 2009-06-23 Ian Lance Taylor <iant@google.com>
9809
9810 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9811 * configure: Rebuild.
9812
9813 2009-06-23 Ian Lance Taylor <iant@google.com>
9814
9815 PR 10147
9816 * object.cc (Object::section_contents): Don't try to get a view if
9817 the section has length zero.
9818 (Object::handle_gnu_warning_section): If the section is empty, use
9819 the name of the section as the warning.
9820
9821 2009-06-23 Ian Lance Taylor <iant@google.com>
9822
9823 PR 10133
9824 * stringpool.h (class Stringpool_template): Add optimize_ field.
9825 (Stringpool_template::set_optimize): New function.
9826 * stringpool.cc (Stringpool_template::Stringpool_template):
9827 Initialize optimize_ field.
9828 (Stringpool_template::set_string_offsets): Test local optimize
9829 fild rather than parameter.
9830 * layout.cc (Layout::Layout): Call set_optimize on the section
9831 name stringpool.
9832
9833 2009-06-22 Ian Lance Taylor <iant@google.com>
9834
9835 PR 10030
9836 * yyscript.y: Parse TARGET.
9837 * script.cc (script_set_target): New function.
9838 * script-c.h (script_set_target): Declare.
9839 * options.cc (General_options::string_to_object_format): Rename
9840 from string_to_object_format in anonymous namespace. Change
9841 callers.
9842 * options.h (class General_options): Declare
9843 string_to_object_format.
9844
9845 2009-06-22 Ian Lance Taylor <iant@google.com>
9846
9847 * script-sections.cc (Script_sections::create_segments): Don't put
9848 program headers in a PT_LOAD segment if -n or -N.
9849
9850 2009-06-22 Ian Lance Taylor <iant@google.com>
9851
9852 PR 10141
9853 * options.h (class General_options): Add -z lazy and -z now. Sort
9854 -z options into alphabetical order.
9855 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9856
9857 2009-06-21 Ian Lance Taylor <iant@google.com>
9858
9859 * layout.cc (Layout::make_output_section): Call
9860 Target::new_output_section.
9861 (Layout::attach_allocated_section_to_segment): Put large section
9862 sections in a separate load segment with the large segment flag
9863 set.
9864 (Layout::segment_precedes): Sort large data segments after other
9865 load segments.
9866 (align_file_offset): New static function.
9867 (Layout::set_segment_offsets): Use align_file_offset.
9868 * output.h (class Output_section): Add is_small_section_ and
9869 is_large_section_ fields.
9870 (Output_section::is_small_section): New function.
9871 (Output_section::set_is_small_section): New function.
9872 (Output_section::is_large_section): New function.
9873 (Output_section::set_is_large_section): New function.
9874 (Output_section::is_large_data_section): New function.
9875 (class Output_segment): Add is_large_data_segment_ field.
9876 (Output_segment::is_large_data_segment): New function.
9877 (Output_segment::set_is_large_data_segment): New function.
9878 * output.cc (Output_section::Output_section): Initialize new
9879 fields.
9880 (Output_segment::Output_segment): Likewise.
9881 (Output_segment::add_output_section): Add assertion that large
9882 data sections always go in large data segments. Force small data
9883 sections to the end of the list of data sections. Force small BSS
9884 sections to the start of the list of BSS sections. For large BSS
9885 sections to the end of the list of BSS sections.
9886 * symtab.h (class Symbol): Declare is_common_shndx.
9887 (Symbol::is_defined): Check Symbol::is_common_shndx.
9888 (Symbol::is_common): Likewise.
9889 (class Symbol_table): Define enum Commons_section_type. Update
9890 declarations. Add small_commons_ and large_commons_ fields.
9891 * symtab.cc (Symbol::is_common_shndx): New function.
9892 (Symbol_table::Symbol_table): Initialize new fields.
9893 (Symbol_table::add_from_object): Put small and large common
9894 symbols in the right list.
9895 (Symbol_table::sized_finalized_symbol): Check
9896 Symbol::is_common_shndx.
9897 (Symbol_table::sized_write_globals): Likewise.
9898 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9899 common symbol lists. Don't call do_allocate_commons_list if the
9900 list is empty.
9901 (Symbol_table::do_allocate_commons_list): Remove is_tls
9902 parameter. Add comons_section_type parameter. Change all
9903 callers. Handle small and large common symbols.
9904 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9905 Symbol::is_common_shndx.
9906 * resolve.cc (symbol_to_bits): Likewise.
9907 * target.h (Target::small_common_shndx): New function.
9908 (Target::small_common_section_flags): New function.
9909 (Target::large_common_shndx): New function.
9910 (Target::large_common_section_flags): New function.
9911 (Target::new_output_section): New function.
9912 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9913 small_common_section_flags, and large_common_section_flags
9914 fields.
9915 (Target::do_new_output_section): New virtual function.
9916 * arm.cc (Target_arm::arm_info): Initialize new fields.
9917 * i386.cc (Target_i386::i386_info): Likewise.
9918 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9919 Likewise.
9920 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9921 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9922 (Target_x86_64::do_new_output_section): New function.
9923 * configure.ac: Define conditional MCMODEL_MEDIUM.
9924 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9925 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9926 (large_LDFLAGS): Define.
9927 * testsuite/large.c: New file.
9928 * testsuite/testfile.cc (Target_test::test_target_info):
9929 Initialize new fields.
9930 * configure, testsuite/Makefile.in: Rebuild.
9931
9932 2009-06-05 Doug Kwan <dougkwan@google.com>
9933
9934 * Makefile.am (CCFILES): Add target.cc.
9935 * Makefile.in: Regenerate.
9936 * i386.cc (class Target_i386): Define new virtual method to
9937 override do_is_local_label_name in parent.
9938 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9939 local symbols if --discard-locals or -X is given.
9940 * options.h (class General_options): Declare new options
9941 '--discard-locals' and '-X' for discarding locals.
9942 * target.h (class Target): Define new methods is_local_label_name.
9943 Declare new virtual method do_is_local_label_name.
9944 * target.cc: New file.
9945 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9946 (check_SCRIPTS): Add discard_locals_test.sh.
9947 (check_DATA): Add discard_local_tests.syms.
9948 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9949 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9950 * testsuite/Makefile.in: Regenerate.
9951 * testsuite/discard_locals_test.c: New file.
9952 * testsuite/discard_locals_test.sh: Same.
9953
9954 2009-06-05 Doug Kwan <dougkwan@google.com>
9955
9956 * object.cc (Sized_relobj::Sized_relobj): Initialize
9957 discarded_eh_frame_shndx_ to -1U.
9958 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9959 section.
9960 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9961 a discarded .eh_frame section.
9962 (Sized_relobj::do_finalize_local_symbols): Ditto.
9963 * object.h (class Sized_relobj): Declare new member
9964 discarded_eh_frame_shndx_.
9965 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9966 (local_labels_test.o, local_labels_test): New rules.
9967 * testsuite/Makefile.in: Regenerate.
9968
9969 2009-06-04 Doug Kwan <dougkwan@google.com>
9970
9971 * layout.cc (Layout::section_name_mapping): Add mapping for
9972 special ARM sections.
9973
9974 2009-06-03 Doug Kwan <dougkwan@google.com>
9975
9976 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9977 (utils::has_overflow): Same.
9978
9979 2009-06-03 Ian Lance Taylor <iant@google.com>
9980
9981 * layout.cc (Layout::section_name_mapping): New array, replacing
9982 Layout::linkonce_mapping.
9983 (Layout::section_name_mapping_count): New variable, replacing
9984 Layout::linkonce_mapping_count.
9985 (Layout::linkonce_output_name): Remove.
9986 (Layout::output_section_name): Rewrite.
9987 * layout.h (class Layout): Rename Linkonce_mapping to
9988 Section_name_mapping, linkonce_mapping to section_name_mapping,
9989 linkonce_mapping_count to section_name_mapping_count. Don't
9990 declare linkonce_output_name.
9991
9992 2009-06-03 Doug Kwan <dougkwan@google.com>
9993
9994 * gold/arm.cc (namespace utils): New.
9995 (Target_arm::reloc_is_non_pic): Define new method.
9996 (class Arm_relocate_functions): New.
9997 (Target_arm::Relocate::relocate): Handle relocation types used by
9998 Android.
9999
10000 2009-06-03 Ian Lance Taylor <iant@google.com>
10001
10002 * arm.cc (Target_arm::scan::global): Use || instead of |.
10003
10004 2009-06-02 Doug Kwan <dougkwan@google.com>
10005
10006 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10007 issued_non_pic_error_.
10008 (class Target_arm::Scan): Declare new method check_non_pic.
10009 Define new method symbol_needs_plt_entry.
10010 Declare new data member issued_non_pic_error_.
10011 (class Target_arm::Relocate): Declare new method
10012 should_apply_static_reloc.
10013 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10014 (Target_arm::Scan::check_non_pic): Define new method.
10015 (Target_arm::Scan::local): Handle a small subset of reloc types used
10016 by Android.
10017 (Target_arm::Scan::local): Same.
10018 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10019
10020 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10021
10022 * incremental.cc (Incremental_inputs::report_command_line): Filter
10023 out --incremental-* options.
10024
10025 2009-05-29 Doug Kwan <dougkwan@google.com>
10026
10027 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10028 template class.
10029 (class Target_arm): Update comment.
10030 (Target_arm::Target_arm): Initialize new data members GOT_,
10031 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10032 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10033 and Target_arm::rel_dyn_section.
10034 Declare new_enum Target_arm::Got_type.
10035 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10036 and DYNBSS_.
10037 Update commments for member do_dynsym_value.
10038 (Target_arm::got_size, Target_arm::plt_section,
10039 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10040 new methods inside class defintion.
10041 (Target_arm::got_section): Define new method.
10042 (Target_arm::rel_dyn_section): Same.
10043 (Output_data_plt_arm): New template class.
10044 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10045 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10046 (Output_data_plt_arm::add_entry): Same.
10047 (Output_data_plt_arm::first_plt_entry): Define new
10048 static data member for PLT instruction template.
10049 (Output_data_plt_arm::plt_entry): Same.
10050 (Output_data_plt_arm::do_write): Define new method.
10051 (Target_arm::make_plt_entry): Same.
10052 (Target_arm::do_finalize_sections): Same.
10053 (Target_arm::do_dynsym_value): Same.
10054
10055 2009-05-28 Doug Kwan <dougkwan@google.com>
10056
10057 * Makefile.am (TARGETSOURCES): Add arm.cc.
10058 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10059 * Makefile.in: Regenerate.
10060 * arm.cc: New file.
10061 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10062
10063 2009-05-26 Doug Kwan <dougkwan@google.com>
10064
10065 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10066 (General_options::check_excluded_libs): Strip off directories in
10067 archive name before matching like GNU ld does.
10068 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10069 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10070 (exclude_libs_test_LDFLAGS): Add linker option
10071 -Wl,--exclude-libs,libexclude_libs_test_3
10072 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10073 an explicit archive without using -l.
10074 (alt/libexclude_libs_test_3.a): New make rule.
10075 * testsuite/Makefile.in: Regenerate.
10076 * testsuite/exclude_libs_test.c : Declare lib3_default().
10077 (main): Call it.
10078 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10079 * exclude_libs_test_3.c: New file.
10080
10081 2009-05-26 Nick Clifton <nickc@redhat.com>
10082
10083 * po/id.po: New Indonesian translation.
10084 * po/gold.pot: Updated template file.
10085
10086 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10087
10088 * testsuite/Makefile.am: Add -ffunction-sections to compile
10089 gc_comdat_test files. Add -Wl,--gc-sections to build
10090 gc_comdat_test.
10091 * testsuite/Makefile.in: Regenerate.
10092 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10093
10094 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10095
10096 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10097 kept comdat section was garbage collected.
10098 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10099 * testsuite/Makefile.in: Regenerate.
10100 * testsuite/gc_comdat_test.sh: New file.
10101 * testsuite/gc_comdat_test_1.cc: New file.
10102 * testsuite/gc_comdat_test_2.cc: New file.
10103
10104 2009-05-19 Doug Kwan <dougkwan@google.com>
10105
10106 * archive.cc (Archive::Archive): Move constructor from archive.h
10107 to here. Initialize no_export_.
10108 (Archive::get_elf_object_for_member): Set no_export flag of object.
10109 * archive.h (Archive::Archive): Move constructor body to
10110 archive.cc.
10111 (Archive::no_export): New method.
10112 (Archive::no_export_): New field.
10113 * object.h (Object::Object): Initialize no_export_ to false.
10114 (Object::no_export, Object::set_no_export): New methods.
10115 (Object::no_export_): New field.
10116 * options.cc (General_options::parse_exclude_libs): New method.
10117 (General_options::check_excluded_libs) Same.
10118 * options.h (exclude_libs): New option.
10119 (General_options::check_excluded_libs): New method declaration.
10120 (General_options::excluded_libs_): New field.
10121 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10122 default or protected visibility if an object has no-export flag set.
10123 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10124 (check_SCRIPTS): Add exclude_libs_test.sh.
10125 (check_DATA): Add exclude_libs_test.syms.
10126 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10127 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10128 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10129 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10130 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10131 libexclude_libs_test_2.a): New rules.
10132 * testsuite/Makefile.in: Regenerate.
10133 * testsuite/exclude_libs_test.c: New file.
10134 * testsuite/exclude_libs_test.sh: Ditto.
10135 * testsuite/exclude_libs_test_1.c: Ditto.
10136 * testsuite/exclude_libs_test_2.c: Ditto.
10137
10138 2009-05-15 Ian Lance Taylor <iant@google.com>
10139
10140 * configure.ac: Check for declarations for cases where libiberty.h
10141 checks HAVE_DECL_xxx.
10142 * configure, config.in: Rebuild.
10143
10144 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10145
10146 * gold.h (Incremental_argument_list): Remove (invalid) forward
10147 declaration.
10148 * incremental.cc (Incremental_inputs::report_achive): New method.
10149 (Incremental_inputs::report_object): New method.
10150 (Incremental_inputs::report_script): New method.
10151 (Incremental_inputs::finalize_inputs): New method.
10152 (Incremental_inputs::finalize): Call finalize_inputs().
10153 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10154 Create inputs entries.
10155 * incremental.h (Incremental_input_type): New enum.
10156 (Incremental_inputs::Incremental_input): Initialize new fields.
10157 (Incremental_inputs::report_inputs): New method.
10158 (Incremental_inputs::report_achive): New method.
10159 (Incremental_inputs::report_object): New method.
10160 (Incremental_inputs::report_script): New method.
10161 (Incremental_inputs::finalize_inputs): New method.
10162 (Incremental_inputs::Input_info): New struct.
10163 (Incremental_inputs::Input_info_map): New typedef.
10164 (Incremental_inputs::lock_): New field.
10165 (Incremental_inputs::Inputs_): New field.
10166 (Incremental_inputs::Inputs_map): New field.
10167 * main.cc (main): Call Incremental_input::report_inputs.
10168 * options.h (Input_argument_list): Typedef moved from
10169 Input_arguments.
10170 (Input_file_group::Files): Remove, use ::Input_argument_list.
10171 (Input_file_group::Input_argument_list): Remove, use
10172 ::Input_argument_list.
10173 * plugin.cc (Plugin_manager::add_input_file): Add error in
10174 incremental build.
10175 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10176 functions.
10177 * script.cc (read_input_script): Call
10178 Incremental_input::report_script.
10179 * script.h (Script_info): New class.
10180
10181 2009-04-27 Ian Lance Taylor <iant@google.com>
10182
10183 * x86_64.cc (do_adjust_output_section): Set entsize to
10184 plt_entry_size.
10185
10186 2009-04-23 Elliott Hughes <enh@google.com>
10187
10188 * output.cc (Output_file::close): After short writes, continue
10189 writing from the correct offset in the buffer being written.
10190
10191 2009-04-23 Chris Demetriou <cgd@google.com>
10192
10193 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10194 * configure: Regenerate.
10195 * config.in: Regenerate.
10196 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10197 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10198
10199 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10200
10201 * incremental.cc (Incremental_inputs_header_data): Renamed from
10202 Incremental_input_header_data.
10203 (Incremental_inputs_header_data::data_size): New field.
10204 (Incremental_inputs_header_data::put_input_file_count): Renamed
10205 from input_file_count.
10206 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10207 from command_line_offset.
10208 (Incremental_inputs_header_data::put_reserved): Renamed from
10209 put_reserved.
10210 (Incremental_inputs_entry_data): Renamed from
10211 Incremental_input_entry_data.
10212 (Incremental_inputs_entry_data::data_size): New field.
10213 (Incremental_inputs::report_command_line): New method.
10214 (Incremental_inputs::finalize): New method.
10215 (Incremental_inputs::create_incremental_inputs_data): New method.
10216 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10217 * incremental.h: New file.
10218 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10219 (Layout::finalize): Create incremental inputs section in
10220 incremental builds.
10221 (Layout::create_incremental_info_sections): New method.
10222 * layout.h (Layout::incremental_inputs): New method.
10223 (Layout::create_incremental_info_sections): New method.
10224 (Layout::incremental_inputs_): New field.
10225 * main.cc (main): Notify Incremental_input of the command line.
10226
10227 2009-04-01 Ian Lance Taylor <iant@google.com>
10228 Mikolaj Zalewski <mikolajz@google.com>
10229
10230 * gold.h (reserve_unordered_map): Define, three versions, one for
10231 each version of Unordered_map.
10232 * layout.cc (Layout::Layout): Remove options parameter. Add
10233 number_of_input_files parameter. Don't initialize options_.
10234 Initialize number_of_input_files_ and resized_signatures_. Move
10235 sections_are_attached_.
10236 (Layout::layout_group): Reserve space for group_signatures_.
10237 (Layout::find_or_add_kept_section): Change name parameter to be a
10238 reference. Resize signatures_ map when it gets large enough.
10239 (Layout::layout_eh_frame): Use parameters->options() instead of
10240 this->options_.
10241 (Layout::make_output_section): Likewise.
10242 (Layout::attach_allocated_section_to_segment): Likewise.
10243 (Layout::finalize, Layout::create_executable_stack): Likewise.
10244 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10245 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10246 * layout.h (class Layout): Update declarations. Remove options_
10247 field. Add number_of_input_files_ and resized_signatures_
10248 fields. Move sections_are_attached_ field.
10249 * main.cc (main): Pass number of input files to Layout
10250 constructor. Don't pass options.
10251
10252 2009-03-30 Ian Lance Taylor <iant@google.com>
10253
10254 * ffsll.c (ffsll): Correct implementation.
10255
10256 2009-03-27 Ian Lance Taylor <iant@google.com>
10257
10258 * ffsll.c: New file.
10259 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10260 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10261 * ftruncate.c (ftruncate): Declare before definition.
10262 * mremap.c (mremap): Likewise.
10263 * pread.c (pread): Likewise.
10264 * configure, Makefile.in, config.in: Rebuild.
10265
10266 * mremap.c: New file.
10267 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10268 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10269 (mremap): Declare if HAVE_MREMAP is not defined.
10270 * configure, Makefile.in, config.in: Rebuild.
10271
10272 2009-03-27 Cary Coutant <ccoutant@google.com>
10273
10274 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10275 position independent.
10276 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10277 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10278
10279 2009-03-24 Cary Coutant <ccoutant@google.com>
10280
10281 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10282 an executable.
10283 (needs_dynamic_reloc): Likewise.
10284
10285 2009-03-24 Ian Lance Taylor <iant@google.com>
10286
10287 * yyscript.y (file_cmd): Recognize EXTERN.
10288 (extern_name_list, extern_name_list_body): New nonterminals.
10289 * script.cc (script_add_extern): Define.
10290 * script-c.h (script_add_extern): Declare.
10291
10292 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10293
10294 * object.cc (is_elf_object): Define.
10295 * object.h (is_elf_object): Declare.
10296 * archive.cc (Archive::get_elf_object_for_member): Call
10297 is_elf_object.
10298 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10299
10300 2009-03-24 Elliott Hughes <enh@google.com>
10301
10302 * output.cc (Output_file::map_anonymous): Define.
10303 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10304 try an anonymous one. Report the size if the mmap fails.
10305 * output.h (class Output_file): Declare map_anonymous.
10306
10307 2009-03-24 Ian Lance Taylor <iant@google.com>
10308
10309 * target-select.cc (instantiate_target): Don't acquire the lock if
10310 the instantiated_target_ field has already been set.
10311
10312 2009-03-23 Ian Lance Taylor <iant@google.com>
10313
10314 * gold-threads.h (class Initialize_lock): Define.
10315 * gold-threads.cc (class Initialize_lock_once): Define.
10316 (initialize_lock_control): New static variable.
10317 (initialize_lock_pointer): New static variable.
10318 (initialize_lock_once): New static function.
10319 (Initialize_lock::Initialize_lock): Define.
10320 (Initialize_lock::initialize): Define.
10321 * target-select.h: Include "gold-threads.h".
10322 (class Target_selector): Add lock_ and initialize_lock_ fields.
10323 Don't define instantiate_target, just declare it.
10324 * target-select.cc (Target_selector::Target_selector): Initialize
10325 new fields.
10326 (Target_selector::instantiate_target): Define.
10327 * descriptors.h: Include "gold-threads.h".
10328 (class Descriptors): Add initialize_lock_ field.
10329 * descriptors.cc (Descriptors::Descriptors): Initialize new
10330 field.
10331 (Descriptors::open): Use initialize_lock_ field
10332 * errors.h (class Errors): Add initialize_lock_ field.
10333 * errors.cc (Errors::Errors): Initialize new field.
10334 (Errors::initialize_lock): Use initialize_lock_ field.
10335 * powerpc.cc (class Target_selector_powerpc): Remove
10336 instantiated_target_ field. In do_recognize call
10337 instantiate_target rather than do_instantiate_target. In
10338 do_instantiate_target just allocate a new target.
10339 * sparc.cc (class Target_selector_sparc): Likewise.
10340
10341 * freebsd.h: New file.
10342 * i386.cc: Include "freebsd.h".
10343 (Target_i386): Derive from Target_freebsd rather than
10344 Sized_target.
10345 (Target_selector_i386): Derive from Target_selector_freebsd rather
10346 than Target_selector.
10347 * x86_64.cc: Include "freebsd.h".
10348 (Target_x86_64): Derive from Target_freebsd rather than
10349 Sized_target.
10350 (Target_selector_x86_64): Derive from Target_selector_freebsd
10351 rather than Target_selector.
10352 * target.h (class Target): Add adjust_elf_header and
10353 do_adjust_elf_header.
10354 * output.cc (Output_file_header:: do_sized_write): Call target
10355 adjust_elf_header routine.
10356 * configure.tgt: Set targ_osabi.
10357 * configure.ac: Define GOLD_DEFAULT_OSABI.
10358 * parameters.cc (Parameters::default_target): Pass
10359 GOLD_DEFAULT_OSABI to select_target.
10360 * target-select.h (class Target_selector): Make instantiate_target
10361 protected rather than private.
10362 * Makefile.am (HFILES): Add freebsd.h.
10363 * configure, Makefile.in, config.in: Rebuild.
10364
10365 * merge.cc (do_add_input_section): Correct pend value. Change
10366 message about last entry not being null terminated from error to
10367 warning.
10368
10369 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10370
10371 * incremental.cc: New file.
10372 * Makefile.am (CCFILES): Add incremental.cc.
10373 * Makefile.in: Rebuild.
10374
10375 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10376
10377 * layout.cc (Layout::output_section_name): Preserve names
10378 of '.note.' sections.
10379
10380 2009-03-19 Ian Lance Taylor <iant@google.com>
10381
10382 * descriptors.cc (Descriptors::open): Check that the options are
10383 valid before using them.
10384
10385 2009-03-18 Ian Lance Taylor <iant@google.com>
10386
10387 * script-sections.h: Include <list>.
10388 (class Script_sections): Change Sections_elements from std::vector
10389 to std::list. Typedef public Elements_iterator. Add
10390 orphan_section_placement_, data_segment_align_start_, and
10391 saw_data_segment_align_ fields. Remove data_segment_align_index_
10392 field.
10393 * script-sections.cc (class Orphan_section_placement): New class.
10394 (class Sections_element): Add virtual functions is_relro and
10395 orphan_section_init. Remove virtual function place_orphan_here.
10396 (class Output_section_definition): Add is_relro and
10397 orphan_section_init. Remove place_orphan_here.
10398 (class Orphan_output_section): Likewise.
10399 (Script_sections::Script_sections): Update for field changes.
10400 (Script_sections::data_segment_align): Set saw_data_segment_align_
10401 and data_segment_align_start_, not data_segment_align_index.
10402 (Script_sections::data_segment_relro_end): Check
10403 saw_data_segment_align_. Use data_segment_align_start_ rather
10404 than data_segment_align_index_.
10405 (Script_sections::place_orphan): Rewrite to use
10406 Orphan_section_placement.
10407
10408 2009-03-17 Ian Lance Taylor <iant@google.com>
10409
10410 * archive.cc (Archive::add_symbols): Check for a version attached
10411 to the symbol name in the archive map.
10412 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10413 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10414 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10415 (ver_test_11.a): New target.
10416 * testsuite/Makefile.in: Rebuild.
10417
10418 * configure.ac: Check for chsize and posix_fallocate. Replace
10419 ftruncate.
10420 * ftruncate.c: New file, from gnulib.
10421 * output.cc (posix_fallocate): Define dummy version if not
10422 HAVE_POSIX_FALLOCATE.
10423 (Output_file::map): Call posix_fallocate rather than lseek and
10424 write.
10425 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10426 * configure, Makefile.in, config.in: Rebuild.
10427
10428 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10429
10430 * layout.h (Layout::create_note): Add section_name parameter.
10431 * layout.cc (Layout::create_note): Likewise.
10432 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10433
10434 2009-03-17 Ian Lance Taylor <iant@google.com>
10435
10436 * descriptors.cc: Include "options.h".
10437 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10438 (Descriptors::open): Always use O_CLOEXEC when opening a new
10439 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10440 then set FD_CLOEXEC.
10441
10442 * sparc.cc (class Target_sparc): Add has_got_section.
10443 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10444 make sure we have a GOT section.
10445
10446 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10447 (Target_sparc::Scan::local): Likewise.
10448 (Target_sparc::Scan::global): Likewise.
10449 (Target_sparc::Relocate::relocate): Likewise.
10450 (Target_sparc::Relocate::relocate_tls): Likewise.
10451
10452 * symtab.cc (Symbol_table::define_default_version): New function,
10453 broken out of add_from_object.
10454 (Symbol_table::add_from_object): Call define_default_version.
10455 (Symbol_table::define_special_symbol): Add resolve_oldsym
10456 parameter. Change all callers. If the version for a symbol comes
10457 from a version script, resolve it with the symbol with the same
10458 name with no version. Also add the symbol without a version if
10459 appropriate.
10460 (do_define_in_output_data): If resolving with oldsym, don't delete
10461 sym.
10462 (do_define_in_output_segment): Likewise.
10463 (do_define_as_constant): Likewise.
10464 * symtab.h (class Symbol_table): Update declarations.
10465
10466 2009-03-13 Ian Lance Taylor <iant@google.com>
10467
10468 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10469 (Read_symbols::requeue): New function.
10470 (Read_symbols::do_read_symbols): If make_elf_object fails because
10471 the target type is not configured, and the file was searched for,
10472 issue a warning and retry with the next directory.
10473 (Add_symbols::run): If the file has an incompatible format, and
10474 it was searched for, requeue the Read_symbols task. On error,
10475 release the object.
10476 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10477 dirindex parameter to constructor. Change all callers. Declare
10478 incompatible_warning and requeue.
10479 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10480 input_argument_ and input_group_ fields. Add them to
10481 constructor. Change all callers.
10482 (class Read_script): Add dirindex_ field. Add it to constructor.
10483 Change all callers.
10484 * archive.cc (Archive::setup): Remove input_objects parameter.
10485 Change all callers.
10486 (Archive::get_file_and_offset): Likewise.
10487 (Archive::read_all_symbols): Likewise.
10488 (Archive::read_symbols): Likewise.
10489 (Archive::get_elf_object_for_member): Remove input_objects
10490 parameter. Add punconfigured parameter. Change all callers.
10491 (Archive::add_symbols): Change return type to bool. Check return
10492 value of include_member.
10493 (Archive::include_all_members): Likewise.
10494 (Archive::include_member): Change return type to bool. Return
10495 false if first included object has incompatible target. Set
10496 included_member_ field.
10497 (Add_archive_symbols::run): If add_symbols returns false, requeue
10498 Read_symbols task.
10499 * archive.h (class Archive): Add included_member_ field.
10500 Initialize it in constructor. Add input_file and searched_for
10501 methods. Update declarations.
10502 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10503 input_argument_ fields. Add them to constructor. Change all
10504 callers.
10505 * script.cc: Include "target-select.h".
10506 (class Parser_closure): Add skip_on_incompatible_target_ and
10507 found_incompatible_target_ fields. Add
10508 skip_on_incompatible_target parameter to constructor. Change all
10509 callers. Add methods skip_on_incompatible_target,
10510 clear_skip_on_incompatible_target, found_incompatible_target, and
10511 set_found_incompatible_target.
10512 (read_input_script): Add dirindex parameter. Change all callers.
10513 If parser finds an incompatible target, requeue Read_symbols
10514 task.
10515 (script_set_symbol): Clear skip_on_incompatible_target in
10516 closure.
10517 (script_add_assertion, script_parse_option): Likewise.
10518 (script_start_sections, script_add_phdr): Likewise.
10519 (script_check_output_format): New function.
10520 * script.h (read_input_script): Update declaration.
10521 * script-c.h (script_check_output_format): Declare.
10522 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10523 (ignore_cmd): Remove OUTPUT_FORMAT.
10524 * fileread.cc (Input_file::Input_file): Add explicit this.
10525 (Input_file::will_search_for): New function.
10526 (Input_file::open): Add pindex parameter. Change all callers.
10527 * fileread.h (class Input_file): Add input_file_argument method.
10528 Declare will_search_for. Update declarations.
10529 * object.cc (make_elf_object): Add punconfigured parameter.
10530 Change all callers.
10531 * object.h (class Object): Make input_file public. Add
10532 searched_for method.
10533 (make_elf_object): Update declaration.
10534 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10535 restart search.
10536 * dirsearch.h (class Dirsearch): Update declaration.
10537 * options.h (class General_options): Add --warn-search-mismatch.
10538 * parameters.cc (Parameters::is_compatible_target): New function.
10539 * parameters.h (class Parameters): Declare is_compatible_target.
10540 * workqueue.cc (Workqueue::add_blocker): New function.
10541 * workqueue.h (class Workqueue): Declare add_blocker.
10542
10543 * fileread.cc (Input_file::open): Remove options parameter.
10544 Change all callers.
10545 (Input_file::open_binary): Likewise.
10546 * script.cc (read_input_script): Likewise.
10547 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10548 options parameter from constructor. Change all callers.
10549 (class Read_script): Likewise.
10550 * fileread.h (class Input_file): Update declarations.
10551 * script.h (read_input_script): Update declaration.
10552
10553 2009-03-10 Nick Clifton <nickc@redhat.com>
10554
10555 * po/es.po: New Spanish translation.
10556
10557 2009-03-06 Cary Coutant <ccoutant@google.com>
10558
10559 * options.cc (parse_short_option): Keep dash_z from registering itself.
10560
10561 2009-03-03 Ian Lance Taylor <iant@google.com>
10562
10563 PR 9918
10564 * target-reloc.h (relocate_section): Pass output_section to
10565 relocate.
10566 * i386.cc (Target_i386::should_apply_static_reloc): Add
10567 output_section parameter. Change all callers.
10568 (Target_i386::Relocate::relocate): Add output_section parameter.
10569 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10570 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10571 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10572 * testsuite/two_file_shared.sh: New script.
10573 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10574 (check_DATA): Add two_file_shared.dbg.
10575 (two_file_shared.dbg): New target.
10576 * testsuite/Makefile.in: Rebuild.
10577
10578 2009-03-01 Ian Lance Taylor <iant@google.com>
10579
10580 * configure.ac: Check for byteswap.h.
10581 * configure: Rebuild.
10582 * config.in: Rebuild.
10583
10584 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10585
10586 * layout.cc (Layout::find_or_add_kept_section): New function.
10587 (Layout::add_comdat): Removed.
10588 * layout.h (struct Kept_section): Move out of class Layout.
10589 Remove trailing underscores from field names. Add group_sections
10590 field. Rename group_ field to is_group. Change all uses.
10591 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10592 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10593 comdat_groups_ field.
10594 (Sized_relobj::include_section_group): Use
10595 find_or_add_kept_section and Kept_section::group_sections.
10596 (Sized_relobj::include_linkonce_section): Likewise.
10597 * object.cc (class Sized_relobj): Don't define Comdat_group or
10598 Comdat_group_table. Remove find_comdat_group and
10599 add_comdat_group. Remove comdat_groups_ field.
10600 * plugin.cc (include_comdat_group): Use
10601 Layout::find_or_add_kept_section.
10602
10603 2009-02-28 Ian Lance Taylor <iant@google.com>
10604
10605 * README: --gc-sections and map files are now supported. Document
10606 some build requirements.
10607
10608 PR 6992
10609 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10610 relocatable link set the value of the section symbol to zero.
10611 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10612 relocatable link don't include the section address in the local
10613 symbol value.
10614
10615 2009-02-27 Ian Lance Taylor <iant@google.com>
10616
10617 PR 6811
10618 * options.h (class Search_directory): Add is_system_directory.
10619 (class General_options): Declare is_in_system_directory.
10620 * options.cc (get_relative_sysroot): Make static.
10621 (get_default_sysroot): Make static.
10622 (General_optoins::is_in_system_directory): New function.
10623 * fileread.cc (Input_file::is_in_system_directory): New function.
10624 * fileread.h (class Input_file): Declare is_in_system_directory.
10625 * object.h (class Object): Add is_in_system_directory.
10626 (class Input_objects): Remove system_library_directory_ field.
10627 * object.cc (Input_objects::add_object): Don't set
10628 system_library_directory_.
10629 (input_objects::found_in_system_library_directory): Remove.
10630 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10631 parameter. Change all callers.
10632 (Symbol_table::sized_write_globals): Likewise.
10633 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10634 Call Object::is_in_system_directory.
10635 * symtab.h (class Symbol_table): Update declarations.
10636
10637 PR 5990
10638 * descriptors.h (Open_descriptor): Add is_on_stack field.
10639 * descriptors.cc (Descriptors::open): If the descriptor is on the
10640 top of the stack, remove it. Initialize is_on_stack field.
10641 (Descriptors::release): Only add pod to stack if it is not on the
10642 stack already.
10643 (Descriptors::close_some_descriptor): Clear stack_next and
10644 is_on_stack fields.
10645
10646 PR 7091
10647 * output.cc (Output_section::find_starting_output_address): Rename
10648 from starting_output_address; add PADDR parameter; change return
10649 type.
10650 * output.h (class Output_section): Declare
10651 find_starting_output_address instead of starting_output_address.
10652 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10653 section symbol for which we can't find a merge section.
10654
10655 PR 9836
10656 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10657 hidden or internal, force the symbol to be local.
10658 * resolve.cc (Symbol::override_visibility): Define.
10659 (Symbol::override_base): Use override_visibility.
10660 (Symbol_table::resolve): Likewise.
10661 (Symbol::override_base_with_special): Likewise.
10662 (Symbol_table::override_with_special): If the visibility is hidden
10663 or internal, force the symbol to be local.
10664 * symtab.h (class Symbol): Add set_visibility and
10665 override_visibility.
10666 * testsuite/ver_test_1.sh: New file.
10667 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10668 (check_DATA): Add ver_test_1.syms.
10669 (ver_test_1.syms): New target.
10670 * testsuite/Makefile.in: Rebuild.
10671
10672 2009-02-25 Cary Coutant <ccoutant@google.com>
10673
10674 * layout.cc (Layout::choose_output_section): Don't rename sections
10675 when using a linker script that has a SECTIONS clause.
10676 * Makefile.in: Regenerate.
10677
10678 * testsuite/Makefile.am (script_test_5.sh): New test case.
10679 * testsuite/Makefile.in: Regenerate.
10680 * testsuite/script_test_5.cc: New file.
10681 * testsuite/script_test_5.sh: New file.
10682 * testsuite/script_test_5.t: New file.
10683
10684 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10685
10686 * archive.cc (Archive::include_member): Update calls to add_symbols.
10687 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10688 the Layout argument.
10689 * dynobj.h (do_add_symbols): Add the Layout argument.
10690 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10691 Layout argument.
10692 * object.h (Object::add_symbols): Add the Layout argument.
10693 (Object::do_add_symbols): Add the Layout argument.
10694 (Sized_relobj::do_add_symbols): Add the Layout argument.
10695 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10696 Unify the two versions.
10697 (Add_plugin_symbols): Remove.
10698 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10699 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10700 (Add_plugin_symbols): Remove.
10701 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10702 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10703 (Add_symbols::run): Make it work with Pulginobj.
10704
10705 2009-02-06 Ian Lance Taylor <iant@google.com>
10706
10707 * object.cc (Sized_relobj::do_layout): Make info message start
10708 with lower case letter.
10709
10710 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10711
10712 * binary.cc: Fix file comment.
10713
10714 * options.h (enum Incremental_disposition): Define.
10715 (class General_options): Add new options: --incremental,
10716 --incremental_changed, --incremental_unchanged,
10717 --incremental_unknown. Add incremental_disposition_ and
10718 implicit_incremental_ fields.
10719 (General_options::incremental_disposition): New function.
10720 (class Position_dependent_options): Add incremental_disposition
10721 option.
10722 (Position_dependent_options::copy_from_options): Set incremental
10723 dispositions.
10724 * options.cc (General_options::parse_incremental_changed): New
10725 function.
10726 (General_options::parse_incremental_unchanged): New function.
10727 (General_options::parse_incremental_unknown): New function.
10728 (General_options::General_options): Initialize new fields
10729 incremental_disposition_ and implicit_incremental_.
10730 (General_options::finalize): Check for uasge of --incremental-*
10731 without --incremental.
10732
10733 2009-02-06 Chris Demetriou <cgd@google.com>
10734
10735 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10736 pointer and to report location as the file name associated with
10737 the symbol.
10738 (gold_undefined_symbol_at_location): New function to replace the
10739 old gold_undefined_symbol functionality.
10740 * target-reloc.h (relocate_section): Update to use
10741 gold_undefined_symbol_at_location.
10742 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10743 Call gold_undefined_symbol function rather than gold_error.
10744 * errors.h (Errors::undefined_symbol): Take location as a
10745 string, rather than calculating it from a relocation.
10746 * errors.cc (Errors::fatal): Print "fatal error:" before the
10747 formatted message.
10748 (Errors::error, Errors::error_at_location): Print "error: "
10749 before the formatted message.
10750 (Errors::undefined_symbol): Take location as a string, rather
10751 than calculating it from a relocation.
10752 (gold_undefined_symbol_at_location): New function akin to
10753 old gold_undefined_symbol, calculates location from relocation.
10754 (gold_undefined_symbol): Change to take only a Symbol pointer
10755 and to report location as the file name associated with the symbol.
10756 * testsuite/debug_msg.sh: Update for changed error messages.
10757 * testsuite/undef_symbol.sh: Likewise.
10758
10759 2009-02-04 Duncan Sands <baldrick@free.fr>
10760
10761 PR 9812
10762 * reduced_debug_output.h
10763 (Output_reduced_debug_abbrev_section::failed): Use format for
10764 gold_warning.
10765 (Output_reduced_debug_info_section::faild): Likewise.
10766
10767 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10768
10769 * script.cc (Lazy_demangler): New class.
10770 (Version_script_info::get_symbol_version_helper): Demangle a
10771 symbol only once.
10772
10773 2009-01-29 Cary Coutant <ccoutant@google.com>
10774
10775 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10776 to __tls_get_addr.
10777 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10778
10779 2009-01-28 Ian Lance Taylor <iant@google.com>
10780
10781 * version.cc (version_string): Bump to 1.9.
10782
10783 * gold.h: Include <cstring> and <stdint.h>.
10784 * version.cc: Include <cstdio>.
10785 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10786 warning.
10787 * reduced_debug_output.cc (insert_into_vector): Rename from
10788 Insert_into_vector; change all callers. Use Swap_unaligned to
10789 avoid aliasing issue; remove union since it is unnecessary.
10790
10791 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10792
10793 * Makefile.am (CCFILES): Add gc.cc.
10794 (HFILES): Add gc.h.
10795 * Makefile.in: Regenerate.
10796 * gold.cc (Gc_runner): New class.
10797 (queue_initial_tasks): Call garbage collection related tasks
10798 when corresponding options are invoked.
10799 (queue_middle_gc_tasks): New function.
10800 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10801 processed early before laying out sections during garbage collection.
10802 * gold.h (queue_middle_gc_tasks): New function.
10803 (is_prefix_of): Move from "layout.cc".
10804 * i386.cc (Target_i386::gc_process_relocs): New function.
10805 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10806 * main.cc (main): Create object of class "Garbage_collection".
10807 * object.cc (Relobj::copy_symbols_data): New function.
10808 (Relobj::is_section_name_included): New function.
10809 (Sized_relobj::do_layout): Allow this function to be called twice
10810 during garbage collection and defer layout of section during the
10811 first call.
10812 * object.h (Relobj::get_symbols_data): New function.
10813 (Relobj::is_section_name_included): New function.
10814 (Relobj::copy_symbols_data): New function.
10815 (Relobj::set_symbols_data): New function.
10816 (Relobj::get_relocs_data): New function.
10817 (Relobj::set_relocs_data): New function.
10818 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10819 (Relobj::gc_process_relocs): New function.
10820 (Relobj::do_gc_process_relocs): New pure virtual function.
10821 (Relobj::sd_): New data member.
10822 (Sized_relobj::is_output_section_offset_invalid): New function.
10823 (Sized_relobj::do_gc_process_relocs): New function.
10824 * options.h (General_options::gc_sections): Modify to not be a no-op.
10825 (General_options::print_gc_sections): New option.
10826 * plugin.cc (Plugin_finish::run): Remove function call to
10827 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10828 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10829 * reloc.cc (Read_relocs::run): Add task to process relocs and
10830 determine unreferenced sections when doing garbage collection.
10831 (Gc_process_relocs): New class.
10832 (Sized_relobj::do_gc_process_relocs): New function.
10833 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10834 sections that are garbage collected.
10835 * reloc.h (Gc_process_relocs): New class.
10836 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10837 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10838 symbols whose corresponding sections are garbage collected.
10839 (Symbol_table::Symbol_table): Add new parameter for the garbage
10840 collection object.
10841 (Symbol_table::gc_mark_undef_symbols): New function.
10842 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10843 (Symbol_table::gc_mark_dyn_syms): New function.
10844 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10845 as garbage.
10846 (Symbol_table::add_from_object): Likewise.
10847 (Symbol_table::add_from_relobj): When building shared objects, do not
10848 treat externally visible symbols as garbage.
10849 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10850 table information for static and relocatable links.
10851 * symtab.h (Symbol_table::set_gc): New function.
10852 (Symbol_table::gc): New function.
10853 (Symbol_table::gc_mark_undef_symbols): New function.
10854 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10855 (Symbol_table::gc_mark_dyn_syms): New function.
10856 (Symbol_table::gc_): New data member.
10857 * target.h (Sized_target::gc_process_relocs): New pure virtual
10858 function.
10859 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10860 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10861
10862 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10863
10864 * options.h (General_options::gc_sections): Define as a no-op for now.
10865 (General_options::no_keep_memory): Ditto.
10866 (General_options::Bshareable): Define.
10867 * options.cc (General_options::finalize): Honor -Bshareable.
10868
10869 2009-01-20 Andreas Schwab <schwab@suse.de>
10870
10871 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10872 read the value in the contents, since we don't use it. Use the
10873 template endianness when writing.
10874 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10875
10876 2009-01-19 Andreas Schwab <schwab@suse.de>
10877
10878 * configure.tgt (powerpc64-*): Fix targ_obj.
10879
10880 2009-01-15 Ian Lance Taylor <iant@google.com>
10881
10882 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10883 local symbols when stripping all symbols.
10884
10885 2009-01-14 Cary Coutant <ccoutant@google.com>
10886
10887 * output.cc (Output_reloc): Add explicit instantiations.
10888
10889 2009-01-14 Cary Coutant <ccoutant@google.com>
10890
10891 * archive.cc (Archive::get_elf_object_for_member): Remove call
10892 to File_read::claim_for_plugin.
10893 * descriptors.cc (Descriptors::open): Remove reference to
10894 is_claimed.
10895 (Descriptors::claim_for_plugin): Remove.
10896 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10897 (Descriptors::is_claimed): Remove.
10898 (claim_descriptor_for_plugin): Remove.
10899 * fileread.cc (File_read::claim_for_plugin): Remove.
10900 * fileread.h (File_read::claim_for_plugin): Remove.
10901 (File_read::descriptor): Reopen descriptor if necessary.
10902 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10903 (Plugin_manager::all_symbols_read): Add task parameter. Change
10904 all callers.
10905 (Plugin_manager::get_input_file): New function.
10906 (Plugin_manager::release_input_file): New function.
10907 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10908 corresponding data member.
10909 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10910 and pass to base constructor. Change all callers.
10911 (get_input_file, release_input_file): New functions.
10912 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10913 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10914 (Plugin_manager::all_symbols_read): Add task parameter.
10915 (Plugin_manager::get_input_file): New function.
10916 (Plugin_manager::release_input_file): New function.
10917 (Plugin_manager::task_): New data member.
10918 (Pluginobj::Pluginobj): Add filesize parameter.
10919 (Pluginobj::filename): New function.
10920 (Pluginobj::descriptor): New function.
10921 (Pluginobj::filesize): New function.
10922 (Pluginobj::filesize_): New data member.
10923 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10924 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10925 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10926
10927 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10928 with archive libraries.
10929 * testsuite/Makefile.in: Regenerate.
10930 * testsuite/plugin_test.c (struct sym_info): New type.
10931 (get_input_file, release_input_file): New static variables.
10932 (onload): Capture new transfer vector entries.
10933 (claim_file_hook): Stop reading at end of file according to filesize.
10934 Factor out parsing of readelf output into separate function.
10935 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10936 APIs and get the source file name from the symbol table. Convert
10937 source file name to corresponding object file name. Print info
10938 message when adding new input files.
10939 (parse_readelf_line): New function.
10940 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10941 * testsuite/plugin_test_2.sh: Likewise.
10942 * testsuite/plugin_test_3.sh: Likewise.
10943 * testsuite/plugin_test_4.sh: New test case.
10944
10945 2009-01-07 Ian Lance Taylor <iant@google.com>
10946
10947 * version.cc (version_string): Bump to 1.8.
10948
10949 2008-12-23 Cary Coutant <ccoutant@google.com>
10950
10951 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10952 * plugin.cc (Plugin_manager::finish): Rename as
10953 layout_deferred_objects. Move cleanup to separate function.
10954 (Plugin_manager::cleanup): New function.
10955 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10956 separately.
10957 * plugin.h (Plugin_manager::finish): Rename as
10958 layout_deferred_objects.
10959 (Plugin_manager::cleanup): New function.
10960 (Plugin_manager::cleanup_done): New field.
10961
10962 2008-12-23 Cary Coutant <ccoutant@google.com>
10963
10964 * plugin.cc (is_visible_from_outside): New function.
10965 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10966 so we don't return "IR only" status for exported symbols or -r links.
10967
10968 * testsuite/Makefile.am (plugin_test_3): New test case.
10969 * testsuite/Makefile.in: Regenerate.
10970 * testsuite/plugin_test_3.sh: New file.
10971
10972 2008-12-22 Cary Coutant <ccoutant@google.com>
10973
10974 * object.cc (Sized_relobj::layout_section): New function.
10975 (Sized_relobj::do_layout): Defer layout of input sections until after
10976 plugin has provided replacement files.
10977 (Sized_relobj::do_layout_deferred_sections): New function.
10978 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10979 (Relobj::layout_deferred_sections): New function.
10980 (Relobj::do_layout_deferred_sections): New function.
10981 (Sized_relobj::do_layout_deferred_sections): New function.
10982 (Sized_relobj::layout_section): New function.
10983 (Sized_relobj::Deferred_layout): New structure.
10984 (Sized_relobj::deferred_layout_): New field.
10985 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10986 Change all callers. Layout deferred sections.
10987 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10988 references.
10989 (Plugin_hook::run): Move code from do_plugin_hook inline.
10990 (Plugin_hook::do_plugin_hook): Remove.
10991 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10992 (Plugin_manager::finish): Renamed, was cleanup.
10993 (Plugin_manager::should_defer_layout): New function.
10994 (Plugin_manager::add_deferred_layout_object): New function.
10995 (Plugin_manager::Deferred_layout_list): New type.
10996 (Plugin_manager::deferred_layout_objects_): New field.
10997 (Plugin_hook::do_plugin_hook): Remove.
10998
10999 2008-12-17 Ian Lance Taylor <iant@google.com>
11000
11001 * options.h (class General_options): Add --no case for
11002 --export-dynamic.
11003
11004 2008-12-16 Cary Coutant <ccoutant@google.com>
11005
11006 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11007 vector.
11008 (Plugin_manager::claim_file): Create plugin object even if
11009 plugin did not call the add_symbols callback.
11010 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11011 asking for more symbols than were added.
11012 * testsuite/Makefile.am (plugin_test_1): Add test case with
11013 no global symbols.
11014 (empty.syms): New target.
11015 * testsuite/Makefile.in: Regenerate.
11016 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11017 message. Don't call add_symbols if no globals.
11018 (all_symbols_read_hook): Don't provide replacement for empty
11019 claimed file.
11020
11021 2008-12-12 Ian Lance Taylor <iant@google.com>
11022
11023 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11024 r_type == 0 for a local symbol with r_sym == 0.
11025 (scan_relocatable_relocs): Pass r_sym to
11026 local_non_section_strategy.
11027 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11028 r_sym parameter.
11029
11030 * configure.ac: Update test for TLS descriptors: they are
11031 supported as of glibc 2.9.
11032 * configure: Rebuild.
11033
11034 2008-12-11 Ian Lance Taylor <iant@google.com>
11035
11036 PR 7091
11037 * target-reloc.h (Default_scan_relocatable_relocs): For each
11038 function, map r_type == 0 to RELOC_DISCARD.
11039
11040 2008-12-10 Cary Coutant <ccoutant@google.com>
11041
11042 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11043 object to override a kept COMDAT group from a plugin object.
11044
11045 2008-12-09 Ian Lance Taylor <iant@google.com>
11046
11047 PR 7088
11048 * yyscript.y (file_cmd): Handle INPUT.
11049
11050 * testsuite/initpri1.c: Change all declarations to be full
11051 prototypes by adding void, to avoid compiler warnings.
11052
11053 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
11054
11055 * options.cc (General_options::parse_plugin_opt): New.
11056 (General_options::add_plugin): The argument now is just the filename.
11057 (General_options::add_plugin_option): New.
11058 * options.h (plugin_opt): New.
11059 (add_plugin): Change argument name.
11060 (add_plugin_option): New.
11061 * plugin.cc (Plugin::load): Don't parse the plugin option.
11062 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11063 (Plugin::add_option): New.
11064 (Plugin::args_): Change type.
11065 (Plugin::filename_): New.
11066 (Plugin_manager::add_plugin_option): New.
11067 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11068 * testsuite/Makefile.in: Regenerate.
11069
11070 2008-12-05 Cary Coutant <ccoutant@google.com>
11071
11072 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11073 Handle --strip-lto-sections option.
11074 * options.h (strip_lto_sections): New option.
11075
11076 2008-12-01 Cary Coutant <ccoutant@google.com>
11077
11078 * plugin.cc (ld_plugin_message): Change format parameter to const.
11079 Fix mismatch between new[] and delete.
11080
11081 2008-11-14 Cary Coutant <ccoutant@google.com>
11082
11083 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11084 instead of -1U.
11085
11086 2008-11-05 Craig Silverstein <csilvers@google.com>
11087
11088 * options.cc (General_options::parse_dynamic_list): New function.
11089 * options.h (General_options): New flags dynamic_list,
11090 dynamic_list_data, dynamic_list_cpp_new, and
11091 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11092 (General_options::in_dynamic_list): New function.
11093 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11094 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11095 (Lex::can_continue_name): Likewise.
11096 (yylex): Likewise.
11097 (read_script_file): New parameter script_options.
11098 (read_dynamic_list): New function.
11099 (Script_options::define_dynamic_list): New function.
11100 (dynamic_list_keyword_parsecodes): New variable.
11101 (dynamic_list_keywords): New variable.
11102 * script.h (Script_options::define_dynamic_list): New function
11103 prototype.
11104 (read_dynamic_list): New function prototype.
11105 * symtab.cc (strprefix): New macro.
11106 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11107 dynamic_list_data, dynamic_list_cpp_new, and
11108 dynamic_list_cpp_typeinfo.
11109 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11110 (dynamic_list_expr): New rule.
11111 (dynamic_list_nodes): Likewise.
11112 (dynamic_list_node): Likewise.
11113 * testsuite/Makefile.am (dynamic_list): New test.
11114 * testsuite/Makefile.in: Regenerated.
11115 * testsuite/dynamic_list.t: New file.
11116 * testsuite/dynamic_list.sh: New file.
11117
11118 2008-11-05 Craig Silverstein <csilvers@google.com>
11119
11120 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11121 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11122 (t11_last): Likewise.
11123 * testsuite/ver_test_6.c (main): Likewise.
11124
11125 2008-10-07 Cary Coutant <ccoutant@google.com>
11126
11127 * options.c (General_options::finalize): Add check for -static and
11128 -shared.
11129 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11130 is not empty.
11131
11132 2008-10-02 Cary Coutant <ccoutant@google.com>
11133
11134 * plugin.cc (make_sized_plugin_object): Fix conditional
11135 compilation to work when not all targets are enabled.
11136
11137 2008-09-29 Cary Coutant <ccoutant@google.com>
11138
11139 * archive.cc (Archive::get_file_and_offset): Use filename instead
11140 of name to get library path.
11141 (Archive::include_member): Unlock external member of a thin archive.
11142
11143 * testsuite/Makefile.am (TEST_AR): New variable.
11144 (thin_archive_test_1): New test.
11145 (thin_archive_test_2): New test.
11146 * testsuite/Makefile.in: Regenerate.
11147 * testsuite/thin_archive_main.cc: New file.
11148 * testsuite/thin_archive_test_1.cc: New file.
11149 * testsuite/thin_archive_test_2.cc: New file.
11150 * testsuite/thin_archive_test_3.cc: New file.
11151 * testsuite/thin_archive_test_4.cc: New file.
11152
11153 2008-09-29 Cary Coutant <ccoutant@google.com>
11154
11155 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11156 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11157 instead of -1U.
11158 (Sized_relobj::do_finalize_local_symbols): Likewise.
11159 (Sized_relobj::map_to_kept_section): Likewise.
11160 * object.h (Sized_relobj::invalid_address): New constant.
11161 (Sized_relobj::do_output_section_offset): Check for invalid_address
11162 and return -1ULL.
11163 * output.cc (Output_reloc::local_section_offset): Use constant
11164 invalid_address instead of -1U.
11165 (Output_reloc::get_address): Likewise.
11166 (Output_section::output_address): Change -1U to -1ULL.
11167 * output.h (Output_reloc::invalid_address): New constant.
11168 * reloc.cc (Sized_relobj::write_sections): Use constant
11169 invalid_address instead of -1U.
11170 (Sized_relobj::relocate_sections): Likewise.
11171 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11172 values for merge sections.
11173 * target-reloc.h (relocate_for_relocatable): Use constant
11174 invalid_address instead of -1U.
11175
11176 2008-09-19 Cary Coutant <ccoutant@google.com>
11177
11178 Add plugin functionality for link-time optimization (LTO).
11179 * configure.ac (plugins): Add --enable-plugins option.
11180 * configure: Regenerate.
11181 * config.in: Regenerate.
11182 * Makefile.am (LIBDL): New variable.
11183 (CCFILES): Add plugin.cc.
11184 (HFILES): Add plugin.h.
11185 (ldadd_var): Add LIBDL.
11186 * Makefile.in: Regenerate.
11187
11188 * archive.cc: Include "plugin.h".
11189 (Archive::setup): Don't preread archive symbols when using a plugin.
11190 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11191 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11192 files.
11193 (Archive::include_member): Add symbols from plugin objects.
11194 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11195 * descriptors.cc (Descriptors::open): Check for file descriptors
11196 abandoned by plugins.
11197 (Descriptors::claim_for_plugin): New function.
11198 * descriptors.h (Descriptors::claim_for_plugin): New function.
11199 (Open_descriptor::is_claimed): New field.
11200 (claim_descriptor_for_plugin): New function.
11201 * fileread.cc (File_read::claim_for_plugin): New function.
11202 * fileread.h (File_read::claim_for_plugin): New function.
11203 (File_read::descriptor): New function.
11204 * gold.cc: Include "plugin.h".
11205 (queue_initial_tasks): Add task to call plugin hooks for generating
11206 new object files.
11207 * main.cc: Include "plugin.h".
11208 (main): Load plugin libraries.
11209 * object.h (Pluginobj): Declare.
11210 (Object::pluginobj): New function.
11211 (Object::do_pluginobj): New function.
11212 (Object::set_target): New function.
11213 * options.cc: Include "plugin.h".
11214 (General_options::parse_plugin): New function.
11215 (General_options::General_options): Initialize plugins_ field.
11216 (General_options::add_plugin): New function.
11217 * options.h (Plugin_manager): Declare.
11218 (General_options): Add --plugin option.
11219 (General_options::has_plugins): New function.
11220 (General_options::plugins): New function.
11221 (General_options::add_plugin): New function.
11222 (General_options::plugins_): New field.
11223 * plugin.cc: New file.
11224 * plugin.h: New file.
11225 * readsyms.cc: Include "plugin.h".
11226 (Read_symbols::do_read_symbols): Check for archive before checking
11227 for ELF file. Call plugin hooks to claim files.
11228 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11229 from a real object file; force override when processing replacement
11230 files.
11231 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11232 (Symbol::init_base_object): Likewise.
11233 (Symbol::init_base_output_data): Likewise.
11234 (Symbol::init_base_output_segment): Likewise.
11235 (Symbol::init_base_constant): Likewise.
11236 (Symbol::init_base_undefined): Likewise.
11237 (Symbol::output_section): Assert that object is not a plugin.
11238 (Symbol_table::add_from_pluginobj): New function.
11239 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11240 undefined.
11241 (Symbol_table::sized_write_globals): Likewise.
11242 (Symbol_table::add_from_pluginobj): Instantiate template.
11243 * symtab.h (Sized_pluginobj): Declare.
11244 (Symbol::in_real_elf): New function.
11245 (Symbol::set_in_real_elf): New function.
11246 (Symbol::in_real_elf_): New field.
11247 (Symbol_table::add_from_pluginobj): New function.
11248
11249 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11250 (LIBDL): New variable.
11251 (LDADD): Add LIBDL.
11252 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11253 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11254 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11255 (MOSTLYCLEANFILES): Likewise.
11256 * testsuite/Makefile.in: Regenerate.
11257 * testsuite/plugin_test.c: New file.
11258 * testsuite/plugin_test_1.sh: New file.
11259 * testsuite/plugin_test_2.sh: New file.
11260
11261 2008-09-16 Ian Lance Taylor <iant@google.com>
11262
11263 * target-reloc.h (relocate_section): Check whether a symbol is
11264 defined by the ABI before reporting an undefined symbol error.
11265 * target.h (Target::is_defined_by_abi): Make parameter const.
11266 (Target::do_is_defined_by_abi): Likewise.
11267 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11268 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11269 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11270 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11271 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11272 * testsuite/Makefile.in: Rebuild.
11273
11274 * fileread.cc (make_view): Add casts to avoid warning.
11275
11276 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11277
11278 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11279 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11280
11281 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11282
11283 * options.h (General_options::output_is_executable): New.
11284 (General_options::output_is_pie): New.
11285 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11286 for shared libraries.
11287 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11288
11289 2008-09-11 Chris Demetriou <cgd@google.com>
11290
11291 * options.h (origin): New -z option.
11292 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11293 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11294 in DT_FLAGS_1.
11295
11296 2008-09-05 Cary Coutant <ccoutant@google.com>
11297
11298 * fileread.cc (File_read::make_view): Add check for attempt to map
11299 beyond end of file.
11300
11301 2008-09-05 Cary Coutant <ccoutant@google.com>
11302
11303 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11304 explicit instantiations.
11305
11306 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11307
11308 PR gold/6858
11309 * options.cc (General_options::finalize): Allow undefined symbols
11310 in shlibs if linking -shared.
11311
11312 PR gold/6859
11313 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11314 symbols as not needing a dynsym entry.
11315
11316 2008-08-20 Craig Silverstein <csilvers@google.com>
11317
11318 * fileread.cc (File_read::open): Do not lock the file unless it
11319 was successfully opened.
11320
11321 2008-08-14 Cary Coutant <ccoutant@google.com>
11322
11323 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11324 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11325 * testsuite/tls_test.cc (struct int128): 128-bit struct
11326 for testing TLS relocs with non-zero addend.
11327 (v12): New TLS variable.
11328 (t12): New test.
11329 (t_last): Add check for v12.
11330 * testsuite/tls_test.h (t12): New function.
11331 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11332
11333 2008-08-13 Ian Lance Taylor <iant@google.com>
11334
11335 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11336 set tls_segment_ or relro_segment_.
11337 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11338 when appropriate.
11339 * output.h (Output_section::clear_is_relro): New function.
11340 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11341 sections specially even when output_data_ is empty.
11342 (Output_segment::maximum_alignment): When first section is relro,
11343 only force alignment for PT_LOAD segments.
11344 * script.cc (script_data_segment_align): New function.
11345 (script_data_segment_relro_end): New function.
11346 * script-c.h (script_data_segment_align): Declare.
11347 (script_data_segment_relro_end): Declare.
11348 * script-sections.h (class Script_sections): Declare
11349 data_segment_align and data_segment_relro_end. Add fields
11350 segment_align_index_ and saw_relro_end_.
11351 * script-sections.cc (class Sections_element): Add set_is_relro
11352 virtual function. Add new bool* parameter to place_orphan_here.
11353 Add get_output_section virtual function.
11354 (class Output_section_definition): Add set_is_relro. Add new
11355 bool* parameter to place_orphan_here. Add get_output_section.
11356 Add is_relro_ field.
11357 (Output_section_definition::Output_section_definition): Initialize
11358 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11359 and is_relro_ fields.
11360 (Output_section_definition::place_orphan_here): Add is_relro
11361 parameter.
11362 (Output_section_definition::set_section_addresses): Set relro for
11363 output section.
11364 (Output_section_definition::alternate_constraint): Likewise.
11365 (class Orphan_output_section): Add new bool* parameter to
11366 place_orphan_here. Add get_output_section.
11367 (Orphan_output_section::place_orphan_here): Add is_relro
11368 parameter.
11369 (Script_sections::Script_sections): Initialize
11370 data_segment_align_index_ and saw_relro_end_.
11371 (Script_sections::data_segment_align): New function.
11372 (Script_sections::data_segment_relro_end): New function.
11373 (Script_sections::place_orphan): Set or clear is_relro.
11374 (Script_sections::set_section_addresses): Force alignment of first
11375 TLS section.
11376 * yyscript.y (exp): Call script_data_segment_align and
11377 script_data_segment_relro_end.
11378 * testsuite/relro_script_test.t: New file.
11379 * testsuite/relro_test.cc (using_script): Declare.
11380 (t1, t2): Test using_script.
11381 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11382 (relro_script_test_SOURCES): Define.
11383 (relro_script_test_DEPENDENCIES): Define.
11384 (relro_script_test_LDFLAGS): Define.
11385 (relro_script_test_LDADD): Define.
11386 (relro_script_test.so): New target.
11387 * testsuite/Makefile.in: Rebuild.
11388
11389 2008-08-06 Cary Coutant <ccoutant@google.com>
11390
11391 * archive.cc (Archive::total_archives, Archive::total_members)
11392 (Archive::total_members_loaded): New variables.
11393 (Archive::setup): Add parameter. Add option to preread
11394 archive symbols.
11395 (Archive::read_armap): Add counter.
11396 (Archive::get_file_and_offset): New function.
11397 (Archive::get_elf_object_for_member): New function.
11398 (Archive::read_all_symbols): New function.
11399 (Archive::read_symbols): New function.
11400 (Archive::add_symbols): Add counters.
11401 (Archive::include_all_members): Use armap to find members if it's
11402 already built.
11403 (Archive::include_member): Skip reading symbols if already read.
11404 Factored code into Archive::get_file_and_offset and
11405 Archive::get_elf_object_for_member. Changed call to
11406 Mapfile::report_include_archive_member.
11407 (Archive::print_stats): New function.
11408 * archive.h: Declare Object and Read_symbols_data classes.
11409 (Archive::Archive): Add initializers for new members.
11410 (Archive::setup): Add parameter.
11411 (Archive::print_stats): New function.
11412 (Archive::total_archives, Archive::total_members)
11413 (Archive::total_members_loaded): New variables.
11414 (Archive::get_file_and_offset): New function.
11415 (Archive::get_elf_object_for_member): New function.
11416 (Archive::read_all_symbols): New function.
11417 (Archive::read_symbols): New function.
11418 (Archive::Archive_member): New class.
11419 (Archive::members_): New member.
11420 (Archive::num_members_): New member.
11421 * main.cc: Include archive.h.
11422 (main): Call Archive::print_stats.
11423 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11424 archive parameter; member_name is now the fully-decorated name.
11425 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11426 * options.h: (General_options): Add --preread-archive-symbols option.
11427 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11428 Archive::setup.
11429
11430 2008-08-04 Ian Lance Taylor <iant@google.com>
11431
11432 * symtab.h (Symbol::use_plt_offset): New function.
11433 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11434 * powerpc.cc (Relocate::relocate): Likewise.
11435 * sparc.cc (Relocate::relocate): Likewise.
11436 * x86_64.cc (Relocate::relocate): Likewise.
11437 * testsuite/weak_plt.sh: New test.
11438 * testsuite/weak_plt_main.cc: New test.
11439 * testsuite/weak_plt_shared.cc: New test.
11440 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11441 (check_PROGRAMS): Add weak_plt.
11442 (check_DATA): Add weak_plt_shared.so.
11443 (weak_plt_main_pic.o, weak_plt): New targets.
11444 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11445 * testsuite/Makefile.in: Rebuild.
11446
11447 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11448 gcctestdir/ld.
11449 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11450 * testsuite/Makefile.in: Rebuild.
11451
11452 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11453
11454 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11455 * Makefile.in: Regenerate.
11456 * po/POTFILES.in: Regenerate.
11457
11458 2008-07-29 Ian Lance Taylor <iant@google.com>
11459
11460 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11461 symbols before other symbols.
11462 * testsuite/script_test_2.cc (test_addr): Declare.
11463 (test_addr_alias): Declare.
11464 (main): Check that test_addr and test_addr_alias have the right
11465 values.
11466 * testsuite/script_test_2.t: Define test_addr_alias and
11467 test_addr.
11468
11469 2008-07-24 Ian Lance Taylor <iant@google.com>
11470
11471 PR 5990
11472 * descriptors.cc: New file.
11473 * descriptors.h: New file.
11474 * gold-threads.h (class Hold_optional_lock): New class.
11475 * fileread.cc: Include "descriptors.h".
11476 (File_read::~File_read): Release descriptor rather than closing
11477 it.
11478 (File_read::open) [file]: Call open_descriptor rather than open.
11479 Set is_descriptor_opened_.
11480 (File_read::open) [memory]: Assert that descriptor is not open.
11481 (File_read::reopen_descriptor): New function.
11482 (File_read::release): Release descriptor.
11483 (File_read::do_read): Make non-const. Reopen descriptor.
11484 (File_read::read): Make non-const.
11485 (File_read::make_view): Reopen descriptor.
11486 (File_read::do_readv): Likewise.
11487 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11488 Update declarations.
11489 * layout.cc: Include "descriptors.h".
11490 (Layout::create_build_id): Use open_descriptor rather than open.
11491 * output.cc: Include "descriptors.h".
11492 (Output_file::open): Use open_descriptor rather than open.
11493 * archive.cc (Archive::const_iterator): Change Archive to be
11494 non-const.
11495 (Archive::begin, Archive::end): Make non-const.
11496 (Archive::count_members): Likewise.
11497 * archive.h (class Archive): Update declarations.
11498 * object.h (Object::read): Make non-const.
11499 * Makefile.am (CCFILES): Add descriptors.cc.
11500 (HFILES): Add descriptors.h.
11501 * Makefile.in: Rebuild.
11502
11503 PR 6716
11504 * gold.h: Always include <clocale>. Add Solaris workarounds
11505 following code in binutils/sysdep.h.
11506
11507 PR 6048
11508 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11509 this->eh_frame_hdr_ is NULL before using it.
11510
11511 * dynobj.cc (Versions::Versions): Update comment.
11512
11513 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11514 the base version name.
11515
11516 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11517 array size plus one.
11518 (Stringpool_template::set_string_offsets): Subtract one from key
11519 before using it as an array index.
11520 (Stringpool_template::get_offset_with_length): Likewise.
11521 (Stringpool_template::write_to_buffer): Likewise.
11522 * stringpool.h (Stringpool_template::get_offset_from_key):
11523 Likewise.
11524
11525 2008-07-23 Ian Lance Taylor <iant@google.com>
11526
11527 PR 6658
11528 * object.h (Merged_symbol_value::value): Do our best to handle a
11529 negative addend.
11530
11531 PR 6647
11532 * script.cc (Version_script_info::get_versions): Don't add empty
11533 version tag to return value.
11534 (Version_script_info::get_symbol_version_helper): Change return
11535 type to bool. Add pversion parameter. Change all callers.
11536 (script_register_vers_node): Don't require a non-NULL tag.
11537 * script.h (class Version_script_info): Update declarations.
11538 (Version_script_info::get_symbol_version): Change return type to
11539 bool. Add version parameter. Change all callers.
11540 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11541 handling. Handle an empty version from a version script.
11542 (Symbol_table::define_special_symbol): Likewise.
11543 * testsuite/ver_test_10.script: New file.
11544 * testsuite/ver_test_10.sh: New file.
11545 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11546 (check_DATA): Add ver_test_10.syms.
11547 (ver_test_10.syms, ver_test_10.so): New target.
11548 * testsuite/Makefile.in: Rebuild.
11549
11550 2008-07-23 Simon Baldwin <simonb@google.com>
11551
11552 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11553 to zero for undefined symbols from dynamic libraries.
11554
11555 2008-07-23 Ian Lance Taylor <iant@google.com>
11556
11557 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11558 Change all callers.
11559 * symtab.h (class Symbol_table): Update declaration.
11560 * testsuite/ver_test_9.cc: New file.
11561 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11562 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11563 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11564 (ver_test_9.so, ver_test_9.o): New targets.
11565 * testsuite/Makefile.in: Rebuild.
11566
11567 2008-07-22 Ian Lance Taylor <iant@google.com>
11568
11569 * options.h (class General_options): Define --check-sections.
11570 * layout.cc (Layout::set_segment_offsets): Handle
11571 --check-sections.
11572
11573 * options.h (class General_options): Define -n/--nmagic and
11574 -N/--omagic.
11575 * options.cc (General_options::finalize): For -n/--nmagic or
11576 -N/--omagic, set -static.
11577 * layout.cc (Layout::attach_allocated_section_to_segment): If
11578 -N/--omagic, don't put read-only and read-write sections in
11579 different segments.
11580 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11581 finding a read-only segment.
11582 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11583 don't set the minimum segment alignment to the common page size,
11584 and don't set the file offset to the address modulo the page size.
11585 * script-sections.cc (Script_sections::create_segments): If
11586 -n/--omagic, don't put read-only and read-write sections in
11587 different segments.
11588
11589 * cref.cc: New file.
11590 * cref.h: New file.
11591 * options.h (class General_options): Add --print-symbol-counts.
11592 * main.cc (main): Issue defined symbol report if requested.
11593 * archive.cc (Archive::interpret_header): Make into a const member
11594 function.
11595 (Archive::add_symbols): Call Input_objects::archive_start and
11596 archive_stop.
11597 (Archive::const_iterator): Define new class.
11598 (Archive::begin, Archive::end): New functions.
11599 (Archive::include_all_members): Rewrite to use iterator.
11600 (Archive::count_members): New function.
11601 * archive.h (class Archive): Update declarations.
11602 (Archive::filename): New function.
11603 * object.cc: Include "cref.h".
11604 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11605 (Sized_relobj::do_get_global_symbol_counts): New function.
11606 (Input_objects::add_object): Add object to cross-referencer.
11607 (Input_objects::archive_start): New function.
11608 (Input_objects::archive_stop): New function.
11609 (Input_objects::print_symbol_counts): New function.
11610 * object.h: Declare Cref and Archive.
11611 (Object::get_global_symbol_counts): New function.
11612 (Object::do_get_global_symbol_counts): New pure virtual function.
11613 (class Sized_relobj): Add defined_count_ field. Update
11614 declarations.
11615 (class Input_objects): Add cref_ field. Update constructor.
11616 Update declarations.
11617 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11618 defined_count_.
11619 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11620 symbol counts.
11621 (Sized_dynobj::do_get_global_symbol_counts): New function.
11622 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11623 defined_count_. Update declarations. Define Symbols typedef.
11624 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11625 parameter. Change all callers.
11626 (Symbol_table::add_from_dynobj): Add sympointers and defined
11627 parameters. Change all callers.
11628 * symtab.h (class Symbol_table): Update declarations.
11629 * Makefile.am (CCFILES): Add cref.cc.
11630 (HFILES): Add cref.h.
11631 * Makefile.in: Rebuild.
11632
11633 2008-07-22 Simon Baldwin <simonb@google.com>
11634
11635 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11636 to zero when writing undefined symbols.
11637
11638 2008-07-22 Ian Lance Taylor <iant@google.com>
11639
11640 * output.cc (Output_section::add_input_section): Don't try to
11641 merge empty merge sections.
11642
11643 2008-07-21 Craig Silverstein <csilvers@google.com>
11644
11645 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11646 Include symbol version in error message.
11647
11648 2008-07-20 Chris Demetriou <cgd@google.com>
11649
11650 * configure.ac (gold_cv_c_random_seed): New configured variable.
11651 (RANDOM_SEED_CFLAGS): New substituted variable.
11652 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11653 * configure: Rebuild.
11654 * Makefile.in: Likewise.
11655 * testsuite/Makefile.in: Likewise.
11656
11657 2008-07-18 Ian Lance Taylor <iant@google.com>
11658
11659 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11660 where we see NAME/NULL and NAME/VERSION as separate symbols.
11661 * testsuite/ver_test_main.cc (main): Call t4.
11662 (t4, t4_2a): Define.
11663 * testsuite/ver_test_2.cc (t4_2): Define.
11664 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11665 * testsuite/ver_test_4.cc (t4_2a): Define.
11666 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11667 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11668
11669 2008-07-17 Ian Lance Taylor <iant@google.com>
11670
11671 * dynobj.cc (Versions::add_def): If we give an error about a
11672 missing version, go ahead and create the version anyhow.
11673
11674 2008-07-10 Ian Lance Taylor <iant@google.com>
11675
11676 Handle output sections with more than 0x7fffffff bytes.
11677 * object.h (class Relobj): Change map_to_output_ to
11678 output_sections_, and just keep a section pointer. Change all
11679 uses. Move comdat group support to Sized_relobj.
11680 (Relobj::is_section_specially_mapped): Remove.
11681 (Relobj::output_section): Remove poff parameter. Change all
11682 callers.
11683 (Relobj::output_section_offset): New function.
11684 (Relobj::set_section_offset): Rewrite.
11685 (Relobj::map_to_output): Remove.
11686 (Relobj::output_sections): New function.
11687 (Relobj::do_output_section_offset): New pure virtual function.
11688 (Relobj::do_set_section_offset): Likewise.
11689 (class Sized_relobj): Add section_offsets_ field. Add comdat
11690 group support from Relobj. Update declarations.
11691 (Sized_relobj::get_output_section_offset): New function.
11692 (Sized_relobj::do_output_section_offset): New function.
11693 (Sized_relobj::do_set_section_offset): New function.
11694 * object.cc (Relobj::output_section_address): Remove.
11695 (Sized_relobj::Sized_relobj): Initialize new fields.
11696 (Sized_relobj::include_section_group): Cast find_kept_object to
11697 Sized_relobj.
11698 (Sized_relobj::include_linkonce_section): Likewise.
11699 (Sized_relobj::do_layout): Use separate arrays for output section
11700 and output offset.
11701 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11702 output_sections.
11703 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11704 output_sections and section_offsets.
11705 (Sized_relobj::write_local_symbols): Likewise.
11706 (map_to_kept_section): Compute output address directly.
11707 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11708 output_sections and section_offsets.
11709 (Sized_relobj::write_sections): Likewise.
11710 (Sized_relobj::relocate_sections): Likewise.
11711 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11712 * output.h (class Output_reloc): Update declarations. Change
11713 u2_.relobj to Sized_relobj*.
11714 (class Output_data_reloc): Change add functions to use
11715 Sized_relobj*.
11716 * output.cc (Output_reloc::Output_reloc): Change relobj to
11717 Sized_relobj*.
11718 (Output_reloc::local_section_offset): Change return type to
11719 Elf_Addr. Use get_output_section_offset.
11720 (Output_reloc::get_address): Likewise.
11721 (Output_section::is_input_address_mapped): Don't call
11722 is_section_specially_mapped.
11723 (Output_section::output_offset): Likewise.
11724 (Output_section::output_address): Likewise.
11725 (Output_section::starting_output_address): Likewise.
11726 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11727 parameter to Sized_relobj*.
11728 (Copy_relocs::need_copy_reloc): Likewise.
11729 (Copy_relocs::save): Likewise.
11730 * copy-relocs.h (class Copy_relocs): Update declarations.
11731 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11732 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11733 * target-reloc.h (relocate_for_relocatable): Change
11734 offset_in_output_section type to Elf_Addr. Change code that uses
11735 it as well.
11736 * layout.cc (Layout::layout): Always set *off.
11737 * mapfile.cc (Mapfile::print_input_section): Use
11738 output_section_offset.
11739 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11740 Sized_relobj*.
11741 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11742 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11743 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11744
11745 2008-07-03 Ian Lance Taylor <iant@google.com>
11746
11747 * layout.cc (Layout::include_section): Do not discard unrecognized
11748 SHT_STRTAB sections.
11749
11750 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11751
11752 * script.cc (Lex::can_continue_name): Make '?' allowable in
11753 version-script names.
11754 * testsuite/version_script.map: Change glob pattern to use '?'
11755
11756 2008-06-30 Manish Singh <yosh@gimp.org>
11757
11758 PR 6585
11759 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11760 Correct typo.
11761
11762 2008-06-30 Ian Lance Taylor <iant@google.com>
11763
11764 PR 6660
11765 PR 6682
11766 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11767 versions]: Don't try to read the value in the contents, since we
11768 don't use it. Use the template endianness when writing.
11769
11770 2008-06-25 Cary Coutant <ccoutant@google.com>
11771
11772 * fileread.cc (File_read::make_view): Assert on zero-length view.
11773 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11774 symbol table when there are no symbols to read.
11775
11776 2008-06-23 Craig Silverstein <csilvers@google.com>
11777
11778 * version.cc (version_string): Bump to 1.7
11779
11780 2008-06-18 Craig Silverstein <csilvers@google.com>
11781
11782 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11783 constant 0xFFFF to type Valtype.
11784 (Powerpc_relocate_functions::rel16_ha): Likewise.
11785
11786 2008-06-17 Ian Lance Taylor <iant@google.com>
11787
11788 * output.h (Output_section::Input_section): Initialize p2align_ to
11789 zero for Output_section_data constructors.
11790 (Output_section::Input_section::addralign): If not an input
11791 section, return the alignment of the Output_section_data.
11792 * testsuite/copy_test.cc: New file.
11793 * testsuite/copy_test_1.cc: New file.
11794 * testsuite/copy_test_2.cc: New file.
11795 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11796 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11797 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11798 (copy_test_1_pic.o, copy_test_1.so): New targets.
11799 (copy_test_2_pic.o, copy_test_2.so): New targets.
11800 * testsuite/Makefile.in: Rebuild.
11801
11802 * script-sections.cc (Script_sections::place_orphan): Initialize
11803 local variable exact.
11804
11805 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11806
11807 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11808
11809 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11810 David S. Miller <davem@davemloft.net>
11811
11812 * powerpc.cc: New file.
11813 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11814 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11815 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11816 * Makefile.in: Rebuild.
11817
11818 2008-06-09 Ian Lance Taylor <iant@google.com>
11819
11820 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11821 <exception>.
11822 (throwing, orig_terminate): New static variables.
11823 (terminate_handler): New static function.
11824 (t2): Set terminate handler.
11825
11826 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11827
11828 PR 6584
11829 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11830 alignment.
11831
11832 2008-05-30 Cary Coutant <ccoutant@google.com>
11833
11834 * archive.cc (Archive::include_all_members) Correct to step
11835 over symbol table and extended name table in thin archives.
11836
11837 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11838
11839 PR 6407
11840 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11841 calculation.
11842
11843 2008-05-28 Caleb Howe <cshowe@google.com>
11844
11845 * reduced_debug_output.cc: New file.
11846 * reduced_debug_output.h: New file.
11847 * options.h (class General_options): Add --strip-debug-non-line.
11848 * options.cc (General_options::finalize): Add strip_debug_non_line
11849 to the strip heirarchy.
11850 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11851 fields.
11852 * layout.cc: Include "reduced_debug_output.h".
11853 (Layout::Layout): Initialize new fields.
11854 (line_only_debug_sections): New static array.
11855 (is_lines_only_debug_sections): New static inline function.
11856 (Layout::include_section): Handle --strip-debug-non-line.
11857 (Layout::make_output_section): If --strip-debug-non-line, build
11858 new output sections for .debug_abbrev and .debug_info.
11859 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11860 gold. Warn about possible overflow.
11861 (read_signed_LEB_128): Likewise.
11862 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11863 (read_signed_LEB_128): Declare.
11864 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11865 (HFILES): Add reduced_debug_output.h.
11866 * Makefile.in: Rebuild.
11867
11868 2008-05-21 Ian Lance Taylor <iant@google.com>
11869
11870 * mapfile.cc: New file.
11871 * mapfile.h: New file.
11872 * options.h (class General_options): Add -M/--print-map and -Map.
11873 * options.cc (General_options::finalize): Make -M equivalent to
11874 -Map -.
11875 * main.cc: Include <cstdio> and "mapfile.h".
11876 (main): Open mapfile if requested.
11877 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11878 constructor. Change caller.
11879 (queue_initial_tasks): Add mapfile parameter. Change caller.
11880 (queue_middle_tasks): Likewise.
11881 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11882 declarations.
11883 * archive.cc: Include "mapfile.h".
11884 (Archive::add_symbols): Add mapfile parameter. Change all
11885 callers. Pass mapfile, symbol, and reason to include_member.
11886 (Archive::include_all_members): Add mapfile parameter. Change all
11887 callers.
11888 (Archive::include_member): Add mapfile, sym, and why parameters.
11889 Change all callers. Report inclusion to map file.
11890 * archive.h: Include "fileread.h".
11891 (class Archive): Update declarations.
11892 (Archive::file): New const method.
11893 (class Add_archive_symbols): Add mapfile_ field. Update
11894 constructor. Change all callers.
11895 * readsyms.h (class Read_symbols): Likewise.
11896 (class Finish_group): Likewise.
11897 (class Read_script): Likewise.
11898 * common.cc: Include "mapfile.h".
11899 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11900 all callers.
11901 (Symbol_table::do_allocate_commons): Likewise.
11902 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11903 symbol allocation to mapfile.
11904 * common.h (class Allocate_commons_task): Add mapfile_ field.
11905 Update constructor. Change all callers.
11906 * symtab.h (class Symbol_table): Update declarations.
11907 * layout.cc: Include "mapfile.h".
11908 (Layout_task_runner::run): Print information to mapfile.
11909 (Layout::create_gold_note): Change Output_data_fixed_space to
11910 Output_data_zero_fill.
11911 (Layout::create_build_id): Likewise.
11912 (Layout::print_to_mapfile): New function.
11913 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11914 constructor. Change caller.
11915 (class Layout): Declare print_to_mapfile.
11916 * output.cc (Output_section::Input_section::print_to_mapfile): New
11917 function.
11918 (Output_section::add_input_section): If producing a map, always
11919 add to input_sections_ list.
11920 (Output_section::do_print_to_mapfile): New function.
11921 (Output_segment::print_sections_to_mapfile): New function.
11922 (Output_segment::print_section_list_to_mapfile): New function.
11923 * output.h: Include "mapfile.h".
11924 (Output_data::print_to_mapfile): New function.
11925 (Output_data::do_print_to_mapfile): New virtual function.
11926 (Output_segment_headers::do_print_to_mapfile): New function.
11927 (Output_file_header::do_print_to_mapfile): New function.
11928 (Output_data_const::do_print_to_mapfile): New function.
11929 (class Output_data_const_buffer): Add map_name_ field. Update
11930 constructor. Change all callers. Add do_print_to_mapfile
11931 function.
11932 (class Output_data_fixed_space): Likewise.
11933 (class Output_data_space): Likewise.
11934 (class Output_data_zero_fill): New class.
11935 (Output_data_strtab::do_print_to_mapfile): New function.
11936 (Output_data_reloc_base::do_print_to_mapfile): New function.
11937 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11938 (Output_data_group::do_print_to_mapfile): New function.
11939 (Output_data_got::do_print_to_mapfile): New function.
11940 (Output_data_dynamic::do_print_to_mapfile): New function.
11941 (Output_symtab_xindex::do_print_to_mapfile): New function.
11942 (class Output_section): Declare do_print_to_mapflie. Declare
11943 print_to_mapfile in Input_section.
11944 (class Output_segment): Declare new functions.
11945 * object.h (Sized_relobj::symbol_count): New function.
11946 * script-sections.cc
11947 (Output_section_element_dot_assignment::set_section_addresses):
11948 Change Output_data_fixed_space to Output_data_zero_fill.
11949 (Output_data_expression::do_print_to_mapfile): New function.
11950 * script.cc (read_input_script): Add mapfile parameter. Change
11951 all callers.
11952 * script.h (read_input_script): Update declaration.
11953 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11954 (Eh_frame::do_print_to_mapfile): New function.
11955 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11956 (Output_merge_string::do_print_to_mapfile): New function.
11957 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11958 function.
11959 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11960 function.
11961 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11962 function.
11963 * Makefile.am (CCFILES): Add mapfile.cc.
11964 (HFILES): Add mapfile.h.
11965 * Makefile.in: Rebuild.
11966
11967 2008-05-19 Ian Lance Taylor <iant@google.com>
11968
11969 * options.h (class General_options): Add -z relro.
11970 * layout.cc (Layout::Layout): Initialize relro_segment_.
11971 (Layout::add_output_section_data): Return the output section.
11972 (Layout::make_output_section): Rcognize relro sections and mark
11973 them appropriately.
11974 (Layout::attach_allocated_section_to_segment): Put relro sections
11975 in a PT_GNU_RELRO segment.
11976 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11977 section as relro.
11978 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11979 PT_TLS segments.
11980 (Layout::linkonce_mapping): Map d.rel.ro.local to
11981 .data.rel.ro.local.
11982 (Layout::output_section_name): Us .data.rel.ro.local for any
11983 section which begins with that.
11984 * layout.h (class Layout): Update add_output_section_data
11985 declaration. Add relro_segment_ field.
11986 * output.cc (Output_section::Output_section): Initialize is_relro_
11987 and is_relro_local_ fields.
11988 (Output_segment::add_output_section): Group relro sections.
11989 (Output_segment::is_first_section_relro): New function.
11990 (Output_segment::maximum_alignment): If there is a relro section,
11991 align the segment to the common page size.
11992 (Output_segment::set_section_addresses): Track whether we are
11993 looking at relro sections. If the last section is a relro
11994 section, align to the common page size.
11995 (Output_segment::set_section_list_addresses): Add in_relro
11996 parameter. Change all callers. Align to the page size when
11997 moving from relro to non-relro section.
11998 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11999 segment.
12000 * output.h (class Output_section): Add is_relro_ and
12001 is_relro_local_ fields.
12002 (Output_section::is_relro): New function.
12003 (Output_section::set_is_relro): New function.
12004 (Output_section::is_relro_local): New function.
12005 (Output_section::set_is_relro_local): New function.
12006 (class Output_segment): Update declarations.
12007 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12008 * sparc.cc (Target_sparc::got_section): Likewise.
12009 * x86_64.cc (Target_x86_64::got_section): Likewise.
12010 * testsuite/relro_test_main.cc: New file.
12011 * testsuite/relro_test.cc: New file.
12012 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12013 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12014 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12015 (relro_test.so, relro_test_pic.o): New targets.
12016 * testsuite/Makefile.in: Rebuild.
12017
12018 2008-05-16 Ian Lance Taylor <iant@google.com>
12019
12020 * output.cc (Output_segment::add_output_section): Remove front
12021 parameter.
12022 * output.h (class Output_segment): Remove
12023 add_initial_output_section and overloaded add_output_section.
12024 Update declaration of remaining add_output_section.
12025 * layout.cc (Layout::create_interp): Call add_output_section
12026 rather than add_initial_output_section.
12027 (Layout::finish_dynamic_section): Likewise.
12028
12029 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12030 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12031 know the dynamic type.
12032 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12033 field. Initialize it in constructor.
12034 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12035 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12036 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12037 reloc.
12038
12039 * output.cc (Output_reloc::get_address): Change return type to
12040 Elf_Addr.
12041 * output.h (class Output_reloc): Update get_address declaration.
12042 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12043 for section addresses.
12044
12045 2008-05-09 Ian Lance Taylor <iant@google.com>
12046
12047 PR 6493
12048 * gold.cc (gold_nomem): Use return value of write.
12049
12050 2008-05-08 Ian Lance Taylor <iant@google.com>
12051
12052 * symtab.c (Symbol::init_base_output_data): Add version
12053 parameter. Change all callers.
12054 (Symbol::init_base_output_segment): Likewise.
12055 (Symbol::init_base_constant): Likewise.
12056 (Symbol::init_base_undefined): Likewise.
12057 (Sized_symbol::init_output_data): Likewise.
12058 (Sized_symbol::init_output_segment): Likewise.
12059 (Sized_symbol::init_constant): Likewise.
12060 (Sized_symbol::init_undefined): Likewise.
12061 (Symbol_table::do_define_in_output_data): If the new symbol has a
12062 version, mark it as the default.
12063 (Symbol_table::do_define_in_output_segment): Likewise.
12064 (Symbol_table::do_define_as_constant): Likewise.
12065 * symtab.h (class Symbol): Update declarations.
12066 (class Sized_symbol): Likewise.
12067 * resolve.cc (Symbol::override_version): New function.
12068 (Symbol::override_base): Call override_version.
12069 (Symbol::override_base_with_special): Likewise.
12070 * testsuite/ver_script_8.script: New file.
12071 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12072 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12073 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12074 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12075
12076 2008-05-06 Ian Lance Taylor <iant@google.com>
12077
12078 PR 6049
12079 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12080 functions.
12081 (class General_options): Remove existing --undefined, and add
12082 --no-undefined instead. Add new --undefined as synonym for -u.
12083 * archive.cc (Archive::add_symbols): Check whether symbol was
12084 named with -u.
12085 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12086 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12087 all uses. Add IS_UNDEFINED. Update declarations to split
12088 different versions of init_base. Declare init_base_undefined.
12089 (Symbol::is_defined): Handle IS_UNDEFINED.
12090 (Symbol::is_undefined): Likewise.
12091 (Symbol::is_weak_undefined): Call is_undefined.
12092 (Symbol::is_absolute): Handle IS_CONSTANT.
12093 (class Sized_symbol): Update declarations to split different
12094 versions of init. Declare init_undefined.
12095 (class Symbol_table): Declare new functions.
12096 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12097 Change all callers.
12098 (Symbol::init_base_output_data): Likewise.
12099 (Symbol::init_base_output_segment): Likewise.
12100 (Symbol::init_base_constant): Likewise.
12101 (Symbol::init_base_undefined): New function.
12102 (Sized_symbol::init_object): Rename from init. Change all
12103 callers.
12104 (Sized_symbol::init_output_data): Likewise.
12105 (Sized_symbol::init_output_segment): Likewise.
12106 (Sized_symbol::init_constant): Likewise.
12107 (Sized_symbol::init_undefined): New function.
12108 (Symbol_table::add_undefined_symbols_from_command_line): New
12109 function.
12110 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12111 function.
12112 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12113 (Symbol::output_section): Likewise.
12114 (Symbol::set_output_section): Likewise.
12115 (Symbol_table::sized_finalize_symbol): Likewise.
12116 (Symbol_table::sized_write_globals): Likewise.
12117 * resolve.cc (Symbol_table::should_override): Likewise.
12118 (Symbol::override_base_with_special): Likewise.
12119
12120 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12121 symbol, change it to have default visibility.
12122 * testsuite/protected_1.cc: New file.
12123 * testsuite/protected_2.cc: New file.
12124 * testsuite/protected_3.cc: New file.
12125 * testsuite/protected_main_1.cc: New file.
12126 * testsuite/protected_main_2.cc: New file.
12127 * testsuite/protected_main_3.cc: New file.
12128 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12129 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12130 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12131 (protected_1.so): New target.
12132 (protected_1_pic.o, protected_2_pic.o): New targets.
12133 (protected_3_pic.o): New target.
12134 (check_PROGRAMS): Add protected_2.
12135 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12136 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12137 * testsuite/Makefile.in: Rebuild.
12138
12139 * options.h (DEFINE_var): Add set_user_set_##varname__.
12140 (DEFINE_bool_alias): New macro.
12141 (class General_options): Define -Bstatic using DEFINE_bool_alias
12142 rather than DEFINE_special. Add --undefined as an alias for -z
12143 defs.
12144 * options.cc (General_options::parse_Bstatic): Remove.
12145
12146 * options.h (class General_options): Add --fatal-warnings.
12147 * main.cc (main): Implement --fatal-warnings.
12148 * errors.h (Errors::warning_count): New function.
12149
12150 * options.h (class General_options): Add -Bsymbolic-functions.
12151 * symtab.h (Symbol::is_preemptible): Check for
12152 -Bsymbolic-functions.
12153
12154 2008-05-05 Ian Lance Taylor <iant@google.com>
12155
12156 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12157 as noVARNAME rather than no-VARNAME.
12158 (class General_options): Add option -z combreloc.
12159 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12160 get_address.
12161 (Output_reloc::sort_before) [SHT_REL]: New function.
12162 (Output_reloc::sort_before) [SHT_RELA]: New function.
12163 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12164 Sort_relocs_comparison.
12165 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12166 parameter. Change all callers.
12167 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12168 sort_relocs parameter. Change all callers.
12169 * output.cc (Output_reloc::get_address): New function, broken out
12170 of write_rel.
12171 (Output_reloc::write_rel): Call it.
12172 (Output_reloc::compare): New function.
12173 (Output_data_reloc_base::do_write): Optionally sort relocs.
12174
12175 * configure.ac: If targ_extra_obj is set, link it in.
12176 * configure.tgt: Initialize all variables.
12177 (x86_64*): Set targ_extra_obj and targ_extra_size.
12178 * configure: Rebuild.
12179
12180 * object.cc (Sized_relobj::include_section_group): Adjust section
12181 indexes read from group data. Build vector to pass to
12182 layout_group.
12183 * layout.cc (Layout::layout_group): Add flags and shndxes
12184 parameters. Remove contents parameter. Change caller. Update
12185 explicit instantiations.
12186 * layout.h (class Layout): Update layout_group declaration.
12187 * output.cc (Output_data_group::Output_data_group): Add flags and
12188 input_shndxes parameters. Remove contents parameter. Change
12189 caller.
12190 (Output_data_group::do_write): Change input_sections_ to
12191 input_shndxes_.
12192 * output.h (class Output_data_group): Update constructor
12193 declaration. Rename input_sections_ to input_shndxes_.
12194 * testsuite/many_sections_test.cc: Add template.
12195
12196 2008-04-30 Cary Coutant <ccoutant@google.com>
12197
12198 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12199
12200 * layout.cc (Layout::include_section): Refactored check for debug
12201 info section.
12202 (Layout::add_comdat): Add new parameters. Change type
12203 of signature parameter. Add object and shndx to signatures table.
12204 (Layout::find_kept_object): New function.
12205 * layout.h: Include <cstring>.
12206 (Layout::is_debug_info_section): New function.
12207 (Layout::add_comdat): Add new parameters.
12208 (Layout::find_kept_object): New function.
12209 (Layout::Kept_section): New struct.
12210 (Layout::Signatures): Change type of map range.
12211 * object.cc (Relobj::output_section_address): New function.
12212 (Sized_relobj::include_section_group): Add new parameters. Change
12213 calls to Layout::add_comdat. Change to build table of kept comdat
12214 groups and table mapping discarded sections to kept sections.
12215 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12216 (Sized_relobj::do_layout): Change calls to include_section_group and
12217 include_linkonce_section.
12218 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12219 value to zero when section is discarded.
12220 (Sized_relobj::map_to_kept_section): New function.
12221 * object.h (Relobj::output_section_address): New function.
12222 (Relobj::Comdat_group): New type.
12223 (Relobj::find_comdat_group): New function.
12224 (Relobj::Comdat_group_table): New type.
12225 (Relobj::Kept_comdat_section): New type.
12226 (Relobj::Kept_comdat_section_table): New type.
12227 (Relobj::add_comdat_group): New function.
12228 (Relobj::set_kept_comdat_section): New function.
12229 (Relobj::get_kept_comdat_section): New function.
12230 (Relobj::comdat_groups_): New field.
12231 (Relobj::kept_comdat_sections_): New field.
12232 (Symbol_value::input_value): Update comment.
12233 (Sized_relobj::map_to_kept_section) New function.
12234 (Sized_relobj::include_linkonce_section): Add new parameter.
12235 * target-reloc.h (Comdat_behavior): New type.
12236 (get_comdat_behavior): New function.
12237 (relocate_section): Add code to map a discarded section to the
12238 corresponding kept section when applying a relocation.
12239
12240 2008-04-30 Craig Silverstein <csilvers@google.com>
12241
12242 * dwarf_reader.cc (next_generation_count): New static var.
12243 (Addr2line_cache_entry): New struct.
12244 (addr2line_cache): New static var.
12245 (Dwarf_line_info::one_addr2line): Added caching.
12246 (Dwarf_line_info::clear_addr2line_cache): New function.
12247 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12248 cache-size parameter.
12249 (Dwarf_line_info::one_addr2line_cache): New function.
12250 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12251 new cache-size argument to one_addr2line(), and clear cache.
12252
12253 2008-04-28 Cary Coutant <ccoutant@google.com>
12254
12255 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12256 R_386_PC8 relocations.
12257
12258 2008-04-23 Ian Lance Taylor <iant@google.com>
12259
12260 * object.cc (Sized_relobj::include_section_group): Check for
12261 invalid section group.
12262
12263 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12264 header size.
12265
12266 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12267 than read for file header.
12268 * archive.cc (Archive::include_member): Likewise.
12269
12270 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12271
12272 * aclocal.m4: Regenerate.
12273 * configure: Regenerate.
12274
12275 2008-04-19 Ian Lance Taylor <iant@google.com>
12276
12277 * version.cc (version_string): Bump to 1.6.
12278
12279 * testsuite/Makefile.am (many_sections_r_test): New target.
12280 (many_sections_r_test_SOURCES): Remove.
12281 (many_sections_r_test_DEPENDENCIES): Remove.
12282 (many_sections_r_test_LDFLAGS): Remove.
12283 (many_sections_r_test_LDADD): Remove.
12284
12285 * object.cc (Sized_relobj::do_add_symbols): Always pass
12286 local_symbol_count_ to add_from_relobj.
12287
12288 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12289 every thousand variables.
12290 * testsuite/Makefile.in: Rebuild.
12291
12292 * object.cc (Xindex::initialize_symtab_xindex): New function.
12293 (Xindex::read_symtab_xindex): New function.
12294 (Xindex::sym_xindex_to_shndx): New function.
12295 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12296 available.
12297 (Sized_relobj::do_initialize_xindex): New function.
12298 (Sized_relobj::do_read_symbols): Adjust section links.
12299 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12300 parameter. Change all callers.
12301 (Sized_relobj::include_section_group): Adjust section links and
12302 symbol section indexes.
12303 (Sized_relobj::do_layout): Adjust section links.
12304 (Sized_relobj::do_count_local_symbols): Adjust section links and
12305 symbol section indexes.
12306 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12307 ordinary and special symbols.
12308 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12309 dynsym_xindex parameters. Change all callers. Adjust section
12310 links. Use SHN_XINDEX when needed.
12311 (Sized_relobj::get_symbol_location_info): Adjust section links.
12312 Don't get fooled by special symbols.
12313 * object.h (class Xindex): Define.
12314 (class Object): Add xindex_ parameter. Declare virtual functoin
12315 do_initialize_xindex.
12316 (Object::adjust_sym_shndx): New function.
12317 (Object::set_xindex): New protected function.
12318 (class Symbol_value): Add is_ordinary_shndx_ field.
12319 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12320 (Symbol_value::value): Assert ordinary section.
12321 (Symbol_value::initialize_input_to_output_map): Likewise.
12322 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12323 Change all callers.
12324 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12325 all callers.
12326 (class Sized_relobj): Update declarations.
12327 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12328 parameter. Change all callers.
12329 (Sized_relobj::adjust_shndx): New function.
12330 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12331 field.
12332 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12333 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12334 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12335 (Sized_dynobj::read_dynsym_section): Adjust section links.
12336 (Sized_dynobj::read_dynamic): Likewise.
12337 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12338 section links.
12339 (Sized_dynobj::do_initialize_xindex): New function.
12340 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12341 do_initialize_xindex.
12342 (Sized_dynobj::adjust_shndx): New function.
12343 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12344 dynsym_xindex_ fields.
12345 (Layout::finalize): Add a call to set_section_indexes before
12346 creating the symtab sections.
12347 (Layout::set_section_indexes): Don't do anything if the section
12348 already has a section index.
12349 (Layout::create_symtab_sections): Add shnum parameter. Change
12350 caller. Create .symtab_shndx section if needed.
12351 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12352 caller.
12353 (Layout::allocated_output_section_count): New function.
12354 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12355 needed.
12356 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12357 fields. Update declarations.
12358 (Layout::symtab_xindex): New function.
12359 (Layout::dynsym_xindex): New function.
12360 (class Write_symbols_task): Add layout_ field.
12361 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12362 Change caller.
12363 * output.cc (Output_section_headers::Output_section_headers): Add
12364 shstrtab_section parameter. Change all callers.
12365 (Output_section_headers::do_sized_write): Store overflow values
12366 for section count and section string table section index in
12367 section header zero.
12368 (Output_file_header::do_sized_write): Check for overflow of
12369 section count and section string table section index.
12370 (Output_symtab_xindex::do_write): New function.
12371 (Output_symtab_xindex::endian_do_write): New function.
12372 * output.h (class Output_section_headers): Add shstrtab_section_.
12373 Update declarations.
12374 (class Output_symtab_xindex): Define.
12375 (Output_section::has_out_shndx): New function.
12376 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12377 field.
12378 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12379 Change all callers.
12380 (Sized_symbol::init): Likewise.
12381 (Symbol::output_section): Check for ordinary symbol.
12382 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12383 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12384 callers.
12385 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12386 Change all callers. Simplify handling of symbols from sections
12387 not included in the link.
12388 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12389 distinction.
12390 (Weak_alias_sorter::operator()): Assert that symbols are
12391 ordinary.
12392 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12393 distinction.
12394 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12395 parameters. Change all callers.
12396 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12397 symbol distinction. Use SHN_XINDEX when needed.
12398 (Symbol_table::write_section_symbol): Add symtab_xindex
12399 parameter. Change all callers.
12400 (Symbol_table::sized_write_section_symbol): Likewise. Use
12401 SHN_XINDEX when needed.
12402 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12403 declarations.
12404 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12405 (Symbol::is_defined): Check is_ordinary.
12406 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12407 (Symbol::is_absolute, Symbol::is_common): Likewise.
12408 (class Sized_symbol): Update declarations.
12409 (class Symbol_table): Update declarations.
12410 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12411 parameters. Change all callers.
12412 (Sized_symbol::override): Likewise.
12413 (Symbol_table::override): Likewise.
12414 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12415 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12416 is_ordinary, and orig_st_shndx parameters. Change all callers.
12417 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12418 to be in an ordinary section.
12419 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12420 object and is_ordinary parameters. Change all callers.
12421 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12422 Change all callers. Don't add undefined or non-ordinary symbols
12423 to reloc_map_.
12424 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12425 Change all callers.
12426 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12427 declarations.
12428 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12429 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12430 (Sized_relobj::relocate_sections): Likewise.
12431 * target-reloc.h (scan_relocs): Adjust section symbol index.
12432 (scan_relocatable_relocs): Likewise.
12433 * i386.cc (Scan::local): Check for ordinary symbols.
12434 * sparc.cc (Scan::local): Likewise.
12435 * x86_64.cc (Scan::local): Likewise.
12436 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12437 to symbol_section_and_value.
12438 * testsuite/many_sections_test.cc: New file.
12439 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12440 (check_PROGRAMS): Add many_sections_test.
12441 (many_sections_test_SOURCES): Define.
12442 (many_sections_test_DEPENDENCIES): Define.
12443 (many_sections_test_LDFLAGS): Define.
12444 (BUILT_SOURCES): Add many_sections_define.h.
12445 (many_sections_define.h): New target.
12446 (BUILT_SOURCES): Add many_sections_check.h.
12447 (many_sections_check.h): New target.
12448 (check_PROGRAMS): Add many_sections_r_test.
12449 (many_sections_r_test_SOURCES): Define.
12450 (many_sections_r_test_DEPENDENCIES): Define.
12451 (many_sections_r_test_LDFLAGS): Define.
12452 (many_sections_r_test_LDADD): Define.
12453 (many_sections_r_test.o): New target.
12454 * testsuite/Makefile.in: Rebuild.
12455
12456 2008-04-17 Cary Coutant <ccoutant@google.com>
12457
12458 * errors.cc (Errors::info): New function.
12459 (gold_info): New function.
12460 * errors.h (Errors::info): New function.
12461 * gold.h (gold_info): New function.
12462 * object.cc (Input_objects::add_object): Print trace output.
12463 * options.cc (options::parse_set): New function.
12464 (General_options::parse_wrap): Deleted.
12465 (General_options::General_options): Deleted initializer.
12466 * options.h (options::String_set): New typedef.
12467 (options::parse_set): New function.
12468 (DEFINE_set): New macro.
12469 (General_options::wrap): Changed to use DEFINE_set. Changed
12470 callers of any_wrap_symbols and is_wrap_symbol.
12471 (General_options::trace, General_options::trace_symbol):
12472 New options.
12473 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12474 (General_options::wrap_symbols_): Deleted.
12475 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12476
12477 2008-04-17 David S. Miller <davem@davemloft.net>
12478
12479 * options.cc (General_options::parse_V): New function.
12480 * options.h: Add entries for -V and -Qy.
12481
12482 2008-04-17 Ian Lance Taylor <iant@google.com>
12483
12484 * common.cc (Symbol_table::allocate_commons): Remove options
12485 parameter. Change caller.
12486 (Symbol_table::do_allocate_commons): Remove options parameter.
12487 Change caller. Just call do_allocate_commons_list twice.
12488 (Symbol_table::do_allocate_commons_list): New function, broken out
12489 of do_allocate_commons.
12490 * common.h (class Allocate_commons_task): Remove options_ field.
12491 Update constructor.
12492 * symtab.cc (Symbol_table::Symbol_table): Initialize
12493 tls_commons_.
12494 (Symbol_table::add_from_object): Put TLS common symbols on
12495 tls_commons_ list.
12496 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12497 which are IN_OUTPUT_DATA.
12498 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12499 allocate_commons and do_allocate_commons declarations. Declare
12500 do_allocate_commons_list.
12501 * gold.cc (queue_middle_tasks): Update creation of
12502 Allocate_commons_task to not pass options.
12503 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12504 (TLS_TEST_C_FLAGS): New variable.
12505 (tls_test_c_pic.o): New target.
12506 (tls_test_shared.so): Link in tls_test_c_pic.o.
12507 (tls_test_c_pic_ie.o): New target.
12508 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12509 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12510 (tls_test_c.o): New target.
12511 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12512 (tls_pic_test_LDADD): Likewise.
12513 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12514 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12515 (tls_test_c_gnu2.o): New target.
12516 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12517 tls_test_c_gnu2.o.
12518 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12519 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12520 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12521 * testsuite/tls_test.cc: Include "config.h".
12522 (t_last): Call t11_last.
12523 * testsuite/tls_test.h (t11, t11_last): Declare.
12524 * testsuite/tls_test_c.c: New file.
12525 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12526 * configure.ac: Check for OpenMP support.
12527 * configure, config.in, Makefile.in: Rebuild.
12528 * testsuite/Makefile.in: Rebuild.
12529
12530 2008-04-16 Cary Coutant <ccoutant@google.com>
12531
12532 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12533 (Target_i386::tls_base_symbol_defined_): New field.
12534 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12535 (Target_i386::Scan::global): Likewise.
12536 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12537 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12538 (Target_x86_64::tls_base_symbol_defined_): New field.
12539 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12540 (Target_x86_64::Scan::global): Likewise.
12541
12542 2008-04-16 Cary Coutant <ccoutant@google.com>
12543
12544 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12545 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12546 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12547 building shared libraries.
12548 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12549 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12550 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12551 * testsuite/Makefile.in: Rebuild.
12552 * testsuite/weak_undef.h: New file.
12553 * testsuite/weak_undef_file1.cc: Add extra test cases.
12554 * testsuite/weak_undef_file2.cc: Likewise.
12555 * testsuite/weak_undef_test.cc: Likewise.
12556
12557 2008-04-16 David S. Miller <davem@davemloft.net>
12558
12559 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12560 Add issued_non_pic_error_ field. Declare check_non_pic.
12561 (Target_sparc::Scan::check_non_pic): New function.
12562 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12563 (Target_sparc::Scan::global): Likewise.
12564
12565 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12566 * configure: Rebuild.
12567
12568 * options.h (DEFINE_enable): New macro.
12569 (new_dtags): New enable option.
12570 (initfirst, interpose, loadfltr, nodefaultlib,
12571 nodelete, nodlopen, nodump): New -z options.
12572 * layout.cc (Layout:finish_dynamic_section): If new
12573 dtags enabled, emit DT_RUNPATH. Also, emit a
12574 DT_FLAGS_1 containing any specified -z flags.
12575
12576 2008-04-16 Ian Lance Taylor <iant@google.com>
12577
12578 * copy-relocs.cc: New file.
12579 * copy-relocs.h: New file.
12580 * reloc.cc: Remove Copy_relocs code.
12581 * reloc.h: Likewise.
12582 * reloc-types.h (struct Reloc_types) [both versions]: Add
12583 get_reloc_addend_noerror.
12584 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12585 variants of add_global which take an addend which must be zero.
12586 * i386.cc: Include "copy-relocs.h".
12587 (class Target_i386): Change type of copy_relocs_ to variable,
12588 update initializer.
12589 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12590 Change all callers.
12591 (Target_i386::do_finalize_sections): Change handling of
12592 copy_relocs_.
12593 * sparc.cc: Include "copy-relocs.h".
12594 (class Target_sparc): Change type of copy_relocs_ to variable,
12595 update initializer.
12596 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12597 Change all callers.
12598 (Target_sparc::do_finalize_sections): Change handling of
12599 copy_relocs_.
12600 * x86_64.cc: Include "copy-relocs.h".
12601 (class Target_x86_64): Change type of copy_relocs_ to variable,
12602 update initializer.
12603 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12604 class. Change all callers.
12605 (Target_x86_64::do_finalize_sections): Change handling of
12606 copy_relocs_.
12607 * Makefile.am (CCFILES): Add copy-relocs.cc.
12608 (HFILES): Add copy-relocs.h.
12609
12610 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12611
12612 * testsuite/script_test_4.sh: Permit leading zeroes.
12613
12614 2008-04-15 Ian Lance Taylor <iant@google.com>
12615
12616 * script-sections.cc (Script_sections::create_segments): Use
12617 header_size_adjustment even when there is enough room for the
12618 headers.
12619 * testsuite/script_test_4.sh: New file.
12620 * testsuite/script_test_4.t: New file.
12621 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12622 (check_DATA): Add script_test_4.stdout.
12623 (MOSTLYCLEANFILES): Likewise.
12624 (script_test_4): New target.
12625 (script_test_4.stdout): New target.
12626 * testsuite/Makefile.in: Rebuild.
12627
12628 * sparc.cc: Add definitions for Output_data_plt_sparc class
12629 constants.
12630
12631 2008-04-14 David S. Miller <davem@davemloft.net>
12632
12633 * sparc.cc: New file.
12634 * Makefile.am (TARGETSOURCES): Add sparc.cc
12635 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12636 * configure.tgt: Document targ_extra_size and
12637 targ_extra_big_endian. Add entries for sparc-* and
12638 sparc64-*.
12639 * configure.ac: Handle targ_extra_size and
12640 targ_extra_big_endian.
12641 * Makefile.in: Rebuild.
12642 * configure: Likewise.
12643 * po/POTFILES.in: Likewise.
12644 * po/gold.pot: Likewise.
12645
12646 2008-04-14 Ian Lance Taylor <iant@google.com>
12647
12648 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12649 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12650 in the name/type/flags to section mapping. Don't call
12651 allocate_output_section.
12652 (Layout::choose_output_section): Change parameter from adjust_name
12653 to is_input_section. Don't permit input sections after sections
12654 are attached to segments. Don't call allocate_output_section.
12655 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12656 not write_enable_output_section.
12657 (Layout::make_output_section): Don't push to
12658 unattached_section_list_ nor call attach_to_segment. Call
12659 attach_section_to_segment if sections are attached.
12660 (Layout::attach_sections_to_segments): New function.
12661 (Layout::attach_section_to_segment): New function.
12662 (Layout::attach_allocated_section_to_segment): Rename from
12663 attach_to_segment. Remove flags parameter.
12664 (Layout::allocate_output_section): Remove function.
12665 (Layout::write_enable_output_section): Remove function.
12666 * layout.h (class Layout): Update for above changes. Add new
12667 field sections_are_attached_.
12668 * output.h (Output_section::update_flags_for_input_section): New
12669 function.
12670 * output.cc (Output_section::add_input_section): Call
12671 update_flags_for_input_section.
12672 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12673
12674 2008-04-11 Cary Coutant <ccoutant@google.com>
12675
12676 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12677 thought unnecessary.
12678 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12679
12680 2008-04-11 Ian Lance Taylor <iant@google.com>
12681
12682 * output.h (class Output_section_data): Remove inline definition
12683 of set_addralign.
12684 * output.cc (Output_section_data::set_addralign): New function.
12685
12686 2008-04-11 Cary Coutant <ccoutant@google.com>
12687
12688 Add support for TLS descriptors for i386 and x86_64.
12689 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12690 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12691 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12692 GOT_TYPE_TLS_DESC.
12693 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12694 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12695 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12696 relocations.
12697 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12698 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12699 Fix problem with initial-exec relocations.
12700 (Target_i386::Relocate::relocate_tls): Likewise.
12701 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12702 relaxation.
12703 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12704 support for section-plus-offset dynamic table entries.
12705 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12706 (Output_data_dynamic::Dynamic_entry): Add support for
12707 section-plus-offset dynamic table entries.
12708 (Output_data_dynamic::Classification): Likewise.
12709 (Output_data_dynamic::classification_): Renamed offset_.
12710 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12711 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12712 (Target_x86_64::make_plt_section): New function.
12713 (Target_x86_64::reserve_tlsdesc_entries): New function.
12714 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12715 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12716 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12717 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12718 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12719 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12720 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12721 add extra PLT entry for TLS descriptors.
12722 (Output_data_plt_x86_64::got_): New field.
12723 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12724 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12725 fields.
12726 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12727 descriptors.
12728 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12729 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12730 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12731 R_386_TLS_DESC_CALL relocations.
12732 (Target_x86_64::Scan::global): Likewise.
12733 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12734 for TLS descriptors.
12735 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12736 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12737 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12738 GD-to-IE relaxation.
12739 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12740 and TLS_DESCRIPTORS.
12741 * Makefile.in: Rebuild.
12742 * configure: Rebuild.
12743 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12744 (tls_test_shared2.so): New target.
12745 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12746 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12747 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12748 (tls_shared_gd_to_ie_test_LDADD): New variable.
12749 (tls_shared_gnu2_gd_to_ie_test): New target.
12750 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12751 New targets.
12752 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12753 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12754 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12755 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12756 (tls_shared_gnu2_test): New target.
12757 (tls_test_gnu2_shared.so): New target.
12758 (tls_shared_gnu2_test_SOURCES): New variable.
12759 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12760 (tls_shared_gnu2_test_LDFLAGS): New variable.
12761 (tls_shared_gnu2_test_LDADD): New variable.
12762 * testsuite/Makefile.in: Rebuild.
12763 * testsuite/Makefile.
12764
12765 2008-04-11 Ian Lance Taylor <iant@google.com>
12766
12767 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12768 justsyms.t.
12769 * testsuite/Makefile.in: Rebuild.
12770
12771 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12772 long.
12773 * testsuite/script_test_2.cc (main): Adjust test.
12774
12775 2008-04-11 David S. Miller <davem@davemloft.net>
12776 Ian Lance Taylor <iant@google.com>
12777
12778 * options.h (General_options): Add entries for '-Y' and
12779 '-relax'.
12780 * options.cc (General_options:finalize): If -Y was used, add those
12781 entries to the library path instead of the default "/lib" and
12782 "/usr/lib".
12783
12784 2008-04-11 David S. Miller <davem@davemloft.net>
12785
12786 * testsuite/justsyms.t: Start at 0x100.
12787 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12788 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12789 long.
12790 * testsuite/script_test_2.cc: Adjust string and section length
12791 checks.
12792
12793 2008-04-09 Ian Lance Taylor <iant@google.com>
12794
12795 PR gold/5996
12796 * script-sections.cc (Sections_element::allocate_to_segment): Add
12797 orphan parameter.
12798 (Output_section_definition::allocate_to_segment): Likewise.
12799 (Orphan_output_section::allocate_to_segment): Likewise.
12800 (Script_sections::attach_sections_using_phdrs_clause): Don't
12801 propagate non-PT_LOAD segments to orphan sections.
12802 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12803 readelf rather than objdump.
12804 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12805 .interp section and PT_INTERP segment are the same size.
12806 * testsuite/Makefile.in: Rebuild.
12807
12808 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12809 aliases for symbols defined in the same object.
12810 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12811 (weak_alias_test_SOURCES): New variable.
12812 (weak_alias_test_DEPENDENCIES): New variable.
12813 (weak_alias_test_LDFLAGS): New variable.
12814 (weak_alias_test_LDADD): New variable.
12815 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12816 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12817 (weak_alias_test_3.o): New target.
12818 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12819 * testsuite/weak_alias_test_main.cc: New file.
12820 * testsuite/weak_alias_test_1.cc: New file.
12821 * testsuite/weak_alias_test_2.cc: New file.
12822 * testsuite/weak_alias_test_3.cc: New file.
12823
12824 2008-04-08 Ian Lance Taylor <iant@google.com>
12825
12826 * options.h (class General_options): Add --noinhibit-exec option.
12827 * main.cc (main): Check --noinhibit-exec.
12828
12829 * options.h (class General_options): Define --wrap as a special
12830 option. Add wrap_symbols_ field.
12831 (General_options::any_wrap_symbols): New function.
12832 (General_options::is_wrap_symbol): New function.
12833 * options.cc (General_options::parse_wrap): New function.
12834 (General_options::General_options): Initialize wrap_symbols_.
12835 * symtab.cc (Symbol_table::wrap_symbol): New function.
12836 (Symbol_table::add_from_object): Handle --wrap.
12837 * symtab.h (class Symbol_table): Declare wrap_symbol.
12838 * target.h (Target::wrap_char): New function.
12839 (Target::Target_info): Add wrap_char field.
12840 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12841 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12842 * testsuite/testfile.cc (Target_test::test_target_info):
12843 Likewise.
12844
12845 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12846 there is one.
12847
12848 * layout.h (class Layout): Add added_eh_frame_data_ field.
12849 * layout.cc (Layout::Layout): Initialize new field.
12850 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12851 output section until we find a section we merged successfully.
12852 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12853 that the size be non-zero.
12854
12855 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12856 qualifier.
12857
12858 2008-04-08 Craig Silverstein <csilvers@google.com>
12859
12860 * configure.ac: Export new conditional variable HAVE_ZLIB.
12861 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12862 on HAVE_ZLIB.
12863 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12864 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12865
12866 2008-04-07 Ian Lance Taylor <iant@google.com>
12867
12868 * version.cc (version_string): Set to "1.5".
12869
12870 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12871 Add issued_non_pic_error_ field. Declare check_non_pic.
12872 (Target_x86_64::Scan::check_non_pic): New function.
12873 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12874 (Target_x86_64::Scan::global): Likewise.
12875
12876 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12877 addend parameter. Change caller. Handle merge sections.
12878 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12879 Address to Addend. Don't add in the result of
12880 local_section_offset, pass down the addend and use the returned
12881 value.
12882 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12883 Update declarations of local_section_offset and symbol_value.
12884 * testsuite/two_file_test_1.cc (t18): New function.
12885 * testsuite/two_file_test_2.cc (f18): New function.
12886 * testsuite/two_file_test_main.cc (main): Call t18.
12887 * testsuite/two_file_test.h (t18, f18): Declare.
12888
12889 * configure.ac: Don't test for objdump, c++filt, or readelf.
12890 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12891 conditionals.
12892 (TEST_READELF): New variable.
12893 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12894 (check_PROGRAMS): Add two_file_strip_test.
12895 (two_file_strip_test): New target.
12896 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12897 (two_file_same_shared_strip_test_SOURCES): New variable.
12898 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12899 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12900 (two_file_same_shared_strip_test_LDADD): New variable.
12901 (two_file_shared_strip.so): New target.
12902 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12903 (ver_test_5.syms, ver_test_7.syms): Likewise.
12904 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12905 (strip_test_3.stdout): Use TEST_OBJDUMP.
12906 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12907
12908 2008-04-04 Cary Coutant <ccoutant@google.com>
12909
12910 * symtab.h (Symbol::is_weak_undefined): New function.
12911 (Symbol::is_strong_undefined): New function.
12912 (Symbol::is_absolute): New function.
12913 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12914 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12915 absolute symbols.
12916 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12917 (weak_undef_test): New target.
12918 * testsuite/Makefile.in: Rebuild.
12919 * testsuite/weak_undef_file1.cc: New file.
12920 * testsuite/weak_undef_file2.cc: New file.
12921 * testsuite/weak_undef_test.cc: New file.
12922
12923 2008-04-03 Craig Silverstein <csilvers@google.com>
12924
12925 * compressed_output.h (class Output_compressed_section): Use
12926 unsigned buffer.
12927 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12928 add zlib header.
12929 (zlib_compressed_suffix): Removed.
12930 (Output_compressed_section::set_final_data_size): Use unsigned
12931 buffers.
12932 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12933 Fix linker invocation.
12934 (flagstest_o_specialfile_and_compress_debug_sections):
12935 Likewise.
12936 * testsuite/Makefile.in: Regenerated.
12937
12938 2008-04-02 David S. Miller <davem@davemloft.net>
12939
12940 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12941 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12942
12943 2008-04-02 Craig Silverstein <csilvers@google.com>
12944
12945 * TODO: New file.
12946
12947 2008-04-02 Ian Lance Taylor <iant@google.com>
12948
12949 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12950 parameters. Update for new key type to views_. Change all
12951 callers.
12952 (File_read::read): Adjust for byteshift in returned view.
12953 (File_read::add_view): New function, broken out of
12954 find_and_make_view.
12955 (File_read::make_view): New function, broken out of
12956 find_and_make_view.
12957 (File_read::find_or_make_view): Add offset and aligned
12958 parameters. Rewrite accordingly. Change all callers.
12959 (File_read::get_view): Add offset and aligned parameters. Adjust
12960 for byteshift in return value.
12961 (File_read::get_lasting_view): Likewise.
12962 * fileread.h (class File_read): Update declarations.
12963 (class File_read::View): Add byteshift_ field. Add byteshift to
12964 constructor. Add byteshift method.
12965 * archive.h (Archive::clear_uncached_views): New function.
12966 (Archive::get_view): Add aligned parameter. Change all callers.
12967 * object.h (Object::get_view): Add aligned parameter. Change all
12968 callers.
12969 (Object::get_lasting_view): Likewise.
12970
12971 * fileread.cc (File_read::release): Don't call clear_views if
12972 there are multiple objects.
12973 * fileread.h (File_read::clear_uncached_views): New function.
12974 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12975 on the archive.
12976
12977 2008-03-31 Cary Coutant <ccoutant@google.com>
12978
12979 Add thin archive support.
12980 * archive.cc (Archive::armagt): New const.
12981 (Archive::setup): Remove task parameter and calls to unlock.
12982 (Archive::unlock_nested_archives): New function.
12983 (Archive::read_header): Add nested_off parameter. Change
12984 all callers.
12985 (Archive::interpret_header): Likewise.
12986 (Archive::include_all_members): Change to handle thin
12987 archives.
12988 (Archive::include_member): Likewise.
12989 * archive.h (Archive::Archive): Add new parameters and
12990 initializers.
12991 (Archive::armagt): New const.
12992 (Archive::setup): Remove task parameter.
12993 (Archive::unlock_nested_archives): New function.
12994 (Archive::read_header): Add nested_off parameter.
12995 (Archive::interpret_header): Likewise.
12996 (Archive::Nested_archive_table): New typedef.
12997 (Archive::is_thin_archive_): New field.
12998 (Archive::nested_archives_): New field.
12999 (Archive::options_): New field.
13000 (Archive::dirpath_): New field.
13001 (Archive::task_): New field.
13002 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13003 for thin archives. Pass additional parameters to
13004 Archive::Archive. Unlock the archive file after calling
13005 Archive::setup.
13006
13007 2008-03-29 Ian Lance Taylor <iant@google.com>
13008
13009 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13010 version symbol to be local.
13011 * testsuite/ver_test_4.sh: New file.
13012 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13013 (check_DATA): Add ver_test_4.syms.
13014 (ver_test_4.syms): New target.
13015 * testsuite/Makefile.in: Rebuild.
13016
13017 * output.cc
13018 (Output_section::Input_section_sort_entry::has_priority): New
13019 function.
13020 (Output_section::Input_section_sort_entry::match_file_name): New
13021 function.
13022 (Output_section::Input_section_sort_entry::match_section_name):
13023 Remove.
13024 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13025 Remove.
13026 (Output_section::Input_section_sort_entry::match_section_file):
13027 Remove.
13028 (Output_section::Input_section_sort_compare::operator()): Rewrite
13029 using new Input_section_sort_entry functions. Sort crtbegin and
13030 crtend first. Sort sections with no priority before sections with
13031 a priority.
13032 * testsuite/initpri1.c (d3): Check j != 4.
13033 (cd5): New constructor/destructor function.
13034 (main): Check j != 2.
13035
13036 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13037 new symbol when resolving, don't call set_is_default.
13038 * testsuite/ver_test_7.cc: New file.
13039 * testsuite/ver_test_7.sh: New file.
13040 * testsuite/Makefile.am (ver_test_7.so): New target.
13041 (ver_test_7.o): New target.
13042 (check_SCRIPTS): Add ver_test_7.sh.
13043 (check_DATA): Add ver_test_7.syms.
13044 (ver_test_7.syms): New target.
13045
13046 2008-03-28 Ian Lance Taylor <iant@google.com>
13047
13048 * layout.cc (Layout::layout): If we see an input section with a
13049 name that needs sorting, set the must_sort flag for the output
13050 section.
13051 (Layout::make_output_section): If the name of the output section
13052 indicates that it might require sorting, set the may_sort flag.
13053 * output.h (Output_section::may_sort_attached_input_sections): New
13054 function.
13055 (Output_section::set_may_sort_attached_input_sections): New
13056 function.
13057 (Output_section::must_sort_attached_input_sections): New
13058 function.
13059 (Output_section::set_must_sort_attached_input_sections): New
13060 function.
13061 (class Output_section): Declare Input_section_sort_entry. Define
13062 Input_section_sort_compare. Declare
13063 sort_attached_input_sections. Add new fields:
13064 may_sort_attached_input_sections_,
13065 must_sort_attached_input_sections_,
13066 attached_input_sections_are_sorted_.
13067 * output.cc (Output_section::Output_section): Initialize new
13068 fields.
13069 (Output_section::add_input_section): Add an entry to
13070 input_sections_ if may_sort or must_sort are true.
13071 (Output_section::set_final_data_size): Call
13072 sort_attached_input_sections if necessary.
13073 (Output_section::Input_section_sort_entry): Define new class.
13074 (Output_section::Input_section_sort_compare::operator()): New
13075 function.
13076 (Output_section::sort_attached_input_sections): New function.
13077 * configure.ac: Check whether the compiler supports constructor
13078 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13079 * testsuite/initpri1.c: New file.
13080 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13081 CONSTRUCTOR_PRIORITY.
13082 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13083 (initpri1_LDFLAGS): New variable.
13084 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13085
13086 2008-03-27 Ian Lance Taylor <iant@google.com>
13087
13088 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13089 * testsuite/common_test_1.c: New file.
13090 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13091 (common_test_1_SOURCES): New variable.
13092 (common_test_1_DEPENDENCIES): New variable.
13093 (common_test_1_LDFLAGS): New variable.
13094
13095 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13096 and commons_ correctly when NAME/VERSION does not override
13097 NAME/NULL.
13098 * testsuite/ver_test_6.c: New file.
13099 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13100 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13101 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13102
13103 2008-03-26 Ian Lance Taylor <iant@google.com>
13104
13105 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13106 of an undefined symbol from a version script.
13107 * testsuite/Makefile.am (ver_test_5.so): New target.
13108 (ver_test_5.o): New target.
13109 (check_SCRIPTS): Add ver_test_5.sh.
13110 (check_DATA): Add ver_test_5.syms.
13111 (ver_test_5.syms): New target.
13112 * testsuite/ver_test_5.cc: New file.
13113 * testsuite/ver_test_5.script: New file.
13114 * testsuite/ver_test_5.sh: New file.
13115 * Makefile.in, testsuite/Makefile.in: Rebuild.
13116
13117 PR gold/5986
13118 Fix problems building gold with gcc 4.3.0.
13119 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13120 (gold_error_at_location, gold_warning_at_location): Use it.
13121 * configure.ac: Check whether we can compile and use a template
13122 function with a printf attribute.
13123 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13124 when jumping over bytes.
13125 * object.cc: Instantiate Object::read_section_data.
13126 * debug.h: Include <cstring>
13127 * dwarf_reader.cc: Include <algorithm>
13128 * main.cc: Include <cstring>.
13129 * options.cc: Include <cstring>.
13130 * output.cc: Include <cstring>.
13131 * script.cc: Include <cstring>.
13132 * script.h: Include <string>.
13133 * symtab.cc: Include <cstring> and <algorithm>.
13134 * target-select.cc: Include <cstring>.
13135 * version.cc: Include <string>.
13136 * testsuite/testmain.cc: Include <cstdlib>.
13137 * configure, config.in: Rebuild.
13138
13139 2008-03-25 Ian Lance Taylor <iant@google.com>
13140
13141 * options.cc: Include "../bfd/bfdver.h".
13142 (options::help): Print bug reporting address.
13143
13144 * version.cc (print_version): Adjust output for current value of
13145 BFD_VERSION_STRING.
13146
13147 * NEWS: New file.
13148
13149 * options.cc (options::help): Print list of supported targets.
13150 * target-select.h: Include <vector>.
13151 (class Target_selector): Make machine_, size_, and is_big_endian_
13152 fields const. Add bfd_name_ and instantiated_target_ fields.
13153 (Target_selector::Target_selector): Add bfd_name parameter.
13154 (Target_selector::recognize): Make non-virtual, call
13155 do_recognize.
13156 (Target_selector::recognize_by_name): Make non-virtual, call
13157 do_recognize_by_name.
13158 (Target_selector::supported_names): New function.
13159 (Target_selector::bfd_name): New function.
13160 (Target_selector::do_instantiate_target): New pure virtual
13161 function.
13162 (Target_selector::do_recognize): New virtual function.
13163 (Target_selector::do_recognize_by_name): New virtual function.
13164 (Target_selector::instantiate_target): New private function.
13165 (supported_target_names): Declare.
13166 * target-select.cc (Target_selector::Target_selector): Update for
13167 new parameter and fields.
13168 (select_target_by_name): Check that the name matches before
13169 calling recognize_by_name.
13170 (supported_target_names): New function.
13171 * i386.cc (class Target_selector_i386): Update Target_selector
13172 constructor call. Remove recognize and recognize_by_name. Add
13173 do_instantiate_target.
13174 * x86_64.cc (class Target_selector_x86_64): Likewise.
13175 * testsuite/testfile.cc (class Target_selector_test): Update for
13176 changes to Target_selector.
13177
13178 * README: Rewrite, with some notes on unsupported features.
13179
13180 2008-03-24 Cary Coutant <ccoutant@google.com>
13181
13182 * i386.cc (Target_i386::Got_type): New enum declaration.
13183 (Target_i386::Scan::local): Updated callers of Output_data_got
13184 member functions.
13185 (Target_i386::Scan::global): Likewise.
13186 (Target_i386::Relocate::relocate): Likewise.
13187 (Target_i386::Relocate::relocate_tls): Likewise.
13188 * object.h (Got_offset_list): New class.
13189 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13190 (Sized_relobj::local_got_offset): Likewise.
13191 (Sized_relobj::set_local_got_offset): Likewise.
13192 (Sized_relobj::local_has_tls_got_offset): Removed.
13193 (Sized_relobj::local_tls_got_offset): Removed.
13194 (Sized_relobj::set_local_tls_got_offset): Removed.
13195 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13196 * output.cc (Output_data_got::add_global): Added got_type parameter.
13197 (Output_data_got::add_global_with_rel): Likewise.
13198 (Output_data_got::add_global_with_rela): Likewise.
13199 (Output_data_got::add_global_pair_with_rel): New function.
13200 (Output_data_got::add_global_pair_with_rela): New function.
13201 (Output_data_got::add_local): Added got_type parameter.
13202 (Output_data_got::add_local_with_rel): Likewise.
13203 (Output_data_got::add_local_with_rela): Likewise.
13204 (Output_data_got::add_local_pair_with_rel): New function.
13205 (Output_data_got::add_local_pair_with_rela): New function.
13206 (Output_data_got::add_global_tls): Removed.
13207 (Output_data_got::add_global_tls_with_rel): Removed.
13208 (Output_data_got::add_global_tls_with_rela): Removed.
13209 (Output_data_got::add_local_tls): Removed.
13210 (Output_data_got::add_local_tls_with_rel): Removed.
13211 (Output_data_got::add_local_tls_with_rela): Removed.
13212 * output.h (Output_data_got::add_global): Added got_type parameter.
13213 (Output_data_got::add_global_with_rel): Likewise.
13214 (Output_data_got::add_global_with_rela): Likewise.
13215 (Output_data_got::add_global_pair_with_rel): New function.
13216 (Output_data_got::add_global_pair_with_rela): New function.
13217 (Output_data_got::add_local): Added got_type parameter.
13218 (Output_data_got::add_local_with_rel): Likewise.
13219 (Output_data_got::add_local_with_rela): Likewise.
13220 (Output_data_got::add_local_pair_with_rel): New function.
13221 (Output_data_got::add_local_pair_with_rela): New function.
13222 (Output_data_got::add_global_tls): Removed.
13223 (Output_data_got::add_global_tls_with_rel): Removed.
13224 (Output_data_got::add_global_tls_with_rela): Removed.
13225 (Output_data_got::add_local_tls): Removed.
13226 (Output_data_got::add_local_tls_with_rel): Removed.
13227 (Output_data_got::add_local_tls_with_rela): Removed.
13228 * resolve.cc (Symbol::override_base_with_special): Removed
13229 reference to has_got_offset_ field.
13230 * symtab.cc (Symbol::init_fields): Replaced initialization
13231 of got_offset_ with got_offsets_. Removed initialization
13232 of has_got_offset_
13233 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13234 (Symbol::got_offset): Likewise.
13235 (Symbol::set_got_offset): Likewise.
13236 (Symbol::has_tls_got_offset): Removed.
13237 (Symbol::tls_got_offset): Removed.
13238 (Symbol::set_tls_got_offset): Removed.
13239 (Symbol::got_offset_): Removed.
13240 (Symbol::tls_mod_got_offset_): Removed.
13241 (Symbol::tls_pair_got_offset_): Removed.
13242 (Symbol::got_offsets_): New field.
13243 (Symbol::has_got_offset): Removed.
13244 (Symbol::has_tls_mod_got_offset): Removed.
13245 (Symbol::has_tls_pair_got_offset): Removed.
13246 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13247 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13248 member functions.
13249 (Target_x86_64::Scan::global): Likewise.
13250 (Target_x86_64::Relocate::relocate): Likewise.
13251 (Target_x86_64::Relocate::relocate_tls): Likewise.
13252
13253 2008-03-25 Ben Elliston <bje@au.ibm.com>
13254
13255 * yyscript.y: Fix spelling error in comment.
13256
13257 2008-03-24 Ian Lance Taylor <iant@google.com>
13258
13259 * options.h (class General_options): Define build_id option.
13260 * layout.h (class Layout): Declare write_build_id, create_note,
13261 create_build_id. Add build_id_note_ member.
13262 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13263 "libiberty.h", "md5.h", "sha1.h".
13264 (Layout::Layout): Initialize eh_frame_data_,
13265 eh_frame_hdr_section_, and build_id_note_.
13266 (Layout::finalize): Call create_build_id.
13267 (Layout::create_note): New function, broken out of
13268 Layout::create_gold_note.
13269 (Layout::create_gold_note): Call create_note.
13270 (Layout::create_build_id): New function.
13271 (Layout::write_build_id): New function.
13272 (Close_task_runner::run): Call write_build_id.
13273
13274 * x86_64.cc: Correct license to GPLv3.
13275
13276 2008-03-23 Ian Lance Taylor <iant@google.com>
13277
13278 * options.cc: Include "demangle.h".
13279 (parse_optional_string): New function.
13280 (parse_long_option): Handle takes_optional_argument.
13281 (parse_short_option): Update dash_z initializer. Handle
13282 takes_optional_argument.
13283 (General_options::General_options): Initialize do_demangle_.
13284 (General_options::finalize): Set do_demangle_. Handle demangling
13285 style.
13286 * options.h (parse_optional_string): Declare.
13287 (struct One_option): Add optional_arg field. Update constructor.
13288 Update call constructor calls. Add takes_optional_argument
13289 function.
13290 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13291 (DEFINE_optional_string): Define.
13292 (General_options::demangle): Change from DEFINE_bool to
13293 DEFINE_optional_string.
13294 (General_options::no_demangle): New function.
13295 (General_options::do_demangle): New function.
13296 (General_options::set_do_demangle): New function.
13297 (General_options::execstack_status_): Move definition to end of
13298 class definition.
13299 (General_options::static_): Likewise.
13300 (General_options::do_demangle_): New field.
13301 * object.cc (big_endian>::get_symbol_location_info): Call
13302 Options::do_demangle, not Options::demangle.
13303 * symtab.cc (demangle): Likewise.
13304
13305 2008-03-22 Ian Lance Taylor <iant@google.com>
13306
13307 * gold.h: Include <cstddef> and <sys/types.h>
13308 * options.h: Include <cstring>.
13309
13310 2008-03-21 Ian Lance Taylor <iant@google.com>
13311
13312 * Added source code to GNU binutils.
This page took 0.286257 seconds and 5 git commands to generate.