* dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2012-06-04 Cary Coutant <ccoutant@google.com>
2
3 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4 has_dynsym_index.
5
6 2012-05-25 Sriraman Tallam <tmsriram@google.com>
7
8 * symtab.cc (Symbol_table::define_special_symbol):
9 Initialize *poldsym to prevent uninitialized variable errors.
10
11 2012-05-23 Cary Coutant <ccoutant@google.com>
12
13 * layout.cc (Layout::section_name_mapping): Add rules to handle
14 exact match on .data.rel.ro.local or .data.rel.ro.
15 (Layout::output_section_name): Check for exact matches.
16
17 2012-05-23 Cary Coutant <ccoutant@google.com>
18
19 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
20 more carefully.
21
22 2012-05-22 Cary Coutant <ccoutant@google.com>
23
24 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
25 object before exporting symbol.
26
27 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
28
29 * testsuite/tls_test.cc: Include "config.h" first.
30 * testsuite/tls_test_c.c: Likewise.
31
32 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
33 Nick Clifton <nickc@redhat.com>
34
35 PR 14072
36 * configure.in: Add check that sysdep.h has been included before
37 any system header files.
38 * configure: Regenerate.
39 * config.in: Regenerate.
40
41 2012-05-14 Cary Coutant <ccoutant@google.com>
42
43 * layout.cc (Layout::make_output_section): Mark .tdata section
44 as RELRO.
45 * testsuite/relro_test.cc: Add a TLS variable.
46
47 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
48
49 PR gold/14091
50 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
51 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
52 R_X86_64_64.
53
54 2012-05-08 Cary Coutant <ccoutant@google.com>
55
56 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
57 (lines_only_debug_sections): Likewise.
58
59 2012-05-02 Roland McGrath <mcgrathr@google.com>
60
61 * nacl.cc: New file.
62 * nacl.h: New file.
63 * Makefile.am (CCFILES, HFILES): Add them.
64 * Makefile.in: Regenerate.
65 * i386.cc (Output_data_plt_i386_nacl): New class.
66 (Output_data_plt_i386_nacl_exec): New class.
67 (Output_data_plt_i386_nacl_dyn): New class.
68 (Target_i386_nacl): New class.
69 (Target_selector_i386_nacl): New class.
70 (target_selector_i386): Use it instead of Target_selector_i386.
71 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
72 (Target_x86_64_nacl): New class.
73 (Target_selector_x86_64_nacl): New class.
74 (target_selector_x86_64, target_selector_x32): Use it instead of
75 Target_selector_x86_64.
76 * arm.cc (Output_data_plt_arm_nacl): New class.
77 (Target_arm_nacl): New class.
78 (Target_selector_arm_nacl): New class.
79 (target_selector_arm, target_selector_armbe): Use it instead of
80 Target_selector_arm.
81
82 * target-select.cc (select_target): Take new Input_file* and off_t
83 arguments, pass them on to recognize method of selector.
84 * object.cc (make_elf_sized_object): Update caller.
85 * parameters.cc (parameters_force_valid_target): Likewise.
86 * incremental.cc (make_sized_incremental_binary): Likewise.
87 * target-select.h: Update decl.
88 (Target_selector::recognize): Take new Input_file* argument,
89 pass it on to do_recognize.
90 (Target_selector::do_recognize): Take new Input_file* argument.
91 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
92 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
93 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
94 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
95
96 * target.h (Target::Target_info): New members isolate_execinstr
97 and rosegment_gap.
98 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
99 * arm.cc (Target_arm::arm_info): Update initializer.
100 * i386.cc (Target_i386::i386_info): Likewise.
101 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
102 * sparc.cc (Target_sparc::sparc_info): Likewise.
103 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
104 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
105 * layout.cc (Layout::attach_allocated_section_to_segment):
106 Take new const Target* argument. If target->isolate_execinstr(), act
107 like --rosegment.
108 (Layout::find_first_load_seg): Take new const Target* argument;
109 if target->isolate_execinstr(), reject PF_X segments.
110 (Layout::relaxation_loop_body): Update caller.
111 (Layout::set_segment_offsets): If target->isolate_execinstr(),
112 reset file offset to zero when we hit LOAD_SEG, and then do a second
113 loop over the segments before LOAD_SEG to reassign offsets after
114 addresses have been determined. Handle target->rosegment_gap().
115 (Layout::attach_section_to_segment): Take new const Target* argument;
116 pass it to attach_allocated_section_to_segment.
117 (Layout::make_output_section): Update caller.
118 (Layout::attach_sections_to_segments): Take new const Target* argument;
119 pass it to attach_section_to_segment.
120 * gold.cc (queue_middle_tasks): Update caller.
121 * layout.h (Layout): Update method decls with new arguments.
122
123 * arm.cc (Target_arm::Target_arm): Take optional argument for the
124 Target_info pointer to use.
125 (Target_arm::do_make_data_plt): New virtual method.
126 (Target_arm::make_data_plt): New method that calls it.
127 (Target_arm::make_plt_entry): Use it.
128 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
129 for the section alignment.
130 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
131 method.
132 (Output_data_plt_arm::first_plt_entry_offset): Call it.
133 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
134 method.
135 (Output_data_plt_arm::get_plt_entry_size): Call it.
136 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
137 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
138 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
139 method.
140 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
141 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
142 method instead of sizeof(plt_entry).
143 (Output_data_plt_arm::add_entry): Likewise.
144 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
145 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
146 than static method.
147 (Target_arm::plt_entry_size): Likewise.
148 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
149 Move to ...
150 (Output_data_plt_arm_standard): ... here, new class.
151 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
152 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
153 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
154
155 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
156 Take additional argument for the PLT entry size.
157 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
158 Use get_plt_entry_size method rather than plt_entry_size variable.
159 (Output_data_plt_x86_64::reserve_slot): Likewise.
160 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
161 (Output_data_plt_x86_64::add_entry): Likewise.
162 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
163 (Output_data_plt_x86_64::address_for_global): Likewise.
164 (Output_data_plt_x86_64::address_for_local): Likewise.
165 (Output_data_plt_x86_64::set_final_data_size): Likewise.
166 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
167 Make method non-static.
168 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
169 method.
170 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
171 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
172 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
173 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
174 virtual method.
175 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
176 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
177 virtual method.
178 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
179 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
180 virtual method.
181 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
182 (Output_data_plt_x86_64::plt_entry_size)
183 (Output_data_plt_x86_64::first_plt_entry)
184 (Output_data_plt_x86_64::plt_entry)
185 (Output_data_plt_x86_64::tlsdesc_plt_entry)
186 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
187 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
188 (Output_data_plt_x86_64_standard): ... here, new class.
189 (Target_x86_64::Target_x86_64): Take optional argument for the
190 Target_info pointer to use.
191 (Target_x86_64::do_make_data_plt): New virtual method.
192 (Target_x86_64::make_data_plt): New method to call it.
193 (Target_x86_64::init_got_plt_for_update): Use that.
194 Call this->plt_->add_eh_frame method here.
195 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
196 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
197 rather than static method.
198 (Target_x86_64::plt_entry_size): Likewise.
199 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
200 rather than plt_entry_size variable. Move guts of PLT filling to...
201 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
202 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
203 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
204
205 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
206 additional argument for the section alignment.
207 Don't do add_eh_frame_for_plt here.
208 (Output_data_plt_i386::first_plt_entry_offset): Make the method
209 non-static. Use get_plt_entry_size method rather than plt_entry_size
210 variable.
211 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
212 method.
213 (Output_data_plt_i386::get_plt_entry_size): Call it.
214 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
215 (Output_data_plt_i386::add_eh_frame): New method to call it.
216 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
217 method.
218 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
219 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
220 method.
221 (Output_data_plt_i386::fill_plt_entry): New method to call it.
222 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
223 method instead of plt_entry_size.
224 (Output_data_plt_i386::plt_entry_size)
225 (Output_data_plt_i386::plt_eh_frame_fde_size)
226 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
227 (Output_data_plt_i386_standard): ... here, new class.
228 (Output_data_plt_i386_exec): New class.
229 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
230 (Output_data_plt_i386_exec::first_plt_entry): ... here.
231 (Output_data_plt_i386::exec_plt_entry): Move to ...
232 (Output_data_plt_i386_exec::plt_entry): ... here.
233 (Output_data_plt_i386_dyn): New class.
234 (Output_data_plt_i386::first_plt_entry): Move to ...
235 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
236 (Output_data_plt_i386::dyn_plt_entry): Move to ...
237 (Output_data_plt_i386_dyn::plt_entry): ... here.
238 (Target_i386::Target_i386): Take optional argument for the Target_info
239 pointer to use.
240 (Target_i386::do_make_data_plt): New virtual method.
241 (Target_i386::make_data_plt): New method to call it.
242 (Target_i386::make_plt_section): Use that.
243 Call this->plt_->add_eh_frame method here.
244 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
245 rather than plt_entry_size variable.
246 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
247 (Output_data_plt_i386::address_for_local): Likewise.
248 (Output_data_plt_i386::do_write): Likewise.
249 Move guts of PLT filling to...
250 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
251 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
252 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
253 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
254
255 2012-05-01 Cary Coutant <ccoutant@google.com>
256
257 * dwarf_reader.cc (Dwarf_die::read_attributes)
258 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
259 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
260 * reduced_debug_output.cc
261 (Output_reduced_debug_info_section::get_die_end): Remove
262 DW_FORM_GNU_ref_index. Add default case.
263
264 2012-04-26 Mark Wielaard <mjw@redhat.com>
265
266 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
267 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
268 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
269 DW_AT_high_pc as offset from DW_AT_low_pc.
270
271 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
272 * testsuite/Makefile.in: Regenerate.
273 * testsuite/gdb_index_test_3.c: New test source file.
274 * testsuite/gdb_index_test_3.sh: New test source file.
275
276 2012-04-25 Ian Lance Taylor <iant@google.com>
277
278 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
279 pointer.
280 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
281 as a class, not a struct.
282 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
283 (Target_arm::apply_cortex_a8_workaround): Likewise.
284 * gc.h: Declare Reloc_types as a struct, not a class.
285 * object.h: Declare Symbols_data as a struct.
286 * reloc.h: Declare Read_relocs_data as a struct.
287 * target.h: Declare Relocate_info as a struct.
288
289 2012-04-24 David S. Miller <davem@davemloft.net>
290
291 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
292 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
293 and R_SPARC_WPLT30.
294
295 2012-04-24 Cary Coutant <ccoutant@google.com>
296
297 * incremental-dump.cc (find_input_containing_global): Replace
298 magic number with symbolic constant.
299 (dump_incremental_inputs): Update version number.
300 * incremental.cc (Output_section_incremental_inputs): Update version
301 number; import symbolic constants from Incremental_inputs_reader.
302 (Incremental_inputs::create_data_sections): Align relocations
303 section correctly for 64-bit targets.
304 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
305 constants; add padding.
306 (Output_section_incremental_inputs::write_header): Add assert for
307 header_size.
308 (Output_section_incremental_inputs::write_input_files): Add assert
309 for input_entry_size.
310 (Output_section_incremental_inputs::write_info_blocks): Add padding;
311 add assert for object_info_size, input_section_entry_size,
312 global_sym_entry_size.
313 * incremental.h (Incremental_inputs_reader): Add symbolic constants
314 for data structure sizes; use them.
315 (Incremental_input_entry_reader): Import symbolic constants from
316 Incremental_inputs_reader; use them.
317
318 2012-04-23 David S. Miller <davem@davemloft.net>
319
320 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
321 and elf_flags_set_.
322 (Target_sparc::Target_sparc): Initialize new fields.
323 (Target_sparc::do_make_elf_object): New function.
324 (Target_sparc::do_adjust_elf_header): New function.
325
326 2012-04-23 Cary Coutant <ccoutant@google.com>
327
328 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
329 CU range table of gdb index.
330
331 2012-04-20 David S. Miller <davem@davemloft.net>
332
333 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
334 instead of false.
335
336 2012-04-16 David S. Miller <davem@davemloft.net>
337
338 * sparc.cc (Target_sparc::got_address): New function.
339 (Sparc_relocate_functions::gdop_hix22): New function.
340 (Sparc_relocate_functions::gdop_lox10): New function.
341 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
342 relocs.
343 (Target_sparc::Scan::local): Likewise if the global symbol is not
344 preemptible and is not IFUNC.
345 (Target_sparc::Relocate::relocate): Perform GOTDATA code
346 transformations for local and non-preemptible non-IFUNC global
347 symbols.
348
349 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
350 writing out 64-bit part of ranges.
351
352 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
353 -fpic and -fpie respectively.
354 * Makefile.in: Regenerate.
355
356 * sparc.cc (class Target_sparc): Add rela_ifunc_.
357 (Target_sparc::Target_sparc): Initialize new field.
358 (Target_sparc::do_plt_section_for_global): New function.
359 (Target_sparc::do_plt_section_for_local): New function.
360 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
361 (Target_sparc::make_plt_section): New function, broken out of
362 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
363 (Target_sparc::make_plt_entry): Call make_plt_section.
364 (Target_sparc::make_local_ifunc_plt_entry): New function.
365 (Target_sparc::rela_ifunc_section): New function.
366 (Target_sparc::plt_section): Remove const.
367 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
368 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
369 and ifunc_count_ fields.
370 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
371 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
372 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
373 (Output_data_plt_sparc::rela_ifunc): New function.
374 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
375 (Output_data_plt_sparc::has_ifunc_section): New function.
376 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
377 (Output_data_plt_sparc::address_for_global): New function.
378 (Output_data_plt_sparc::address_for_local): New function.
379 (Output_data_plt_sparc::plt_index_to_offset): New function.
380 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
381 and entry_count.
382 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
383 entry_count.
384 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
385 R_SPARC_JMP_IREL to switch.
386 (Target_sparc::Scan::check_non_pic): Likewise.
387 (Target_sparc::Scan::local): Handle IFUNC symbols.
388 (Target_sparc::Scan::local): Likewise.
389 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
390 and plt_address_for_local.
391 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
392 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
393
394 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
395 (class Output_data_reloc): Adjust calls to Output_reloc_type.
396 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
397 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
398 global relocs too.
399 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
400 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
401 calls.
402 * sparc.cc (Target_sparc::Scan::global): Likewise.
403 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
404
405 2012-04-16 Cary Coutant <ccoutant@google.com>
406
407 * archive.cc (Library_base::should_include_member): Check for
408 --export-dynamic-symbol.
409 * options.h (class General_options): Add --export-dynamic-symbol.
410 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
411 --export-dynamic-symbol.
412 (Symbol_table::gc_mark_undef_symbols): Likewise.
413 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
414
415 2012-04-12 David S. Miller <davem@davemloft.net>
416
417 * sparc.cc (Reloc::wdisp10): New relocation method.
418 (Reloc::h34): Likewise.
419 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
420 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
421 R_SPARC_WDISP10.
422 (Target_sparc::Scan::local): Likewise.
423 (Target_sparc::Scan::global): Likewise.
424 (Target_sparc::Relocate::relocate): Likewise.
425
426 2012-04-09 Cary Coutant <ccoutant@google.com>
427
428 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
429 low_pc == 0.
430
431 2012-04-06 Ian Lance Taylor <iant@google.com>
432
433 * timer.cc: #include <unistd.h>.
434
435 2012-04-06 Roland McGrath <mcgrathr@google.com>
436
437 * configure.in (AC_CHECK_HEADERS): Add locale.h.
438 * config.in: Regenerate.
439 * configure: Regenerate.
440
441 2012-04-05 Nick Clifton <nickc@redhat.com>
442
443 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
444 (AM_LC_MESSAGES): Add.
445 * aclocal.m4: Regenerate.
446 * config.in: Regenerate.
447 * configure: Regenerate.
448
449 2012-03-21 Cary Coutant <ccoutant@google.com>
450
451 * Makefile.am: Add gdb-index.cc, gdb-index.h.
452 * Makefile.in: Regenerate.
453 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
454 (Sized_elf_reloc_mapper::symbol_section): New function.
455 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
456 (make_elf_reloc_mapper): New function.
457 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
458 (Dwarf_abbrev_table::do_read_abbrevs): New function.
459 (Dwarf_abbrev_table::do_get_abbrev): New function.
460 (Dwarf_ranges_table::read_ranges_table): New function.
461 (Dwarf_ranges_table::read_range_list): New function.
462 (Dwarf_pubnames_table::read_section): New function.
463 (Dwarf_pubnames_table::read_header): New function.
464 (Dwarf_pubnames_table::next_name): New function.
465 (Dwarf_die::Dwarf_die): New function.
466 (Dwarf_die::read_attributes): New function.
467 (Dwarf_die::skip_attributes): New function.
468 (Dwarf_die::set_name): New function.
469 (Dwarf_die::set_linkage_name): New function.
470 (Dwarf_die::attribute): New function.
471 (Dwarf_die::string_attribute): New function.
472 (Dwarf_die::int_attribute): New function.
473 (Dwarf_die::uint_attribute): New function.
474 (Dwarf_die::ref_attribute): New function.
475 (Dwarf_die::child_offset): New function.
476 (Dwarf_die::sibling_offset): New function.
477 (Dwarf_info_reader::check_buffer): New function.
478 (Dwarf_info_reader::parse): New function.
479 (Dwarf_info_reader::do_parse): New function.
480 (Dwarf_info_reader::do_read_string_table): New function.
481 (Dwarf_info_reader::lookup_reloc): New function.
482 (Dwarf_info_reader::get_string): New function.
483 (Dwarf_info_reader::visit_compilation_unit): New function.
484 (Dwarf_info_reader::visit_type_unit): New function.
485 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
486 Sized_elf_reloc_mapper.
487 (Sized_dwarf_line_info::symbol_section): Remove function.
488 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
489 (Sized_dwarf_line_info::read_line_mappings): Remove object
490 parameter, adjust callers.
491 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
492 * dwarf_reader.h: Include <sys/types.h>.
493 (class Track_relocs): Remove forward declaration.
494 (class Elf_reloc_mapper): New class.
495 (class Sized_elf_reloc_mapper): New class.
496 (class Dwarf_abbrev_table): New class.
497 (class Dwarf_range_list): New class.
498 (class Dwarf_ranges_table): New class.
499 (class Dwarf_pubnames_table): New class.
500 (class Dwarf_die): New class.
501 (class Dwarf_info_reader): New class.
502 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
503 (Sized_dwarf_line_info::symbol_section): Remove member function.
504 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
505 base class.
506 * gdb-index.cc: New source file.
507 * gdb-index.h: New source file.
508 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
509 and .debug_types sections, call Layout::add_to_gdb_index.
510 (Sized_relobj_incr::do_section_name): Implement.
511 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
512 return type; Implement.
513 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
514 return type.
515 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
516 parameter list and return type.
517 (Sized_incr_dynobj::do_section_contents): Likewise.
518 * layout.cc: Include gdb-index.h.
519 (Layout::Layout): Initialize gdb_index_data_.
520 (Layout::init_fixed_output_section): Check for .gdb_index section.
521 (Layout::add_to_gdb_index): New function. Instantiate.
522 * layout.h: Add forward declaration for class Gdb_index.
523 (Layout::add_to_gdb_index): New member function.
524 (Layout::gdb_index_data_): New data member.
525 * main.cc: Include gdb-index.h.
526 (main): Print statistics for gdb index.
527 * object.cc (Object::section_contents): Move code into
528 do_section_contents.
529 (need_decompressed_section): Check for sections needed when building
530 gdb index.
531 (build_compressed_section_map): Likewise.
532 (Sized_relobj_file::do_read_symbols): Need local symbols when building
533 gdb index.
534 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
535 sections; call Layout::add_to_gdb_index.
536 (Sized_relobj_file::do_decompressed_section_contents): Call
537 do_section_contents directly.
538 * object.h (Object::do_section_contents): Adjust parameter list and
539 return type.
540 (Object::do_decompressed_section_contents): Call do_section_contents
541 directly.
542 (Sized_relobj_file::do_section_contents): Adjust parameter list and
543 return type.
544 * options.h (class General_options): Add --gdb-index option.
545 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
546 list and return type.
547 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
548 * reloc.h (Track_relocs::checkpoint): New function.
549 (Track_relocs::reset): New function.
550
551 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
552 New test cases.
553 * testsuite/Makefile.in: Regenerate.
554 * testsuite/gdb_index_test.cc: New test source file.
555 * testsuite/gdb_index_test_1.sh: New test source file.
556 * testsuite/gdb_index_test_2.sh: New test source file.
557
558 2012-03-19 Doug Kwan <dougkwan@google.com>
559
560 * arm.cc (Target_arm::do_define_standard_symbols): New method.
561 (Target_arm::do_finalize_sections): Remove code which defines
562 __exidx_start and __exidx_end. Make symbol table parameter
563 anonymous as it is not used.
564 * gold.cc (queue_middle_tasks): Call target hook to define any
565 target-specific symbols.
566 * target.h (Target::define_standard_symbols): New method.
567 (Target::do_define_standard_symbols): Same.
568 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
569 * testsuite/Makefile.in: Regenerate.
570 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
571 and __exidx_end.
572 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
573 relocations are generated for __exidx_start and __exidx_end.
574
575 2012-03-16 Doug Kwan <dougkwan@google.com>
576
577 * testsuite/Makefile.am: Disable test initpri3b.
578 * testsuite/Makefile.in: Regenerate.
579
580 2012-03-15 Doug Kwan <dougkwan@google.com>
581
582 * arm.cc (Target_arm::got_section): Make .got section read-only
583 if -z now is given.
584
585 2012-03-15 Ian Lance Taylor <iant@google.com>
586
587 PR gold/13850
588 * layout.cc (Layout::make_output_section): Correctly mark
589 SHT_INIT_ARRAY, et. al., as relro.
590
591 2012-03-14 Doug Kwan <dougkwan@google.com>
592
593 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
594 dynamic relocations for protected symbols in shared objects.
595
596 2012-03-13 Ian Lance Taylor <iant@google.com>
597
598 * resolve.cc (Symbol_table::resolve): When merging common symbols,
599 keep the larger alignment.
600
601 2012-03-12 Cary Coutant <ccoutant@google.com>
602
603 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
604 handling of DW_LNE_define_file.
605
606 2012-03-12 Cary Coutant <ccoutant@google.com>
607
608 * reduced_debug_output.cc
609 (Output_reduced_debug_info_section::get_die_end): Add new FORM
610 codes to switch.
611
612 2012-02-29 Cary Coutant <ccoutant@google.com>
613
614 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
615
616 2012-02-29 Cary Coutant <ccoutant@google.com>
617
618 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
619 Call Object::decompressed_section_contents.
620 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
621 New dtor.
622 (Sized_dwarf_line_info::buffer_start_): New data member.
623 * merge.cc (Output_merge_data::do_add_input_section): Call
624 Object::decompressed_section_contents.
625 (Output_merge_string::do_add_input_section): Likewise.
626 * object.cc (need_decompressed_section): New function.
627 (build_compressed_section_map): Decompress sections needed later.
628 (Sized_relobj_file::do_decompressed_section_contents): New function.
629 (Sized_relobj_file::do_discard_decompressed_sections): New function.
630 * object.h (Object::decompressed_section_contents): New function.
631 (Object::discard_decompressed_sections): New function.
632 (Object::do_decompressed_section_contents): New function.
633 (Object::do_discard_decompressed_sections): New function.
634 (Compressed_section_info): New type.
635 (Compressed_section_map): Include decompressed section contents.
636 (Sized_relobj_file::do_decompressed_section_contents): New function.
637 (Sized_relobj_file::do_discard_decompressed_sections): New function.
638
639 2012-02-16 Cary Coutant <ccoutant@google.com>
640
641 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
642 * testsuite/Makefile.in: Regenerate.
643
644 2012-02-14 Cary Coutant <ccoutant@google.com>
645
646 * options.cc (General_options::finalize): Disallow -pie and -static.
647
648 2012-02-03 Doug Kwan <dougkwan@google.com>
649
650 * arm.cc (Arm_relocate_functions::abs8,
651 Arm_relocate_functions::abs16): Use
652 Bits::has_signed_unsigned_overflow32.
653 (Arm_relocate_functions::thm_abs8): Correct range of
654 overflow check.
655 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
656 in assertions.
657
658 2012-02-02 Doug Kwan <dougkwan@google.com>
659
660 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
661 position independent outputs, not just shared objects.
662
663 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
664
665 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
666 * configure: Regenerated.
667
668 2012-01-27 Ian Lance Taylor <iant@google.com>
669
670 * reloc.h (Bits): New class with static functions, copied from
671 namespace utils in arm.cc.
672 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
673 instead.
674
675 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
676
677 * incremental.cc (write_info_blocks): Correct relocation offset.
678
679 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
680
681 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
682 (Relocate::tls_gd_to_le): Likewise.
683
684 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
685
686 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
687
688 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
689
690 * configure.ac: Check if -mcmodel=medium works.
691 * configure: Regenerated.
692
693 2012-01-24 Cary Coutant <ccoutant@google.com>
694
695 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
696 definition and ...
697 (read_unsigned_LEB_128_x): ... this new function.
698 (read_signed_LEB_128): Replaced with inline definition and ...
699 (read_signed_LEB_128_x): ... this new function.
700 * int_encoding.h (read_unsigned_LEB_128_x): New function.
701 (read_unsigned_LEB_128): Add inline definition.
702 (read_signed_LEB_128_x): New function.
703 (read_signed_LEB_128): Add inline definition.
704 * testsuite/Makefile.am (leb128_unittest): New unit test.
705 * testsuite/Makefile.in: Regenerate.
706 * testsuite/leb128_unittest.cc: New unit test.
707
708 2012-01-23 Ian Lance Taylor <iant@google.com>
709
710 PR gold/13617
711 * i386.cc (Target_i386::do_code_fill): When using a jmp
712 instruction, pad with nop instructions.
713 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
714
715 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
716
717 * x86_64.cc (gc_process_relocs): Add typename on types used in
718 template.
719 (scan_relocs): Likewise.
720 (relocate_section): Likewise.
721 (apply_relocation): Likewise.
722
723 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
724
725 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
726 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
727 under x32.
728
729 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
730
731 * x86_64.cc: Initial support for x32.
732
733 2012-01-03 Cary Coutant <ccoutant@google.com>
734
735 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
736 Use abstract base class for GOT.
737 * gold/output.h (class Output_data_got_base): New abstract base class.
738 (class Output_data_got): Derive from new base class, adjust ctors.
739 (Output_data_got::reserve_slot): Make virtual; rename to
740 do_reserve_slot; Adjust callers.
741 * gold/target.h (Sized_target::init_got_plt_for_update): Return
742 pointer to abstract base class.
743 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
744
745 2011-12-18 Ian Lance Taylor <iant@google.com>
746
747 * object.h (Relobj::local_symbol_value): New function.
748 (Relobj::local_plt_offset): New function.
749 (Relobj::local_has_got_offset): New function.
750 (Relobj::local_got_offset): New function.
751 (Relobj::set_local_got_offset): New function.
752 (Relobj::do_local_symbol_value): New pure virtual function.
753 (Relobj::do_local_plt_offset): Likewise.
754 (Relobj::do_local_has_got_offset): Likewise.
755 (Relobj::do_local_got_offset): Likewise.
756 (Relobj::do_set_local_got_offset): Likewise.
757 (Sized_relobj::do_local_has_got_offset): Rename from
758 local_has_got_offset.
759 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
760 (Sized_relobj::do_set_local_got_offset): Rename from
761 set_local_got_offset.
762 (Sized_relobj_file::do_local_plt_offset): Rename from
763 local_plt_offset.
764 (Sized_relobj_file::do_local_symbol_value): New function.
765 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
766 local_plt_offset.
767 * output.cc (Output_data_got::Got_entry::write): Change object to
768 Relobj. Use local_symbol_value.
769 (Output_data_got::add_global_with_rel): Change rel_dyn to
770 Output_data_reloc_generic*. Use add_global_generic.
771 (Output_data_got::add_global_with_rela): Remove. Change all
772 callers to use add_global_with_rel.
773 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
774 Output_data_reloc_generic*. Use add_global_generic.
775 (Output_data_got::add_global_pair_with_rela): Remove. Change all
776 callers to use add_global_pair_with_rel.
777 (Output_data_got::add_local): Change object to Relobj*.
778 (Output_data_got::add_local_plt): Likewise.
779 (Output_data_got::add_local_with_rel): Change object to Relobj*,
780 change rel_dyn to Output_data_reloc_generic*. Use
781 add_local_generic.
782 (Output_data_got::add_local_with_rela): Remove. Change all
783 callers to use all_local_with_rel.
784 (Output_data_got::add_local_pair_with_rel): Change object to
785 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
786 add_output_section_generic.
787 (Output_data_got::add_local_pair_with_rela): Remove. Change all
788 callers to use add_local_pair_with_rel.
789 (Output_data_got::reserve_local): Change object to Relobj*.
790 * output.h: (class Output_data_reloc_generic): Add pure virtual
791 declarations for add_global_generic, add_local_generic,
792 add_output_section_generic.
793 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
794 functions for Output_data_reloc_generic. Update declarations for
795 changes listed in output.cc.
796 (class Output_data_got): Change template parameter to got_size.
797 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
798 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
799 function.
800 (Sized_relobj_incr::do_local_plt_offset): New function.
801 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
802 add_global_generic.
803
804 2011-12-17 Cary Coutant <ccoutant@google.com>
805
806 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
807 * resolve.cc (Symbol_table::resolve): Likewise.
808 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
809 arrays.
810 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
811
812 2011-12-16 Ian Lance Taylor <iant@google.com>
813
814 * output.h (Output_data_reloc_generic::add): Only call
815 add_dynamic_reloc if this is a dynamic reloc section.
816
817 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
818
819 PR gold/13505
820 * target-reloc.h (apply_relocation): Replace <64, false> with
821 <size, big_endian>.
822
823 2011-11-25 Nick Clifton <nickc@redhat.com>
824
825 * po/it.po: New Italian translation.
826
827 2011-11-17 Sterling Augustine <saugustine@google.com>
828
829 * script.cc (script_include_directive): Implement.
830 (read_script_file): New local variables name and search_path. Update
831 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
832 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
833 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
834
835 2011-11-11 Sterling Augustine <saugustine@google.com>
836
837 * yyscript.y (section_cmd): Add support for INCLUDE directive.
838 (file_or_sections_cmd): Likewise.
839
840 2011-11-11 Doug Kwan <dougkwan@google.com>
841
842 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
843 if --just-symbols is given.
844
845 2011-11-10 Doug Kwan <dougkwan@google.com>
846
847 PR gold/13362
848 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
849 when processing data relocs.
850 * reloc.h (Relocate_functions::rel_unaligned): New method.
851 (Relocate_functions::pcrel_unaligned): Ditto.
852 (Relocate_functions::rel32_unaligned): Ditto.
853 (Relocate_functions::pcrel32_unaligned): Ditto.
854
855 2011-11-09 Doug Kwan <dougkwan@google.com>
856
857 PR gold/13362
858 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
859 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
860 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
861 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
862 (Relocate_functions::rel_unaligned): New.
863 (Relocate_functions::rel32_unaligned): New.
864 * target-reloc.h (relocate_for_relocatable): Add code to handle
865 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
866 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
867 arm_unaligned_reloc_r): New targets.
868 * testsuite/Makefile.in: Regenerate.
869 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
870 linking.
871
872 2011-11-02 Ian Lance Taylor <iant@google.com>
873
874 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
875 NATIVE_LINKER.
876 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
877 * options.cc (General_options::finalize): Use library search path
878 from configure script if specified. If not native and no sysroot,
879 only search TOOLLIBDIR.
880 * options.h (Search_directory::Search_directory): Change name to
881 const std::string&.
882 (General_options::add_to_library_path_with_sysroot): Change arg to
883 const std::string&.
884 * configure, Makefile.in, config.in: Rebuild.
885
886 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
887
888 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
889 we are working around the ARM1176 Erratum.
890 * options.h (General_options::fix_arm1176): Add option.
891 * testsuite/Makefile.am: Add testcases, and keep current ones
892 working.
893 * testsuite/Makefile.in: Regenerate.
894 * testsuite/arm_fix_1176.s: New file.
895 * testsuite/arm_fix_1176.sh: Likewise.
896
897 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
898
899 * arm.cc (Target_arm::Target_arm): Remove initialisation of
900 may_use_blx_.
901 (Target_arm::may_use_blx): Remove method.
902 (Target_arm::set_may_use_blx): Likewise.
903 (Target_arm::may_use_v4t_interworking): New method.
904 (Target_arm::may_use_v5t_interworking): Likewise.
905 (Target_arm::may_use_blx_): Remove member variable.
906 (Arm_relocate_functions::arm_branch_common): Check for v5T
907 interworking.
908 (Arm_relocate_functions::thumb_branch_common): Likewise.
909 (Reloc_stub::stub_type_for_reloc): Likewise.
910 (Target_arm::do_finalize_sections): Correct interworking checks.
911 * testsuite/Makefile.am: Add new tests.
912 * testsuite/Makefile.in: Regenerate.
913 * testsuite/arm_farcall_arm_arm.s: New test.
914 * testsuite/arm_farcall_arm_arm.sh: Likewise.
915 * testsuite/arm_farcall_arm_thumb.s: Likewise.
916 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
917 * testsuite/arm_farcall_thumb_arm.s: Likewise.
918 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
919 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
920 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
921
922 2011-10-31 Cary Coutant <ccoutant@google.com>
923
924 PR gold/13023
925 * expression.cc (Expression::eval_with_dot): Add
926 is_section_dot_assignment parameter.
927 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
928 absolute and assigning to dot within a section.
929 * script-sections.cc
930 (Output_section_element_assignment::set_section_addresses): Pass
931 dot_section to set_if_absolute.
932 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
933 as is_section_dot_assignment flag to eval_with_dot.
934 (Output_section_element_dot_assignment::set_section_addresses):
935 Likewise.
936 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
937 parameter. Also set value if relative to dot_section; set the
938 symbol's output_section.
939 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
940 parameter. Adjust all callers.
941 (Expression::eval_maybe_dot): Likewise.
942 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
943 Adjust all callers.
944 * testsuite/script_test_2.t: Test assignment of an absolute value
945 to dot within an output section element.
946
947 2011-10-31 Cary Coutant <ccoutant@google.com>
948
949 * options.h (class General_options): Add --[no-]gnu-unique options.
950 * symtab.cc (Symbol_table::sized_write_globals): Convert
951 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
952
953 2011-10-31 Cary Coutant <ccoutant@google.com>
954
955 PR gold/13359
956 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
957 unnecessary assertion.
958 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
959
960 2011-10-31 Sriraman Tallam <tmsriram@google.com>
961
962 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
963 gc_mark_symbol.
964 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
965 gc_mark_symbol.
966 Change to just keep the section associated with symbol.
967 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
968 they are externally visible and --export-dynamic is turned on.
969 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
970
971 2011-10-19 Ian Lance Taylor <iant@google.com>
972
973 PR gold/13163
974 * script-sections.cc
975 (Output_section_element_dot_assignment::needs_output_section): New
976 function.
977
978 2011-10-19 Ian Lance Taylor <iant@google.com>
979
980 PR gold/13204
981 * layout.cc (Layout::segment_precedes): Don't assert failure if a
982 --section-start option was seen.
983 * options.h (General_options::any_section_start): New function.
984
985 2011-10-18 David S. Miller <davem@davemloft.net>
986
987 PR binutils/13301
988 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
989 member to track relocation locations that have moved during TLS
990 reloc optimizations.
991 (Target_sparc::Relocate::Relocate): Initialize to NULL.
992 (Target_sparc::Relocate::relocate): Adjust view down by 4
993 bytes if it matches reloc_adjust_addr_.
994 (Target_sparc::Relocate::relocate_tls): Always move the
995 __tls_get_addr call delay slot instruction forward 4 bytes when
996 performing relaxation.
997
998 2011-10-18 Cary Coutant <ccoutant@google.com>
999
1000 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1001 (Output_file::map_no_anonymous): Check for non-zero
1002 return code from posix_fallocate.
1003
1004 2011-10-17 Cary Coutant <ccoutant@google.com>
1005
1006 PR gold/13245
1007 * plugin.cc (is_visible_from_outside): Check for symbols
1008 referenced from dynamic objects.
1009 * resolve.cc (Symbol_table::resolve): Don't count references
1010 from dynamic objects as references from real ELF files.
1011 * testsuite/plugin_test_2.sh: Adjust expected result.
1012
1013 2011-10-17 Cary Coutant <ccoutant@google.com>
1014
1015 * gold.cc: Include timer.h.
1016 (queue_middle_tasks): Stamp time.
1017 (queue_final_tasks): Likewise.
1018 * main.cc (main): Store timer in parameters. Print timers
1019 for each pass.
1020 * parameters.cc (Parameters::Parameters): Initialize timer_.
1021 (Parameters::set_timer): New function.
1022 (set_parameters_timer): New function.
1023 * parameters.h (Parameters::set_timer): New function.
1024 (Parameters::timer): New function.
1025 (Parameters::timer_): New data member.
1026 (set_parameters_timer): New function.
1027 * timer.cc (Timer::stamp): New function.
1028 (Timer::get_pass_time): New function.
1029 * timer.h (Timer::stamp): New function.
1030 (Timer::get_pass_time): New function.
1031 (Timer::pass_times_): New data member.
1032
1033 2011-10-17 Cary Coutant <ccoutant@google.com>
1034
1035 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1036 task for members of lib groups.
1037
1038 2011-10-17 Cary Coutant <ccoutant@google.com>
1039
1040 PR gold/13288
1041 * fileread.cc (File_read::find_view): Add assert.
1042 (File_read::make_view): Move bounds check (replace with assert)...
1043 (File_read::find_or_make_view): ... to here.
1044
1045 2011-10-12 Cary Coutant <ccoutant@google.com>
1046
1047 * output.cc (Output_file::open_base_file): Handle case where
1048 ::read returns less than requested size.
1049
1050 2011-10-10 Cary Coutant <ccoutant@google.com>
1051
1052 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1053 Initialize defined_count_.
1054 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1055 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1056 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1057 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1058 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1059 * incremental.h (Sized_relobj_incr::defined_count_): New data
1060 member.
1061 (Sized_incr_dynobj::defined_count_): New data member.
1062 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1063 Return zeroes instead of internal error.
1064
1065 2011-10-10 Cary Coutant <ccoutant@google.com>
1066
1067 PR gold/13249
1068 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1069 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1070 * output.h (class Output_reloc): Add use_plt_offset flag.
1071 (Output_reloc::type_): Adjust size of bit field.
1072 (Output_reloc::use_plt_offset_): New bit field.
1073 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1074 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1075 flag. Adjust all callers.
1076 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1077 creating RELATIVE relocations.
1078
1079 2011-10-10 Nick Clifton <nickc@redhat.com>
1080
1081 * po/es.po: Updated Spanish translation.
1082 * po/fi.po: Updated Finnish translation.
1083
1084 2011-10-03 Diego Novillo <dnovillo@google.com>
1085
1086 * options.cc (parse_uint): Fix dereference of RETVAL.
1087
1088 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1089
1090 * layout.h (section_order_map_): New member.
1091 (get_section_order_map): New member function.
1092 * output.cc (Output_section::add_input_section): Check for patterns
1093 only when --section-ordering-file is specified.
1094 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1095 output_sections have been formed.
1096 * layout.cc (Layout_Layout): Initialize section_order_map_.
1097 * plugin.cc (update_section_order): Store order in order_map. Do not
1098 update the order.
1099 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1100 * testsuite/Makefile.in: Regenerate.
1101 * testsuite/plugin_section_order.c: New file.
1102 * testsuite/plugin_final_layout.cc: New file.
1103 * testsuite/plugin_final_layout.sh: New file.
1104
1105 2011-09-29 Cary Coutant <ccoutant@google.com>
1106
1107 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1108 Check for NULL.
1109 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1110 symbols during incremental update.
1111 (Symbol_table::add_from_dynobj): Likewise.
1112
1113 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1114 Ian Lance Taylor <iant@google.com>
1115
1116 * symtab.cc (Symbol_table::define_special_symbol): Always
1117 canonicalize version string.
1118
1119 2011-09-26 Cary Coutant <ccoutant@google.com>
1120
1121 * gold.cc (queue_initial_tasks): Move option checks ...
1122 * options.cc (General_options::finalize): ... to here. Disable
1123 some options; make others fatal.
1124
1125 2011-09-26 Cary Coutant <ccoutant@google.com>
1126
1127 gcc PR lto/47247
1128 * plugin.cc (get_symbols_v2): New function.
1129 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1130 (is_referenced_from_outside): New function.
1131 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1132 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1133 (get_symbols): Pass version parameter.
1134 (get_symbols_v2): New function.
1135 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1136 parameter.
1137 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1138 (onload): Add LDPT_GET_SYMBOLS_V2.
1139 (all_symbols_read_hook): Use get_symbols_v2; check for
1140 LDPR_PREVAILING_DEF_IRONLY_EXP.
1141 * testsuite/plugin_test_3.sh: Update expected results.
1142
1143 2011-09-23 Simon Baldwin <simonb@google.com>
1144
1145 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1146 configuration options.
1147 * configure: Regenerate.
1148 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1149 * Makefile.in: Regenerate.
1150 * testsuite/Makefile.in: Regenerate.
1151
1152 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1153
1154 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1155
1156 2011-09-19 Cary Coutant <ccoutant@google.com>
1157
1158 * incremental.cc (can_incremental_update): Fix typo in comment.
1159 * incremental.h (can_incremental_update): Likewise.
1160
1161 2011-09-18 Cary Coutant <ccoutant@google.com>
1162
1163 * incremental.cc (can_incremental_update): New function.
1164 * incremental.h (can_incremental_update): New function.
1165 * layout.cc (Layout::init_fixed_output_section): Call it.
1166 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1167 * object.cc (Sized_relobj_file::do_layout): Call
1168 can_incremental_update.
1169
1170 2011-09-13 Cary Coutant <ccoutant@google.com>
1171
1172 * configure.ac: Check for glibc support for gnu_indirect_function
1173 support with static linking, setting automake conditional
1174 IFUNC_STATIC.
1175 * Makefile.in: Regenerate.
1176 * configure: Regenerate.
1177
1178 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1179 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1180 for IFUNC_STATIC.
1181 * testsuite/Makefile.in: Regenerate.
1182
1183 2011-09-13 Cary Coutant <ccoutant@google.com>
1184
1185 * incremental.cc (Sized_relobj_incr::do_layout): Call
1186 report_comdat_group for kept comdat sections.
1187 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1188 * testsuite/Makefile.in: Regenerate.
1189 * testsuite/incr_comdat_test_1.cc: New source file.
1190 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1191 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1192 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1193
1194 2011-09-13 Ian Lance Taylor <iant@google.com>
1195
1196 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1197 variable external_symbols_offset.
1198
1199 2011-09-12 Ian Lance Taylor <iant@google.com>
1200
1201 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1202 triggered if object has no symbols.
1203
1204 2011-09-09 David S. Miller <davem@davemloft.net>
1205
1206 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1207 (Output_fill_debug_line::do_write): Likewise.
1208
1209 2011-08-29 Cary Coutant <ccoutant@google.com>
1210
1211 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1212 casts to match formatting specs.
1213 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1214
1215 2011-08-26 Cary Coutant <ccoutant@google.com>
1216
1217 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1218 remaining hole size when allocating.
1219 (Layout::make_output_section): Set fill methods for debug sections.
1220 * layout.h (Free_list::Free_list_node): Move from private to
1221 public.
1222 (Free_list::set_min_hole_size): New function.
1223 (Free_list::begin, Free_list::end): New functions.
1224 (Free_list::min_hole_): New data member.
1225 * output.cc: Include dwarf.h.
1226 (Output_fill_debug_info::do_minimum_hole_size): New function.
1227 (Output_fill_debug_info::do_write): New function.
1228 (Output_fill_debug_line::do_minimum_hole_size): New function.
1229 (Output_fill_debug_line::do_write): New function.
1230 (Output_section::Output_section): Initialize new data member.
1231 (Output_section::set_final_data_size): Ensure patch space is larger
1232 than minimum hole size.
1233 (Output_section::do_write): Fill holes in debug sections.
1234 * output.h (Output_fill): New class.
1235 (Output_fill_debug_info): New class.
1236 (Output_fill_debug_line): New class.
1237 (Output_section::set_free_space_fill): New function.
1238 (Output_section::free_space_fill_): New data member.
1239 * testsuite/Makefile.am (incremental_test_3): Add
1240 --incremental-patch option.
1241 (incremental_test_4): Likewise.
1242 (incremental_test_5): Likewise.
1243 (incremental_test_6): Likewise.
1244 (incremental_copy_test): Likewise.
1245 (incremental_common_test_1): Likewise.
1246 * testsuite/Makefile.in: Regenerate.
1247
1248 2011-08-26 Nick Clifton <nickc@redhat.com>
1249
1250 * po/es.po: Updated Spanish translation.
1251
1252 2011-08-01 Cary Coutant <ccoutant@google.com>
1253
1254 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1255 * gold/testsuite/Makefile.in: Regenerate.
1256 * gold/testsuite/justsyms_exec.c: New source file.
1257 * gold/testsuite/justsyms_lib.c: New source file.
1258
1259 2011-08-01 Cary Coutant <ccoutant@google.com>
1260
1261 * layout.cc (Layout::set_segment_offsets): Don't realign text
1262 segment if -Ttext was specified.
1263 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1264 file type.
1265 * object.h (Sized_relobj_file::e_type): New function.
1266 (Sized_relobj_file::e_type_): New data member.
1267 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1268 base address for ET_EXEC files.
1269 * target.cc (Target::do_make_elf_object_implementation): Allow
1270 ET_EXEC files with --just-symbols option.
1271
1272 2011-07-28 Cary Coutant <ccoutant@google.com>
1273
1274 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1275 Add thread_number parameter.
1276 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1277 * workqueue-threads.cc
1278 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1279 current thread if its thread number is greater than desired thread
1280 count.
1281 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1282 Add thread_number parameter.
1283 (Workqueue::should_cancel_thread): Likewise.
1284 (Workqueue::find_runnable_or_wait): Pass thread_number to
1285 should_cancel_thread.
1286 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1287 parameter.
1288
1289 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1290
1291 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1292 only after checking if it cannot be forced local.
1293 * symtab.h (is_externally_visible): Check if the symbol is not forced
1294 local.
1295
1296 2011-07-15 Ian Lance Taylor <iant@google.com>
1297
1298 * options.h (class General_options): Add --print-output-format.
1299 Move -EL next to -EB, for better --help output.
1300 * target-select.cc: Include <cstdio>, "options.h", and
1301 "parameters.h".
1302 (Target_selector::do_target_bfd_name): New function.
1303 (print_output_format): New function.
1304 * target-select.h (class Target_selector): Update declarations.
1305 (Target_selector::target_bfd_name): New function.
1306 (print_output_format): Declare.
1307 * main.cc: Include "target-select.h".
1308 (main): Handle --print-output-format.
1309 * gold.cc: Include "target-select.h".
1310 (queue_initial_tasks): Handle --print-output-format when there are
1311 no input files.
1312 * parameters.cc (parameters_force_valid_target): Give a better
1313 error message if -EB/-EL does not match target.
1314 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1315 function.
1316
1317 2011-07-15 Ian Lance Taylor <iant@google.com>
1318
1319 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1320 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1321 (Output_data_plt_i386::do_write): Write address of .dynamic
1322 section to first entry in .got.plt section.
1323 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1324 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1325 Initialize layout_.
1326 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1327 section to first entry in .got.plt section.
1328 * layout.h (Layout::dynamic_section): New function.
1329
1330 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1331
1332 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1333 to claim_file call.
1334 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1335 input_section_position_, and input_section_glob_.
1336 (read_layout_from_file): Call function section_ordering_specified.
1337 * layout.h (is_section_ordering_specified): New function.
1338 (section_ordering_specified): New function.
1339 (section_ordering_specified_): New boolean member.
1340 * main.cc(main): Call load_plugins after layout object is defined.
1341 * output.cc (Output_section::add_input_section): Use
1342 function section_ordering_specified to check if section ordering is
1343 needed.
1344 * output.cc (Output_section::add_relaxed_input_section): Use
1345 function section_ordering_specified to check if section ordering is
1346 needed.
1347 (Output_section::update_section_layout): New function.
1348 (Output_section::sort_attached_input_sections): Check if input section
1349 must be reordered.
1350 * output.h (Output_section::update_section_layout): New function.
1351 * plugin.cc (get_section_count): New function.
1352 (get_section_type): New function.
1353 (get_section_name): New function.
1354 (get_section_contents): New function.
1355 (update_section_order): New function.
1356 (allow_section_ordering): New function.
1357 (Plugin::load): Add the new interfaces to the transfer vector.
1358 (Plugin_manager::load_plugins): New parameter.
1359 (Plugin_manager::all_symbols_read): New parameter.
1360 (Plugin_manager::claim_file): New parameter. Save the elf object for
1361 unclaimed objects.
1362 (Plugin_manager::get_elf_object): New function.
1363 (Plugin_manager::get_view): Change to directly use the bool to check
1364 if get_view is called from claim_file_hook.
1365 * plugin.h (input_objects): New function
1366 (Plugin__manager::load_plugins): New parameter.
1367 (Plugin_manager::claim_file): New parameter.
1368 (Plugin_manager::get_elf_object): New function.
1369 (Plugin_manager::in_claim_file_handler): New function.
1370 (Plugin_manager::in_claim_file_handler_): New member.
1371 (layout): New function.
1372 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1373 handler with an extra parameter. Make the elf object before calling
1374 claim_file handler.
1375 * testsuite/plugin_test.c (get_section_count): New function pointer.
1376 (get_section_type): New function pointer.
1377 (get_section_name): New function pointer.
1378 (get_section_contents): New function pointer.
1379 (update_section_order): New function pointer.
1380 (allow_section_ordering): New function pointer.
1381 (onload): Check if the new interfaces exist.
1382
1383 2011-07-13 Ian Lance Taylor <iant@google.com>
1384
1385 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1386 relro section.
1387 * x86_64.cc (Target_x86_64::got_section): Likewise.
1388 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1389 (relro_now_test_SOURCES): New variable.
1390 (relro_now_test_DEPENDENCIES): New variable.
1391 (relro_now_test_LDFLAGS): New variable.
1392 (relro_now_test_LDADD): New variable.
1393 (relro_now_test.so): New target.
1394 * testsuite/Makefile.in: Rebuild.
1395
1396 2011-07-12 Ian Lance Taylor <iant@google.com>
1397
1398 PR gold/12980
1399 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1400 GLOB_DAT relocation rather than a RELATIVE relocation for a
1401 protected symbol when creating a shared library.
1402 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1403 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1404 * testsuite/protected_main_1.cc (main): Test that protected
1405 function has same address.
1406
1407 2011-07-11 Ian Lance Taylor <iant@google.com>
1408
1409 PR gold/12979
1410 * options.h (class General_options): Add -Bgroup.
1411 * options.cc (General_options::finalize): If -Bgroup is set,
1412 default to --unresolved-symbols=report-all.
1413 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1414 * target-reloc.h (issue_undefined_symbol_error): Handle
1415 --unresolved-symbols=report-all.
1416
1417 2011-07-08 Ian Lance Taylor <iant@google.com>
1418
1419 PR gold/11985
1420 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1421 if linker script discards key sections.
1422 (Layout::create_dynamic_symtab): Likewise.
1423 (Layout::assign_local_dynsym_offsets): Likewise.
1424 (Layout::sized_create_version_sections): Likewise.
1425 (Layout::create_interp): Likewise.
1426 (Layout::finish_dynamic_section): Likewise.
1427 (Layout::set_dynamic_symbol_size): Likewise.
1428
1429 2011-07-08 Ian Lance Taylor <iant@google.com>
1430
1431 PR gold/12386
1432 * options.h (class General_options): Add --unresolved-symbols.
1433 * target-reloc.h (issue_undefined_symbol_error): Check
1434 --unresolved-symbols. Add comments.
1435
1436 2011-07-08 Ian Lance Taylor <iant@google.com>
1437
1438 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1439 expression more complex.
1440
1441 2011-07-08 Ian Lance Taylor <iant@google.com>
1442
1443 PR gold/11317
1444 * target-reloc.h (issue_undefined_symbol_error): New inline
1445 function, broken out of relocate_section.
1446 (relocate_section): Call issue_undefined_symbol_error.
1447 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1448 there is no TLS segment if we are about to issue an undefined
1449 symbol error.
1450 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1451
1452 2011-07-08 Ian Lance Taylor <iant@google.com>
1453
1454 PR gold/12279
1455 * resolve.cc (Symbol_table::should_override): Add fromtype
1456 parameter. Change all callers. Give error when linking together
1457 TLS and non-TLS symbol.
1458 (Symbol_table::should_override_with_special): Add fromtype
1459 parameter. Change all callers.
1460 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1461 there is no TLS segment if we have reported some errors.
1462 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1463
1464 2011-07-08 Ian Lance Taylor <iant@google.com>
1465
1466 PR gold/12372
1467 * target.h (Target::plt_address_for_global): New function.
1468 (Target::plt_address_for_local): New function.
1469 (Target::plt_section_for_global): Remove.
1470 (Target::plt_section_for_local): Remove.
1471 (Target::do_plt_address_for_global): New virtual function.
1472 (Target::do_plt_address_for_local): New virtual function.
1473 (Target::do_plt_section_for_global): Remove.
1474 (Target::do_plt_section_for_local): Remove.
1475 (Target::register_global_plt_entry): Add Symbol_table and Layout
1476 parameters.
1477 * output.cc (Output_data_got::Got_entry::write): Use
1478 plt_address_for_global and plt_address_for_local.
1479 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1480 address of output section.
1481 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1482 got_irelative_, and irelative_count_ fields. Update
1483 declarations.
1484 (Output_data_plt_i386::has_irelative_section): New function.
1485 (Output_data_plt_i386::entry_count): Add irelative_count_.
1486 (Output_data_plt_i386::set_final_data_size): Likewise.
1487 (class Target_i386): Add got_irelative_ and rel_irelative_
1488 fields. Update declarations.
1489 (Target_i386::Target_i386): Initialize new fields.
1490 (Target_i386::do_plt_address_for_global): New function replacing
1491 do_plt_section_for_global.
1492 (Target_i386::do_plt_address_for_local): New function replacing
1493 do_plt_section_for_local.
1494 (Target_i386::got_section): Create got_irelative_.
1495 (Target_i386::rel_irelative_section): New function.
1496 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1497 fields. Don't define __rel_iplt_{start,end}.
1498 (Output_data_plt_i386::add_entry): Add symtab and layout
1499 parameters. Change all callers. Use different PLT and GOT for
1500 IFUNC symbols.
1501 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1502 layout parameters. Change all callers. Use different PLT and
1503 GOT.
1504 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1505 (Output_data_plt_i386::rel_irelative): New function.
1506 (Output_data_plt_i386::address_for_global): New function.
1507 (Output_data_plt_i386::address_for_local): New function.
1508 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1509 IRELATIVE GOT when changing IFUNC GOT entries.
1510 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1511 reloc.
1512 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1513 if we didn't create an IRELATIVE GOT.
1514 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1515 plt_address_for_local.
1516 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1517 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1518 got_irelative_, and irelative_count_ fields. Update
1519 declarations.
1520 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1521 Initialize new fields. Remove symtab parameter. Change all
1522 callers.
1523 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1524 irelative_count_.
1525 (Output_data_plt_x86_64::has_irelative_section): New function.
1526 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1527 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1528 fields. Update declarations.
1529 (Target_x86_64::Target_x86_64): Initialize new fields.
1530 (Target_x86_64::do_plt_address_for_global): New function replacing
1531 do_plt_section_for_global.
1532 (Target_x86_64::do_plt_address_for_local): New function replacing
1533 do_plt_section_for_local.
1534 (Target_x86_64::got_section): Create got_irelative_.
1535 (Target_x86_64::rela_irelative_section): New function.
1536 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1537 all callers. Don't create __rel_iplt_{start,end}.
1538 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1539 parameters. Change all callers. Use different PLT and GOT for
1540 IFUNC symbols.
1541 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1542 layout parameters. Change all callers. Use different PLT and
1543 GOT.
1544 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1545 parameters. Change all callers. Use different PLT and GOT for
1546 IFUNC symbols.
1547 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1548 (Output_data_plt_x86_64::rela_irelative): New function.
1549 (Output_data_plt_x86_64::address_for_global): New function.
1550 (Output_data_plt_x86_64::address_for_local): New function.
1551 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1552 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1553 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1554 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1555 parameters.
1556 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1557 reloc.
1558 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1559 symbols if we didn't create an IRELATIVE GOT.
1560 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1561 plt_address_for_local.
1562 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1563 * testsuite/ifuncvar1.c: New test file.
1564 * testsuite/ifuncvar2.c: New test file.
1565 * testsuite/ifuncvar3.c: New test file.
1566 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1567 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1568 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1569 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1570 * testsuite/Makefile.in: Rebuild.
1571
1572 2011-07-07 Cary Coutant <ccoutant@google.com>
1573
1574 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1575 (two_file_test_1_ndebug.o): Likewise.
1576 (two_file_test_1b_ndebug.o): Likewise.
1577 (two_file_test_2_ndebug.o): Likewise.
1578 (two_file_test_main_ndebug.o): Likewise.
1579 (incremental_test_2): Link with no-debug versions.
1580
1581 2011-07-06 Cary Coutant <ccoutant@google.com>
1582
1583 * gold/incremental.cc
1584 (Output_section_incremental_inputs::write_info_blocks): Check for
1585 hidden and internal symbols.
1586
1587 2011-07-06 Cary Coutant <ccoutant@google.com>
1588
1589 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1590 Check disposition for startup file.
1591 (Incremental_inputs::report_command_line): Ignore
1592 --incremental-startup-unchanged option.
1593 * options.cc (General_options::parse_incremental_startup_unchanged):
1594 New function.
1595 (General_options::General_options): Initialize new data member.
1596 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1597 (General_options): Add --incremental-startup-unchanged option.
1598 (General_options::incremental_startup_disposition): New function.
1599 (General_options::incremental_startup_disposition_): New data member.
1600
1601 2011-07-06 Cary Coutant <ccoutant@google.com>
1602
1603 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1604 input file index to Script_info ctor.
1605 (Sized_incremental_binary::do_file_has_changed): Find the
1606 command-line argument for files named in scripts.
1607 * incremental.h (Script_info::Script_info): New ctor
1608 with input file index.
1609 (Script_info::input_file_index): New function.
1610 (Script_info::input_file_index_): New data member.
1611 (Incremental_binary::get_library): Add const.
1612 (Incremental_binary::get_script_info): Add const.
1613 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1614 * testsuite/Makefile.am (incremental_test_5): New test case.
1615 (incremental_test_6): New test case.
1616 * testsuite/Makefile.in: Regenerate.
1617
1618 2011-07-06 Cary Coutant <ccoutant@google.com>
1619
1620 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1621 debug output when command lines differ.
1622
1623 2011-07-06 Cary Coutant <ccoutant@google.com>
1624
1625 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1626 --incremental-patch option.
1627 * layout.cc (Free_list::allocate): Extend allocation beyond original
1628 end if enabled.
1629 (Layout::make_output_section): Mark sections that should get
1630 patch space.
1631 * options.cc (parse_percent): New function.
1632 * options.h (parse_percent): New function.
1633 (DEFINE_percent): New macro.
1634 (General_options): Add --incremental-patch option.
1635 * output.cc (Output_section::Output_section): Initialize new data
1636 members.
1637 (Output_section::add_input_section): Print section name when out
1638 of patch space.
1639 (Output_section::add_output_section_data): Likewise.
1640 (Output_section::set_final_data_size): Add patch space when
1641 doing --incremental-full.
1642 (Output_section::do_reset_address_and_file_offset): Remove patch
1643 space.
1644 (Output_segment::set_section_list_addresses): Print debug output
1645 only if --incremental-update.
1646 * output.h (Output_section::set_is_patch_space_allowed): New function.
1647 (Output_section::is_patch_space_allowed_): New data member.
1648 (Output_section::patch_space_): New data member.
1649 * parameters.cc (Parameters::incremental_full): New function.
1650 * parameters.h (Parameters::incremental_full): New function
1651 * testsuite/Makefile.am (incremental_test_2): Add test for
1652 --incremental-patch option.
1653 * testsuite/Makefile.in: Regenerate.
1654 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1655 (t18): Remove function body.
1656
1657 2011-07-05 Doug Kwan <dougkwan@google.com>
1658
1659 PR gold/12771
1660 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1661 Arm_Address type for relocation result.
1662 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1663 overflow check.
1664 (Arm_relocate_functions::abs32): Use unaligned access.
1665 (Arm_relocate_functions::rel32): Ditto.
1666 (Arm_relocate_functions::prel31): Ditto.
1667 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1668 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1669 static data relocations.
1670 * testsuite/Makefile.in: Regnerate.
1671 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1672
1673 2011-07-05 Ian Lance Taylor <iant@google.com>
1674
1675 PR gold/12392
1676 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1677 symbols if necessary.
1678 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1679
1680 2011-07-05 Ian Lance Taylor <iant@google.com>
1681
1682 PR gold/12952
1683 * resolve.cc (Symbol::override_base_with_special): Simply override
1684 version with special symbol version, ignoring previous version.
1685
1686 2011-07-05 Ian Lance Taylor <iant@google.com>
1687
1688 * object.cc (Sized_relobj_file::include_section_group): Add
1689 information to comment about signature location.
1690
1691 2011-07-02 Ian Lance Taylor <iant@google.com>
1692
1693 PR gold/12957
1694 * options.h (class General_options): Add -f and -F.
1695 * options.cc (General_options::finalize): Fatal error if -f/-F
1696 are used without -shared.
1697 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1698
1699 2011-07-02 Ian Lance Taylor <iant@google.com>
1700
1701 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1702
1703 2011-07-01 Ian Lance Taylor <iant@google.com>
1704
1705 PR gold/12525
1706 PR gold/12952
1707 * resolve.cc (Symbol::override_base_with_special): Don't override
1708 the version if the overriding symbol has a different name.
1709 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1710 all callers. If we give an error about an undefined version,
1711 define the base version if necessary.
1712 * dynobj.h (class Versions): Update declaration.
1713 * testsuite/weak_alias_test_5.cc: New file.
1714 * testsuite/weak_alias_test.script: New file.
1715 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1716 and versioned_alias have the right value, and call t2.
1717 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1718 weak_alias_test_5.so.
1719 (weak_alias_test_LDADD): Likewise.
1720 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1721 * testsuite/Makefile.in: Rebuild.
1722
1723 2011-07-01 Ian Lance Taylor <iant@google.com>
1724
1725 PR gold/12525
1726 * options.h (class General_options): Support -z notext.
1727 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1728 -Wl,-z,notext.
1729 (two_file_shared_nonpic.so): Likewise.
1730 (two_file_shared_mixed.so): Likewise.
1731 (two_file_shared_mixed_1.so): Likewise.
1732 (weak_undef_lib_nonpic.so): Likewise.
1733 (alt/weak_undef_lib_nonpic.so): Likewise.
1734 (tls_test_shared_nonpic.so): Likewise.
1735 * testsuite/Makefile.in: Rebuild.
1736
1737 2011-07-01 Ian Lance Taylor <iant@google.com>
1738
1739 PR gold/12525
1740 * configure.ac: Test whether static linking works, setting
1741 the automake conditional HAVE_STATIC.
1742 * testsuite/Makefile.am: Disable tests using -static if
1743 HAVE_STATIC is not true.
1744 * configure, testsuite/Makefile.in: Rebuild.
1745
1746 2011-07-01 Ian Lance Taylor <iant@google.com>
1747
1748 PR gold/12525
1749 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1750 Assert if we see DW_EH_PE_indirect.
1751 * target.h (Target::ehframe_datarel_base): New function.
1752 (Target::do_ehframe_datarel_base): New target function.
1753 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1754 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1755 function.
1756
1757 2011-07-01 Ian Lance Taylor <iant@google.com>
1758
1759 PR gold/12571
1760 * options.h (class General_options): Add
1761 --ld-generated-unwind-info.
1762 * ehframe.cc (Fde::write): Add address parameter. Change all
1763 callers. If associated with PLT, fill in address and size.
1764 (Cie::set_output_offset): Only add merge mapping if there is an
1765 object.
1766 (Cie::write): Add address parameter. Change all callers.
1767 (Eh_frame::add_ehframe_for_plt): New function.
1768 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1769 input_offset_ fields into union u_, with new plt field.
1770 (Fde::Fde): Adjust for new union field.
1771 (Fde::Fde) [Output_data version]: New constructor.
1772 (Fde::add_mapping): Only add merge mapping if there is an object.
1773 (class Cie): Update declarations.
1774 (class Eh_frame): Declare add_ehframe_for_plt.
1775 * layout.cc (Layout::layout_eh_frame): Break out code into
1776 make_eh_frame_section, and call it.
1777 (Layout::make_eh_frame_section): New function.
1778 (Layout::add_eh_frame_for_plt): New function.
1779 * layout.h (class Layout): Update declarations.
1780 * merge.cc (Merge_map::add_mapping): Add assertion.
1781 * i386.cc: Include "dwarf.h".
1782 (class Output_data_plt_i386): Make first_plt_entry,
1783 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1784 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1785 and plt_eh_frame_fde.
1786 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1787 boundary. Call add_eh_frame_for_plt if appropriate.
1788 * x86_64.cc: Include "dwarf.h".
1789 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1790 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1791 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1792 and plt_eh_frame_fde.
1793 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1794 appropriate.
1795
1796 2011-06-29 Ian Lance Taylor <iant@google.com>
1797
1798 PR gold/12629
1799 * object.cc (Sized_relobj_file::layout_section): Change shdr
1800 parameter to be const.
1801 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1802 out of do_layout.
1803 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1804 appropriate. Call layout_eh_frame_section.
1805 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1806 sections.
1807 * object.h (class Sized_relobj_file): Update declarations.
1808
1809 2011-06-29 Ian Lance Taylor <iant@google.com>
1810
1811 PR gold/12652
1812 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1813 modifier.
1814 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1815
1816 2011-06-29 Ian Lance Taylor <iant@google.com>
1817
1818 PR gold/12675
1819 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1820 SHT_X86_64_UNWIND.
1821 * layout.cc (Layout::layout_eh_frame): Likewise.
1822
1823 2011-06-29 Ian Lance Taylor <iant@google.com>
1824
1825 PR gold/12695
1826 * layout.cc (Layout::symtab_section_shndx): New function.
1827 * layout.h (class Layout): Declare symtab_section_shndx.
1828 * output.cc (Output_section::write_header): Call it.
1829
1830 2011-06-29 Ian Lance Taylor <iant@google.com>
1831
1832 PR gold/12818
1833 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1834 symbols which are not used in a relocation.
1835
1836 2011-06-28 Ian Lance Taylor <iant@google.com>
1837
1838 PR gold/12898
1839 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1840 script create indistinguishable segments.
1841 (Layout::set_segment_offsets): Use stable_sort when sorting
1842 segments. Pass this to Compare_segments constructor.
1843 * layout.h (class Layout): Make segment_precedes non-static.
1844 (class Compare_segments): Change from struct to class. Add
1845 layout_ field. Add constructor.
1846 * script-sections.cc
1847 (Script_sections::attach_sections_using_phdrs_clause): Rename
1848 local orphan to is_orphan. Don't report failure to put empty
1849 section in segment. On attachment failure, report name of
1850 section, and attach to first PT_LOAD segment.
1851
1852 2011-06-28 Ian Lance Taylor <iant@google.com>
1853
1854 PR gold/12934
1855 * target-select.cc (Target_selector::Target_selector): Add
1856 emulation parameter. Change all callers.
1857 (select_target_by_bfd_name): Rename from select_target_by_name.
1858 Change all callers.
1859 (select_target_by_emulation): New function.
1860 (supported_emulation_names): New function.
1861 * target-select.h (class Target_selector): Add emulation_ field.
1862 Update declarations.
1863 (Target_selector::recognize_by_bfd_name): Rename from
1864 recognize_by_name. Change all callers.
1865 (Target_selector::supported_bfd_names): Rename from
1866 supported_names. Change all callers.
1867 (Target_selector::recognize_by_emulation): New function.
1868 (Target_selector::supported_emulations): New function.
1869 (Target_selector::emulation): New function.
1870 (Target_selector::do_recognize_by_bfd_name): Rename from
1871 do_recognize_by_name. Change all callers.
1872 (Target_selector::do_supported_bfd_names): Rename from
1873 do_supported_names. Change all callers.
1874 (Target_selector::do_recognize_by_emulation): New function.
1875 (Target_selector::do_supported_emulations): New function.
1876 (select_target_by_bfd_name): Change name in declaration.
1877 (select_target_by_emulation): Declare.
1878 (supported_emulation_names): Declare.
1879 * parameters.cc (parameters_force_valid_target): Try to find
1880 target based on emulation from -m option.
1881 * options.h (class General_options): Change doc string for -m.
1882 * options.cc (help): Print emulations.
1883 (General_options::parse_V): Likewise.
1884 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1885 Add emulation parameter. Change all callers.
1886
1887 2011-06-28 Ian Lance Taylor <iant@google.com>
1888
1889 * target.h (class Target): Add osabi_ field.
1890 (Target::osabi): New function.
1891 (Target::set_osabi): New function.
1892 (Target::Target): Initialize osabi_.
1893 (Target::do_adjust_elf_header): Make pure virtual.
1894 (Sized_target::do_adjust_elf_header): Declare.
1895 * target.cc (Sized_target::do_adjust_elf_header): New function.
1896 (class Sized_target): Instantiate all versions.
1897 * freebsd.h (class Target_freebsd): Remove.
1898 (Target_selector_freebsd::do_recognize): Call set_osabi on
1899 Target.
1900 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1901 (Target_selector_freebsd::set_osabi): Remove.
1902 * i386.cc (class Target_i386): Inherit from Sized_target rather
1903 than Target_freebsd.
1904 * x86_64.cc (class Target_x86_64): Likewise.
1905
1906 2011-06-28 Ian Lance Taylor <iant@google.com>
1907
1908 * target.h (Target::can_check_for_function_pointers): Rewrite.
1909 Make non-virtual.
1910 (Target::can_icf_inline_merge_sections): Likewise.
1911 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1912 (Target::Target_info): Add can_icf_inline_merge_sections field.
1913 (Target::do_can_check_for_function_pointers): New virtual
1914 function.
1915 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1916 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1917 from can_check_for_function_pointers, move in file.
1918 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1919 section_may_have_icf_unsafe_poineters, move in file.
1920 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1921 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1922 Rename from can_check_for_function_pointers, move in file.
1923 (Target_i386::can_icf_inline_merge_sections): Remove.
1924 (Target_i386::i386_info): Initialize
1925 can_icf_inline_merge_sections.
1926 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1927 Initialize can_icf_inline_merge_sections.
1928 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1929 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1930 Rename from can_check_for_function_pointers, move in file.
1931 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1932 (Target_x86_64::x86_64_info): Initialize
1933 can_icf_inline_merge_sections.
1934 * testsuite/testfile.cc (Target_test::test_target_info):
1935 Likewise.
1936 * icf.cc (get_section_contents): Correct formatting.
1937
1938 2011-06-27 Ian Lance Taylor <iant@google.com>
1939
1940 * symtab.cc (Symbol::versioned_name): New function.
1941 (Symbol_table::add_to_final_symtab): Use versioned_name when
1942 appropriate.
1943 (Symbol_table::sized_write_symbol): Likewise.
1944 * symtab.h (class Symbol): Declare versioned_name.
1945 * stringpool.h (class Stringpool_template): Add variant of add
1946 which takes a std::basic_string.
1947 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1948 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1949 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1950 (ver_test_12.o): New target.
1951 * testsuite/Makefile.in: Rebuild.
1952
1953 2011-06-27 Doug Kwan <dougkwan@google.com>
1954
1955 * arm.cc (Arm_relocate_functions::thm_jump8,
1956 Arm_relocate_functions::thm_jump11): Use a wider signed
1957 type to compute offset.
1958 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1959 arm_thm_jump8.
1960 * testsuite/Makefile.in: Regenerate.
1961 * testsuite/arm_branch_in_range.sh: Check test results of
1962 arm_thm_jump11 and arm_thm_jump8.
1963 * testsuite/arm_thm_jump11.s: New test source file.
1964 * testsuite/arm_thm_jump11.t: New linker script.
1965 * testsuite/arm_thm_jump8.s: New test source file.
1966 * testsuite/arm_thm_jump8.t: New linker script.
1967
1968 2011-06-24 Ian Lance Taylor <iant@google.com>
1969
1970 * layout.cc: Include "object.h".
1971 (ctors_sections_in_init_array): New static variable.
1972 (Layout::is_ctors_in_init_array): New function.
1973 (Layout::layout): Add entry to ctors_sections_in_init_array if
1974 appropriate.
1975 * layout.h (class Layout): Declare is_ctors_in_init_array.
1976 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1977 is_ctors_reverse_view is set.
1978 (Sized_relobj_file::write_sections): Add layout parameter. Change
1979 all callers. Set is_ctors_reverse_view field of View_size.
1980 (Sized_relobj_file::reverse_words): New function.
1981 * object.h (Sized_relobj_file::View_size): Add
1982 is_ctors_reverse_view field.
1983 (class Sized_relobj_file): Update declarations.
1984 * testsuite/initpri3.c: New test.
1985 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1986 initpri3b.
1987 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1988 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1989 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1990 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1991 * testsuite/Makefile.in: Rebuild.
1992
1993 2011-06-24 Cary Coutant <ccoutant@google.com>
1994
1995 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1996 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1997 (debug_msg_cdebug.err): New targets.
1998 * testsuite/Makefile.in: Regenerate.
1999 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2000 Fix checks for link with shared library.
2001
2002 2011-06-24 Doug Kwan <dougkwan@google.com>
2003
2004 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2005 skip empty text sections.
2006 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2007
2008 2011-06-22 Ian Lance Taylor <iant@google.com>
2009
2010 PR gold/12910
2011 * options.h (class General_options): Add --ctors-in-init-array.
2012 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2013 friends as SHT_PROGBITS for merging sections.
2014 (Layout::layout): Remove special handling of .init_array and
2015 friends. Don't sort if doing relocatable link. Sort for .ctors
2016 and .dtors if ctors_in_init_array.
2017 (Layout::make_output_section): Force correct section types for
2018 .init_array and friends. Don't sort if doing relocatable link,
2019 Don't sort .ctors and .dtors if ctors_in_init_array.
2020 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2021 (Layout::output_section_name): Add relobj parameter. Change all
2022 callers. Handle .ctors. and .dtors. in code rather than table.
2023 Handle .ctors and .dtors if ctors_in_init_array.
2024 (Layout::match_file_name): New function, moved from output.cc.
2025 * layout.h (class Layout): Update declarations.
2026 * output.cc: Include "layout.h".
2027 (Input_section_sort_entry::get_priority): New function.
2028 (Input_section_sort_entry::match_file_name): Just call
2029 Layout::match_file_name.
2030 (Output_section::Input_section_sort_init_fini_compare::operator()):
2031 Handle .ctors and .dtors. Sort by explicit priority rather than
2032 by name.
2033 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2034 * testsuite/initpri2.c: New test.
2035 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2036 (check_PROGRAMS): Add initpri2.
2037 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2038 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2039 * configure, testsuite/Makefile.in: Rebuild.
2040
2041 2011-06-19 Ian Lance Taylor <iant@google.com>
2042
2043 PR gold/12880
2044 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2045 .interp section to a PT_INTERP segment even if we have seen a
2046 --dynamic-linker option. Don't do it if we have seen a PHDRS
2047 clause in a linker script.
2048 (Layout::finalize): Don't create a .interp section if we've
2049 already create a PT_INTERP segment.
2050 (Layout::create_interp): Always call choose_output_section (revert
2051 patch of 2011-06-17). Don't create PT_INTERP segment.
2052 * script-sections.cc
2053 (Script_sections::create_note_and_tls_segments): Add a .interp
2054 section to a PT_INTERP segment even if we have seen a
2055 --dynamic-linker option.
2056
2057 2011-06-18 Ian Lance Taylor <iant@google.com>
2058
2059 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2060 merely because a non-PT_LOAD segment has a dynamic reloc.
2061
2062 2011-06-18 Ian Lance Taylor <iant@google.com>
2063
2064 * layout.cc (Layout::finish_dynamic_section): Don't create
2065 DT_FLAGS entry if not needed.
2066
2067 2011-06-18 Ian Lance Taylor <iant@google.com>
2068
2069 PR gold/12745
2070 * layout.cc (Layout::layout_eh_frame): Correct handling of
2071 writable .eh_frame section.
2072
2073 2011-06-17 Ian Lance Taylor <iant@google.com>
2074
2075 PR gold/12893
2076 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2077 symbol is redefined with the exact same object and value.
2078
2079 2011-06-17 Ian Lance Taylor <iant@google.com>
2080
2081 PR gold/12880
2082 * layout.h (class Layout): Add interp_segment_ field.
2083 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2084 (Layout::attach_allocated_section_to_segment): If making shared
2085 library, put .interp section in PT_INTERP segment.
2086 (Layout::finalize): Also call create_interp if -dynamic-linker
2087 option was used.
2088 (Layout::create_interp): Assert that there is no PT_INTERP
2089 segment. If not using a SECTIONS clause, use make_output_section.
2090 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2091 * script-sections.cc
2092 (Script_sections::create_note_and_tls_segments): If making shared
2093 library, put .interp section in PT_INTERP segment.
2094
2095 2011-06-17 Ian Lance Taylor <iant@google.com>
2096
2097 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2098 when making a shared library.
2099
2100 2011-06-17 Ian Lance Taylor <iant@google.com>
2101
2102 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2103 parameter. Change all callers. Don't issue warning about PC32
2104 against locally defined symbol.
2105
2106 2011-06-16 Ian Lance Taylor <iant@google.com>
2107
2108 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2109 occurs in same object.
2110
2111 2011-06-14 Alan Modra <amodra@gmail.com>
2112
2113 * po/POTFILES.in: Regenerate.
2114
2115 2011-06-09 Ian Lance Taylor <iant@google.com>
2116
2117 * script-sections.cc
2118 (Orphan_output_section::set_section_addresses): For a relocatable
2119 link set address to 0.
2120
2121 2011-06-09 Cary Coutant <ccoutant@google.com>
2122
2123 PR gold/12804
2124 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2125 used with --compress-debug-sections.
2126 * gold/object.cc (Sized_relobj_file::do_layout): Report
2127 uncompressed size of compressed input sections.
2128
2129 2011-06-08 Cary Coutant <ccoutant@google.com>
2130
2131 PR gold/12804
2132 * testsuite/two_file_test_2_v1.cc: Change initialization of
2133 v2 to keep it in .data.
2134
2135 2011-06-07 Cary Coutant <ccoutant@google.com>
2136
2137 * common.cc (Symbol_table::do_allocate_commons_list): Call
2138 gold_fallback.
2139 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2140 (Errors::fallback): New function.
2141 (gold_fallback): New function.
2142 * errors.h (Errors::fallback): New function.
2143 * gold.cc (gold_exit): Change status parameter to enum; adjust
2144 all callers.
2145 (queue_initial_tasks): Call gold_fallback.
2146 * gold.h: Include cstdlib.
2147 (Exit_status): New enum type.
2148 (gold_exit): Change status parameter to enum.
2149 (gold_fallback): New function.
2150 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2151 (Layout::create_symtab_sections): Likewise.
2152 (Layout::create_shdrs): Likewise.
2153 * main.cc (main): Adjust call to gold_exit.
2154 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2155 (Output_data_got::add_got_entry_pair): Likewise.
2156 (Output_section::add_input_section): Likewise.
2157 (Output_section::add_output_section_data): Likewise.
2158 (Output_segment::set_section_list_addresses): Likewise.
2159 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2160
2161 2011-06-07 Cary Coutant <ccoutant@google.com>
2162
2163 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2164 for incremental links.
2165 * output.cc (Output_segment::set_section_list_addresses): Remove
2166 FIXME and test for TLS or BSS.
2167
2168 2011-06-07 Cary Coutant <ccoutant@google.com>
2169
2170 * testsuite/Makefile.am: Add incremental_copy_test,
2171 incremental_common_test_1.
2172 * testsuite/Makefile.in: Regenerate.
2173 * testsuite/common_test_1_v1.c: New source file.
2174 * testsuite/common_test_1_v2.c: New source file.
2175 * testsuite/copy_test_v1.cc: New source file.
2176
2177 2011-06-07 Cary Coutant <ccoutant@google.com>
2178
2179 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2180 update, allocate common from bss section's free list.
2181 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2182 linker-defined symbols.
2183 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2184 Skip GOT and PLT entries that are no longer referenced.
2185 (Output_section_incremental_inputs::write_info_blocks): Mark
2186 linker-defined symbols.
2187 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2188 * output.cc (Output_section::allocate): New function.
2189 * output.h (Output_section::allocate): New function.
2190 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2191 linker-defined symbols.
2192 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2193 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2194 (Symbol::init_base_output_data): Likewise.
2195 (Symbol::init_base_output_segment): Likewise.
2196 (Symbol::init_base_constant): Likewise.
2197 (Sized_symbol::init_output_data): Likewise.
2198 (Sized_symbol::init_output_segment): Likewise.
2199 (Sized_symbol::init_constant): Likewise.
2200 (Symbol_table::do_define_in_output_data): Likewise.
2201 (Symbol_table::do_define_in_output_segment): Likewise.
2202 (Symbol_table::do_define_as_constant): Likewise.
2203 * symtab.h (Symbol::is_predefined): New function.
2204 (Symbol::init_base_output_data): Add is_predefined parameter.
2205 (Symbol::init_base_output_segment): Likewise.
2206 (Symbol::init_base_constant): Likewise.
2207 (Symbol::is_predefined_): New data member.
2208 (Sized_symbol::init_output_data): Add is_predefined parameter.
2209 (Sized_symbol::init_output_segment): Likewise.
2210 (Sized_symbol::init_constant): Likewise.
2211 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2212
2213 2011-06-07 Cary Coutant <ccoutant@google.com>
2214
2215 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2216 instead of emit_copy_reloc.
2217 (Copy_relocs::emit_copy_reloc): Refactor.
2218 (Copy_relocs::make_copy_reloc): New function.
2219 (Copy_relocs::add_copy_reloc): Remove.
2220 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2221 section.
2222 (Copy_relocs::make_copy_reloc): New function.
2223 (Copy_relocs::add_copy_reloc): Remove.
2224 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2225 unchanged input files.
2226 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2227 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2228 Reserve BSS space for COPY relocations.
2229 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2230 (Output_section_incremental_inputs::write_info_blocks): Record
2231 whether a symbol is copied from a shared object.
2232 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2233 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2234 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2235 (Incremental_input_entry_reader::get_output_symbol_index): Add
2236 is_copy parameter.
2237 (Incremental_binary::emit_copy_relocs): New function.
2238 (Incremental_binary::do_emit_copy_relocs): New function.
2239 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2240 new data member.
2241 (Sized_incremental_binary::add_copy_reloc): New function.
2242 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2243 (Sized_incremental_binary::Copy_reloc): New struct.
2244 (Sized_incremental_binary::Copy_relocs): New typedef.
2245 (Sized_incremental_binary::copy_relocs_): New data member.
2246 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2247 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2248 * target.h (Sized_target::emit_copy_reloc): New function.
2249 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2250
2251 2011-06-02 Cary Coutant <ccoutant@google.com>
2252
2253 PR gold/12163
2254 * gold/archive.cc (Archive::Archive): Initialize new data member.
2255 (Archive::include_all_members): Return if archive has already been
2256 included.
2257 * gold/archive.h (Archive::include_all_members_): New data member.
2258
2259 2011-06-02 Nick Clifton <nickc@redhat.com>
2260
2261 * dynobj.h: Fix spelling mistake in comment.
2262 * output.cc: Likewise.
2263
2264 2011-05-31 Doug Kwan <dougkwan@google.com>
2265 Asier Llano
2266
2267 PR gold/12826
2268 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2269 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2270 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2271 redundant arm_exidx_test.so.
2272 * testsuite/Makefile.in: Regenerate.
2273 (check_SCRIPTS): Add pr12826.sh
2274 (check_DATA): Add pr12826.stdout
2275 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2276 * testsuite/pr12826.sh: New file.
2277 * testsuite/pr12826_1.s: Ditto.
2278 * testsuite/pr12826_1.s: Ditto.
2279
2280 2011-05-30 Ian Lance Taylor <iant@google.com>
2281
2282 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2283 sections.
2284
2285 2011-05-29 Ian Lance Taylor <iant@google.com>
2286
2287 PR gold/12804
2288 * testsuite/Makefile.am: Use different file name for two_file_test
2289 temporary file for each incremental test.
2290 * testsuite/Makefile.in: Rebuild.
2291
2292 2011-05-29 Ian Lance Taylor <iant@google.com>
2293
2294 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2295 binary input file is empty.
2296
2297 2011-05-27 Ian Lance Taylor <iant@google.com>
2298
2299 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2300 (ver_test_9.so): Likewise.
2301 * testsuite/Makefile.in: Rebuild.
2302
2303 2011-05-26 Cary Coutant <ccoutant@google.com>
2304
2305 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2306 * incremental.cc (Incremental_inputs::report_input_section): Fix
2307 comment, indentation.
2308 (Incremental_inputs::report_comdat_group): New function.
2309 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2310 of data for incremental input file entry.
2311 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2312 group count, COMDAT group signatures.
2313 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2314 an unchanged input file.
2315 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2316 Initialize new data member.
2317 (Incremental_object_entry::add_comdat_group): New function.
2318 (Incremental_object_entry::get_comdat_group_count): New function.
2319 (Incremental_object_entry::get_comdat_signature_key): New function.
2320 (Incremental_object_entry::groups_): New data member.
2321 (Incremental_inputs::report_comdat_group): New function.
2322 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2323 data for incremental input file entry.
2324 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2325 (Incremental_input_entry_reader::get_input_section): Adjust size of
2326 data for incremental input file entry.
2327 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2328 (Incremental_input_entry_reader::get_comdat_group_signature): New
2329 function.
2330 * object.cc (Sized_relobj::include_section_group): Report kept
2331 COMDAT groups for incremental links.
2332
2333 2011-05-24 David Meyer <pdox@google.com>
2334
2335 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2336 with name parameter. Add found_name parameter.
2337 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2338 * dirsearch.h (class Dirsearch): Update declaration.
2339
2340 2011-05-24 Ian Lance Taylor <iant@google.com>
2341
2342 * archive.cc (Library_base::should_include_member): Pull in object
2343 from archive if it defines the entry symbol.
2344 * parameters.cc (Parameters::entry): New function.
2345 * parameters.h (class Parameters): Declare entry.
2346 * output.h (class Output_file_header): Remove entry_ field.
2347 * output.cc (Output_file_header::Output_file_header): Remove entry
2348 parameter. Change all callers.
2349 (Output_file_header::entry): Use parameters->entry.
2350 * gold.cc (queue_middle_tasks): Likewise.
2351 * plugin.cc (Plugin_hook::run): Likewise.
2352
2353 2011-05-24 Cary Coutant <ccoutant@google.com>
2354
2355 * gold.cc (queue_initial_tasks): Pass incremental base filename
2356 to Output_file::open_base_file; don't print error message.
2357 * incremental-dump.cc (main): Adjust call to
2358 Output_file::open_for_modification.
2359 * incremental-dump.cc (main): Likewise.
2360 * incremental.cc (Incremental_inputs::report_command_line):
2361 Ignore --incremental-base option when comparing command lines.
2362 Ignore parameter when given as separate argument.
2363 * options.h (class General_options): Add --incremental-base.
2364 * output.cc (Output_file::Output_file):
2365 (Output_file::open_base_file): Add base_name and writable parameters;
2366 read base file into new file; print error message here.
2367 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2368 callers.
2369 * output.h (Output_file::open_for_modification): Rename to...
2370 (Output_file::open_base_file): ...this; add base_name and
2371 writable parameters; adjust all callers.
2372 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2373 callers.
2374 * testsuite/Makefile.am (incremental_test_4): Test
2375 --incremental-base.
2376 * testsuite/Makefile.in: Regenerate.
2377
2378 2011-05-24 Cary Coutant <ccoutant@google.com>
2379
2380 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2381 incremental_test_4.
2382 * testsuite/Makefile.in: Regenerate.
2383 * testsuite/two_file_test_1_v1.cc: New test source file.
2384 * testsuite/two_file_test_1b_v1.cc: New test source file.
2385 * testsuite/two_file_test_2_v1.cc: New test source file.
2386
2387 2011-05-24 Cary Coutant <ccoutant@google.com>
2388
2389 * dynobj.h (Dynobj::do_dynobj): New function.
2390 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2391 flag and soname for shared objects.
2392 * incremental.cc (Incremental_inputs::report_object): Make
2393 either Incremental_object_entry or Incremental_dynobj_entry; add
2394 soname to string table.
2395 (Incremental_inputs::report_input_section): Add assertion.
2396 (Output_section_incremental_inputs::set_final_data_size): Adjust
2397 type of input file entry for shared libraries; adjust size of
2398 shared library info entry.
2399 (Output_section_incremental_inputs::write_input_files): Write
2400 as_needed flag for shared libraries.
2401 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2402 of input file entry for shared libraries; write soname.
2403 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2404 soname from incremental info.
2405 * incremental.h (enum Incremental_input_flags): Add
2406 INCREMENTAL_INPUT_AS_NEEDED.
2407 (Incremental_input_entry::Incremental_input_entry): Initialize new
2408 data member.
2409 (Incremental_input_entry::set_as_needed): New function.
2410 (Incremental_input_entry::as_needed): New function.
2411 (Incremental_input_entry::do_dynobj_entry): New function.
2412 (Incremental_input_entry::as_needed_): New data member.
2413 (Incremental_object_entry::Incremental_object_entry): Don't check
2414 for shared library.
2415 (Incremental_object_entry::do_type): Likewise.
2416 (class Incremental_dynobj_entry): New class.
2417 (Incremental_input_entry_reader::as_needed): New function.
2418 (Incremental_input_entry_reader::get_soname): New function.
2419 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2420 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2421 size of shared library info entry.
2422 * layout.cc (Layout::finish_dynamic_section): Don't test for
2423 incremental link when adding DT_NEEDED entries.
2424 * object.h (Object::Object): Initialize new data member.
2425 (Object::dynobj): New function.
2426 (Object::set_as_needed): New function.
2427 (Object::as_needed): New function.
2428 (Object::do_dynobj): New function.
2429 (Object::as_needed_): New data member.
2430
2431 2011-05-24 Cary Coutant <ccoutant@google.com>
2432
2433 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2434 info; adjust display of GOT entries.
2435 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2436 vector of input objects; remove file_status_.
2437 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2438 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2439 got_plt reader; call target hooks to reserve GOT entries.
2440 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2441 of input file info header and GOT info entry.
2442 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2443 relocation info.
2444 (Got_plt_view_info::got_descriptor): Remove.
2445 (Got_plt_view_info::sym_index): New data member.
2446 (Got_plt_view_info::input_index): New data member.
2447 (Local_got_offset_visitor::visit): Write input file index.
2448 (Global_got_offset_visitor::visit): Write 0 for input file index.
2449 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2450 with sym_index and input_index.
2451 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2452 incremental info GOT entry; replace got_descriptor with input_index.
2453 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2454 map from input file index to object.
2455 (Sized_relobj_incr::do_layout): Replace direct data member reference
2456 with accessor function.
2457 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2458 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2459 Adjust size of input file info header.
2460 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2461 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2462 (Incremental_input_entry_reader::get_input_section): Adjust size of
2463 input file info header.
2464 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2465 of incremental info GOT entry.
2466 (Incremental_got_plt_reader::get_got_desc): Remove.
2467 (Incremental_got_plt_reader::get_got_symndx): New function.
2468 (Incremental_got_plt_reader::get_got_input_index): New function.
2469 (Sized_incremental_binary::Sized_incremental_binary): Remove
2470 file_status_; add input_objects_.
2471 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2472 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2473 (Sized_incremental_binary::file_is_unchanged): Remove.
2474 (Sized_incremental_binary::set_input_object): New function.
2475 (Sized_incremental_binary::input_object): New function.
2476 (Sized_incremental_binary::file_status_): Remove.
2477 (Sized_incremental_binary::input_objects_): New data member.
2478 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2479 references.
2480 (Sized_relobj_incr::invalid_address): Move to base class.
2481 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2482 class.
2483 (Sized_relobj_incr::do_output_section_offset): Likewise.
2484 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2485 (Sized_relobj_incr::section_offsets_): Likewise.
2486 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2487 function.
2488 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2489 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2490 with accessor function.
2491 (Sized_relobj_file::do_layout): Likewise.
2492 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2493 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2494 (Sized_relobj_file::compute_final_local_value): Replace refs to
2495 section_offsets_ with accessor function.
2496 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2497 * object.h (Relobj::Relobj): Initialize new data members.
2498 (Relobj::add_dyn_reloc): New function.
2499 (Relobj::first_dyn_reloc): New function.
2500 (Relobj::dyn_reloc_count): New function.
2501 (Relobj::first_dyn_reloc_): New data member.
2502 (Relobj::dyn_reloc_count_): New data member.
2503 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2504 references.
2505 (Sized_relobj::Address): New typedef.
2506 (Sized_relobj::invalid_address): Move here from child class.
2507 (Sized_relobj::Sized_relobj): Initialize new data members.
2508 (Sized_relobj::sized_relobj): New function.
2509 (Sized_relobj::is_output_section_offset_invalid): Move here from
2510 child class.
2511 (Sized_relobj::get_output_section_offset): Likewise.
2512 (Sized_relobj::local_has_got_offset): Likewise.
2513 (Sized_relobj::local_got_offset): Likewise.
2514 (Sized_relobj::set_local_got_offset): Likewise.
2515 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2516 (Sized_relobj::clear_got_offsets): New function.
2517 (Sized_relobj::section_offsets): Move here from child class.
2518 (Sized_relobj::do_output_section_offset): Likewise.
2519 (Sized_relobj::do_set_section_offset): Likewise.
2520 (Sized_relobj::Local_got_offsets): Likewise.
2521 (Sized_relobj::local_got_offsets_): Likewise.
2522 (Sized_relobj::section_offsets_): Likewise.
2523 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2524 references.
2525 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2526 class.
2527 (Sized_relobj_file::sized_relobj): New function
2528 (Sized_relobj_file::local_has_got_offset): Move to base class.
2529 (Sized_relobj_file::local_got_offset): Likewise.
2530 (Sized_relobj_file::set_local_got_offset): Likewise.
2531 (Sized_relobj_file::get_output_section_offset): Likewise.
2532 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2533 (Sized_relobj_file::do_output_section_offset): Likewise.
2534 (Sized_relobj_file::do_set_section_offset): Likewise.
2535 (Sized_relobj_file::Local_got_offsets): Likewise.
2536 (Sized_relobj_file::local_got_offsets_): Likewise.
2537 (Sized_relobj_file::section_offsets_): Likewise.
2538 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2539 (all constructors).
2540 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2541 (Output_reloc::get_symbol_index): Likewise.
2542 (Output_reloc::local_section_offset): Likewise.
2543 (Output_reloc::get_address): Likewise.
2544 (Output_reloc::symbol_value): Likewise.
2545 (Output_data_got::reserve_slot): Move to class definition.
2546 (Output_data_got::reserve_local): New function.
2547 (Output_data_got::reserve_slot_for_global): Remove.
2548 (Output_data_got::reserve_global): New function.
2549 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2550 (all constructors, two instantiations).
2551 (Output_reloc::get_relobj): New function (two instantiations).
2552 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2553 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2554 (Output_data_reloc::add_global): Adjust type of relobj.
2555 (Output_data_reloc::add_global_relative): Likewise.
2556 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2557 (Output_data_reloc::add_local): Likewise.
2558 (Output_data_reloc::add_local_relative): Likewise.
2559 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2560 (Output_data_reloc::add_local_section): Likewise.
2561 (Output_data_reloc::add_output_section): Likewise.
2562 (Output_data_reloc::add_absolute): Likewise.
2563 (Output_data_reloc::add_target_specific): Likewise.
2564 (Output_data_got::reserve_slot): Move definition here.
2565 (Output_data_got::reserve_local): New function.
2566 (Output_data_got::reserve_global): New function.
2567 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2568 section_offsets_ with accessor function.
2569 (Sized_relobj_file::write_sections): Likewise.
2570 (Sized_relobj_file::do_relocate_sections): Likewise.
2571 * target.h (Sized_target::reserve_local_got_entry): New function.
2572 (Sized_target::reserve_global_got_entry): New function.
2573 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2574 (Target_x86_64::reserve_global_got_entry): New function.
2575 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2576
2577 2011-05-23 Cary Coutant <ccoutant@google.com>
2578
2579 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2580 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2581 bit when checking got_type.
2582 * incremental.cc (Sized_incremental_binary::setup_readers):
2583 Store symbol table and string table locations; initialize bit vector
2584 of file status flags.
2585 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2586 unchanged files.
2587 (Sized_incremental_binary::do_process_got_plt): New function.
2588 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2589 (Output_section_incremental_inputs::set_final_data_size): Record
2590 file index for each input file.
2591 (Output_section_incremental_inputs::write_got_plt): Store file index
2592 instead of input entry offset for each GOT entry.
2593 * incremental.h
2594 (Incremental_input_entry::Incremental_input_entry): Initialize new
2595 data member.
2596 (Incremental_input_entry::set_offset): Store file index.
2597 (Incremental_input_entry::get_file_index): New function.
2598 (Incremental_input_entry::file_index_): New data member.
2599 (Incremental_binary::process_got_plt): New function.
2600 (Incremental_binary::do_process_got_plt): New function.
2601 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2602 data members.
2603 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2604 (Sized_incremental_binary::set_file_is_unchanged): New function.
2605 (Sized_incremental_binary::file_is_unchanged): New function.
2606 (Sized_incremental_binary::do_process_got_plt): New function.
2607 (Sized_incremental_binary::file_status_): New data member.
2608 (Sized_incremental_binary::main_symtab_loc_): New data member.
2609 (Sized_incremental_binary::main_strtab_loc_): New data member.
2610 * output.cc (Output_data_got::Got_entry::write): Add case
2611 RESERVED_CODE.
2612 (Output_data_got::add_global): Call add_got_entry.
2613 (Output_data_got::add_global_plt): Likewise.
2614 (Output_data_got::add_global_with_rel): Likewise.
2615 (Output_data_got::add_global_with_rela): Likewise.
2616 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2617 (Output_data_got::add_global_pair_with_rela): Likewise.
2618 (Output_data_got::add_local): Call add_got_entry.
2619 (Output_data_got::add_local_plt): Likewise.
2620 (Output_data_got::add_local_with_rel): Likewise.
2621 (Output_data_got::add_local_with_rela): Likewise.
2622 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2623 (Output_data_got::add_local_pair_with_rela): Likewise.
2624 (Output_data_got::reserve_slot): New function.
2625 (Output_data_got::reserve_slot_for_global): New function.
2626 (Output_data_got::add_got_entry): New function.
2627 (Output_data_got::add_got_entry_pair): New function.
2628 (Output_section::add_output_section_data): Edit FIXME.
2629 * output.h
2630 (Output_section_data_build::Output_section_data_build): New
2631 constructor with size parameter.
2632 (Output_data_space::Output_data_space): Likewise.
2633 (Output_data_got::Output_data_got): Initialize new data member; new
2634 constructor with size parameter.
2635 (Output_data_got::add_constant): Call add_got_entry.
2636 (Output_data_got::reserve_slot): New function.
2637 (Output_data_got::reserve_slot_for_global): New function.
2638 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2639 (Output_data_got::add_got_entry): New function.
2640 (Output_data_got::add_got_entry_pair): New function.
2641 (Output_data_got::free_list_): New data member.
2642 * target.h (Sized_target::init_got_plt_for_update): New function.
2643 (Sized_target::register_global_plt_entry): New function.
2644 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2645 Initialize new data member; call init; add constructor with PLT count.
2646 (Output_data_plt_x86_64::init): New function.
2647 (Output_data_plt_x86_64::add_relocation): New function.
2648 (Output_data_plt_x86_64::reserve_slot): New function.
2649 (Output_data_plt_x86_64::free_list_): New data member.
2650 (Target_x86_64::init_got_plt_for_update): New function.
2651 (Target_x86_64::register_global_plt_entry): New function.
2652 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2653 incremental updates.
2654 (Output_data_plt_x86_64::add_relocation): New function.
2655 * testsuite/object_unittest.cc (Object_test): Set default options.
2656
2657 2011-05-16 Ian Lance Taylor <iant@google.com>
2658
2659 * options.h (class General_options): Make -i a synonym for -r.
2660
2661 2011-05-16 Ian Lance Taylor <iant@google.com>
2662
2663 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2664
2665 2011-05-10 Cary Coutant <ccoutant@google.com>
2666
2667 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2668 strip_all (-s).
2669
2670 2011-05-06 Ian Lance Taylor <iant@google.com>
2671
2672 * layout.cc (Layout::layout): If the output section flags change,
2673 update the ordering.
2674
2675 2011-04-25 Cary Coutant <ccoutant@google.com>
2676
2677 * incremental-dump.cc (dump_incremental_inputs): Print local
2678 symbol info for each input file.
2679 * incremental.cc
2680 (Output_section_incremental_inputs::set_final_data_size): Add local
2681 symbol info to input file entries in incremental info.
2682 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2683 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2684 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2685 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2686 implementation.
2687 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2688 (Sized_incr_relobj::do_relocate): Write the local symbols.
2689 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2690 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2691 Adjust size of input file header.
2692 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2693 (Incremental_inputs_reader::get_local_symbol_count): New function.
2694 (Incremental_inputs_reader::get_input_section): Adjust size of input
2695 file header.
2696 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2697 (Sized_incr_relobj::This): New typedef.
2698 (Sized_incr_relobj::sym_size): New const data member.
2699 (Sized_incr_relobj::Local_symbol): New struct.
2700 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2701 (Sized_incr_relobj::do_local_symbol_offset): New function.
2702 (Sized_incr_relobj::local_symbol_count_): New data member.
2703 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2704 (Sized_incr_relobj::local_symbol_index_): New data member.
2705 (Sized_incr_relobj::local_symbol_offset_): New data member.
2706 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2707 (Sized_incr_relobj::local_symbols_): New data member.
2708 * object.h (Relobj::output_local_symbol_count): New function.
2709 (Relobj::local_symbol_offset): New function.
2710 (Relobj::do_output_local_symbol_count): New function.
2711 (Relobj::do_local_symbol_offset): New function.
2712 (Sized_relobj::do_output_local_symbol_count): New function.
2713 (Sized_relobj::do_local_symbol_offset): New function.
2714
2715 2011-04-22 Vladimir Simonov <sv@sw.ru>
2716
2717 * descriptors.cc (set_close_on_exec): New function.
2718 (Descriptors::open): Use set_close_on_exec.
2719 * output.cc (S_ISLNK): Define if not defined.
2720
2721 2011-04-22 Cary Coutant <ccoutant@google.com>
2722
2723 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2724 global symbol map.
2725 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2726 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2727 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2728 relocations.
2729 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2730 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2731 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2732 * incremental.h
2733 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2734 function.
2735 (Incremental_binary::apply_incremental_relocs): New function.
2736 (Incremental_binary::do_apply_incremental_relocs): New function.
2737 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2738 data member.
2739 (Sized_incremental_binary::add_global_symbol): New function.
2740 (Sized_incremental_binary::global_symbol): New function.
2741 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2742 (Sized_incremental_binary::symbol_map_): New data member.
2743 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2744 * target.h (Sized_target::apply_relocation): New function.
2745 * target-reloc.h (apply_relocation): New function.
2746 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2747
2748 2011-04-22 Doug Kwan <dougkwan@google.com>
2749
2750 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2751 flag of a SHT_ARM_EXIDX section.
2752 * testsuite/Makefile.am (arm_exidx_test): New test rules.
2753 * testsuite/Makefile.in: Regenerate.
2754 * testsuite/arm_exidx_test.s: New file.
2755 * testsuite/arm_exidx_test.sh: Same.
2756
2757 2011-04-20 Cary Coutant <ccoutant@google.com>
2758
2759 PR gold/12689
2760 * archive.h (Incremental_archive_entry::Archive_member):
2761 Initialize arg_serial_ (second constructor).
2762
2763 2011-04-17 Ian Lance Taylor <iant@google.com>
2764
2765 * object.cc (Relocate_info::location): Simplify location string.
2766 * errors.cc (Errors::error_at_location): Don't print program
2767 name.
2768 (Errors::warning_at_location): Likewise.
2769 (Errors::undefined_symbol): Likewise.
2770 * testsuite/debug_msg.sh: Update accordingly.
2771
2772 2011-04-14 Cary Coutant <ccoutant@google.com>
2773
2774 * gold/layout.cc (Layout::symtab_section_offset): New function.
2775 * gold/layout.h (Layout::symtab_section_offset): New function.
2776 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2777
2778 2011-04-12 Ian Lance Taylor <iant@google.com>
2779
2780 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2781 with MREMAP_MAYMOVE.
2782 * output.h (class Output_file): Add map_is_allocated_ field.
2783 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2784 not available, provide stubs. If mremap is not available, #define
2785 it to gold_mremap.
2786 (MREMAP_MAYMOVE): Define if not defined.
2787 (Output_file::Output_file): Initialize map_is_allocated_.
2788 (Output_file::resize): Check map_is_allocated_.
2789 (Output_file::map_anonymous): If mmap fails, use malloc.
2790 (Output_file::unmap): Don't do anything for an anonymous map.
2791 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2792 is not available, provide stubs.
2793 (File_read::View::~View): Use free rather than delete[].
2794 (File_read::make_view): Use malloc rather than new[]. If mmap
2795 fails, use malloc.
2796 (File_read::find_or_make_view): Use malloc rather than new[].
2797 * gold.h: Remove HAVE_REMAP code.
2798 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2799 exists. Rename mremap to gold_mremap. If mmap is not available
2800 don't do anything.
2801 * configure, config.in: Rebuild.
2802
2803 2011-04-11 Ian Lance Taylor <iant@google.com>
2804
2805 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2806 initialize local variable v.
2807
2808 2011-04-11 Cary Coutant <ccoutant@google.com>
2809
2810 * archive.cc (Archive::include_member): Adjust call to
2811 report_object.
2812 (Add_archive_symbols::run): Track argument serial numbers.
2813 (Lib_group::include_member): Likewise.
2814 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2815 * archive.h (Incremental_archive_entry::Archive_member):
2816 Initialize arg_serial_.
2817 (Archive_member::arg_serial_): New data member.
2818 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2819 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2820 incremental link.
2821 (Sized_dynobj::do_for_all_local_got_entries): New function.
2822 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2823 function.
2824 * fileread.cc (get_mtime): New function.
2825 * fileread.h (get_mtime): New function.
2826 * gold.cc (queue_initial_tasks): Check for incremental update.
2827 (process_incremental_input): New function.
2828 (queue_middle_tasks): Don't force valid target for incremental
2829 update.
2830 * incremental-dump.cc (find_input_containing_global): Adjust
2831 size of symbol info entry.
2832 (dump_incremental_inputs): Dump argument serial number and
2833 in_system_directory flag; bias shndx by 1; print symbol names
2834 when dumping per-file symbol lists; use new symbol info readers.
2835 * incremental.cc
2836 (Output_section_incremental_inputs:update_data_size): New function.
2837 (Sized_incremental_binary::setup_readers): Setup input readers
2838 for each input file; build maps for files added from libraries
2839 and scripts.
2840 (Sized_incremental_binary::check_input_args): New function.
2841 (Sized_incremental_binary::do_check_inputs): Build map of argument
2842 serial numbers to input arguments.
2843 (Sized_incremental_binary::do_file_has_changed): Rename
2844 do_file_is_unchanged to this; compare file modification times.
2845 (Sized_incremental_binary::do_init_layout): New function.
2846 (Sized_incremental_binary::do_reserve_layout): New function.
2847 (Sized_incremental_binary::do_get_input_reader): Remove.
2848 (Sized_incremental_binary::get_symtab_view): New function.
2849 (Incremental_checker::can_incrementally_link_output_file): Remove.
2850 (Incremental_inputs::report_command_line): Exclude --debug options.
2851 (Incremental_inputs::report_archive_begin): Add parameter; track
2852 argument serial numbers; don't put input file entry for archive
2853 before archive members.
2854 (Incremental_inputs::report_archive_end): Put input file entry
2855 for archive after archive members.
2856 (Incremental_inputs::report_object): Add parameter; track argument
2857 serial numbers and in_system_directory flag.
2858 (Incremental_inputs::report_script): Add parameter; track argument
2859 serial numbers.
2860 (Output_section_incremental_inputs::set_final_data_size): Adjust
2861 size of symbol info entry; check for forwarding symbols.
2862 (Output_section_incremental_inputs::write_input_files): Write
2863 in_system_directory flag and argument serial number.
2864 (Output_section_incremental_inputs::write_info_blocks): Map section
2865 indices between incremental info and original input file; store
2866 input section index for each symbol.
2867 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2868 change operator() to visit().
2869 (class Global_got_offset_visitor): Likewise.
2870 (class Global_symbol_visitor_got_plt):
2871 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2872 classes.
2873 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2874 (Sized_incr_relobj::do_read_symbols): New function.
2875 (Sized_incr_relobj::do_layout): New function.
2876 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2877 (Sized_incr_relobj::do_add_symbols): New function.
2878 (Sized_incr_relobj::do_should_include_member): New function.
2879 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2880 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2881 (Sized_incr_relobj::do_section_size): New function.
2882 (Sized_incr_relobj::do_section_name): New function.
2883 (Sized_incr_relobj::do_section_contents): New function.
2884 (Sized_incr_relobj::do_section_flags): New function.
2885 (Sized_incr_relobj::do_section_entsize): New function.
2886 (Sized_incr_relobj::do_section_address): New function.
2887 (Sized_incr_relobj::do_section_type): New function.
2888 (Sized_incr_relobj::do_section_link): New function.
2889 (Sized_incr_relobj::do_section_info): New function.
2890 (Sized_incr_relobj::do_section_addralign): New function.
2891 (Sized_incr_relobj::do_initialize_xindex): New function.
2892 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2893 (Sized_incr_relobj::do_read_relocs): New function.
2894 (Sized_incr_relobj::do_gc_process_relocs): New function.
2895 (Sized_incr_relobj::do_scan_relocs): New function.
2896 (Sized_incr_relobj::do_count_local_symbols): New function.
2897 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2898 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2899 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2900 (Sized_incr_relobj::do_relocate): New function.
2901 (Sized_incr_relobj::do_set_section_offset): New function.
2902 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2903 (Sized_incr_dynobj::do_read_symbols): New function.
2904 (Sized_incr_dynobj::do_layout): New function.
2905 (Sized_incr_dynobj::do_add_symbols): New function.
2906 (Sized_incr_dynobj::do_should_include_member): New function.
2907 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2908 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2909 (Sized_incr_dynobj::do_section_size): New function.
2910 (Sized_incr_dynobj::do_section_name): New function.
2911 (Sized_incr_dynobj::do_section_contents): New function.
2912 (Sized_incr_dynobj::do_section_flags): New function.
2913 (Sized_incr_dynobj::do_section_entsize): New function.
2914 (Sized_incr_dynobj::do_section_address): New function.
2915 (Sized_incr_dynobj::do_section_type): New function.
2916 (Sized_incr_dynobj::do_section_link): New function.
2917 (Sized_incr_dynobj::do_section_info): New function.
2918 (Sized_incr_dynobj::do_section_addralign): New function.
2919 (Sized_incr_dynobj::do_initialize_xindex): New function.
2920 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2921 (make_sized_incremental_object): New function.
2922 (Incremental_library::copy_unused_symbols): New function.
2923 (Incremental_library::do_for_all_unused_symbols): New function.
2924 * incremental.h (enum Incremental_input_flags): New type.
2925 (class Incremental_checker): Remove.
2926 (Incremental_input_entry::Incremental_input_entry): Add argument
2927 serial number.
2928 (Incremental_input_entry::arg_serial): New function.
2929 (Incremental_input_entry::set_is_in_system_directory): New function.
2930 (Incremental_input_entry::is_in_system_directory): New function.
2931 (Incremental_input_entry::arg_serial_): New data member.
2932 (Incremental_input_entry::is_in_system_directory_): New data member.
2933 (class Script_info): Move here from script.h.
2934 (Script_info::Script_info): Add filename parameter.
2935 (Script_info::filename): New function.
2936 (Script_info::filename_): New data member.
2937 (Incremental_script_entry::Incremental_script_entry): Add argument
2938 serial number.
2939 (Incremental_object_entry::Incremental_object_entry): Likewise.
2940 (Incremental_object_entry::add_input_section): Build list of input
2941 sections with map to original shndx.
2942 (Incremental_object_entry::get_input_section_index): New function.
2943 (Incremental_object_entry::shndx_): New data member.
2944 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2945 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2946 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2947 serial number.
2948 (Incremental_inputs::report_archive_begin): Likewise.
2949 (Incremental_inputs::report_object): Likewise.
2950 (Incremental_inputs::report_script): Likewise.
2951 (class Incremental_global_symbol_reader): New class.
2952 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2953 and store flags and input file type.
2954 (Incremental_input_entry_reader::arg_serial): New function.
2955 (Incremental_input_entry_reader::type): Extract type from flags.
2956 (Incremental_input_entry_reader::is_in_system_directory): New function.
2957 (Incremental_input_entry_reader::get_input_section_count): Call
2958 accessor function for type.
2959 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2960 function for type; adjust size of global symbol entry.
2961 (Incremental_input_entry_reader::get_global_symbol_count): Call
2962 accessor function for type.
2963 (Incremental_input_entry_reader::get_object_count): Likewise.
2964 (Incremental_input_entry_reader::get_object_offset): Likewise.
2965 (Incremental_input_entry_reader::get_member_count): Likewise.
2966 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2967 (Incremental_input_entry_reader::get_member_offset): Likewise.
2968 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2969 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2970 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2971 (Incremental_input_entry_reader::get_global_symbol_reader): New
2972 function.
2973 (Incremental_input_entry_reader::get_output_symbol_index): New
2974 function.
2975 (Incremental_input_entry_reader::type_): Remove.
2976 (Incremental_input_entry_reader::flags_): New data member.
2977 (Incremental_inputs_reader::input_file_offset): New function.
2978 (Incremental_inputs_reader::input_file_index): New function.
2979 (Incremental_inputs_reader::input_file): Call input_file_offset.
2980 (Incremental_inputs_reader::input_file_at_offset): New function.
2981 (Incremental_relocs_reader::get_r_type): Reformat.
2982 (Incremental_relocs_reader::get_r_shndx): Reformat.
2983 (Incremental_relocs_reader::get_r_offset): Reformat.
2984 (Incremental_relocs_reader::data): New function.
2985 (Incremental_binary::Incremental_binary): Initialize new data members.
2986 (Incremental_binary::check_inputs): Add cmdline parameter.
2987 (Incremental_binary::file_is_unchanged): Remove.
2988 (Input_reader::arg_serial): New function.
2989 (Input_reader::get_unused_symbol_count): New function.
2990 (Input_reader::get_unused_symbol): New function.
2991 (Input_reader::do_arg_serial): New function.
2992 (Input_reader::do_get_unused_symbol_count): New function.
2993 (Input_reader::do_get_unused_symbol): New function.
2994 (Incremental_binary::input_file_count): New function.
2995 (Incremental_binary::get_input_reader): Change signature to use
2996 index instead of filename.
2997 (Incremental_binary::file_has_changed): New function.
2998 (Incremental_binary::get_input_argument): New function.
2999 (Incremental_binary::get_library): New function.
3000 (Incremental_binary::get_script_info): New function.
3001 (Incremental_binary::init_layout): New function.
3002 (Incremental_binary::reserve_layout): New function.
3003 (Incremental_binary::output_file): New function.
3004 (Incremental_binary::do_check_inputs): New function.
3005 (Incremental_binary::do_file_is_unchanged): Remove.
3006 (Incremental_binary::do_file_has_changed): New function.
3007 (Incremental_binary::do_init_layout): New function.
3008 (Incremental_binary::do_reserve_layout): New function.
3009 (Incremental_binary::do_input_file_count): New function.
3010 (Incremental_binary::do_get_input_reader): Change signature.
3011 (Incremental_binary::input_args_map_): New data member.
3012 (Incremental_binary::library_map_): New data member.
3013 (Incremental_binary::script_map_): New data member.
3014 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3015 new data members.
3016 (Sized_incremental_binary::output_section): New function.
3017 (Sized_incremental_binary::inputs_reader): Add const.
3018 (Sized_incremental_binary::symtab_reader): Add const.
3019 (Sized_incremental_binary::relocs_reader): Add const.
3020 (Sized_incremental_binary::got_plt_reader): Add const.
3021 (Sized_incremental_binary::get_symtab_view): New function.
3022 (Sized_incremental_binary::Inputs_reader): New typedef.
3023 (Sized_incremental_binary::Input_entry_reader): New typedef.
3024 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3025 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3026 (Sized_incremental_binary::do_file_has_changed): New function.
3027 (Sized_incremental_binary::do_init_layout): New function.
3028 (Sized_incremental_binary::do_reserve_layout): New function.
3029 (Sized_input_reader::Inputs_reader): Remove.
3030 (Sized_input_reader::Input_entry_reader): Remove.
3031 (Sized_input_reader::do_arg_serial): New function.
3032 (Sized_input_reader::do_get_unused_symbol_count): New function.
3033 (Sized_input_reader::do_get_unused_symbol): New function.
3034 (Sized_incremental_binary::do_input_file_count): New function.
3035 (Sized_incremental_binary::do_get_input_reader): Change signature;
3036 use index instead of filename.
3037 (Sized_incremental_binary::section_map_): New data member.
3038 (Sized_incremental_binary::input_entry_readers_): New data member.
3039 (class Sized_incr_relobj): New class.
3040 (class Sized_incr_dynobj): New class.
3041 (make_sized_incremental_object): New function.
3042 (class Incremental_library): New class.
3043 * layout.cc (Free_list::num_lists): New static data member.
3044 (Free_list::num_nodes): New static data member.
3045 (Free_list::num_removes): New static data member.
3046 (Free_list::num_remove_visits): New static data member.
3047 (Free_list::num_allocates): New static data member.
3048 (Free_list::num_allocate_visits): New static data member.
3049 (Free_list::init): New function.
3050 (Free_list::remove): New function.
3051 (Free_list::allocate): New function.
3052 (Free_list::dump): New function.
3053 (Free_list::print_stats): New function.
3054 (Layout_task_runner::run): Resize output file for incremental updates.
3055 (Layout::Layout): Initialize new data members.
3056 (Layout::set_incremental_base): New function.
3057 (Layout::init_fixed_output_section): New function.
3058 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3059 incremental updates.
3060 (Layout::create_gold_note): Do not create gold note section for
3061 incremental updates.
3062 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3063 for incremental updates.
3064 (Layout::set_section_offsets): For incremental updates, allocate space
3065 from free list.
3066 (Layout::create_symtab_sections): Layout with offsets relative to
3067 start of section; for incremental updates, allocate space from free
3068 list.
3069 (Layout::create_shdrs): For incremental updates, allocate space from
3070 free list.
3071 (Layout::finish_dynamic_section): For incremental updates, do not
3072 check --as-needed (fixed in subsequent patch).
3073 * layout.h (class Free_list): New class.
3074 (Layout::set_incremental_base): New function.
3075 (Layout::incremental_base): New function.
3076 (Layout::init_fixed_output_section): New function.
3077 (Layout::allocate): New function.
3078 (Layout::incremental_base_): New data member.
3079 (Layout::free_list_): New data member.
3080 * main.cc (main): Print Free_list statistics.
3081 * object.cc (Relobj::finalize_incremental_relocs): Add
3082 clear_counts parameter; clear counts only when clear_counts is set.
3083 (Sized_relobj::Sized_relobj): Initialize new base class.
3084 (Sized_relobj::do_layout): Don't report special sections.
3085 (Sized_relobj::do_for_all_local_got_entries): New function.
3086 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3087 symtab_off to all symbol table offsets.
3088 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3089 * object.h (class Got_offset_list): Move to top of file.
3090 (Object::Object): Allow case where input_file == NULL.
3091 (Object::~Object): Likewise.
3092 (Object::input_file): Assert that input_file != NULL.
3093 (Object::lock): Allow case where input_file == NULL.
3094 (Object::unlock): Likewise.
3095 (Object::is_locked): Likewise.
3096 (Object::token): Likewise.
3097 (Object::release): Likewise.
3098 (Object::is_incremental): New function.
3099 (Object::get_mtime): New function.
3100 (Object::for_all_local_got_entries): New function.
3101 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3102 (Object::set_is_in_system_directory): New function.
3103 (Object::is_in_system_directory): New function.
3104 (Object::do_is_incremental): New function.
3105 (Object::do_get_mtime): New function.
3106 (Object::do_for_all_local_got_entries): New function.
3107 (Object::is_in_system_directory_): New data member.
3108 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3109 (class Sized_relobj_base): New class.
3110 (class Sized_relobj): Derive from Sized_relobj_base.
3111 (class Sized_relobj::Symbols): Redeclare from base class.
3112 (class Sized_relobj::local_got_offset_list): Remove.
3113 (class Sized_relobj::Output_sections): Redeclare from base class.
3114 (class Sized_relobj::do_for_all_local_got_entries): New function.
3115 (class Sized_relobj::write_local_symbols): Add offset parameter.
3116 (class Sized_relobj::local_symbol_offset_): Update comment.
3117 (class Sized_relobj::local_dynsym_offset_): Update comment.
3118 * options.cc (Input_arguments::add_file): Remove const.
3119 * options.h (Input_file_argument::Input_file_argument):
3120 Initialize arg_serial_ (all constructors).
3121 (Input_file_argument::set_arg_serial): New function.
3122 (Input_file_argument::arg_serial): New function.
3123 (Input_file_argument::arg_serial_): New data member.
3124 (Input_arguments::Input_arguments): Initialize file_count_.
3125 (Input_arguments::add_file): Remove const.
3126 (Input_arguments::number_of_input_files): New function.
3127 (Input_arguments::file_count_): New data member.
3128 (Command_line::number_of_input_files): Call
3129 Input_arguments::number_of_input_files.
3130 * output.cc (Output_segment_headers::Output_segment_headers):
3131 Set current size.
3132 (Output_section::Input_section::current_data_size): New function.
3133 (Output_section::Output_section): Initialize new data members.
3134 (Output_section::add_input_section): Don't do merge sections for
3135 an incremental link; allocate space from free list for an
3136 incremental update.
3137 (Output_section::add_output_section_data): Allocate space from
3138 free list for an incremental update.
3139 (Output_section::update_data_size): New function.
3140 (Output_section::set_fixed_layout): New function.
3141 (Output_section::reserve): New function.
3142 (Output_segment::set_section_addresses): Remove const.
3143 (Output_segment::set_section_list_addresses): Remove const; allocate
3144 space from free list for an incremental update.
3145 (Output_segment::set_offset): Adjust size of RELRO segment for an
3146 incremental update.
3147 * output.h (Output_data::current_data_size): Move here from
3148 child classes.
3149 (Output_data::pre_finalize_data_size): New function.
3150 (Output_data::update_data_size): New function.
3151 (Output_section_headers::update_data_size): new function.
3152 (Output_section_data_build::current_data_size): Move to Output_data.
3153 (Output_data_strtab::update_data_size): New function.
3154 (Output_section::current_data_size): Move to Output_data.
3155 (Output_section::set_fixed_layout): New function.
3156 (Output_section::has_fixed_layout): New function.
3157 (Output_section::reserve): New function.
3158 (Output_section::update_data_size): New function.
3159 (Output_section::has_fixed_layout_): New data member.
3160 (Output_section::free_list_): New data member.
3161 (Output_segment::set_section_addresses): Remove const.
3162 (Output_segment::set_section_list_addresses): Remove const.
3163 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3164 New function.
3165 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3166 New function.
3167 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3168 parameter when calling Add_symbols constructor; store argument
3169 serial number for members of a lib group.
3170 (Add_symbols::locks): Allow case where token == NULL.
3171 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3172 (Read_member::~Read_member): New function.
3173 (Read_member::is_runnable): New function.
3174 (Read_member::locks): New function.
3175 (Read_member::run): New function.
3176 (Check_script::~Check_script): New function.
3177 (Check_script::is_runnable): New function.
3178 (Check_script::locks): New function.
3179 (Check_script::run): New function.
3180 (Check_library::~Check_library): New function.
3181 (Check_library::is_runnable): New function.
3182 (Check_library::locks): New function.
3183 (Check_library::run): New function.
3184 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3185 (Add_symbols::library_): New data member.
3186 (class Read_member): New class.
3187 (class Check_script): New class.
3188 (class Check_library): New class.
3189 * reloc.cc (Read_relocs::is_runnable): Allow case where
3190 token == NULL.
3191 (Read_relocs::locks): Likewise.
3192 (Scan_relocs::locks): Likewise.
3193 (Relocate_task::locks): Likewise.
3194 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3195 to clear counters.
3196 (Sized_relobj::incremental_relocs_scan): Fix comment.
3197 (Sized_relobj::do_relocate): Pass output file offset to
3198 write_local_symbols.
3199 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3200 from class declaration.
3201 * script.cc (read_input_script): Allocate Script_info; pass
3202 argument serial number to report_script.
3203 * script.h (class Script_info): Move to incremental.h.
3204 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3205 * symtab.h (Symbol_table::add_from_incrobj): New function.
3206 (Symbol_table::set_file_offset): New function.
3207
3208 2011-04-05 Cary Coutant <ccoutant@google.com>
3209
3210 * incremental-dump.cc (dump_incremental_inputs): Change signature
3211 to take a Sized_incremental_binary; change caller. Use readers
3212 in Sized_incremental_binary.
3213 * incremental.cc
3214 (Sized_incremental_binary::find_incremental_inputs_sections):
3215 Rename do_find_incremental_inputs_sections to this.
3216 (Sized_incremental_binary::setup_readers): New function.
3217 (Sized_incremental_binary::do_check_inputs): Check
3218 has_incremental_info_ flag; move setup code to setup_readers;
3219 use input readers.
3220 (Sized_incremental_binary::do_file_is_unchanged): New function.
3221 (Sized_incremental_binary::do_get_input_reader): New function.
3222 * incremental.h (class Incremental_binary): Move to end of file.
3223 (Incremental_binary::file_is_unchanged): New function.
3224 (Incremental_binary::do_file_is_unchanged): New function.
3225 (Incremental_binary::Input_reader): New class.
3226 (Incremental_binary::get_input_reader): New function.
3227 (class Sized_incremental_binary): Move to end of file.
3228 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3229 input section reader classes.
3230 (Sized_incremental_binary::has_incremental_info): New function.
3231 (Sized_incremental_binary::inputs_reader): New function.
3232 (Sized_incremental_binary::symtab_reader): New function.
3233 (Sized_incremental_binary::relocs_reader): New function.
3234 (Sized_incremental_binary::got_plt_reader): New function.
3235 (Sized_incremental_binary::do_file_is_unchanged): New function.
3236 (Sized_incremental_binary::Sized_input_reader): New class.
3237 (Sized_incremental_binary::get_input_reader): New function.
3238 (Sized_incremental_binary::find_incremental_inputs_sections):
3239 Rename do_find_incremental_inputs_sections to this.
3240 (Sized_incremental_binary::setup_readers): New function.
3241 (Sized_incremental_binary::has_incremental_info_): New data member.
3242 (Sized_incremental_binary::inputs_reader_): New data member.
3243 (Sized_incremental_binary::symtab_reader_): New data member.
3244 (Sized_incremental_binary::relocs_reader_): New data member.
3245 (Sized_incremental_binary::got_plt_reader_): New data member.
3246 (Sized_incremental_binary::current_input_file_): New data member.
3247
3248 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3249
3250 PR gold/12640
3251 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3252 violation.
3253
3254 2011-03-30 Cary Coutant <ccoutant@google.com>
3255
3256 * archive.cc (Archive::include_member): Adjust call to report_object.
3257 (Add_archive_symbols::run): Add script_info to call to
3258 report_archive_begin.
3259 (Lib_group::include_member): Adjust call to report_object.
3260 (Add_lib_group_symbols::run): Adjust call to report_object.
3261 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3262 blocks. Add object count for script input files.
3263 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3264 script_info parameter; change all callers.
3265 (Incremental_inputs::report_object): Add script_info parameter;
3266 change all callers.
3267 (Incremental_inputs::report_script): Store backpointer to
3268 incremental info entry.
3269 (Output_section_incremental_inputs::set_final_data_size): Record
3270 additional information for scripts.
3271 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3272 * incremental.h (Incremental_script_entry::add_object): New function.
3273 (Incremental_script_entry::get_object_count): New function.
3274 (Incremental_script_entry::get_object): New function.
3275 (Incremental_script_entry::objects_): New data member; adjust
3276 constructor.
3277 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3278 (Incremental_inputs::report_object): Add script_info parameter.
3279 (Incremental_inputs_reader::get_object_count): New function.
3280 (Incremental_inputs_reader::get_object_offset): New function.
3281 * options.cc (Input_arguments::add_file): Return reference to
3282 new input argument.
3283 * options.h (Input_argument::set_script_info): New function.
3284 (Input_argument::script_info): New function.
3285 (Input_argument::script_info_): New data member; adjust all
3286 constructors.
3287 (Input_file_group::add_file): Return reference to new input argument.
3288 (Input_file_lib::add_file): Likewise.
3289 (Input_arguments::add_file): Likewise.
3290 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3291 * script.cc (Parser_closure::Parser_closure): Add script_info
3292 parameter; adjust all callers.
3293 (Parser_closure::script_info): New function.
3294 (Parser_closure::script_info_): New data member.
3295 (read_input_script): Report scripts earlier to incremental info.
3296 (script_add_file): Set script_info in Input_argument.
3297 (script_add_library): Likewise.
3298 * script.h (Script_options::Script_info): Rewrite class.
3299
3300 2011-03-29 Cary Coutant <ccoutant@google.com>
3301
3302 * archive.cc (Library_base::should_include_member): Move
3303 method here from class Archive.
3304 (Archive::Archive): Initialize base class.
3305 (Archive::should_include_member): Move to base class.
3306 (Archive::do_for_all_unused_symbols): New function.
3307 (Add_archive_symbols::run): Remove redundant access to
3308 incremental_inputs.
3309 (Lib_group::Lib_group): Initialize base class.
3310 (Lib_group::do_filename): New function.
3311 (Lib_group::include_member): Pass pointer to Lib_group to
3312 report_object.
3313 (Lib_group::do_for_all_unused_symbols): New function.
3314 (Add_lib_group_symbols::run): Report archive information for
3315 incremental links.
3316 * archive.h (class Library_base): New base class.
3317 (class Archive): Derive from Library_base.
3318 (Archive::filename): Move to base class.
3319 (Archive::set_incremental_info): Likewise.
3320 (Archive::incremental_info): Likewise.
3321 (Archive::Should_include): Likewise.
3322 (Archive::should_include_member): Likewise.
3323 (Archive::Armap_entry): Remove.
3324 (Archive::Unused_symbol_iterator): Remove.
3325 (Archive::unused_symbols_begin): Remove.
3326 (Archive::unused_symbols_end): Remove.
3327 (Archive::do_filename): New function.
3328 (Archive::do_get_mtime): New function.
3329 (Archive::do_for_all_unused_symbols): New function.
3330 (Archive::task_): Move to base class.
3331 (Archive::incremental_info_): Likewise.
3332 (class Lib_group): Derive from Library_base.
3333 (Lib_group::do_filename): New function.
3334 (Lib_group::do_get_mtime): New function.
3335 (Lib_group::do_for_all_unused_symbols): New function.
3336 (Lib_group::task_): Move to base class.
3337 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3338 function.
3339 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3340 function.
3341 * incremental.cc (Incremental_inputs::report_archive_begin):
3342 Use Library_base; call library's get_mtime; add incremental inputs
3343 entry before members.
3344 (class Unused_symbol_visitor): New class.
3345 (Incremental_inputs::report_archive_end): Use Library_base; use
3346 visitor class to record unused symbols; don't add incremental inputs
3347 entry after members.
3348 (Incremental_inputs::report_object): Use Library_base.
3349 * incremental.h
3350 (Incremental_archive_entry::Incremental_archive_entry): Remove
3351 unused Archive parameter.
3352 (Incremental_inputs::report_archive_begin): Use Library_base.
3353 (Incremental_inputs::report_archive_end): Likewise.
3354 (Incremental_inputs::report_object): Likewise.
3355 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3356 function.
3357 * object.h (Object::for_all_global_symbols): New function.
3358 (Object::do_for_all_global_symbols): New function.
3359 (Sized_relobj::do_for_all_global_symbols): New function.
3360 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3361 function.
3362 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3363 function.
3364
3365 2011-03-27 Ian Lance Taylor <iant@google.com>
3366
3367 * archive.cc (Archive::interpret_header): Return -1 if something
3368 goes wrong. Change callers accordingly.
3369
3370 2011-03-25 Cary Coutant <ccoutant@google.com>
3371
3372 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3373 * testsuite/Makefile.in: Regenerate.
3374
3375 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3376
3377 * plugin.cc (get_view): New.
3378 (Plugin::load): Pass get_view to the plugin.
3379 (Plugin_manager::get_view): New.
3380
3381 2011-03-21 Ian Lance Taylor <iant@google.com>
3382
3383 * testsuite/final_layout.sh: Rewrite to not use dc.
3384 * testsuite/relro_test.sh: Fail if dc is not present.
3385
3386 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3387
3388 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3389 Change == to -eq.
3390 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3391 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3392 Change == to -eq.
3393 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3394 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3395
3396 2011-03-14 Ian Lance Taylor <iant@google.com>
3397
3398 * script-sections.cc (Sort_output_sections::script_compare):
3399 Rename from is_before, change return type.
3400 (Sort_output_sections::operator()): Adjust accordingly.
3401
3402 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3403
3404 PR gold/12572
3405 * testsuite/odr_violation2.cc: Add comment to make all error line
3406 numbers double digits.
3407 * testsuite/debug_msg.sh: Adjust expected errors.
3408
3409 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3410
3411 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3412 but mark earlier ones as non-canonical
3413 (offset_to_iterator): Update search target and example
3414 (do_addr2line): Return extra lines in a vector*
3415 (format_file_lineno): Extract from do_addr2line
3416 (one_addr2line): Add vector* out-param
3417 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3418 when a lineno entry appeared last for its instruction
3419 (Dwarf_line_info): Add vector* out-param
3420 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3421 * symtab.cc (Odr_violation_compare): Include the lineno in the
3422 comparison again.
3423 (linenos_from_loc): New. Combine the canonical line for an
3424 address with its other lines.
3425 (True_if_intersect): New. Helper functor to make
3426 std::set_intersection a query.
3427 (detect_odr_violations): Compare sets of lines instead of just
3428 one line for each function. This became less deterministic, but
3429 has fewer false positives.
3430 * symtab.h: Declarations.
3431 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3432 mix an optimized and non-optimized object in the same binary
3433 (odr_violation2.so): Same.
3434 * testsuite/Makefile.in: Regenerate from Makefile.am.
3435 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3436 * testsuite/debug_msg.sh: Update line numbers and add
3437 assertions.
3438 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3439 non-optimized context.
3440 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3441 isn't inlined, and use OdrDerived in an optimized context.
3442 * testsuite/odr_header1.h: Defines OdrDerived, where
3443 optimization will change the
3444 first-instruction-in-the-destructor's file and line number.
3445 * testsuite/odr_header2.h: Defines OdrBase.
3446
3447 2011-03-09 Ian Lance Taylor <iant@google.com>
3448
3449 * fileread.cc (File_read::clear_views): Don't delete the whole
3450 file view.
3451
3452 2011-03-08 Ian Lance Taylor <iant@google.com>
3453
3454 PR gold/12525
3455 * fileread.cc: #include <climits>.
3456 (GOLD_IOV_MAX): Define.
3457 (File_read::read_multiple): Limit number of entries by iov_max.
3458 * fileread.h (class File_read): Always set max_readv_entries to
3459 128.
3460
3461 2011-03-07 Ian Lance Taylor <iant@google.com>
3462
3463 PR gold/12525
3464 * options.h (class General_options): Add -dy and -dn.
3465
3466 2011-03-02 Cary Coutant <ccoutant@google.com>
3467
3468 * testsuite/script_test_9.t: Add TLS segment.
3469
3470 2011-03-02 Simon Baldwin <simonb@google.com>
3471
3472 * configure.ac: Add check for gnu_indirect_function support in
3473 the toolchain building binutils.
3474 * configure: Rebuild.
3475
3476 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3477
3478 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3479 plugin only symbols.
3480 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3481 in plugin files as not needed in the symbol table.
3482
3483 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3484
3485 * output.cc (Output_section::add_input_section): Delay fill
3486 generation for section ordering.
3487
3488 2011-02-09 Ian Lance Taylor <iant@google.com>
3489
3490 PR gold/12316
3491 * object.h (class Sized_relobj): Remove clear_local_symbols.
3492 * reloc.cc (Sized_relobj::do_relocate): Don't call
3493 clear_local_symbols.
3494
3495 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3496
3497 * plugin.cc (is_visible_from_outside): Return true for symbols
3498 in the -u option.
3499
3500 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3501
3502 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3503 filename.
3504
3505 2011-02-02 Sriraman Tallam <tmsriram@google.com>
3506
3507 * icf.h (is_section_foldable_candidate): Change type of parameter
3508 to std::string.
3509 * icf.cc (Icf::find_identical_sections): Change type of local variable
3510 section_name to be std::string.
3511 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3512
3513 2011-01-25 Ian Lance Taylor <iant@google.com>
3514
3515 * script.cc (script_add_extern): Rewrite to use
3516 add_symbol_reference.
3517
3518 2011-01-25 Doug Kwan <dougkwan@google.com>
3519
3520 * icf.cc (get_section_contents): Always lock section's object.
3521
3522 2011-01-24 Ian Lance Taylor <iant@google.com>
3523
3524 * options.h (class General_options): Accept
3525 --no-detect-odr-violations.
3526
3527 2011-01-24 Ian Lance Taylor <iant@google.com>
3528
3529 * version.cc (version_string): Bump to 1.11.
3530
3531 2011-01-24 Ian Lance Taylor <iant@google.com>
3532
3533 * plugin.cc (class Plugin_rescan): Define new class.
3534 (Plugin_manager::claim_file): Set any_claimed_.
3535 (Plugin_manager::save_archive): New function.
3536 (Plugin_manager::save_input_group): New function.
3537 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3538 necessary.
3539 (Plugin_manager::new_undefined_symbol): New function.
3540 (Plugin_manager::rescan): New function.
3541 (Plugin_manager::rescannable_defines): New function.
3542 (Plugin_manager::add_input_file): Set any_added_.
3543 * plugin.h (class Plugin_manager): define new fields rescannable_,
3544 undefined_symbols_, any_claimed_, and any_added_. Declare
3545 Plugin_rescan as friend. Declare new functions.
3546 (Plugin_manager::Rescannable): Define type.
3547 (Plugin_manager::Rescannable_list): Define type.
3548 (Plugin_manager::Undefined_symbol_list): Define type.
3549 (Plugin_manager::Plugin_manager): Initialize new fields.
3550 * archive.cc (Archive::defines_symbol): New function.
3551 (Add_archive_symbols::run): Pass archive to plugins if any.
3552 * archive.h (class Archive): Declare defines_symbol.
3553 * readsyms.cc (Input_group::~Input_group): New function.
3554 (Finish_group::run): Pass input_group to plugins if any.
3555 * readsyms.h (class Input_group): Declare destructor.
3556 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3557 any.
3558
3559 2011-01-10 Ian Lance Taylor <iant@google.com>
3560
3561 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3562 section as relro.
3563 (Layout::set_segment_offsets): Reset increase_relro before calling
3564 set_section_addresses a second time.
3565
3566 2011-01-04 Cary Coutant <ccoutant@google.com>
3567
3568 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3569 sections before NOBITS sections.
3570
3571 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3572
3573 * version.cc (print_version): Update copyright to 2011.
3574
3575 2010-12-23 Cary Coutant <ccoutant@google.com>
3576
3577 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3578 of OS to this->add. Add OD parameter to second form of the function.
3579
3580 2010-12-20 Ian Lance Taylor <iant@google.com>
3581
3582 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3583 second of two consecutive entries with same offset.
3584
3585 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3586
3587 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3588 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3589 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3590 to avoid unneeded links against $(LDADD).
3591 * testsuite/Makefile.in: Regenerate.
3592
3593 2010-12-15 Ian Lance Taylor <iant@google.com>
3594
3595 PR gold/12324
3596 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3597 for R_X86_64_32 and R_X86_64_PC32.
3598 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3599 ver_matching_def_pic.o.
3600 (ver_matching_def_pic.o): New target.
3601
3602 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3603
3604 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3605 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3606 Move definition before File_read::View member definitions.
3607 (File_read::View::~View): Initialize and hold lock before
3608 updating current_mapped_bytes.
3609
3610 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3611
3612 * dwarf_reader.cc: Remove outdated comment.
3613 * gold-threads.cc: Fix typo in error message.
3614 * archive.cc: Fix typos in comments.
3615 * archive.h: Likewise.
3616 * arm-reloc-property.cc: Likewise.
3617 * arm-reloc-property.h: Likewise.
3618 * arm-reloc.def: Likewise.
3619 * arm.cc: Likewise.
3620 * attributes.h: Likewise.
3621 * cref.cc: Likewise.
3622 * ehframe.cc: Likewise.
3623 * fileread.h: Likewise.
3624 * gold.h: Likewise.
3625 * i386.cc: Likewise.
3626 * icf.cc: Likewise.
3627 * incremental.h: Likewise.
3628 * int_encoding.cc: Likewise.
3629 * layout.h: Likewise.
3630 * main.cc: Likewise.
3631 * merge.h: Likewise.
3632 * object.cc: Likewise.
3633 * object.h: Likewise.
3634 * options.cc: Likewise.
3635 * readsyms.cc: Likewise.
3636 * reduced_debug_output.cc: Likewise.
3637 * reloc.cc: Likewise.
3638 * script-sections.cc: Likewise.
3639 * sparc.cc: Likewise.
3640 * symtab.h: Likewise.
3641 * target-reloc.h: Likewise.
3642 * target.cc: Likewise.
3643 * target.h: Likewise.
3644 * timer.cc: Likewise.
3645 * timer.h: Likewise.
3646 * x86_64.cc: Likewise.
3647
3648 2010-12-09 Cary Coutant <ccoutant@google.com>
3649
3650 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3651 stack.
3652 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3653 parameter; change all callers.
3654 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3655 * options.h (warn_execstack): New option.
3656
3657 2010-12-07 Doug Kwan <dougkwan@google.com>
3658
3659 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3660 like function call relocations.
3661
3662 2010-12-07 Ian Lance Taylor <iant@google.com>
3663
3664 * archive.cc (Archive::get_elf_object_for_member): Permit
3665 punconfigured to be NULL.
3666 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3667 (Archive::include_member): Pass NULL to get_elf_object_for_member
3668 if we searched for the archive and this is the first included
3669 object.
3670
3671 2010-12-01 Ian Lance Taylor <iant@google.com>
3672
3673 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3674 track_relocs_type_ field.
3675 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3676 Set track_relocs_type_.
3677 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3678 contents when using RELA relocs.
3679 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3680 reloc_map_.
3681 * reloc.cc (Track_relocs::next_addend): New function.
3682 * reloc.h (class Track_relocs): Declare next_addend.
3683
3684 2010-12-01 Ian Lance Taylor <iant@google.com>
3685
3686 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3687 virtual destructor.
3688
3689 2010-12-01 Ian Lance Taylor <iant@google.com>
3690
3691 * README: Update compilers known to work and fail.
3692
3693 2010-11-23 Matthias Klose <doko@ubuntu.com>
3694
3695 * configure.in: For --enable-gold, handle value `default' instead of
3696 `both*'. Always install ld as ld.bfd, install as ld if gold is
3697 not the default.
3698 * configure: Regenerate.
3699
3700 2010-11-18 Doug Kwan <dougkwan@google.com>
3701
3702 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3703 and right_alignment to be zero. Store result alignment only if it is
3704 greater than existing alignment.
3705
3706 2010-11-16 Cary Coutant <ccoutant@google.com>
3707
3708 PR gold/12220
3709 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3710 Check for ".zdebug_line".
3711
3712 2010-11-16 Doug Kwan <dougkwan@google.com>
3713 Cary Coutant <ccoutant@google.com>
3714
3715 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3716 by reference; adjust all callers.
3717 * output.cc (Output_segment::set_section_addresses): Adjust references
3718 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3719 list is empty.
3720 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3721 end at page boundary.
3722
3723 2010-11-16 Cary Coutant <ccoutant@google.com>
3724
3725 PR gold/12220
3726 * layout.cc (Layout::choose_output_section): Transform names of
3727 compressed sections even when using a script with a SECTIONS clause.
3728 (Layout::output_section_name): Remove code to transform
3729 compressed debug section names.
3730 * output.cc (Output_section::add_input_section): Use uncompressed
3731 section size when tracking input sections.
3732
3733 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3734
3735 * symtab.h (Symbol::NON_PIC_REF): Remove.
3736 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3737 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3738 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3739 (Symbol::use_plt_offset): Take a flags argument and pass it
3740 directly to needs_dynamic_reloc. Restrict check for undefined
3741 weak symbols to function calls.
3742 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3743 (Target_arm::Scan::global): Use it.
3744 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3745 (Target_arm::Relocate::relocate): Likewise.
3746 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3747 parameter with an r_type parameter. Use get_reference_flags
3748 to get the flags.
3749 (Target_arm::Relocate::relocate): Update accordingly.
3750 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3751 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3752 (Target_i386::Scan::global): Likewise.
3753 (Target_i386::Relocate::relocate): Likewise.
3754 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3755 parameter with an r_type parameter. Use get_reference_flags
3756 to get the flags.
3757 (Target_i386::Relocate::relocate): Update accordingly.
3758 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3759 (Target_powerpc::Scan::global): Use it.
3760 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3761 (Target_powerpc::Relocate::relocate): Likewise.
3762 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3763 (Target_sparc::Scan::global): Use it.
3764 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3765 (Target_sparc::Relocate::relocate): Likewise.
3766 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3767 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3768 (Target_x86_64::Scan::global): Likewise.
3769 (Target_x86_64::Relocate::relocate): Likewise.
3770
3771 2010-11-08 Doug Kwan <dougkwan@google.com>
3772 Cary Coutant <ccoutant@google.com>
3773
3774 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3775 (Arm_exidx_merge_section::section_contents_): New data member.
3776 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3777 (Arm_input_section::~Arm_input_section): De-allocate memory.
3778 (Arm_input_section::original_contents_): New data member.
3779 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3780 in parameters instead of calling Object::section_contents without
3781 locking.
3782 (Arm_output_section::group_section): New parameter TASK. Pass it
3783 to callees that need locking objects.
3784 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3785 to lock EXIDX input sections. Fix a formatting issue. Call
3786 Arm_exidx_merged_section::build_contents to create merged section
3787 contents.
3788 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3789 to lock object of stub table owner.
3790 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3791 TEXT_SIZE to initialize data member TEXT_SIZE_.
3792 (Arm_exidx_input_section::addralign): Fix typo in comment.
3793 (Arm_exidx_input_section::text_size): New method.
3794 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3795 that require locking objects. Lock objects before scanning for stubs
3796 and updating local symbols.
3797 (Arm_input_section<big_endian>::init): Copy contents of original
3798 input section.
3799 (Arm_input_section<big_endian>::do_write): Use saved contents of
3800 original input section instead of calling Object::section_contents
3801 without locking.
3802 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3803 size without calling Object::section_size().
3804 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3805 for size. Allocate a buffer for merged EXIDX entries.
3806 (Arm_exidx_merged_section::build_contents): New method.
3807 (Arm_exidx_merged_section::do_write): Move merge section contents
3808 building code to Arm_exidx_merged_section::build_contetns. Write
3809 out contetns in buffer instead of building it on the fly.
3810 (Arm_relobj::make_exidx_input_section): Also pass text section size
3811 to Arm_exidx_input_section constructor.
3812 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3813 (Arm_dynobj::do_read_symbols): Fix memory leak.
3814 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3815 * target.h: (class Task): Add forward declaration.
3816 (Target::relax): Add new parameter TASK and pass it to
3817 Target::do_relax().
3818 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3819
3820 2010-11-05 Cary Coutant <ccoutant@google.com>
3821
3822 PR gold/10708
3823 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3824 object when reading from the file.
3825 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3826 second layout pass.
3827 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3828 when reading section contents.
3829 (get_section_contents): Likewise.
3830 (icf::find_identical_sections): Likewise.
3831 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3832 object when reading from the file.
3833 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3834 the object when doing deferred section layout.
3835
3836 2010-11-03 Nick Clifton <nickc@redhat.com>
3837
3838 PR gold/12001
3839 * script.h (class Symbol_assignment: name): New member. Returns
3840 the name of the symbol.
3841 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3842 Returns true if the given symbol name is on the list of
3843 assignments wating to be processed.
3844 * archive.cc (should_incldue_member): If the symbol is undefined,
3845 check to see if it is on the list of symbols pending assignment.
3846
3847 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3848
3849 * script-sections.cc (Script_sections::find_memory_region): Check
3850 for a NULL output section pointer.
3851
3852 2010-10-29 Doug Kwan <dougkwan@google.com>
3853
3854 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3855 Output_section::add_relaxed_input_section.
3856 * output.cc (Output_section::add_relaxed_input_section): Add new
3857 arguments LAYOUT and NAME. Set section order index.
3858 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3859 Copy section order index.
3860 * output.h (Output_section::add_relaxed_input_section): Add new
3861 arguments LAYOUT and NAME.
3862
3863 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3864
3865 * testsuite/Makefile.am: Move gcctestdir/ld rule to
3866 NATIVE_OR_CROSS_LINKER.
3867 * testsuite/Makefile.in: Regenerate.
3868
3869 2010-10-20 Doug Kwan <dougkwan@google.com>
3870
3871 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3872 without SHF_LINK_ORDER flags.
3873 * layout.cc (Layout::choose_output_section): Do not filter
3874 SHF_LINK_ORDER flag in a relocatable link.
3875
3876 2010-10-17 Cary Coutant <ccoutant@google.com>
3877
3878 * output.h (Output_segment::set_section_addresses): Change function
3879 signature. Update all callers.
3880 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3881 sections.
3882 (Output_segment::set_section_addresses): Align after last TLS
3883 section. Add padding before last relro section instead of after.
3884
3885 2010-10-17 Doug Kwan <dougkwan@google.com>
3886
3887 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3888 GOT output section to be writable.
3889
3890 2010-10-14 Cary Coutant <ccoutant@google.com>
3891
3892 * debug.h (DEBUG_INCREMENTAL): New flag.
3893 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3894 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3895 mode.
3896 * incremental.cc (report_command_line): Ignore all forms of
3897 --incremental.
3898 * layout.cc (Layout::Layout): Check parameters for incremental link
3899 mode.
3900 * options.cc (General_options::parse_incremental): New function.
3901 (General_options::parse_no_incremental): New function.
3902 (General_options::parse_incremental_full): New function.
3903 (General_options::parse_incremental_update): New function.
3904 (General_options::incremental_mode_): New data member.
3905 (General_options::finalize): Check incremental_mode_.
3906 * options.h (General_options): Update help text for --incremental.
3907 Add --no-incremental, --incremental-full, --incremental-update.
3908 (General_options::Incremental_mode): New enum type.
3909 (General_options::incremental_mode): New function.
3910 (General_options::incremental_mode_): New data member.
3911 * parameters.cc (Parameters::incremental_mode_): New data member.
3912 (Parameters::set_options): Set incremental_mode_.
3913 (Parameters::set_incremental_full): New function.
3914 (Parameters::incremental): New function.
3915 (Parameters::incremental_update): New function.
3916 (set_parameters_incremental_full): New function.
3917 * parameters.h (Parameters::set_incremental_full): New function.
3918 (Parameters::incremental): New function.
3919 (Parameters::incremental_update): New function.
3920 (Parameters::incremental_mode_): New data member.
3921 (set_parameters_incremental_full): New function.
3922 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3923 incremental link mode.
3924 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3925 (Sized_relobj::do_relocate_sections): Likewise.
3926 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3927 option.
3928 * testsuite/Makefile.in: Regenerate.
3929 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3930
3931 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3932
3933 * script-sections.h (class Script_sections): Make
3934 Sections_elements typedef public.
3935 * script-sections.cc (class Sort_output_sections): Add elements_
3936 field. Add constructor which sets it; change all callers.
3937 (Sort_output_sections::is_before): New function.
3938 (Sort_output_sections::operator()): Call is_before.
3939 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3940 conditional.
3941 * testsuite/script_test_10.sh: New test. Test script section
3942 order.
3943 * testsuite/script_test_10.t: Likewise.
3944 * testsuite/script_test_10.s: Likewise.
3945 * testsuite/Makefile.am: Wrap the cross linker tests and the
3946 common tests into NATIVE_OR_CROSS_LINKER.
3947 (check_SCRIPTS): Add script_test_10.sh.
3948 (check_DATA): Add script_test_10.stdout.
3949 (script_test_10.o, script_test_10): New targets.
3950 (script_test_10.stdout): New target.
3951 * configure, testsuite/Makefile.in: Regenerate.
3952
3953 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3954
3955 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3956 error for the deprecated relocations.
3957 (Target_arm::Scan::global): Likewise.
3958 (Target_arm::Relocate::relocate): Likewise.
3959
3960 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3961
3962 * fileread.cc (Input_file::find_file): Initialize *found_name
3963 and *namep when using the fallback search for case 4.
3964
3965 2010-10-11 Cary Coutant <ccoutant@google.com>
3966
3967 * options.h (class General_options): Redefine -z lazy as an alias for
3968 the negation of -z now.
3969
3970 2010-10-11 Ian Lance Taylor <iant@google.com>
3971
3972 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3973 binding.
3974
3975 2010-10-06 Nick Clifton <nickc@redhat.com>
3976
3977 * script-sections.cc(class Memory_region): Remove
3978 current_lma_offset_ field. Rename current_vma_offset_ to
3979 current_offset_. Add last_section_ field.
3980 (Memory_region::get_current_vma_address): Rename to
3981 get_current_address.
3982 (Memory_region::get_current_lma_address): Delete.
3983 (Memory_region::increment_vma_offset): Rename to
3984 increment_offset.
3985 (Memory_region::increment_lma_offset): Delete.
3986 (Memory_region::attributes_compatible): New method. Returns
3987 true if the provided section is compatible with the region.
3988 (Memory_region::get_last_section): New method. Returns the last
3989 section to use the region.
3990 (Memory_region::set_last_section): New method. Stores the last
3991 section to use the region.
3992 (Script_sections::block_in_region): New method. Returns true if
3993 a block of memory is contained within a region.
3994 (Script_sections::find_memory_region): New method. Locates a
3995 memory region to be used to set a VMA or LMA address.
3996 (Output_section_definition::set_section_addresses): Add code to
3997 check for addresses set by memory regions.
3998 (Output_segment::set_section_addresses): Remove memory region
3999 walking code.
4000 (Script_sections::create_segment): Add a warning if a header
4001 segment is created outside of any region.
4002 * script-sections.h (class Script_sections): Add prototypes for
4003 find_memory_region and block_in_region methods.
4004 * testsuite/memory_test.s: Use .long instead of .word.
4005 * testsuite/memory_test.t: Add some more output sections.
4006 * testsuite/memory_test.sh: Update expected output.
4007
4008 2010-10-02 Doug Kwan <dougkwan@google.com>
4009
4010 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4011 defintion to symtab.h
4012 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4013 declaration to defintion.
4014
4015 2010-10-01 Nick Clifton <nickc@redhat.com>
4016
4017 * expression.cc (eval): Replace dummy argument with NULL.
4018 (eval_maybe_dot): Check for a NULL result section pointer.
4019 (Symbol_expression::value): Likewise.
4020 (Dot_expression::value): Likewise.
4021 (BINARY_EXPRESSION): Likewise.
4022 (Max_expression::value): Likewise.
4023 (Min_expression::value): Likewise.
4024 (Absolute_expression::value): Likewise.
4025 (Addr_expression::value_from_output_section): Likewise.
4026 (Loaddddr_expression::value_from_output_section): Likewise.
4027 (Segment_start_expression::value): Likewise.
4028 * script-sections.cc
4029 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4030 argument with NULL.
4031 (Sections_elememt_dot_assignment::set_section_addresses):
4032 Likewise.
4033 (Output_data_expression::do_write_to_buffer): Likewise.
4034 (Output_section_definition::finalize_symbols): Likewise.
4035 (Output_section_definition::set_section_addresses): Likewise.
4036
4037 2010-09-30 Doug Kwan <dougkwan@google.com>
4038
4039 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4040
4041 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4042
4043 * target.h (Target::can_icf_inline_merge_sections): New virtual
4044 function.
4045 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4046 virtual function.
4047 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4048 virtual function.
4049 * icf.cc (get_section_contents): Inline merge sections only when
4050 target allows it.
4051
4052 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4053
4054 * configure: Regenerate.
4055
4056 2010-09-17 Ian Lance Taylor <iant@google.com>
4057
4058 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4059 * testsuite/Makefile.am (memory_test.o): New target.
4060 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4061 memory_test.t.
4062 * testsuite/Makefile.in: Rebuild.
4063
4064 2010-09-17 Doug Kwan <dougkwan@google.com>
4065
4066 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4067 defintion if relocation uses GOT entries of the symbol.
4068 * testsuite/icf_safe_test.sh: Fix test.
4069 * testsuite/icf_safe_so_test.sh: Fix test.
4070
4071 2010-09-16 Cary Coutant <ccoutant@google.com>
4072
4073 * script_sections.cc (class Memory_region): Remove "NULL" from
4074 vector initializations.
4075
4076 2010-09-15 Cary Coutant <ccoutant@google.com>
4077
4078 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4079 Resolve forwarding symbols.
4080
4081 2010-09-15 Doug Kwan <dougkwan@google.com>
4082
4083 * gold/testsuite/script_test_3.t: Add ARM special sections.
4084 * gold/testsuite/script_test_4.t: Same.
4085 * gold/testsuite/script_test_5.t: Same.
4086 * gold/testsuite/script_test_6.t: Same.
4087 * gold/testsuite/script_test_7.t: Same.
4088 * gold/testsuite/script_test_7.t: Same.
4089 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4090
4091 2010-09-14 Cary Coutant <ccoutant@google.com>
4092
4093 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4094 (Target_x86_64::Relocate::relocate_tls): Replace check for
4095 saw_tls_block_reloc_ with test for executable section.
4096
4097 2010-09-12 Cary Coutant <ccoutant@google.com>
4098
4099 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4100 position-independent executables to shared libraries need dynamic
4101 relocations.
4102 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4103 position-independent executables.
4104 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4105 * testsuite/Makefile.in: Regenerate.
4106
4107 2010-09-10 Nick Clifton <nickc@redhat.com>
4108
4109 PR gold/11997
4110 * testsuite/memory_test.t: Discard any sections that are not
4111 needed.
4112
4113 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4114
4115 PR gold/11996
4116 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4117 "This::" to work around a bug in gcc 4.2.
4118
4119 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4120
4121 2010-09-09 Rafael Espindola <espindola@google.com>
4122
4123 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4124 sections with different PF_X flags in the same segment.
4125 (Layout::find_first_load_seg): Search all segments to find the first
4126 one.
4127 * options.h (rosegment): New.
4128
4129 2010-09-08 Rafael Espindola <espindola@google.com>
4130
4131 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4132
4133 2010-09-08 Doug Kwan <dougkwan@google.com>
4134
4135 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4136 (Arm_relobj::do_relocate_sections): Add new parameter for output
4137 file to match the parent.
4138 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4139 of local symbols instead of input values. Update code to track
4140 changes in gold::relocate_section.
4141 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4142 (Sized_relobj::compute_final_local_value_internal): New methods.
4143 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4144 body into private version of Sized_relobj::compute_final_local_value.
4145 Call the inline method.
4146 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4147 merged symbol value if there is one.
4148 (Symbol_value::has_output_value): New method defintiion.
4149 (Sized_relobj::Compute_final_local_value_status): New enum type.
4150 (Sized_relobj::compute_final_local_value): New methods.
4151 (Sized_relobj::compute_final_local_value_internal): New methods.
4152 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4153 and arm_cortex_a8.sh.
4154 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4155 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4156 New tests.
4157 * Makefile.in: Regenerate.
4158 * testsuite/arm_bl_out_of_range.s: Update test.
4159 * testsuite/thumb_bl_out_of_range.s: Ditto.
4160 * testsuite/thumb_blx_out_of_range.s: Ditto.
4161 * testsuite/arm_branch_out_of_range.sh: New file.
4162 * testsuite/arm_cortex_a8.sh: Ditto.
4163 * testsuite/arm_cortex_a8_b.s: Ditto.
4164 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4165 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4166 * testsuite/arm_cortex_a8_bl.s: Ditto.
4167 * testsuite/arm_cortex_a8_blx.s: Ditto.
4168 * testsuite/arm_cortex_a8_local.s: Ditto.
4169 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4170 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4171
4172 2010-09-08 Rafael Espindola <espindola@google.com>
4173
4174 * Makefile.am (memory_test.stdout): Run readelf with -W.
4175 * Makefile.in: Regenerate.
4176 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4177 64 bit output.
4178
4179 2010-09-08 Rafael Espindola <espindola@google.com>
4180
4181 * script-sections.cc (Script_sections::add_memory_region): Convert
4182 field precision to int.
4183 * script.cc (script_set_section_region, script_set_section_region):
4184 Convert field precision to int.
4185
4186 2010-09-08 Rafael Espindola <espindola@google.com>
4187
4188 * arm.cc (do_finalize_sections): Create the __exidx_start and
4189 __exdix_end symbols even when the section is missing.
4190
4191 2010-09-08 Nick Clifton <nickc@redhat.com>
4192
4193 * README: Remove claim that MEMORY is not supported.
4194 * expression.cc (script_exp_function_origin)
4195 (script_exp_function_length): Move from here to ...
4196 * script.cc: ... here.
4197 (script_set_section_region, script_add_memory)
4198 (script_parse_memory_attr, script_include_directive): New
4199 functions.
4200 * script-sections.cc
4201 (class Memory_region): New class.
4202 (class Output_section_definition): Add set_memory_region,
4203 set_section_vma, set_section_lma and get_section_name methods.
4204 (class Script_Sections): Add add_memory_region,
4205 find_memory_region, find_memory_region_origin,
4206 find_memory_region_length and set_memory_region methods.
4207 Have set_section_addresses method walk the list of set memory
4208 regions.
4209 Extend the print methos to display memory regions.
4210 * script-sections.h: Add prototypes for new methods.
4211 Add enum for MEMORY region attributes.
4212 * yyscript.y: Add support for parsing MEMORY regions.
4213 * script-c.h: Add prototypes for new functions.
4214 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4215 * testsuite/Makefile.in: Regenerate.
4216 * testsuite/memory_test.sh: New script.
4217 * testsuite/memory_test.s: New assembler source file.
4218 * testsuite/memory_test.t: New linker script.
4219
4220 2010-08-27 Doug Kwan <dougkwan@google.com>
4221
4222 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4223 reference override an existing dynamic weak reference.
4224 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4225 * testsuite/Makefile.in: Regenerate.
4226 * testsuite/dyn_weak_ref.sh: New file.
4227 * testsuite/dyn_weak_ref_1.c: Ditto.
4228 * testsuite/dyn_weak_ref_2.c: Ditto.
4229
4230 2010-08-27 Ian Lance Taylor <iant@google.com>
4231
4232 * incremental.h (class Incremental_input_entry): Add virtual
4233 destructor.
4234
4235 2010-08-27 Ian Lance Taylor <iant@google.com>
4236
4237 * testsuite/start_lib_test_3.c: Mark t3 as used.
4238
4239 2010-08-27 Nick Clifton <nickc@redhat.com>
4240
4241 * options.cc (version_script): Fix small typo in previous
4242 whitespace tidyup.
4243
4244 2010-08-25 Nick Clifton <nickc@redhat.com>
4245
4246 * archive.cc: Formatting fixes: Remove whitespace between
4247 typename and following asterisk. Remove whitespace between
4248 function name and opening parenthesis.
4249 * archive.h: Likewise.
4250 * arm.cc: Likewise.
4251 * attributes.cc: Likewise.
4252 * attributes.h: Likewise.
4253 * common.cc: Likewise.
4254 * copy-relocs.cc: Likewise.
4255 * dirsearch.h: Likewise.
4256 * dynobj.cc: Likewise.
4257 * ehframe.cc: Likewise.
4258 * ehframe.h: Likewise.
4259 * expression.cc: Likewise.
4260 * fileread.cc: Likewise.
4261 * fileread.h: Likewise.
4262 * gc.h: Likewise.
4263 * gold-threads.cc: Likewise.
4264 * gold.cc: Likewise.
4265 * i386.cc: Likewise.
4266 * icf.h: Likewise.
4267 * incremental-dump.cc: Likewise.
4268 * incremental.cc: Likewise.
4269 * layout.cc: Likewise.
4270 * layout.h: Likewise.
4271 * main.cc: Likewise.
4272 * merge.cc: Likewise.
4273 * merge.h: Likewise.
4274 * object.cc: Likewise.
4275 * object.h: Likewise.
4276 * options.cc: Likewise.
4277 * options.h: Likewise.
4278 * output.cc: Likewise.
4279 * output.h: Likewise.
4280 * plugin.cc: Likewise.
4281 * plugin.h: Likewise.
4282 * powerpc.cc: Likewise.
4283 * reloc.cc: Likewise.
4284 * script-c.h: Likewise.
4285 * script-sections.cc: Likewise.
4286 * script.cc: Likewise.
4287 * stringpool.cc: Likewise.
4288 * symtab.cc: Likewise.
4289 * symtab.h: Likewise.
4290 * target.cc: Likewise.
4291 * timer.cc: Likewise.
4292 * timer.h: Likewise.
4293 * version.cc: Likewise.
4294 * x86_64.cc: Likewise.
4295
4296 2010-08-24 Nick Clifton <nickc@redhat.com>
4297
4298 PR 11899
4299 * layout.cc (segment_precedes): Sort segments by their physical
4300 addresses, if they have been set.
4301
4302 2010-08-23 Cary Coutant <ccoutant@google.com>
4303
4304 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4305 symbols data.
4306 (Lib_group::include_member): Unlock object after deleting its
4307 symbols data.
4308 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4309 the bug fixed here.
4310
4311 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4312 Cary Coutant <ccoutant@google.com>
4313
4314 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4315 constructor, and set_blocker.
4316 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4317 readsyms_blocker_.
4318 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4319 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4320 * testsuite/Makefile.am (start_lib_test): New test case.
4321 * testsuite/Makefile.in: Regenerate.
4322 * testsuite/start_lib_test_main.c: New file.
4323 * testsuite/start_lib_test_1.c: New file.
4324 * testsuite/start_lib_test_2.c: New file.
4325 * testsuite/start_lib_test_3.c: New file.
4326
4327 2010-08-19 Ian Lance Taylor <iant@google.com>
4328
4329 * Makefile.in: Rebuild with automake 1.11.1.
4330 * aclocal.m4: Likewise.
4331 * testsuite/Makefile.in: Likewise.
4332
4333 2010-08-19 Ian Lance Taylor <iant@google.com>
4334
4335 PR 10893
4336 * i386.cc (class Output_data_plt_i386): Update declarations.
4337 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4338 local_ifuncs_ fields.
4339 (Target_i386::do_plt_section_for_global): New function.
4340 (Target_i386::do_plt_section_for_local): New function.
4341 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4342 parameter; change all callers. Initialize global_ifuncs_ and
4343 local_ifuncs_. If doing a static link define __rel_iplt_start and
4344 __rel_iplt_end.
4345 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4346 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4347 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4348 symbols.
4349 (Target_i386::make_plt_section): New function, broken out of
4350 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4351 (Target_i386::make_plt_entry): Call make_plt_section.
4352 (Target_i386::make_local_ifunc_plt_entry): New function.
4353 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4354 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4355 R_386_IRELATIVE to switch.
4356 (Target_i386::Scan::global): Likewise.
4357 (Target_i386::Relocate::relocate): Likewise.
4358 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4359 switch.
4360 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4361 (Target_x86_64::do_plt_section_for_global): New function.
4362 (Target_x86_64::do_plt_section_for_local): New function.
4363 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4364 parameter; change all callers. If doing a static link define
4365 __rela_iplt_start and __rela_iplt_end.
4366 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4367 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4368 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4369 to point to .plt.
4370 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4371 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4372 switch.
4373 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4374 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4375 R_X86_64_IRELATIVE to switch.
4376 (Target_x86_64::Scan::global): Likewise.
4377 (Target_x86_64::Relocate::relocate): Likewise.
4378 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4379 switch.
4380 * target.h (class Target): Add plt_section_for_global and
4381 plt_section_for_local functions. Add do_plt_section_for_global
4382 and do_plt_section_for_local virtual functions.
4383 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4384 clarifying comments.
4385 (Symbol::use_plt_offset): Handle IFUNC symbol.
4386 * object.cc (Sized_relobj::Sized_relobj): Initialize
4387 local_plt_offsets_.
4388 (Sized_relobj::local_has_plt_offset): New function.
4389 (Sized_relobj::local_plt_offset): New function.
4390 (Sized_relobj::set_local_plt_offset): New function.
4391 (Sized_relobj::do_count): Handle IFUNC symbol.
4392 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4393 a bit away from input_shndx_ field. Add set_is_func_symbol and
4394 is_ifunc_symbol functions.
4395 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4396 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4397 local_plt_offsets_ field.
4398 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4399 * output.h (class Output_section_data): Add non-const
4400 output_section function.
4401 (class Output_data_got): Update declarations.
4402 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4403 Add use_plt_offset parameter to global and local constructors.
4404 Change all callers. Change local_sym_index_ field to 31 bits.
4405 Change GSYM_CODE and CONSTANT_CODE accordingly.
4406 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4407 doing a static link don't set sh_link field.
4408 (Output_data_got::Got_entry::write): Use PLT offset if
4409 appropriate.
4410 (Output_data_got::add_global_plt): New function.
4411 (Output_data_got::add_local_plt): New function.
4412 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4413 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4414 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4415 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4416 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4417 IFUNC conditional.
4418 * testsuite/ifunc-sel.h: New file.
4419 * testsuite/ifuncmain1.c: New file.
4420 * testsuite/ifuncmain1vis.c: New file.
4421 * testsuite/ifuncmod1.c: New file.
4422 * testsuite/ifuncdep2.c: New file.
4423 * testsuite/ifuncmain2.c: New file.
4424 * testsuite/ifuncmain3.c: New file.
4425 * testsuite/ifuncmod3.c: New file.
4426 * testsuite/ifuncmain4.c: New file.
4427 * testsuite/ifuncmain5.c: New file.
4428 * testsuite/ifuncmod5.c: New file.
4429 * testsuite/ifuncmain6pie.c: New file.
4430 * testsuite/ifuncmod6.c: New file.
4431 * testsuite/ifuncmain7.c: New file.
4432 * configure, testsuite/Makefile.in: Rebuild.
4433
4434 2010-08-18 Ian Lance Taylor <iant@google.com>
4435
4436 * incremental.cc
4437 (Output_section_incremental_inputs::write_input_files): Add cast
4438 to avoid signed/unsigned comparison warning.
4439 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4440
4441 2010-08-12 Cary Coutant <ccoutant@google.com>
4442
4443 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4444
4445 2010-08-13 Ian Lance Taylor <iant@google.com>
4446
4447 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4448
4449 2010-08-12 Cary Coutant <ccoutant@google.com>
4450 Doug Kwan <dougkwan@google.com>
4451
4452 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4453 defintion overrides non-weak undef, remember that the original undef
4454 is not weak.
4455 * symtab.cc (Symbol_table::sized_write_global): For undef without
4456 an original weak binding, set binding to global in output.
4457 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4458 * testsuite/Makefile.in: Regenerate.
4459 * testsuite/strong_ref_weak_def.sh: New file.
4460 * testsuite/strong_ref_weak_def_1.c: Ditto.
4461 * testsuite/strong_ref_weak_def_2.c: Ditto.
4462
4463 2010-08-12 Cary Coutant <ccoutant@google.com>
4464
4465 * testsuite/incremental_test.sh: Rewrite.
4466 * testsuite/incremental_test_1.c: Rewrite.
4467 * testsuite/incremental_test_2.c: Rewrite.
4468
4469 2010-08-12 Cary Coutant <ccoutant@google.com>
4470
4471 * arm.cc (Target_arm::got_size): Add const.
4472 (Target_arm::got_entry_count): New function.
4473 (Target_arm::plt_entry_count): New function.
4474 (Target_arm::first_plt_entry_offset): New function.
4475 (Target_arm::plt_entry_size): New function.
4476 (Output_data_plt_arm::entry_count): New function.
4477 (Output_data_plt_arm::first_plt_entry_offset): New function.
4478 (Output_data_plt_arm::get_plt_entry_size): New function.
4479 * i386.cc (Target_i386::got_size): Add const.
4480 (Target_i386::got_entry_count): New function.
4481 (Target_i386::plt_entry_count): New function.
4482 (Target_i386::first_plt_entry_offset): New function.
4483 (Target_i386::plt_entry_size): New function.
4484 (Output_data_plt_i386::entry_count): New function.
4485 (Output_data_plt_i386::first_plt_entry_offset): New function.
4486 (Output_data_plt_i386::get_plt_entry_size): New function.
4487 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4488 find_incremental_inputs_sections. Dump incremental_got_plt section.
4489 * incremental.cc: Include target.h.
4490 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4491 parameter. Adjust all callers. Find incremental_got_plt section.
4492 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4493 section.
4494 (Output_section_incremental_inputs::set_final_data_size): Calculate
4495 size of incremental_got_plt section.
4496 (Output_section_incremental_inputs::do_write): Write the
4497 incremental_got_plt section.
4498 (Got_plt_view_info): New struct.
4499 (Local_got_offset_visitor): New class.
4500 (Global_got_offset_visitor): New class.
4501 (Global_symbol_visitor_got_plt): New class.
4502 (Output_section_incremental_inputs::write_got_plt): New function.
4503 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4504 Add parameter. Adjust all callers.
4505 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4506 (Incremental_inputs::got_plt_section): New function.
4507 (Incremental_inputs::got_plt_section_): New data member.
4508 (Incremental_got_plt_reader): New class.
4509 * layout.cc (Layout::create_incremental_info_sections): Add the
4510 incremental_got_plt section.
4511 * object.h (Got_offset_list::get_list): New function.
4512 (Got offset_list::for_all_got_offsets): New function.
4513 (Sized_relobj::local_got_offset_list): New function.
4514 * powerpc.cc (Target_powerpc::got_size): Add const.
4515 (Target_powerpc::got_entry_count): New function.
4516 (Target_powerpc::plt_entry_count): New function.
4517 (Target_powerpc::first_plt_entry_offset): New function.
4518 (Target_powerpc::plt_entry_size): New function.
4519 (Output_data_plt_powerpc::entry_count): New function.
4520 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4521 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4522 * sparc.cc (Target_sparc::got_size): Add const.
4523 (Target_sparc::got_entry_count): New function.
4524 (Target_sparc::plt_entry_count): New function.
4525 (Target_sparc::first_plt_entry_offset): New function.
4526 (Target_sparc::plt_entry_size): New function.
4527 (Output_data_plt_sparc::entry_count): New function.
4528 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4529 (Output_data_plt_sparc::get_plt_entry_size): New function.
4530 * symtab.h (Symbol::got_offset_list): New function.
4531 (Symbol_table::for_all_symbols): New function.
4532 * target.h (Sized_target::got_entry_count): New function.
4533 (Sized_target::plt_entry_count): New function.
4534 (Sized_target::plt_entry_size): New function.
4535 * x86_64.cc (Target_x86_64::got_size): Add const.
4536 (Target_x86_64::got_entry_count): New function.
4537 (Target_x86_64::plt_entry_count): New function.
4538 (Target_x86_64::first_plt_entry_offset): New function.
4539 (Target_x86_64::plt_entry_size): New function.
4540 (Output_data_plt_x86_64::entry_count): New function.
4541 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4542 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4543
4544 2010-08-12 Cary Coutant <ccoutant@google.com>
4545
4546 * archive.cc: Include incremental.h.
4547 (Archive::Archive): Initialize incremental_info_.
4548 (Archive::include_member): Record archive members in incremental info.
4549 (Add_archive_symbols::run): Record begin and end of an archive in
4550 incremental info.
4551 (Lib_group::include_member): Record objects in incremental info.
4552 * archive.h (Incremental_archive_entry): Forward declaration.
4553 (Archive::set_incremental_info): New member function.
4554 (Archive::incremental_info): New member function.
4555 (Archive::Unused_symbol_iterator): New class.
4556 (Archive::unused_symbols_begin): New member function.
4557 (Archive::unused_symbols_end): New member function.
4558 (Archive::incremental_info_): New data member.
4559 * incremental-dump.cc (find_input_containing_global): New function.
4560 (dump_incremental_inputs): Dump new incremental info sections.
4561 * incremental.cc: Include symtab.h.
4562 (Output_section_incremental_inputs): New class.
4563 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4564 new incremental info sections.
4565 (Sized_incremental_binary::do_check_inputs): Likewise.
4566 (Incremental_inputs::report_archive): Remove.
4567 (Incremental_inputs::report_archive_begin): New function.
4568 (Incremental_inputs::report_archive_end): New function.
4569 (Incremental_inputs::report_object): New function.
4570 (Incremental_inputs::finalize_inputs): Remove.
4571 (Incremental_inputs::report_input_section): New function.
4572 (Incremental_inputs::report_script): Rewrite.
4573 (Incremental_inputs::finalize): Do nothing but finalize string table.
4574 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4575 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4576 (Incremental_inputs::create_data_sections): New function.
4577 (Incremental_inputs::relocs_entsize): New function.
4578 (Output_section_incremental_inputs::set_final_data_size): New function.
4579 (Output_section_incremental_inputs::do_write): New function.
4580 (Output_section_incremental_inputs::write_header): New function.
4581 (Output_section_incremental_inputs::write_input_files): New function.
4582 (Output_section_incremental_inputs::write_info_blocks): New function.
4583 (Output_section_incremental_inputs::write_symtab): New function.
4584 * incremental.h (Incremental_script_entry): Forward declaration.
4585 (Incremental_object_entry): Forward declaration.
4586 (Incremental_archive_entry): Forward declaration.
4587 (Incremental_inputs): Forward declaration.
4588 (Incremental_inputs_header_data): Remove.
4589 (Incremental_inputs_header): Remove.
4590 (Incremental_inputs_header_write): Remove.
4591 (Incremental_inputs_entry_data): Remove.
4592 (Incremental_inputs_entry): Remove.
4593 (Incremental_inputs_entry_write): Remove.
4594 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4595 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4596 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4597 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4598 Likewise.
4599 (Incremental_input_entry): New class.
4600 (Incremental_script_entry): New class.
4601 (Incremental_object_entry): New class.
4602 (Incremental_archive_entry): New class.
4603 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4604 (Incremental_inputs::report_inputs): Remove.
4605 (Incremental_inputs::report_archive): Remove.
4606 (Incremental_inputs::report_archive_begin): New function.
4607 (Incremental_inputs::report_archive_end): New function.
4608 (Incremental_inputs::report_object): Change prototype.
4609 (Incremental_inputs::report_input_section): New function.
4610 (Incremental_inputs::report_script): Change prototype.
4611 (Incremental_inputs::get_reloc_count): New function.
4612 (Incremental_inputs::set_reloc_count): New function.
4613 (Incremental_inputs::create_data_sections): New function.
4614 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4615 (Incremental_inputs::inputs_section): New function.
4616 (Incremental_inputs::symtab_section): New function.
4617 (Incremental_inputs::relocs_section): New function.
4618 (Incremental_inputs::get_stringpool): Add const.
4619 (Incremental_inputs::command_line): Add const.
4620 (Incremental_inputs::inputs): Remove.
4621 (Incremental_inputs::command_line_key): New function.
4622 (Incremental_inputs::input_file_count): New function.
4623 (Incremental_inputs::input_files): New function.
4624 (Incremental_inputs::relocs_entsize): New function.
4625 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4626 (Incremental_inputs::finalize_inputs): Remove.
4627 (Incremental_inputs::Input_info): Remove.
4628 (Incremental_inputs::lock_): Remove.
4629 (Incremental_inputs::inputs_): Change type.
4630 (Incremental_inputs::inputs_map_): Remove.
4631 (Incremental_inputs::current_object_entry_): New data member.
4632 (Incremental_inputs::inputs_section_): New data member.
4633 (Incremental_inputs::symtab_section_): New data member.
4634 (Incremental_inputs::relocs_section_): New data member.
4635 (Incremental_inputs::reloc_count_): New data member.
4636 (Incremental_inputs_reader): New class.
4637 (Incremental_symtab_reader): New class.
4638 (Incremental_relocs_reader): New class.
4639 * layout.cc (Layout::finalize): Move finalization of incremental info
4640 and creation of incremental info sections to follow finalization of
4641 symbol table. Set offsets for postprocessing sections.
4642 (Layout::create_incremental_info_sections): Call
4643 Incremental_inputs::create_data_sections. Add incremental symtab
4644 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4645 sections to layout after input sections.
4646 * layout.h (struct Timespec): Forward declaration.
4647 (Layout::incremental_inputs): Add const.
4648 (Layout::create_incremental_info_sections): Add parameter.
4649 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4650 * object.cc: Include incremental.h.
4651 (Relobj::finalize_incremental_relocs): New function.
4652 (Sized_relobj::do_layout): Record input sections in incremental info.
4653 * object.h (Object::output_section): New function.
4654 (Object::output_section_offset): Moved from Relobj.
4655 (Object::get_incremental_reloc_base): New function.
4656 (Object::get_incremental_reloc_count): New function.
4657 (Object::do_output_section): New function.
4658 (Object::do_output_section_offset): Moved from Relobj.
4659 (Object::do_get_incremental_reloc_base): New function.
4660 (Object::do_get_incremental_reloc_count): New function.
4661 (Object::Object): Initialize new data members.
4662 (Relobj::output_section): Renamed do_output_section and moved to
4663 protected.
4664 (Relobj::output_section_offset): Moved to Object.
4665 (Relobj::do_get_incremental_reloc_base): New function.
4666 (Relobj::do_get_incremental_reloc_count): New function.
4667 (Relobj::allocate_incremental_reloc_counts): New function.
4668 (Relobj::count_incremental_reloc): New function.
4669 (Relobj::finalize_incremental_relocs): New function.
4670 (Relobj::next_incremental_reloc_index): New function.
4671 (Relobj::reloc_counts_): New data member.
4672 (Relobj::reloc_bases_): New data member.
4673 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4674 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4675 (Sized_relobj::incremental_relocs_scan): New function.
4676 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4677 (Sized_relobj::incremental_relocs_write): New function.
4678 (Sized_relobj::incremental_relocs_write_reltype): New function.
4679 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4680 incremental link.
4681 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4682 archives and object files elsewhere.
4683 (Add_symbols::run): Report object files here.
4684 (Finish_group::run): Report end of archive at end of group.
4685 * reloc.cc: Include layout.h, incremental.h.
4686 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4687 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4688 (Sized_relobj::incremental_relocs_scan): New function.
4689 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4690 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4691 (Sized_relobj::incremental_relocs_write): New function.
4692 (Sized_relobj::incremental_relocs_write_reltype): New function.
4693 * script.cc (read_input_script): Rewrite test for incremental link.
4694 Change call to Incremental_inputs::report_script.
4695 * symtab.h (Symbol_table::first_global_index): New function.
4696 (Symbol_table::output_count): New function.
4697
4698 2010-08-12 Doug Kwan <dougkwan@google.com>
4699
4700 * arm.cc (Target_arm::merge_object_attributes): Check command line
4701 options --no-wchar-size-warning and --no-enum-size-warning.
4702 * options.h (General_options): Add ld-compatible options
4703 --no-enum-size-warning and --no-wchar-size-warning.
4704
4705 2010-08-04 Ian Lance Taylor <iant@google.com>
4706
4707 * x86_64.cc (Target_x86_64::Scan::local): Use
4708 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4709 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4710 (Target_x86_64::Scan::global): Likewise.
4711 (Target_x86_64::Relocate::relocate): Likewise.
4712 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4713 Likewise.
4714
4715 2010-08-03 Cary Coutant <ccoutant@google.com>
4716
4717 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4718 to reserve space in merged_strings vector. Keep total input size
4719 for stats.
4720 (Output_merge_string::do_print_merge_stats): Print total input size.
4721 * merge.h (Output_merge_string): Add input_size_ field.
4722 * stringpool.cc (Stringpool_template::string_length): Move
4723 implementations out of Stringpool_template class and place in
4724 stringpool.h.
4725 * stringpool.h (string_length): Move out of Stringpool_template.
4726
4727 2010-08-03 Ian Lance Taylor <iant@google.com>
4728
4729 PR 11712
4730 * layout.cc (relaxation_loop_body): If address of load segment is
4731 set, adjust address to include headers if possible.
4732
4733 2010-08-03 Ian Lance Taylor <iant@google.com>
4734
4735 * version.cc (version_string): Bump to 1.10.
4736
4737 2010-08-03 Ian Lance Taylor <iant@google.com>
4738
4739 PR 11805
4740 * layout.h (enum Output_section_order): Define.
4741 (class Layout): Update declarations.
4742 * layout.cc (Layout::get_output_section): Add order parameter.
4743 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4744 is_first_non_relro parameters. Change all callers.
4745 (Layout::choose_output_section): Likewise.
4746 (Layout::add_output_section_data): Likewise.
4747 (Layout::make_output_section): Likewise. Set order.
4748 (Layout::default_section_order): New function.
4749 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4750 * output.cc (Output_section::Output_section): Initialize order_.
4751 Don't initialize deleted fields.
4752 (Output_segment::Output_segment): Don't initialize deleted
4753 fields.
4754 (Output_segment::add_output_section_to_load): New function
4755 replacing add_output_section. Change all callers to call this or
4756 add_output_section_to_nonload.
4757 (Output_segment::add_output_section_to_nonload): New function.
4758 (Output_segment::remove_output_section): Rewrite.
4759 (Output_segment::add_initial_output_data): Likewise.
4760 (Output_segment::has_any_data_sections): Likewise.
4761 (Output_segment::is_first_section_relro): Likewise.
4762 (Output_segment::maximum_alignment): Likewise.
4763 (Output_segment::has_dynamic_reloc): New function replacing
4764 dynamic_reloc_count. Change all callers.
4765 (Output_segment::has_dynamic_reloc_list): New function replacing
4766 dynamic_reloc_count_list. Change all callers.
4767 (Output_segment::set_section_addresses): Rewrite.
4768 (Output_segment::set_offset): Rewrite.
4769 (Output_segment::find_first_and_last_list): Remove.
4770 (Output_segment::set_tls_offsets): Rewrite.
4771 (Output_segment::first_section_load_address): Likewise.
4772 (Output_segment::output_section_count): Likewise.
4773 (Output_segment::section_with_lowest_load_address): Likewise.
4774 (Output_segment::write_section_headers): Likewise.
4775 (Output_segment::print_sections_to_map): Likewise.
4776 * output.h (class Output_data): Remove dynamic_reloc_count_
4777 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4778 (Output_data::add_dynamic_reloc): Rewrite.
4779 (Output_data::has_dynamic_reloc): New function.
4780 (Output_data::dynamic_reloc_count): Remove.
4781 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4782 is_last_relro_, is_first_non_relro_, is_interp_,
4783 is_dynamic_linker_section_ fields. Add order and set_order
4784 functions. Remove is_relro_local, set_is_relro_local,
4785 is_last_relro, set_is_last_relro, is_first_non_relro,
4786 set_is_first_non_relro functions, is_interp, set_is_interp,
4787 is_dynamic_linker_section, and set_is_dynamic_linker_section
4788 functions.
4789 (class Output_segment): Change Output_data_list from std::list to
4790 std:;vector. Add output_lists_ field. Remove output_data_ and
4791 output_bss_ fields. Update declarations.
4792
4793 2010-08-02 Ian Lance Taylor <iant@google.com>
4794
4795 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4796 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4797 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4798
4799 2010-08-02 Ian Lance Taylor <iant@google.com>
4800
4801 PR 11855
4802 * script.cc (Script_options::Script_options): Initialize
4803 symbol_definitions_ and symbol_references_.
4804 (Script_options::add_symbol_assignment): Update
4805 symbol_definitions_ and symbol_references_.
4806 (Script_options::add_symbol_reference): New function.
4807 (script_symbol): New function.
4808 * script.h (class Script_options): Add symbol_definitions_ and
4809 symbol_references_ fields.
4810 (Script_options::referenced_const_iterator): New type.
4811 (Script_options::referenced_begin): New function.
4812 (Script_options::referenced_end): New function.
4813 (Script_options::is_referenced): New function.
4814 (Script_options::any_unreferenced): New function.
4815 * script-c.h (script_symbol): Declare.
4816 * yyscript.y (exp): Call script_symbol.
4817 * symtab.cc: Include "script.h".
4818 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4819 Change all callers. Check symbols referenced by scripts.
4820 (Symbol_table::add_undefined_symbols_from_command_line): Add
4821 layout parameter. Change all callers.
4822 (Symbol_table::do_add_undefined_symbols_from_command_line):
4823 Likewise. Break out loop body. Check symbols referenced by
4824 scripts.
4825 (Symbol_table::add_undefined_symbol_from_command_line): New
4826 function broken out of
4827 do_add_undefined_symbols_from_command_line.
4828 * symtab.h (class Symbol_table): Update declarations.
4829 * archive.cc: Include "layout.h".
4830 (Archive::should_include_member): Add layout parameter. Change
4831 all callers. Check for symbol mentioned in expression.
4832 * archive.h (class Archive): Update declaration.
4833 * object.cc (Sized_relobj::do_should_include_member): Add layout
4834 parameter.
4835 * object.h (Object::should_include_member): Add layout parameter.
4836 Change all callers.
4837 (Object::do_should_include_member): Add layout parameter.
4838 (class Sized_relobj): Update declaration.
4839 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4840 parameter.
4841 * dynobj.h (class Sized_dynobj): Update declaration.
4842 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4843 layout parameter.
4844 * plugin.h (class Sized_pluginobj): Update declaration.
4845
4846 2010-08-02 Ian Lance Taylor <iant@google.com>
4847
4848 PR 11866
4849 * output.cc (Output_segment::set_offset): Search for the first and
4850 last sections rather than assuming that the list is in order.
4851 (Output_segment::find_first_and_last_list): New function.
4852 * output.h (class Output_segment): Update declarations.
4853 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4854 (relro_strip_test_SOURCES): New variable.
4855 (relro_strip_test_DEPENDENCIES): New variable.
4856 (relro_strip_test_LDFLAGS): New variable.
4857 (relro_strip_test_LDADD): New variable.
4858 (relro_strip_test.so): New target.
4859
4860 2010-08-02 Ian Lance Taylor <iant@google.com>
4861
4862 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4863 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4864 (Target_i386::got_tlsdesc_section): New function.
4865 (Target_i386::got_section): Create space for GOT entries for
4866 TLSDESC relocations.
4867 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4868 R_386_TLS_GOTDESC.
4869 (Target_i386::Scan::global): Likewise.
4870 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4871 using TLSDESC GOT.
4872 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4873 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4874 (Target_x86_64::got_tlsdesc_section): New function.
4875 (Target_x86_64::got_section): Create space for GOT entries for
4876 TLSDESC relocations.
4877 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4878 R_386_TLS_GOTDESC.
4879 (Target_x86_64::Scan::global): Likewise.
4880 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4881 using TLSDESC GOT.
4882
4883 2010-08-02 Ian Lance Taylor <iant@google.com>
4884
4885 * testsuite/final_layout.sh: Use dc to convert from hex to
4886 decimal.
4887
4888 2010-07-29 Sriraman Tallam <tmsriram@google.com>
4889
4890 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4891 paramter to the call to gold::gc_process_relocs.
4892 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4893 paramter to the call to gold::gc_process_relocs.
4894 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4895 parameter to the call to gold::gc_process_relocs.
4896 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4897 template parameter to the call to gold::gc_process_relocs.
4898 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4899 paramter to the call to gold::gc_process_relocs.
4900 * gc.h (get_embedded_addend_size): New function.
4901 (gc_process_relocs): Save the size of the reloc for use by ICF.
4902 * icf.cc (get_section_contents): Get the addend from the text section
4903 for SHT_REL relocation sections.
4904 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4905 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4906 * int_encoding.h (read_from_pointer): New overloaded function.
4907 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4908 * testsuite/icf_sht_rel_addend_test.sh: New file.
4909 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4910 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4911
4912 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4913
4914 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4915 * Makefile.in: Regenerate.
4916 * testsuite/Makefile.in: Regenerate.
4917
4918 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4919
4920 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4921 * gold/testsuite/debug_msg.cc: Likewise.
4922 * gold/testsuite/odr_violation1.cc
4923 * gold/testsuite/odr_violation2.cc
4924
4925 2010-07-21 Cary Coutant <ccoutant@google.com>
4926
4927 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4928 string, and length fields.
4929 (Output_merge_string::Merged_strings_list): New type.
4930 (Output_merge_string::Merged_strings_lists): New typedef.
4931 (Output_merge_string): Replace merged_strings_ with
4932 merged_strings_lists_.
4933 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4934 Merged_strings_list per input object and section. Don't store pointer
4935 to the string. Don't store length with each merged string entry.
4936 (Output_merge_string::finalize_merged_data): Loop over list of merged
4937 strings lists. Recompute length of each merged string.
4938
4939 2010-07-15 Cary Coutant <ccoutant@google.com>
4940
4941 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4942 here.
4943
4944 2010-07-14 Ian Lance Taylor <iant@google.com>
4945
4946 * descriptors.cc (Descriptors::open): Report correct name in error
4947 message.
4948
4949 2010-07-13 Doug Kwan <dougkwan@google.com>
4950
4951 * arm.cc (Arm_input_section::Arm_input_section): For a
4952 SHT_ARM_EXIDX section, always keeps the input sections.
4953 (Arm_input_section::set_exidx_section_link): New method.
4954 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4955 has_errors_ to false.
4956 (Arm_exidx_input_section::has_errors,
4957 Arm_exidx_input_section::set_has_errors): New methods.
4958 (Arm_exidx_input_section::has_errors_): New data member.
4959 (Arm_relobj::get_exidx_shndx_list): New method.
4960 (Arm_output_section::append_text_sections_to_list): Do not skip
4961 section without SHF_EXECINSTR.
4962 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4963 errors.
4964 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4965 section header. Make error messages more verbose. Check for
4966 a non-executable section linked to an EXIDX section.
4967 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4968 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4969 check that there is no deferred EXIDX section if we exit early.
4970 Instead of not making an EXIDX section in case of an error, make one
4971 and set the has_errors flag of it.
4972 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4973 in a relocatable link.
4974 (Target_arm::do_relax): Look for the EXIDX output section instead of
4975 assuming that it is called .ARM.exidx.
4976 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4977 section list. Do not check for SHF_EXECINSTR section flags but
4978 skip any input section with errors.
4979 * output.cc (Output_section::Output_section): Initialize
4980 always_keeps_input_sections_ to false.
4981 (Output_section::add_input_section): Check for
4982 always_keeps_input_sections_.
4983 * output.h (Output_section::always_keeps_input_sections,
4984 Output_section::set_always_keeps_input_sections): New methods.
4985 (Output_section::always_keeps_input_sections): New data member.
4986
4987 2010-07-13 Rafael Espindola <espindola@google.com>
4988
4989 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4990 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4991
4992 2010-07-13 Philip Herron <herron.philip@googlemail.com>
4993 Ian Lance Taylor <iant@google.com>
4994
4995 * output.h (Output_section_lookup_maps::add_merge_section):
4996 Correct check of whether value was inserted.
4997 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4998 (Output_section_lookup_maps::add_relaxed_input_section):
4999 Likewise.
5000 * arm.cc (Target_arm::got_section): Remove used local os.
5001 * i386.cc (Target_i386::got_section): Likewise.
5002 * x86_64.cc (Target_x86_64::got_section): Likewise.
5003 * sparc.cc (Target_sparc::got_section): Likewise.
5004 (Target_sparc::relocate): Remove unused local have_got_offset.
5005 * powerpc.cc (Target_powerpc::relocate): Likewise.
5006
5007 2010-07-13 Ian Lance Taylor <iant@google.com>
5008
5009 * compressed_output.cc (zlib_decompress): Fix signature in
5010 !HAVE_ZLIB_H case.
5011
5012 * archive.cc (Archive::include_member): Unlock an external member
5013 of a thin archive. Don't bother to delete an object we know is
5014 NULL.
5015
5016 2010-07-12 Cary Coutant <ccoutant@google.com>
5017
5018 * compressed_output.cc (zlib_decompress): New function.
5019 (get_uncompressed_size): New function.
5020 (decompress_input_section): New function.
5021 * compressed_output.h (get_uncompressed_size): New function.
5022 (decompress_input_section): New function.
5023 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5024 Handle compressed debug sections.
5025 * layout.cc (is_compressed_debug_section): New function.
5026 (Layout::output_section_name): Map compressed section names to
5027 canonical names.
5028 * layout.h (is_compressed_debug_section): New function.
5029 (is_debug_info_section): Recognize compressed debug sections.
5030 * merge.cc: Include compressed_output.h.
5031 (Output_merge_data::do_add_input_section): Handle compressed
5032 debug sections.
5033 (Output_merge_string::do_add_input_section): Handle compressed
5034 debug sections.
5035 * object.cc: Include compressed_output.h.
5036 (Sized_relobj::Sized_relobj): Initialize new data members.
5037 (build_compressed_section_map): New function.
5038 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5039 * object.h (Object::section_is_compressed): New method.
5040 (Object::do_section_is_compressed): New method.
5041 (Sized_relobj::Compressed_section_map): New type.
5042 (Sized_relobj::do_section_is_compressed): New method.
5043 (Sized_relobj::compressed_sections_): New data member.
5044 * output.cc (Output_section::add_input_section): Handle compressed
5045 debug sections.
5046 * reloc.cc: Include compressed_output.h.
5047 (Sized_relobj::write_sections): Handle compressed debug sections.
5048
5049 2010-07-08 Cary Coutant <ccoutant@google.com>
5050
5051 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5052 weak when resolving to a dynamic def.
5053 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5054 for weak undef/dynamic def cases. Adjust callers.
5055 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5056 undef_binding_weak_.
5057 (Symbol_table::sized_write_globals): Adjust symbol binding.
5058 (Symbol_table::sized_write_symbol): Add binding parameter.
5059 * symtab.h (Symbol::set_undef_binding): New method.
5060 (Symbol::is_undef_binding_weak): New method.
5061 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5062 (Symbol_table::should_override): Add new parameter.
5063 (Symbol_table::sized_write_symbol): Add new parameter.
5064
5065 * testsuite/weak_undef_file1.cc: Add new test case.
5066 * testsuite/weak_undef_file2.cc: Fix header comment.
5067 * testsuite/weak_undef_test.cc: Add new test case.
5068
5069 2010-06-29 Doug Kwan <dougkwan@google.com>
5070
5071 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5072 Initialize USE_SYMBOL_.
5073 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5074 definition.
5075 (Arm_reloc_property::uses_symbol_): New data member declaration.
5076 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5077 uses symbol value and symbol is undefined but not weakly undefined.
5078
5079 2010-06-28 Rafael Espindola <espindola@google.com>
5080
5081 * plugin.cc (Plugin::load): Use dlerror.
5082
5083 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5084
5085 * symtab.cc (detect_odr_violations): When reporting an ODR
5086 violation, report an object where the symbol is defined.
5087
5088 2010-06-25 Doug Kwan <dougkwan@google.com>
5089
5090 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5091 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5092 definition.
5093 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5094 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5095 target hook to detect function points.
5096 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5097 * icf.h (Icf::check_section_for_function_pointers): Change type of
5098 parameter SECTION_NAME to const reference to std::string. Use
5099 target hook to determine if section may have unsafe pointers.
5100 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5101 method definition.
5102
5103 2010-06-21 Rafael Espindola <espindola@google.com>
5104
5105 * fileread.cc (Input_file::find_fie): New
5106 (Input_file::open): Use Input_file::find_fie.
5107 * fileread.h (Input_file::find_fie): New
5108 * plugin.cc (set_extra_library_path): New.
5109 (Plugin::load): Add set_extra_library_path to the transfer vector.
5110 (Plugin_manager::set_extra_library_path): New.
5111 (Plugin_manager::add_input_file): Use the extra search path if set.
5112 (set_extra_library_path(): New.
5113 * plugin.h (Plugin_manager): Add set_extra_library_path and
5114 extra_search_path_.
5115
5116 2010-06-19 Cary Coutant <ccoutant@google.com>
5117
5118 * layout.cc (gdb_sections): Add .debug_types.
5119 (lines_only_debug_sections): Likewise.
5120
5121 2010-06-18 Rafael Espindola <espindola@google.com>
5122
5123 * plugin.cc (add_input_file,add_input_library)
5124 (Plugin_manager::add_input_file): Make filename arguments const.
5125 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5126 const.
5127
5128 2010-06-16 Doug Kwan <dougkwan@google.com>
5129
5130 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5131 .ARM.attributes section if we have not merged any input
5132 attributes sections.
5133
5134 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5135
5136 * arm.cc: Allow combining objects with no EABI version
5137 information.
5138
5139 2010-06-15 Rafael Espindola <espindola@google.com>
5140
5141 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5142
5143 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5144
5145 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5146 (struct iovec): Correct !HAVE_READV definition.
5147
5148 2010-06-10 Cary Coutant <ccoutant@google.com>
5149
5150 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5151 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5152 reloc sections.
5153 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5154
5155 PR 11683
5156 * symtab.h (Symbol::is_placeholder): New member function.
5157 * target-reloc.h (relocate_section): Check for placeholder symbols.
5158
5159 * testsuite/Makefile.am (plugin_test_8): New test.
5160 (plugin_test_9): New test.
5161 * testsuite/Makefile.in: Regenerate.
5162
5163 2010-06-09 Nick Clifton <nickc@redhat.com>
5164
5165 * yyscript.y (input_list_element): Allow strings prefixed with
5166 the '-' character. Treat these as libraries.
5167 * script.cc (script_add_library): New function. Adds a library
5168 specified by "-l<name>" found in an input script.
5169 * script-c.h: Add prototype for script_add_library.
5170
5171 2010-06-07 Doug Kwan <dougkwan@google.com>
5172
5173 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5174 Restrict stub-group size to be within long conditional branch
5175 range when working around cortex-A8 erratum.
5176
5177 2010-06-07 Damien Diederen <dd@crosstwine.com>
5178
5179 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5180 #ifdef typo.
5181
5182 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5183
5184 PR gold/11658
5185 * output.cc
5186 (Output_section::Input_section_sort_entry::compare_section_ordering):
5187 Change to return non-zero correctly.
5188 (Output_section::Input_section_sort_section_order_index_compare
5189 ::operator()): Change to fix ambiguity in comparisons.
5190
5191 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5192
5193 * gold.h (is_wildcard_string): New function.
5194 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5195 (Layout::layout_eh_frame): Ditto.
5196 (Layout::find_section_order_index): New method.
5197 (Layout::read_layout_from_file): New method.
5198 * layout.h (Layout::find_section_order_index): New method.
5199 (Layout::read_layout_from_file): New method.
5200 (Layout::input_section_position_): New private member.
5201 (Layout::input_section_glob_): New private member.
5202 * main.cc (main): Call read_layout_from_file here.
5203 * options.h (--section-ordering-file): New option.
5204 * output.cc (Output_section::input_section_order_specified_): New
5205 member.
5206 (Output_section::Output_section): Initialize new member.
5207 (Output_section::add_input_section): Add new parameter.
5208 Keep input sections when --section-ordering-file is used.
5209 (Output_section::set_final_data_size): Sort input sections when
5210 section ordering file is specified.
5211 (Output_section::Input_section_sort_entry): Add new parameter.
5212 Check sorting type.
5213 (Output_section::Input_section_sort_entry::compare_section_ordering):
5214 New method.
5215 (Output_section::Input_section_sort_compare::operator()): Change to
5216 consider section_order_index.
5217 (Output_section::Input_section_sort_init_fini_compare::operator()):
5218 Change to consider section_order_index.
5219 (Output_section::Input_section_sort_section_order_index_compare
5220 ::operator()): New method.
5221 (Output_section::sort_attached_input_sections): Change to sort
5222 according to section order when specified.
5223 (Output_section::add_input_section<32, true>): Add new parameter.
5224 (Output_section::add_input_section<64, true>): Add new parameter.
5225 (Output_section::add_input_section<32, false>): Add new parameter.
5226 (Output_section::add_input_section<64, false>): Add new parameter.
5227 * output.h (Output_section::add_input_section): Add new parameter.
5228 (Output_section::input_section_order_specified): New
5229 method.
5230 (Output_section::set_input_section_order_specified): New method.
5231 (Input_section::Input_section): Initialize section_order_index_.
5232 (Input_section::section_order_index): New method.
5233 (Input_section::set_section_order_index): New method.
5234 (Input_section::section_order_index_): New member.
5235 (Input_section::Input_section_sort_section_order_index_compare): New
5236 struct.
5237 (Output_section::input_section_order_specified_): New member.
5238 * script-sections.cc (is_wildcard_string): Delete and move modified
5239 method to gold.h.
5240 (Output_section_element_input::Output_section_element_input): Modify
5241 call to is_wildcard_string.
5242 (Output_section_element_input::Input_section_pattern
5243 ::Input_section_pattern): Ditto.
5244 (Output_section_element_input::Output_section_element_input): Ditto.
5245 * testsuite/Makefile.am (final_layout): New test case.
5246 * testsuite/Makefile.in: Regenerate.
5247 * testsuite/final_layout.cc: New file.
5248 * testsuite/final_layout.sh: New file.
5249
5250 2010-06-01 Rafael Espindola <espindola@google.com>
5251
5252 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5253
5254 2010-06-01 Rafael Espindola <espindola@google.com>
5255
5256 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5257 visibility of symbols.
5258
5259 2010-05-27 Doug Kwan <dougkwan@google.com>
5260
5261 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5262 from start of output section instead of address for a local symbol
5263 in a merged or relaxed section when doing a relocatable link.
5264
5265 2010-05-26 Rafael Espindola <espindola@google.com>
5266
5267 PR 11604
5268 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5269 adding sections the garbage collector removed.
5270 * gold/testsuite/Makefile.am: Add test.
5271 * gold/testsuite/Makefile.in: Regenerate.
5272 * gold/testsuite/plugin_test_7.sh: New.
5273 * gold/testsuite/plugin_test_7_1.c: New.
5274 * gold/testsuite/plugin_test_7_2.c: New.
5275
5276 2010-05-26 Rafael Espindola <espindola@google.com>
5277
5278 * script-sections.cc (Output_section_definition::set_section_addresses):
5279 Check for --section-start.
5280
5281 2010-05-26 Doug Kwan <dougkwan@google.com>
5282
5283 * arm.cc (Arm_scan_relocatable_relocs): New class.
5284 (Target_arm::relocate_special_relocatable): New method.
5285 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5286 (Arm_relocate_functions::thumb_branch_common): Same.
5287 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5288 instead of Default_scan_relocatable_relocs.
5289 * target-reloc.h (relocate_for_relocatable): Let target handle
5290 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5291 * target.h (Sized_target::relocate_special_relocatable): New method.
5292
5293 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5294
5295 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5296
5297 2010-05-23 Doug Kwan <dougkwan@google.com>
5298
5299 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5300 instead of a cast.
5301 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5302 with a direct branch, not a conditional branch, to a stub.
5303 * merge.cc (Output_merge_base::record_input_section): New method
5304 defintion.
5305 (Output_merge_data::do_add_input_section): Record input section if
5306 keeps-input-sections flag is set.
5307 (Output_merge_string::do_add_input_section): Ditto.
5308 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5309 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5310 INPUT_SECTIONS_.
5311 (Output_merge_base::keeps_input_sections,
5312 Output_merge_base::set_keeps_input_sections,
5313 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5314 method definitions.
5315 (Output_merge_base::Input_sections): New type declaration.
5316 (Output_merge_base::input_sections_begin,
5317 Output_merge_base::input_sections_end,
5318 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5319 (Output_merge_base::bool keeps_input_sections_,
5320 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5321 Output_merge_base::input_sections_): New data members.
5322 (Output_merge_data::do_set_keeps_input_sections): New method
5323 defintion.
5324 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5325 * output.cc (Output_section::Input_section::relobj): Move method
5326 defintion from class declaration to here and handle merge sections.
5327 (Output_section::Input_section::shndx): Ditto.
5328 (Output_section::Output_section): Remove initializations of removed
5329 data members and initialize new data member LOOKUP_MAPS_.
5330 (Output_section::add_input_section): Set keeps-input-sections flag
5331 for a newly created merge output section as appropriate. Adjust code
5332 to use Output_section_lookup_maps class.
5333 (Output_section::add_relaxed_input_section): Adjst code for lookup
5334 maps code refactoring.
5335 (Output_section::add_merge_input_section): Add a new parameter
5336 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5337 class. If adding input section to a newly created merge output
5338 section fails, remove the new merge section.
5339 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5340 Adjust code for use of the Output_section_lookup_maps class.
5341 (Output_section::find_merge_section): Ditto.
5342 (Output_section::build_lookup_maps): New method defintion.
5343 (Output_section::find_relaxed_input_section): Adjust code to use
5344 Output_section_lookup_maps class.
5345 (Output_section::get_input_sections): Export merge sections. Adjust
5346 code to use Output_section_lookup_maps class.
5347 (Output_section:::add_script_input_section): Adjust code to use
5348 Output_section_lookup_maps class. Update lookup maps for merge
5349 sections also.
5350 (Output_section::discard_states): Use Output_section_lookup_maps.
5351 (Output_section::restore_states): Same.
5352 * output.h (Merge_section_properties): Move class defintion out of
5353 Output_section.
5354 (Output_section_lookup_maps): New class.
5355 (Output_section::Input_section::is_merge_section): New method
5356 defintion.
5357 (Output_section::Input_section::relobj): Move defintion out of class
5358 defintion. Declare method only.
5359 (Output_section::Input_section::shndx): Ditto.
5360 (Output_section::Input_section::output_merge_base): New method defintion.
5361 (Output_section::Input_section::u2_.pomb): New union field.
5362 (Output_section::Merge_section_by_properties_map,
5363 Output_section::Output_section_data_by_input_section_map,
5364 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5365 Remove types.
5366 (Output_section::add_merge_input_section): Add new parameter
5367 KEEPS_INPUT_SECTIONS.
5368 (Output_section::build_lookup_maps): New method declaration.
5369 (Output_section::merge_section_map_,
5370 Output_section::merge_section_by_properties_map_,
5371 Output_section::relaxed_input_section_map_,
5372 Output_section::is_relaxed_input_section_map_valid_): Remove data
5373 members.
5374 (Output_section::lookup_maps_): New data member.
5375
5376 2010-05-21 Doug Kwan <dougkwan@google.com>
5377
5378 PR gold/11619
5379 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5380 avoid a compilation error.
5381
5382 2010-05-19 Rafael Espindola <espindola@google.com>
5383
5384 * script-sections.cc (Output_section_definition::allocate_to_segment):
5385 Update the phdrs_list even when the output section is NULL.
5386 * testsuite/Makefile.am: Add test.
5387 * testsuite/Makefile.in: Regenerate.
5388 * testsuite/script_test_9.cc: New.
5389 * testsuite/script_test_9.sh: New.
5390 * testsuite/script_test_9.t: New.
5391
5392 2010-05-19 Doug Kwan <dougkwan@google.com>
5393
5394 * arm.cc (Arm_input_section::original_size): New method.
5395 (Arm_input_section::do_addralign): Add a cast.
5396 (Arm_input_section::do_output_offset): Remove static cast.
5397 (Arm_input_section::original_addralign,
5398 Arm_input_section::original_size_): Change type to uint32_t.
5399 (Arm_input_section::init): Add safe casts for section alignment
5400 and size.
5401 (Arm_input_section::set_final_data_size): Do not set address and
5402 offset of stub table.
5403 (Arm_output_section::fix_exidx_coverage): Change use of of
5404 Output_section::Simple_input_section to that of
5405 Output_section::Input_section.
5406 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5407 except for the first pass.
5408 * output.cc (Output_section::get_input_sections): Change type of
5409 input_sections to std::list<Input_section>.
5410 (Output_section::add_script_input_section): Rename from
5411 Output_section::add_simple_input_section. Change type of SIS
5412 parameter from Simple_input_section to Input_section.
5413 * output.h (Output_section::Simple_input_section): Remove class.
5414 (Output_section::Input_section): Change class visibility to public.
5415 (Output_section::Input_section::addralign): Use stored alignments
5416 for special input sections if set.
5417 (Output_section::Input_section::set_addralign): New method.
5418 (Output_section::get_input_sections): Change parameter type from
5419 list of Simple_input_section to list of Input_section.
5420 (Output_section::add_script_input_section): Rename from
5421 Output_section::add_simple_input_section. Change first parameter's
5422 type from Simple_input_section to Input_section and remove the
5423 second and third parameters.
5424 * script-sections.cc (Input_section::Input_section_list): Change
5425 type to list of Output_section::Input_section/
5426 (Input_section_info::Input_section_info): Change parameter type of
5427 INPUT_SECTION to Output_section::Input_section.
5428 (Input_section_info::input_section): Change return type.
5429 (Input_section_info::input_section_): Change type to
5430 Output_section::Input_section.
5431 (Output_section_element_input::set_section_addresses): Adjust code
5432 to use Output_section::Input_section instead of
5433 Output_section::Simple_input_section. Adjust code for renaming
5434 of Output_section::add_simple_input_section.
5435 (Orphan_output_section::set_section_addresses): Ditto.
5436
5437 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5438
5439 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5440 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5441
5442 2010-05-18 Rafael Espindola <espindola@google.com>
5443
5444 * options.cc (General_options::finalize): Handle -nostdlib.
5445 * options.h (nostdlib): New option.
5446 * script.cc (script_add_search_dir): Handle -nostdlib.
5447
5448 2010-05-12 Doug Kwan <dougkwan@google.com>
5449
5450 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5451 attributes section only if there no attributes section after merging.
5452 (Target_arm::merge_object_attributes): Move value of
5453 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5454 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5455 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5456 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5457 and arm_attr_merge_7.stdout.
5458 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5459 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5460 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5461 arm_attr_merge_7b.o): New rules.
5462 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5463 arm_attr_merge_7
5464 * testsuite/Makefile.in: Regenerate.
5465 * testsuite/arm_attr_merge.sh: New file.
5466 * testsuite/arm_attr_merge_[67][ab].s: Same.
5467
5468 2010-05-05 Nick Clifton <nickc@redhat.com>
5469
5470 * po/es.po: Updated Spanish translation.
5471
5472 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5473
5474 * Makefile.am (install-exec-local): Properly install gold as
5475 default cross linker.
5476 * Makefile.in: Regenerated.
5477
5478 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5479 Nick Clifton <nickc@redhat.com>
5480
5481 * configure.ac (install_as_default): Define and set to false
5482 unless --enable-gold or --enable-gold=both/gold has been
5483 specified.
5484 * configure: Regenerate.
5485
5486 * Makefile.am (install-exec-local): Install the executable as
5487 'ld.gold'. If install_as_default is true then also install it as
5488 'ld'.
5489 * Makefile.in: Regenerated.
5490
5491 2010-04-24 Ian Lance Taylor <iant@google.com>
5492
5493 * layout.cc (Layout::layout_reloc): In relocatable link don't
5494 combine reloc sections for grouped sections.
5495
5496 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5497
5498 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5499 sections that are not ordinary to icf.
5500 * icf.cc (get_section_contents): Handle relocation pointing to section
5501 with no object or shndx information.
5502 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5503 * testsuite/Makefile.in: Regenerate.
5504 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5505 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5506
5507 2010-04-22 Ian Lance Taylor <iant@google.com>
5508
5509 * expression.cc (Expression::Expression_eval_info): Add
5510 result_alignment_pointer field.
5511 (Expression::eval_with_dot): Add result_alignment_pointer
5512 parameter. Change all callers.
5513 (Expression::eval_maybe_dot): Likewise.
5514 (class Binary_expression): Add alignment_pointer parameter to
5515 left_value and right_value. Change all callers.
5516 (BINARY_EXPRESSION): Set result alignment.
5517 (class Trinary_expression): Add alignment_pointer parameter to
5518 arg2_value and arg3_value. Change all callers.
5519 (Trinary_cond::value): Set result alignment.
5520 (Max_expression::value, Min_expression::value): Likewise.
5521 (Align_expression::value): Likewise.
5522 * script-sections.cc (class Sections_element): Add dot_alignment
5523 parameter to set_section_addresses virtual function. Update
5524 instantiations.
5525 (class Output_section_element): Likewise.
5526 (Script_sections::create_segments): Add dot_alignment parameter.
5527 Change all callers.
5528 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5529 (Script_sections::set_phdrs_clause_addresses): Likewise.
5530 * script-sections.h: Update declarations.
5531 * script.h: Update declarations.
5532 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5533 min_p_align.
5534 * testsuite/script_test_3.t: Set large alignment.
5535 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5536 segment has expected alignment.
5537
5538 2010-04-22 Nick Clifton <nickc@redhat.com>
5539
5540 * po/gold.pot: Updated by the Translation project.
5541 * po/vi.po: Updated Vietnamese translation.
5542
5543 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5544
5545 * testsuite/Makefile.am (check_PROGRAMS): Add
5546 icf_virtual_function_folding_test.
5547 * testsuite/Makefile.in: Regenerated.
5548
5549 2010-04-15 Andrew Haley <aph@redhat.com>
5550
5551 * options.h (merge_exidx_entries): New option.
5552 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5553 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5554 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5555 (Target_arm::merge_exidx_entries): New function.
5556 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5557 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5558 to Arm_exidx_fixup constructor.
5559 Add new arg, merge_exidx_entries.
5560 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5561 Arm_output_section::fix_exidx_coverage.
5562
5563 2010-04-18 Sriraman Tallam <tmsriram@google.com>
5564
5565 * icf.cc (get_section_contents): Check for preemptible functions.
5566 Ignore addend when appropriate.
5567 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5568 section folded.
5569 (add_from_relobj): Check for section folded.
5570 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5571 * symtab.h (should_add_dynsym_entry): Add new parameter.
5572 * target-reloc.h (scan_relocs): Check for section folded.
5573 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5574 Check reloc types for function pointers in shared objects.
5575 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5576 case.
5577 (icf_preemptible_functions_test): New test case.
5578 (icf_string_merge_test): New test case.
5579 * testsuite.Makefile.in: Regenerate.
5580 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5581 bar_glob. Refactor code.
5582 * testsuite/icf_preemptible_functions_test.cc: New file.
5583 * testsuite/icf_preemptible_functions_test.sh: New file.
5584 * testsuite/icf_string_merge_test.cc: New file.
5585 * testsuite/icf_string_merge_test.sh: New file.
5586 * testsuite/icf_virtual_function_folding_test.cc: New file.
5587 * testsuite/icf_virtual_function_folding_test.sh: New file.
5588
5589 2010-04-14 Doug Kwan <dougkwan@google.com>
5590
5591 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5592 for local symbol recounting if we remove a section due to ICF.
5593 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5594 there are no regular objects in input.
5595
5596 2010-04-13 Doug Kwan <dougkwan@google.com>
5597
5598 * arm.cc (Arm_input_section::set_final_data_size): Compute
5599 accurate final data size instead of using current data size.
5600
5601 2010-04-09 Doug Kwan <dougkwan@google.com>
5602
5603 * layout.cc (Layout::choose_output_section): Handle script section
5604 types.
5605 (Layout::make_output_section_for_script): Add section type parameter.
5606 Handle script section types.
5607 * layout.h (Layout::make_output_section_for_script): Add section
5608 type parameter.
5609 * output.cc (Output_section::Output_section): Initialize data member
5610 is_noload_.
5611 (Output_section::do_reset_address_and_file_offset): Do not set address
5612 to 0 if section is a NOLOAD section.
5613 * output.h (Output_section::is_noload): New method.
5614 (Output_section::set_is_noload): Ditto.
5615 (Output_section::is_noload_): New data member.
5616 * script-c.h (Script_section_type): New enum type.
5617 (struct Parser_output_section_header): Add new file section_type.
5618 * script-sections.cc (Sections_element::output_section_name): Add
5619 parameter for returning script section type.
5620 (Output_section_definition::output_section_name): Ditto.
5621 (Output_section_definition::section_type)P; New method.
5622 (Output_section_definiton::script_section_type_name): Ditto.
5623 (Output_section_definition::script_section_type_): New data member.
5624 (Output_section_definition::Output_section_definition): Initialize
5625 data member Output_section_definition::script_section_type_.
5626 (Output_section_definition::create_sections): Pass script section type
5627 to Layout::make_output_section_for_script.
5628 (Output_section_definition::output_section_name): Return script
5629 section type to caller.
5630 (Output_section_definition::set_section_address): Do not advance
5631 dot value and load address if section type is NOLOAD. Set address
5632 of NOLOAD sections regardless of section flags.
5633 (Output_section_definition::print): Print section type if it is
5634 not SCRIPT_SECTION_TYPE_NONE.
5635 (Output_section_definition::section_type): New method.
5636 (Output_section_definition::script_section_type_name): Ditto.
5637 (Script_sections::output_section_name): Add new parameter
5638 PSECTION_TYPE for returning script section type. Pass it to
5639 section elements. Handle discard sections.
5640 (Sort_output_sections::operator()): Handle NOLOAD sections.
5641 * script-sections.h (Script_sections::Section_type): New enum type.
5642 (Script_sections::output_section_name): Add a new parameter for
5643 returning script section type.
5644 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5645 INFO and NOLOAD.
5646 * yyscript.y (union): Add new field SECTION_TYPE.
5647 (COPY, DSECT, INFO, NOLOAD): New tokens.
5648 (opt_address_and_section_type): Change type to output_section_header.
5649 (section_type): New non-terminal
5650 (section_header): Handle section type.
5651 (opt_address_and_section_type): Return section type value.
5652
5653 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5654
5655 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5656 * testsuite/plugin_common_test_2.c (foo): Likewise.
5657
5658 2010-04-08 Doug Kwan <dougkwan@google.com>
5659
5660 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5661 Output_merge_data.
5662 * output.cc (Output_section::add_merge_input_section): Simplify
5663 code and return status of Output_merge_base::add_input_section.
5664 Update merge section map only if Output_merge_base::add_input_section
5665 returns true.
5666
5667 2010-04-07 Doug Kwan <dougkwan@google.com>
5668
5669 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5670 if section is marked as containing instructions but has no mapping
5671 symbols.
5672 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5673 correct section index.
5674 (Arm_relobj::find_linked_text_section): Ditto.
5675
5676 2010-04-07 Cary Coutant <ccoutant@google.com>
5677
5678 * archive.cc (include_member): Destroy Read_symbols_data object before
5679 releasing file.
5680 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5681 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5682 (Read_symbols_data::~Read_symbols_data) New destructor.
5683 (Section_relocs::Section_relocs) New constructor.
5684 (Section_relocs::~Section_relocs) New destructor.
5685 (Read_relocs_data::Read_relocs_data) New constructor.
5686 (Read_relocs_data::~Read_relocs_data) New destructor.
5687 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5688 pointers to NULL after deleting.
5689
5690 2010-04-07 Doug Kwan <dougkwan@google.com>
5691
5692 * arm.cc: Replace "endianity" with "endianness" in comments.
5693 (Arm_exidx_cantunwind): Ditto.
5694 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5695 (Arm_relobj::merge_flags_and_attributes): New method.
5696 (Arm_relobj::merge_flags_and_attributes_): New data member.
5697 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5698 (Arm_relobj::scan_sections_for_stubs): Ditto.
5699 (Arm_relobj::do_read_symbols): Check to see if we really want to
5700 merge processor-specific flags and attributes. Exit early if
5701 an object is empty except for section names and the undefined symbol.
5702 (Target_arm::do_finalize_sections): Move check for ELF format to
5703 Arm_relobj::do_read_symbols. Merge processor specific flags and
5704 attributes from a regular object only when we have determined that
5705 it is aapropriate. Do not create an .ARM.attributes section in
5706 output if there is no regular input object.
5707 (Target_arm::merge_processor_specific_flags): Check
5708 --warn-mismatch before printing any error.
5709 (Target_arm::merge_object_attributes): Ditto.
5710 * gold.cc (queue_middle_tasks): Handle the case in which there is
5711 no regular object in input.
5712 * options.cc (General_options::parse_EB): New method.
5713 (General_options::parse_EL): Same.
5714 (General_options::General_options): Initialize endianness_.
5715 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5716 New options.
5717 (General_options::Endianness): New enum.
5718 (General_options::endianness): New method.
5719 (General_options::endianness_): New data member.
5720 * parameters.cc (Parameters::set_options): Check target endianness.
5721 (Parameters::set_target_once): Ditto.
5722 (Parameters::check_target_endianness): New method.
5723 (parameters_force_valid_target): If either -EL or -EB is specified,
5724 use it to define endianness of default target.
5725 * parameters.h (Parameters::check_target_endianness): New method
5726 declaration.
5727 * target.h (class Target): Change "endianity" to "endianness"
5728 in comments.
5729
5730 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5731
5732 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5733 * configure: Regenerate.
5734 * Makefile.in: Regenerate.
5735 * testsuite/Makefile.in: Regenerate.
5736
5737 2010-04-06 Cary Coutant <ccoutant@google.com>
5738
5739 gcc PR lto/42757
5740 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5741 prevailing definitions of common symbols.
5742 * testsuite/plugin_test_6.sh: New test case.
5743 * testsuite/plugin_common_test_1.c: New test case.
5744 * testsuite/plugin_common_test_2.c: New test case.
5745 * testsuite/Makefile.am (plugin_test_6): New test case.
5746 * testsuite/Makefile.in: Regenerate.
5747
5748 2010-04-06 Nick Clifton <nickc@redhat.com>
5749
5750 * po/vi.po: New Vietnamese translation.
5751
5752 2010-03-30 Doug Kwan <dougkwan@google.com>
5753
5754 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5755
5756 2010-03-25 Doug Kwan <dougkwan@google.com>
5757
5758 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5759 to avoid a conversion warning on a 32-bit host.
5760
5761 2010-03-24 Ian Lance Taylor <iant@google.com>
5762
5763 * testsuite/script_test_3.t: Add a TLS segment.
5764 * testsuite/Makefile.am (check_PROGRAMS): Add
5765 tls_phdrs_script_test.
5766 (tls_phdrs_script_test_SOURCES): Define.
5767 (tls_phdrs_script_test_DEPENDENCIES): Define.
5768 (tls_phdrs_script_test_LDFLAGS): Define.
5769 (tls_phdrs_script_test_LDADD): Define.
5770 * testsuite/Makefile.in: Rebuild.
5771
5772 2010-03-23 Cary Coutant <ccoutant@google.com>
5773
5774 * fileread.cc (find_or_make_view): Fix comment.
5775
5776 2010-03-23 Ian Lance Taylor <iant@google.com>
5777
5778 * script-sections.cc (class Orphan_section_placement): Define
5779 PLACE_TLS and PLACE_TLS_BSS.
5780 (Orphan_section_placement::Orphan_section_placement): Initialize
5781 new places.
5782 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5783 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5784 (tls_script_test_SOURCES): Define.
5785 (tls_script_test_DEPENDENCIES): Define.
5786 (tls_script_test_LDFLAGS): Define.
5787 (tls_script_test_LDADD): Define.
5788 * testsuite/Makefile.in: Rebuild.
5789
5790 2010-03-22 Doug Kwan <dougkwan@google.com>
5791
5792 * arm.cc (Arm_relocate_functions::abs8,
5793 Arm_relocate_functions::abs16): Use correct check for overflow
5794 specified in the ARM ELF specs.
5795 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5796 target of a BLX instruction specially.
5797 (Reloc_stub::stub_type_for_reloc): Ditto.
5798 (Relocate::relocate): Use symbolic names instead of numeric relocation
5799 codes to report error.
5800 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5801 workaround.
5802 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5803 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5804 thumb2_blx_out_of_range.stdout
5805 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5806 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5807 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5808 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5809 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5810 thumb2_blx_in_range, thumb2_blx_in_range.o,
5811 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5812 thumb2_blx_out_of_range.o): New rules.
5813 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
5814 thumb2_blx_in_range and thumb2_blx_out_of_range.
5815 * testsuite/Makefile.in: Regenerate.
5816 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5817 * testsuite/thumb_blx_in_range.s: New file.
5818 * testsuite/thumb_blx_out_of_range.s: New file.
5819
5820 2010-03-22 Rafael Espindola <espindola@google.com>
5821
5822 * archive.cc (Should_include): Move to archive.h.
5823 (should_include_member): Make it a member of Archive.
5824 (Lib_group): New.
5825 (Add_lib_group_symbols): New.
5826 * archive.h: Include options.h.
5827 (Archive_member): Moved from Archive.
5828 (Should_include): Moved from archive.cc.
5829 (Lib_group): New.
5830 (Add_lib_group_symbols): New.
5831 * dynobj.cc (do_should_include_member): New.
5832 * dynobj.h (do_should_include_member): New.
5833 * gold.cc (queue_initial_tasks): Update call to queue.
5834 * main.cc (main): Print lib group stats.
5835 * object.cc (do_should_include_member): New.
5836 * object.h: Include archive.h.
5837 (Object::should_include_member): New.
5838 (Object::do_should_include_member): New.
5839 (Sized_relobj::do_should_include_member): New.
5840 * options.cc (General_options::parse_start_lib): New.
5841 (General_options::parse_end_lib): New.
5842 (Input_arguments::add_file): Handle lib groups.
5843 (Input_arguments::start_group): Check we are not in a lib.
5844 (Input_arguments::start_lib): New.
5845 (Input_arguments::end_lib): New.
5846 * options.h (General_options): Add start_lib and end_lib.
5847 (Input_argument::lib_): New.
5848 (Input_argument::lib): New.
5849 (Input_argument::is_lib): New.
5850 (Input_file_lib): New.
5851 (Input_arguments::in_lib_): New.
5852 (Input_arguments::in_lib): New.
5853 (Input_arguments::start_lib): New.
5854 (Input_arguments::end_lib_): New.
5855 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5856 in unused members as preempted.
5857 (Sized_pluginobj::do_should_include_member): New.
5858 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5859 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5860 return the blocker.
5861 (Read_symbols::do_whole_lib_group): New.
5862 (Read_symbols::do_lib_group): New.
5863 (Read_symbols::do_read_symbols): Handle lib groups.
5864 (Read_symbols::get_name): Handle lib groups.
5865 * readsyms.h (Read_symbols): Add an archive member pointer.
5866 (Read_symbols::do_whole_lib_group): New.
5867 (Read_symbols::do_lib_group): New.
5868 (Read_symbols::member_): New.
5869 * script.cc (read_input_script): Update call to queue_soon.
5870
5871 2010-03-19 Doug Kwan <dougkwan@google.com>
5872
5873 * arm.cc (Stub_table::Stub_table): Initialize new data members
5874 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5875 (Stub_table::add_reloc_stub): Assign stub offset and update
5876 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5877 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5878 New data members.
5879 (Stub_table::update_data_size_and_addralign): Use
5880 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5881 instead of going over all reloc stubs.
5882 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
5883 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5884 Stringpool_template::offset_ to size of Stringpool_char.
5885 (Stringpool_template::new_key_offset): Remove code to initialize
5886 Stringpool_template::offset_.
5887 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5888 Stringpool_template::offset_ to zero.
5889
5890 2010-03-15 Doug Kwan <dougkwan@google.com>
5891
5892 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5893 offset_.
5894 (Stringpool_template::new_key_offset): New method.
5895 (Stringpool_template::add_string): Assign offsets when adding new
5896 strings.
5897 (Stringpool_template::set_string_offsets): Do not set string offsets
5898 when not optimizing.
5899 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5900 member size_.
5901 (Chunked_vector::clear): Clear size_.
5902 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5903 (Chunked_vector::size): Return size_.
5904 (Chunked_vector::push_back): Use size_ to find insert position.
5905 (Chunked_vector::size_): New data member.
5906 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5907 (Stringpool_template::new_key_offset): New method declaration.
5908 (Stringpool_template::offset_): New data member.
5909
5910 2010-03-15 Rafael Espindola <espindola@google.com>
5911
5912 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5913 Add_symbols' constructor.
5914 * readsyms.h (Add_symbols): Remove the input_group member.
5915
5916 2010-03-10 Ian Lance Taylor <iant@google.com>
5917
5918 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5919 target to ask whether a reference to a symbol requires a stack
5920 split.
5921 * target.h (Target::is_call_to_non_split): New function.
5922 (Target::do_is_call_to_non_split): Declare virtual function.
5923 * target.cc: Include "symtab.h".
5924 (Target::do_is_call_to_non_split): New function.
5925 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5926
5927 2010-03-10 Cary Coutant <ccoutant@google.com>
5928
5929 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5930 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5931 (File_read::open[2]): Add whole_file_view_ to list of views.
5932 (File_read::make_view): Remove test of whole_file_view_.
5933 (File_read::find_or_make_view): Create whole_file_view_ if
5934 necessary.
5935 (File_read::clear_views): Replace bool parameter with enum;
5936 adjust all callers. Don't delete views with permanent data;
5937 do delete cached views and views from archives if
5938 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5939 if clearing the corresponding view.
5940 * fileread.h (File_read::Clear_views_mode): New enum.
5941 (File_read::View::is_permanent_view): New method.
5942 (File_read::clear_views): Replace bool parameter
5943 with enum; adjust all callers.
5944 * options.h (General_options): Change keep_files_mapped option;
5945 add map_whole_files.
5946 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5947 releasing the file.
5948 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5949 the file.
5950
5951 2010-03-10 David S. Miller <davem@davemloft.net>
5952
5953 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5954
5955 2010-03-09 Sriraman Tallam <tmsriram@google.com>
5956
5957 * icf.cc (get_section_contents): Add '@' marker after processing the
5958 merge reloc.
5959
5960 2010-03-08 Doug Kwan <dougkwan@google.com>
5961
5962 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5963 due to a conversion warning.
5964 (Arm_relobj::update_output_local_symbol_count): Check for local
5965 symbol with unset output index.
5966
5967 2010-03-05 Ian Lance Taylor <iant@google.com>
5968
5969 * options.h (class General_options): Add --spare-dynamic-tags.
5970 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5971 --spare-dynamic-tags.
5972
5973 2010-03-05 Ian Lance Taylor <iant@google.com>
5974
5975 * incremental.cc: Include "libiberty.h".
5976
5977 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5978
5979 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5980 function, is_info_ member.
5981 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5982 (Versions::Versions): Update caller.
5983 (Versions::define_base_version): Likewise.
5984 (Versions::add_def): Likewise.
5985
5986 2010-03-03 Sriraman Tallam <tmsriram@google.com>
5987
5988 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5989 (Scan::possible_function_pointer_reloc): New function.
5990 (Scan::local_reloc_may_be_function_pointer): Change to call
5991 possible_function_pointer_reloc.
5992 (Scan::global_reloc_may_be_function_pointer): Ditto.
5993 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5994 relocations in ".data.rel.ro._ZTV" section.
5995 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5996 * testsuite/icf_safe_so_test.cc: Ditto.
5997 * testsuite/icf_safe_test.cc: Ditto.
5998 * testsuite/icf_safe_test.sh: Ditto.
5999
6000 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6001 Ian Lance Taylor <iant@google.com>
6002
6003 * target-reloc.h (relocate_section): Check the symbol table index
6004 for -1U before setting the local symbol index.
6005 (scan_relocatable_relocs): If copying the relocation, record that
6006 the local symbol is required.
6007 * object.h (Symbol_value::is_output_symtab_index_set): New
6008 function.
6009 (Symbol_value::may_be_discarded_from_output_symtab): New
6010 function.
6011 (Symbol_value::has_output_symtab_entry): New function.
6012 (Symbol_value::needs_output_symtab_entry): Remove.
6013 (Symbol_value::output_symtab_index): Make sure the symbol index is
6014 set.
6015 (Symbol_value::set_output_symtab_index): Make sure the symbol
6016 index is not set. Make sure the new index is valid.
6017 (Symbol_value::set_must_have_output_symtab_entry): New function.
6018 (Symbol_value::has_output_dynsym_entry): New function.
6019 (Symbol_value::set_output_dynsym_index): Make sure the new index
6020 is valid.
6021 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6022 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6023 local symbol if permitted.
6024 (Sized_relobj::do_finalize_local_symbols): Call
6025 is_output_symtab_index_set rather than needs_output_symtab_entry.
6026 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6027 rather than needs_output_symtab_entry. Call
6028 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6029 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6030 is_output_symtab_index_set rather than needs_output_symtab_entry.
6031 * testsuite/discard_locals_relocatable_test.c: New file.
6032 * testsuite/discard_locals_test.sh: Test -r.
6033 * testsuite/Makefile.am (check_DATA): Add
6034 discard_locals_relocatable_test1.syms,
6035 discard_local_relocatable_test2.syms.
6036 (MOSTLYCLEANFILES): Likewise. Also add
6037 discard_locals_relocatable_test1.lout and
6038 discard_locals_relocatable_test2.out.
6039 (discard_locals_relocatable_test1.syms): New target.
6040 (discard_locals_relocatable_test.o): New target.
6041 (discard_locals_relocatable_test1.out): New target.
6042 (discard_locals_relocatable_test2.syms): New target.
6043 (discard_locals_relocatable_test2.out): New target.
6044 (various): Add missing ../ld-new dependencies.
6045 * testsuite/Makefile.in: Rebuild.
6046
6047 2010-03-03 Nick Clifton <nickc@redhat.com>
6048
6049 * po/fi.po: New Finnish translation.
6050
6051 2010-03-01 Doug Kwan <dougkwan@google.com>
6052
6053 * layout.cc (Layout::Layout): Force section types of .init_array*,
6054 .preinit_array* and .fini_array* sections.
6055 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6056 Fix check of return value of std::string::find.().
6057 (Output_section::Input_section_sort_compare::operator()): Remove
6058 comment about .init_array.
6059 (Output_section::Input_section_sort_init_fini_compare::operator()):
6060 New method.
6061 (Output_section::sort_attached_input_sections): Handle .init_array
6062 and .fini_array specially.
6063 * output.h (Output_section::Inut_section_sort_compare): Update
6064 comment.
6065 (Output_section::Input_section_sort_init_fini_compare): New struct.
6066
6067 2010-02-26 Doug Kwan <dougkwan@google.com>
6068
6069 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6070 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6071 * testsuite/debug_msg.sh: Avoid matching source line number for
6072 use of global variable undef_int.
6073
6074 2010-02-26 Doug Kwan <dougkwan@google.com>
6075
6076 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6077 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6078 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6079 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6080 * options.cc (General_options::General_options): Initialize member
6081 fix_v4bx_.
6082 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6083 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6084 and rm_no_fix_v4bx.stdout
6085 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6086 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6087 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6088 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6089 and arm_no_fix_v4bx.
6090 * Makefile.in: Regenerate.
6091 * testsuite/arm_fix_v4bx.s: New file.
6092 * testsuite/arm_fix_v4bx.sh: Ditto.
6093
6094 2010-02-24 Doug Kwan <dougkwan@google.com>
6095
6096 * arm.cc (Target_arm::got_section): Make the .got section the first
6097 non RELRO section in the data segment.
6098 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6099 suffixes of section names.
6100
6101 2010-02-24 Doug Kwan <dougkwan@google.com>
6102
6103 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6104 flags and attributes merging if an input file is a binary file.
6105 * fileread.cc (Input_file::open): Record format of original file.
6106 * fileread.h (Input_file::Format): New enum type.
6107 (Input_file::Input_file): Initialize data member format_.
6108 (Input_file::format): New method definition.
6109 (Input_file::format_):: New data member.
6110
6111 2010-02-24 Doug Kwan <dougkwan@google.com>
6112
6113 * arm.cc (Arm_output_data_got): New class.
6114 (ARM_TCB_SIZE): New constant
6115 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6116 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6117 If user uses a script with a SECTIONS clause, issue only a warning
6118 for a misplaced EXIDX input section. Otherwise, issue an error.
6119 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6120 garbage collection.
6121 (Target_arm::got_mode_index_entry): Handle static linking.
6122 (Target_arm::Scan::local): Ditto.
6123 (Target_arm::Scan::global): Ditto.
6124 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6125 all incorrectly implemented relocations.
6126 (Target_arm::fix_exidx_coverage): Pass layout to
6127 Arm_output_section::fix_exidx_coverage.
6128 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6129 from ".ARM.exidx." and ".ARM.extab.".
6130
6131 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6132
6133 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6134 section if it does not already exist.
6135 * attributes.cc (Attributes_section_data::Attributes_section_data):
6136 Don't crash if size is zero.
6137
6138 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6139 Ian Lance Taylor <iant@google.com>
6140
6141 * gold.cc (queue_middle_tasks): If no input files were opened,
6142 exit.
6143 * workqueue.h (Task_function::Task_function): Assert that there is
6144 a blocker.
6145
6146 2010-02-22 Doug Kwan <dougkwan@google.com>
6147
6148 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6149 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6150 types to avoid warnings due to different uint64_t implementations
6151 on different hosts.
6152
6153 2010-02-21 Doug Kwan <dougkwan@google.com>
6154
6155 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6156 handling of the maximum backward branch offset.
6157 (Arm_relocate_functions::thumb_branch_common): Ditto.
6158 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6159 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6160 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6161 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6162 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6163 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6164 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6165 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6166 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6167 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6168 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6169 thumb2_bl_out_of_range.o): New rules.
6170 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6171 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6172 thumb2_bl_out_of_range
6173 * testsuite/Makefile.in: Regenerate.
6174 * testsuite/arm_bl_in_range.s: New file.
6175 * testsuite/arm_bl_out_of_range.s: Ditto.
6176 * testsuite/arm_branch_in_range.sh: Ditto.
6177 * testsuite/arm_branch_range.t: Ditto.
6178 * testsuite/thumb2_branch_range.t: Ditto.
6179 * testsuite/thumb_bl_in_range.s: Ditto.
6180 * testsuite/thumb_bl_out_of_range.s: Ditto.
6181 * testsuite/thumb_branch_range.t: Ditto.
6182
6183 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6184
6185 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6186 Add reloc offset information.
6187 * icf.cc (get_section_contents): Change iterators to point to the new
6188 vectors. Add reloc offset information to the contents.
6189 * icf.h (Icf::Sections_reachable_info): New typedef.
6190 (Icf::Sections_reachable_list): New typedef.
6191 (Icf::Offset_info): New typedef.
6192 (Icf::Reloc_info): New struct typedef.
6193 (Icf::Reloc_info_list): New typedef.
6194 (Icf::symbol_reloc_list): Delete method.
6195 (Icf::addend_reloc_list): Delete method.
6196 (Icf::section_reloc_list): Delete method.
6197 (Icf::reloc_info_list): New method.
6198 (Icf::reloc_info_list_): New member.
6199
6200 2010-02-19 Doug Kwan <dougkwan@google.com>
6201
6202 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6203 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6204 * arm.cc (Arm_relocation_functions): New forward declaration.
6205 (Target_arm::Target_arm): Initialize new data members
6206 got_mod_index_offset_ and tls_base_symbol_defined_.
6207 (Target_arm::Relocate::relocate_tls): New method.
6208 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6209 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6210 New methods.
6211 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6212 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6213 (Target_arm::got_mod_index_offset_,
6214 Target_arm::tls_base_symbol_defined_): New data members.
6215 (Target_arm::Scan::local, Target::Scan::global,
6216 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6217 relocations.
6218
6219 2010-02-18 Doug Kwan <dougkwan@google.com>
6220
6221 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6222 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6223 text section as a parameter becuase some broken tools may not set
6224 the link in section header.
6225 (Target_arm::has_got_section): New method.
6226 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6227 without any mapping symbol as data only. Remove warning.
6228 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6229 link in its section header, try to discover the link by inspecting the
6230 REL31 relocation at the beginning of the section.
6231 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6232 in error message.
6233 (Target_arm::Scan::global): Treat any reference to the symbol
6234 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6235
6236 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6237
6238 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6239 (Scan::global_reloc_may_be_function_pointer): New function.
6240 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6241 (Scan::global_reloc_may_be_function_pointer): New function.
6242 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6243 (Scan::global_reloc_may_be_function_pointer): New function.
6244 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6245 (Scan::global_reloc_may_be_function_pointer): New function.
6246 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6247 (Scan::global_reloc_may_be_function_pointer): New function.
6248 (Scan::possible_function_pointer_reloc): New function.
6249 (Target_x86_64::can_check_for_function_pointers): New function.
6250 * gc.h (gc_process_relocs): Scan relocation types to determine if
6251 function pointers were taken for targets that support it.
6252 * icf.cc (Icf::find_identical_sections): Include functions for
6253 folding in safe ICF whose pointer is not taken.
6254 * icf.h (Secn_fptr_taken_set): New typedef.
6255 (fptr_section_id_): New member.
6256 (section_has_function_pointers): New function.
6257 (set_section_has_function_pointers): New function.
6258 (check_section_for_function_pointers): New function.
6259 * options.h: Fix comment for safe ICF option.
6260 * target.h (can_check_for_function_pointers): New function.
6261 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6262 Modify icf_safe_test for X86-64.
6263 * testsuite/Makefile.in: Regenerate.
6264 * testsuite/icf_safe_so_test.cc: New file.
6265 * testsuite/icf_safe_so_test.sh: New file.
6266 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6267 (main): Change to take pointer to function kept_func_3.
6268 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6269 folding is done correctly for X86-64.
6270
6271 2010-02-12 David S. Miller <davem@davemloft.net>
6272
6273 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6274 is_symbolless parameter.
6275 (Output_reloc<SHT_REL>::is_symbolless): New.
6276 (Output_reloc<SHT_REL>::is_symbolless_): New.
6277 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6278 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6279 (Output_reloc<SHT_RELA>::is_symbolless): New.
6280 (Output_data_reloc::add_global): Handle is_symbolless.
6281 (Output_data_reloc::add_global_relative): Likewise.
6282 (Output_data_reloc::add_local): Likewise.
6283 (Output_data_reloc::add_local_relative): Likewise.
6284 (Output_data_reloc::add_symbolless_global_addend): New.
6285 (Output_data_reloc::add_symbolless_local_addend): New.
6286 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6287 is_symbolless.
6288 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6289 instead of ->is_relative_
6290 (Output_reloc::write): Likewise.
6291 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6292 (Output_reloc::write_rel): Simplify.
6293
6294 * sparc.cc (Target_sparc::Scan::local): Use
6295 ->add_symbolless_local_addend as needed.
6296 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6297 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6298 based upon relocation offset.
6299
6300 2010-02-11 Doug Kwan <dougkwan@google.com>
6301
6302 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6303 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6304 beginning of function.
6305 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6306 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6307 parameter is_32bit in calls to should_apply_static_reloc.
6308 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6309 (check_DATA): Add arm_abs_global.stdout.
6310 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6311 arm_abs_global.stdout): New rules.
6312 (MOSTLLYCLEANFILES): Add arm_abs_global
6313 * Makefile.in: Regenerate.
6314 * testsuite/arm_abs_global.s: New file.
6315 * testsuite/arm_abs_global.sh: Ditto.
6316 * testsuite/arm_abs_lib.s: Ditto.
6317
6318 2010-02-11 Ian Lance Taylor <iant@google.com>
6319
6320 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6321 Read_relocs task.
6322 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6323 Allocate_commons_task first.
6324 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6325 task, rather than symtab_lock_.
6326 (Gc_process_relocs::~Gc_process_relocs): New function.
6327 (Gc_process_relocs::is_runnable): Check this_blocker_.
6328 (Gc_process_relocs::locks): Use next_blocker_ rather than
6329 blocker_.
6330 (Scan_relocs::~Scan_relocs): New function.
6331 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6332 symtab_lock_.
6333 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6334 next_blocker_.
6335 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6336 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6337 constructor accordingly.
6338 (class Gc_process_relocs): Likewise.
6339 (class Scan_relocs): Likewise.
6340 * common.h (class Allocate_commons_task): Remove symtab_lock_
6341 field, and corresponding constructor parameter.
6342 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6343 symtab_lock_.
6344 (Allocate_commons_task::locks): Likewise.
6345
6346 2010-02-11 Ian Lance Taylor <iant@google.com>
6347
6348 * gold-threads.h (class Once): Define.
6349 (class Initialize_lock): Rewrite as child of Once.
6350 * gold-threads.cc (class Once_initialize): Define.
6351 (once_pointer_control): New static variable.
6352 (once_pointer, once_arg): New static variables.
6353 (c_run_once): New static function.
6354 (Once::Once, Once::run_once, Once::internal_run): New functions.
6355 (class Initialize_lock_once): Remove.
6356 (initialize_lock_control): Remove.
6357 (initialize_lock_pointer): Remove.
6358 (initialize_lock_once): Remove.
6359 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6360 (Initialize_lock::initialize): Rewrite.
6361 (Initialize_lock::do_run_once): New function.
6362 * archive.cc (Archive::interpret_header): Only clear name if it is
6363 not already empty.
6364 * fileread.cc: Include "gold-threads.h"
6365 (file_counts_lock): New static variable.
6366 (file_counts_initialize_lock): Likewise.
6367 (File_read::release): Only increment counts when using --stats.
6368 Use a lock around the increment.
6369 * parameters.cc (class Set_parameters_target_once): Define.
6370 (set_parameters_target_once): New static variable.
6371 (Parameters::Parameters): Move here from parameters.h.
6372 (Parameters::set_target): Rewrite.
6373 (Parameters::set_target_once): New function.
6374 (Parameters::clear_target): Move here and rewrite.
6375 * parameters.h (class Parameters): Update declarations. Add
6376 set_parameters_target_once_ field.
6377 (Parameters::Parameters): Move to parameters.cc.
6378 (Parameters::clear_target): Likewise.
6379 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6380 task.
6381 (Start_group::~Start_group): New function.
6382 (Start_group::is_runnable): New function.
6383 (Start_group::locks, Start_group::run): New functions.
6384 (Finish_group::run): Change saw_undefined to size_t.
6385 * readsyms.h (class Start_group): Define.
6386 (class Finish_group): Change saw_undefined_ field to size_t.
6387 (Finish_group::Finish_group): Remove saw_undefined and
6388 this_blocker parameters. Change all callers.
6389 (Finish_group::set_saw_undefined): New function.
6390 (Finish_group::set_blocker): New function.
6391 * symtab.h (class Symbol_table): Change saw_undefined to return
6392 size_t. Change saw_undefined_ field to size_t.
6393 * target-select.cc (Set_target_once::do_run_once): New function.
6394 (Target_selector::Target_selector): Initialize set_target_once_
6395 field. Don't initialize lock_ and initialize_lock_ fields.
6396 (Target_selector::instantiate_target): Rewrite.
6397 (Target_selector::set_target): New function.
6398 * target-select.h (class Set_target_once): Define.
6399 (class Target_selector): Update declarations. Make
6400 Set_target_once a friend. Remove lock_ and initialize_lock_
6401 fields. Add set_target_once_ field.
6402
6403 2010-02-10 Ian Lance Taylor <iant@google.com>
6404
6405 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6406 queueing any tasks.
6407 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6408 (queue_middle_tasks): Add all blockers before queueing any tasks.
6409 (queue_final_tasks): Likewise.
6410 * token.h (Task_token::add_blockers): New function.
6411 * object.h (Input_objects::number_of_relobjs): New function.
6412
6413 2010-02-10 Ian Lance Taylor <iant@google.com>
6414
6415 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6416 shared, not if not position independent.
6417 * x86_64.cc (Relocate::relocate_tls): Likewise.
6418 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6419 (tls_pie_pic_test): New target.
6420 * testsuite/Makefile.in: Rebuild.
6421
6422 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6423 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6424 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6425 * testsuite/Makefile.in: Rebuild.
6426
6427 2010-02-09 David S. Miller <davem@davemloft.net>
6428
6429 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6430 R_SPARC_RELATIVE using ->add_local_relative().
6431 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6432
6433 * output.h (Output_data_dynamic::add_section_size): New method
6434 that takes two Output_data objects.
6435 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6436 entry param. Handle it in initializers.
6437 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6438 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6439 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6440 arg.
6441 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6442 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6443 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6444 for dynrel_includes_plt.
6445 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6446 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6447 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6448 before .rela.plt
6449 (Target_sparc::do_finalize_sections): Update to pass true for
6450 dynrel_includes_plt.
6451 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6452 output before .rela.plt
6453 (Target_powerpc::do_finalize_sections): Update to pass true for
6454 dynrel_includes_plt when 32-bit.
6455
6456 2010-02-08 Doug Kwan <dougkwan@google.com>
6457
6458 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6459 method.
6460 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6461 Arm_relobj::scan_section_for_cortex_a8_stubs,
6462 Arm_relobj::do_relocation_section): Instead of calling
6463 Output_section::output_address, use faster
6464 Arm_relobj::simple_input_section_output_address.
6465
6466 2010-02-08 David S. Miller <davem@davemloft.net>
6467
6468 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6469 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6470 relocation helper function.
6471
6472 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6473 just like R_SPARC_GOT{10,13,22}.
6474 (Target_sparc::Scan::local): Likewise.
6475 (Target_sparc::Relocate:relocate): Likewise.
6476
6477 2010-02-06 Ian Lance Taylor <iant@google.com>
6478
6479 * configure.ac: Rewrite targetobjs duplicate removal code to use
6480 only shell constructs.
6481 * configure: Rebuild.
6482
6483 2010-02-05 Doug Kwan <dougkwan@google.com>
6484
6485 PR 11247
6486 * arm.cc (Arm_relobj::section_is_scannable): New method.
6487 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6488 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6489
6490 2010-02-04 Doug Kwan <dougkwan@google.com>
6491
6492 PR 11247
6493 * arm-reloc-property.cc (cstdio): Include.
6494 * configure.ac (targetobjs): Remove duplicates.
6495 * configure: Regenerate.
6496 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6497 big and little endian version for a given address size.
6498
6499 2010-02-03 Doug Kwan <dougkwan@google.com>
6500
6501 * arm-reloc-property.cc
6502 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6503 definition.
6504 * arm-reloc-property.h
6505 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6506 New method definition.
6507 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6508 declaration.
6509 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6510 overflow to N.
6511 (GOT_PREL): Change implemented to Y.
6512 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6513 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6514 (Arm_relocate_functions::movw_abs_nc): Remove method.
6515 (Arm_relocate_functions::movt_abs): Ditto.
6516 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6517 (Arm_relocate_functions::thm_movt_abs): Ditto.
6518 (Arm_relocate_functions::movw_rel_nc): Ditto.
6519 (Arm_relocate_functions::movw_rel): Ditto.
6520 (Arm_relocate_functions::movt_rel): Ditto.
6521 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6522 (Arm_relocate_functions:thm_movw_rel): Ditto.
6523 (Arm_relocate_functions:thm_movt_rel): Ditto.
6524 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6525 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6526 New method definitions.
6527 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6528 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6529 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6530 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6531 (Target_arm::Relocate::relocate): Check for non-static or
6532 unimplemented relocation code and exit early. Change calls to
6533 Target_arm::reloc_uses_thumb_bit and
6534 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6535 instead. Refactor code to handle similar relocations to increase
6536 code sharing. Remove check for unsupported relocation code in switch
6537 statement.
6538 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6539 relocation property table to find out size. Change error message to
6540 print out the name of a relocation code instead of the numeric value.
6541 (Target_arm::scan_reloc_for_stub): Use relocation property table
6542 instead of calling Target_arm::reloc_uses_thumb_bit().
6543
6544 2010-02-02 Doug Kwan <dougkwan@google.com>
6545
6546 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6547 types of relaxed input section.
6548
6549 2010-02-02 Doug Kwan <dougkwan@google.com>
6550
6551 * Makefile.am (HFILES): Add arm-reloc-property.h.
6552 (DEFFILES): New.
6553 (TARGETSOURCES): Add arm-reloc-property.cc
6554 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
6555 (libgold_a_SOURCES): $(DEFFILES)
6556 * Makefile.in: Regenerate.
6557 * arm-reloc-property.cc: New file.
6558 * arm-reloc-property.h: New file.
6559 * arm-reloc.def: New file.
6560 * arm.cc: Update comments.
6561 (arm-reloc-property.h): New included header.
6562 (arm_reloc_property_table): New global variable.
6563 (Target_arm::do_select_as_default_target): New method definition.
6564 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6565 arm-reloc-property to targ_extra_obj.
6566 * parameters.cc (set_parameters_target): Call
6567 Target::select_as_default_target().
6568 * target.h (Target::select_as_default_target): New method definition.
6569 (Target::do_select_as_default_target): Same.
6570
6571 2010-02-01 Doug Kwan <dougkwan@google.com>
6572
6573 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6574 first_output_text_section_.
6575 (Arm_exidx_fixup::first_output_text_section): New method definition.
6576 (Arm_exidx_fixup::first_output_text_section_): New data member.
6577 (Arm_exidx_fixup::process_exidx_section): Record the first text
6578 output section seen.
6579 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6580 and entsize in output section header.
6581
6582 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6583
6584 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6585 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6586 (Arm_relocate_functions::thm_alu11): New Method.
6587 (Arm_relocate_functions::thm_pc8): New Method.
6588 (Arm_relocate_functions::thm_pc12): New Method.
6589 (Target_arm::Scan::local): Handle the relocations.
6590 (Target_arm::Scan::global): Likewise.
6591 (Target_arm::Relocate::relocate): Likewise.
6592 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6593
6594 2010-01-29 Doug Kwan <dougkwan@google.com>
6595
6596 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6597 of relocation types as ld.
6598
6599 2010-01-29 Doug Kwan <dougkwan@google.com>
6600
6601 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6602 to public.
6603 (Arm_relocate_functions::thumb_branch_common): Ditto.
6604 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6605 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6606 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6607 Arm_relocate_functions::jump24): Remove.
6608 (Target_arm::Relocate::relocate): Adjust code to call
6609 Arm_relocation_functions::arm_branch_common and
6610 Arm_relocation_functions::thumb_branch_common instead of their removed
6611 wrappers. Merge switch-cases together to reduce source code size.
6612
6613 2010-01-29 Doug Kwan <dougkwan@google.com>
6614
6615 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6616 output_local_symbol_count_needs_update_.
6617 (Arm_relobj::output_local_symbol_count_needs_update,
6618 Arm_relobj::set_output_local_symbol_count_needs_update,
6619 Arm_relobj::update_output_local_symbol_count): New methods.
6620 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6621 member.
6622 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6623 of pointed function as in a R_ARM_PREL31 relocation.
6624 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6625 for output local symbol count updating.
6626 (Target_arm::do_relax): Update output local symbol counts in objects
6627 if necessary.
6628 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6629
6630 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6631
6632 * arm.cc: Added support for the ARM relocations:
6633 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6634 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6635 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6636 movw_prel_nc).
6637 (Arm_relocate_functions::movw_rel): New method.
6638 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6639 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6640 thm_movw_prel_nc).
6641 (Arm_relocate_functions::thm_movw_rel): New method.
6642 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6643 thm_movt_prel).
6644 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6645 relocations.
6646 (Target_arm::Scan::global): Likewise.
6647 (Target_arm::Relocate::relocate): Likewise.
6648 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6649 Likewise.
6650
6651 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6652
6653 * arm.cc: Added support for ARM group relocations.
6654 (Target_arm::reloc_needs_sym_origin): New method.
6655 (Arm_relocate_functions::calc_grp_kn): New method.
6656 (Arm_relocate_functions::calc_grp_residual): New method.
6657 (Arm_relocate_functions::calc_grp_gn): New method.
6658 (Arm_relocate_functions::arm_grp_alu): New Method.
6659 (Arm_relocate_functions::arm_grp_ldr): New Method.
6660 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6661 (Arm_relocate_functions::arm_grp_ldc): New Method.
6662 (Target_arm::Scan::local): Handle the ARM group relocations.
6663 (Target_arm::Scan::global): Likewise.
6664 (Target_arm::Relocate::relocate): Likewise.
6665 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6666 Likewise.
6667
6668 2010-01-26 Doug Kwan <dougkwan@google.com>
6669
6670 * arm.cc (set): Include.
6671 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6672 pointer type.
6673 (Arm_output_section::Text_section_list): New type.
6674 (Arm_output_section::append_text_sections_to_list): New method.
6675 (Arm_output_section::fix_exidx_coverage): Ditto.
6676 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
6677 (Arm_relobj::convert_input_section_to_relaxed_section): Use
6678 Relobj::set_section_offset() instead of
6679 Sized_relobj::invalidate_section_offset().
6680 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
6681 parameter for section headers. Ignore relocation sections for
6682 unallocated sections and EXIDX sections.
6683 (Target_arm::fix_exidx_coverage): New method.
6684 (Target_arm::output_section_address_less_than): New type.
6685 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6686 linked text section instead of the EXIDX section.
6687 (Arm_output_section::create_stub_group): Add an assertion to check
6688 that this is not an EXIDX output section.
6689 (Arm_output_section::append_text_sections_to_list): New method.
6690 (Arm_output_section::fix_exidx_coverage): Ditto.
6691 (Arm_relobj::scan_sections_for_stubs): Adjust call to
6692 Arm_relobj::section_needs_reloc_stub_scanning.
6693 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6694 first pass.
6695 (Target_arm::fix_exidx_coverage): New method.
6696 * object.h (Relobj::set_output_section): New method.
6697 (Sized_relobj::invalidate_section_offset): Remove method.
6698 (Sized_relobj::do_invalidate_section_offset): Remove method.
6699 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6700
6701 2010-01-25 Doug Kwan <dougkwan@google.com>
6702
6703 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6704 Fix warning due to signed and unsigned comparison on a 32-bit host.
6705
6706 2010-01-22 Doug Kwan <dougkwan@google.com>
6707
6708 * arm.cc (Target_arm::do_relax): Record an output section for section
6709 offset adjustment it contains any stub table that has changed.
6710 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6711 offsets in an output section if necessary.
6712 * output.cc (Output_section::Output_section): Initialize
6713 section_offsets_need_adjustments_.
6714 (Output_section::add_input_section_for_script): Renamed to
6715 Output_section::add_simple_input_section.
6716 (Output_section::save_states): Add a comment.
6717 (Output_section::discard_states): New method defintion.
6718 (Output_section::adjust_section_offsets): Same.
6719 * output.h (Output_section::add_input_section_for_script): Renamed to
6720 Output_section::add_simple_input_section.
6721 (Output_section::discard_states): New method declaration.
6722 (Output_section::adjust_section_offsets): Same.
6723 (Output_section::section_offsets_need_adjustment,
6724 Output_section::set_section_offsets_need_adjustment): New method
6725 definitions.
6726 (Output_section::section_offsets_need_adjustment_): New data member.
6727 * script-sections.cc
6728 (Output_section_element_input::set_section_address): Adjust code for
6729 renaming of Output_section::add_input_section_for_script.
6730 (Orphan_output_section::set_section_address): Same.
6731
6732 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6733
6734 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6735 Fix_v4bx enum values .
6736 * gold/options.h (General_options): New option definitions.
6737 (General_options::fix_v4bx): New method.
6738 (General_options::Fix_v4bx): New enum.
6739 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6740 (General_options::parse_fix_v4bx_interworking): New method.
6741
6742 2010-01-22 Doug Kwan <dougkwan@google.com>
6743
6744 * arm.cc (Arm_exidx_fixup): New class.
6745
6746 2010-01-21 Doug Kwan <dougkwan@google.com>
6747
6748 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6749 classes.
6750 (Arm_exidx_section_offset_map): New type.
6751
6752 2010-01-21 Doug Kwan <dougkwan@google.com>
6753
6754 * arm.cc (Arm_exidx_input_section): New class.
6755 (Arm_relobj::exidx_input_section_by_link,
6756 Arm_relobj::exidx_input_section_by_shndx,
6757 Arm_relobj::make_exidx_input_section): New methods.
6758 (read_arm_attributes_section): Remove.
6759 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6760 information about them.
6761 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6762 to here.
6763
6764 2010-01-20 Doug Kwan <dougkwan@google.com>
6765
6766 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6767 Input_section_specifier to Section_id.
6768 (Target_arm::new_arm_input_section: Adjust code for change of key
6769 type.
6770 (Target_arm::find_arm_input_section): Ditto.
6771 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6772 (Section_id): Remove.
6773 (Garbage_collection::Section_id_hash): Remove.
6774 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6775 (Section_id): Remove.
6776 (Icf::Section_id_hash): Remove.
6777 * object.h (Section_id, Const_section_id, Section_id_hash,
6778 Const_section_id_hash): New type definitions.
6779 * output.cc (Output_section::add_relaxed_input_section): Change to
6780 use Const_section_id instead of Input_section_specifier as key type.
6781 (Output_section::add_merge_input_section): Ditto.
6782 (Output_section::build_relaxation_map): Change to use Section_id
6783 instead of Input_section_specifier as key type.
6784 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6785 Ditto.
6786 (Output_section::convert_input_sections_to_relaxed_sections): Change
6787 to use Const_section_id instead of Input_section_specifier as key type.
6788 (Output_section::find_merge_section): Ditto.
6789 (Output_section::find_relaxed_input_section): Ditto.
6790 * output.h (Input_section_specifier): Remove class.
6791 (Output_section::Output_section_data_by_input_section_map): Change
6792 key type to Const_section_id.
6793 (Output_section::Output_relaxed_input_section_by_input_section_map):
6794 Ditto.
6795 (Output_section::Relaxation_map): Change key type to Section_id.
6796
6797 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6798
6799 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6800 (class Arm_v4bx_stub): New class.
6801 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6802 (Stub_factory::make_arm_v4bx_stub): New method.
6803 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6804 (Stub_table::empty): Handle v4bx stubs.
6805 (Stub_table::add_arm_v4bx_stub): New method.
6806 (Stub_table::find_arm_v4bx_stub): New method.
6807 (Arm_relocate_functions::v4bx): New method.
6808 (Target_arm::fix_v4bx): New method.
6809 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6810 (Stub_table::relocate_stubs): Likewise.
6811 (Stub_table::do_write): Likewise.
6812 (Stub_table::update_data_size_and_addralign): Likewise.
6813 (Stub_table::finalize_stubs): Likewise.
6814 (Target_arm::Scan::local): Likewise.
6815 (Target_arm::Scan::global): Likewise.
6816 (Target_arm::do_finalize_sections): Likewise.
6817 (Target_arm::Relocate::relocate): Likewise.
6818 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6819 Likewise.
6820 (Target_arm::scan_reloc_for_stub): Likewise.
6821 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6822
6823 2010-01-19 Ian Lance Taylor <iant@google.com>
6824
6825 * output.cc (Output_section_headers::do_sized_write): Write large
6826 segment count to sh_info field.
6827 (Output_file_header::do_sized_write): For large segment count,
6828 write PN_XNUM to e_phnum field.
6829
6830 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6831
6832 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6833 (Arm_relocate_functions::thm_jump8): New function.
6834 (Arm_relocate_functions::thm_jump11): New function.
6835 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6836 R_ARM_THM_JUMP11.
6837 (Target_arm::Scan::global): Likewise.
6838 (Target_arm::Relocate::relocate): Likewise.
6839 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6840 Likewise.
6841
6842 2010-01-14 Doug Kwan <dougkwan@google.com>
6843
6844 * arm.cc (map, utility): Include headers.
6845 (Target_arm::apply_cortex_a8_workaround): New method.
6846 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6847 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6848 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6849 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6850 the --[no-]fix-cortex-a8 command line options.
6851 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6852 (Target_arm::relocate_stub): Use addend in instruction template.
6853 * options.h (DEFINE_bool): Set the user-set flag.
6854 (General_options): Add --[no-]-fix-cortex options.
6855 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
6856 : Update fast look-up map after conversion.
6857
6858 2010-01-14 Sriraman Tallam <tmsriram@google.com>
6859
6860 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6861 in the first pass of do_layout.
6862
6863 2010-01-13 Doug Kwan <dougkwan@google.com>
6864
6865 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6866 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6867 apparent compiler problem of not folding static constant integral
6868 data members of elfcpp::Elf_sizes<32>.
6869
6870 2010-01-13 Doug Kwan <dougkwan@google.com>
6871
6872 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6873 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6874 Arm_relobj::scan_section_for_cortex_a8_erratum,
6875 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6876 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6877 sections to scan for relocation stubs into a new method
6878 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6879 relocation and Cortex-A8 stub scanning.
6880 (Target_arm::do_relax): Force stubs to be after stubbed sections
6881 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
6882 the beginning of a new relaxation pass. Update a comment.
6883 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6884
6885 2010-01-12 Ian Lance Taylor <iant@google.com>
6886
6887 * target-reloc.h (visibility_error): New inline function.
6888 (relocate_section): Call visibility_error.
6889 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6890 (MOSTLYCLEANFILES): Likewise.
6891 (protected_4_pic.o, protected_3.err): New targets.
6892 * testsuite/protected_4.cc: New file.
6893
6894 2010-01-12 Doug Kwan <dougkwan@google.com>
6895
6896 * arm.cc (Cortex_a8_reloc): New class.
6897 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6898 and cortex_a8_relocs_info_.
6899 (Target_arm::fix_cortex_a8): New method definition.
6900 (Target_arm::Cortex_a8_relocs_info): New type.
6901 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6902 New data member declarations.
6903 (Target_arm::scan_reloc_for_stub): Record information about
6904 relocations for THUMB branches that might be exempted from the
6905 Cortex-A8 workaround.
6906 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6907 at the beginning of a relaxation pass.
6908
6909 2010-01-12 Doug Kwan <dougkwan@google.com>
6910
6911 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6912 (Arm_relobj::Mapping_symbol_position,
6913 Arm_reloj::Mapping_symbol_position_less,
6914 Arm_relobj::Mapping_symbols_info): New types.
6915 (Target_arm::is_mapping_symbol_name): New method definition.
6916 (Arm_relobj::do_count_local_symbols): Save information about mapping
6917 symbols.
6918
6919 2010-01-11 Doug Kwan <dougkwan@google.com>
6920
6921 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6922 Arm_relocate_functions::thumb32_branch_upper,
6923 Arm_relocate_functions::thumb32_branch_lower,
6924 Arm_relocate_functions::thumb32_cond_branch_offset,
6925 Arm_relocate_functions::thumb32_cond_branch_upper,
6926 Arm_relocate_functions::thumb32_cond_branch_lower,
6927 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6928 branch offset encoding.
6929 (Arm_relocate_functions::thumb_branch_common): Use new branch
6930 offset encoding methods to avoid code duplication.
6931 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6932 (Stub_addend_reader::operator()): Use new branch encoding method
6933 to avoid code duplication.
6934
6935 2010-01-11 Doug Kwan <dougkwan@google.com>
6936
6937 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6938 (Target_arm::do_finalize_sections): Define special EXIDX section
6939 symbols only if referenced.
6940 * gc.h (Garbage_collection::add_reference): New method.
6941 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6942 code duplication.
6943
6944 2010-01-11 Ian Lance Taylor <iant@google.com>
6945
6946 * script.cc (Version_script_info::build_expression_list_lookup):
6947 Change complaing about duplicate wildcard match from error to
6948 warning.
6949
6950 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6951 of 2009-12-30.
6952 (Version_script_info::Version_script_info): Initialize globs_,
6953 default_version_, default_is_global_, and exact_. Don't
6954 initialize globals_ or locals_.
6955 (Version_script_info::build_lookup_tables): Build local symbols
6956 first.
6957 (Version_script_info::unquote): New function.
6958 (Version_script_info::add_exact_match): New function.
6959 (Version_script_info::build_expression_list_lookup): Remove lookup
6960 parameter. Add is_global parameter. Change all callers. Handle
6961 wildcard pattern specially. Unquote pattern. Call
6962 add_exact_match.
6963 (Version_script_info::get_name_to_match): New function.
6964 (Version_script_info::get_symbol_version): New function.
6965 (Version_script_info::get_symbol_version_helper): Remove.
6966 (Version_script_info::check_unmatched_names): Call unquote.
6967 * script.h (class Version_script_info): Change get_symbol_version
6968 to be non-inline and add is_global parameter; change all callers.
6969 Rewrite symbol_is_local. Update declarations. Define struct
6970 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6971 Remove globals_ and locals_ members. Add exact_, globs_,
6972 default_version_, is_global_.
6973 (Version_script_info::Glob): Remove pattern, add expression and
6974 is_global. Update constructor. Change all callers.
6975 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6976 default version.
6977 (Versions::symbol_section_contents): If a symbol is undefined, or
6978 defined in a dynamic object, set the version index to
6979 VER_NDX_LOCAL.
6980 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6981 symbol_is_local.
6982 (Symbol_table::add_from_pluginobj): Likewise.
6983 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6984
6985 2010-01-11 Doug Kwan <dougkwan@google.com>
6986
6987 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6988 (incremental_dump_LDADD): Add linking option for libintl.
6989 * Makefile.in: Regenerate.
6990
6991 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6992
6993 PR gold/11144
6994 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6995 instead of -Ds.
6996 * testsuite/Makefile.in: Regenerated.
6997
6998 2010-01-10 Doug Kwan <dougkwan@google.com>
6999
7000 * options.h (DEFINE_var): Use parentheses around argument varname__
7001 in macro body to avoid any unintended subsequent substitutions.
7002
7003 2010-01-10 Ian Lance Taylor <iant@google.com>
7004
7005 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7006 candidates before doing symbol resolution.
7007
7008 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7009 ODR candidates if only one is weak.
7010
7011 2010-01-08 Ian Lance Taylor <iant@google.com>
7012
7013 * script.cc (Version_script_info::build_expression_list_lookup):
7014 Don't warn about ambiguous version, just record the ambiguity.
7015 (Version_script_info::get_symbol_version_helper): Give error if
7016 version is ambiguous.
7017
7018 2010-01-08 Doug Kwan <dougkwan@google.com>
7019
7020 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7021 prev_data_size_ and prev_addralign_. Remove initializer for
7022 deleted data member has_been_changed_.
7023 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7024 to determine if the table is empty.
7025 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7026 Remove.
7027 (Stub_table::add_reloc_stub): Define method in class definition
7028 instead of just declaring it there.
7029 (Stub_table::add_cortex_a8_stub): New method definition.
7030 (Stub_table::update_data_size_and_addralign): Ditto.
7031 (Stub_table::finalize_stubs): Ditto.
7032 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7033 (Stub_table::do_addralign_): Return address alignment in the
7034 (Stub_table::do_reset_address_and_file_offset): Define method in
7035 class definition instead of declaring it there. Set current data
7036 size to be the data size of the previous pass.
7037 (Stub_table::set_final_data_size): Use current data size as the
7038 final data size.
7039 (Stub_table::relocate_stub): Change parameter type of stub from
7040 Reloc_stub pointer to Stub pointer.
7041 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7042 (Stub_table::Cortex_a8_stub_list): New typedef.
7043 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7044 Stub_table::prev_addralign_): New data member.
7045 (Arm_relobj::Arm_relobj): Initialize data member
7046 section_has_cortex_a8_workaround_.
7047 (Arm_relobj::section_has_cortex_a8_workaround,
7048 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7049 definitions.
7050 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7051 declarations.
7052 (Target_arm::relocate_stub): Change parameter type of stub from
7053 Reloc_stub pointer to Stub pointer.
7054 (Insn_template::size, Insn_template::alignment): Handle
7055 THUMB16_SPECIAL_TYPE.
7056 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7057 Stub_table::update_data_size_and_addralign,
7058 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7059 definitions.
7060 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7061 (Stub_table::do_write): Ditto.
7062 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7063
7064 2010-01-08 Ian Lance Taylor <iant@google.com>
7065
7066 PR 11108
7067 * symtab.h (class Symbol): Remove fields is_target_special_ and
7068 has_plt_offset_. Add field is_defined_in_discarded_section_.
7069 (Symbol::is_defined_in_discarded_section): New function.
7070 (Symbol::set_is_defined_in_discarded_section): New function.
7071 (Symbol::has_plt_offset): Rewrite.
7072 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7073 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7074 Don't initialize is_target_special_ or has_plt_offset_.
7075 Initialize is_defined_in_discarded_section_.
7076 (Symbol_table::add_from_relobj): If appropriate, set
7077 is_defined_in_discarded_section.
7078 * resolve.cc (Symbol::override_base_with_special): Don't test
7079 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7080 * target-reloc.h (relocate_section): Do special handling for
7081 symbols defined in discarded sections for global symbols as well
7082 as local symbols.
7083
7084 2010-01-08 Ian Lance Taylor <iant@google.com>
7085
7086 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7087 the SHT_SYMTAB case.
7088
7089 2010-01-08 Ian Lance Taylor <iant@google.com>
7090
7091 * object.cc (Sized_relobj::do_layout): Don't get confused if
7092 layout_eh_frame returns NULL.
7093
7094 2010-01-08 Ian Lance Taylor <iant@google.com>
7095
7096 PR 11084
7097 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7098 dynamic symbol table, use the normal symbol table.
7099 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7100 symbol table.
7101
7102 2010-01-08 Ian Lance Taylor <iant@google.com>
7103
7104 PR 11072
7105 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7106 sections.
7107
7108 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7109
7110 * version.cc (print_version): Change to "Copyright 2010".
7111
7112 2010-01-08 Ian Lance Taylor <iant@google.com>
7113
7114 PR 10287
7115 PR 11063
7116 * i386.cc (class Target_i386): Change return type of plt_section
7117 to be non-const.
7118 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7119 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7120 tls_desc_rel_ field.
7121 (Output_data_plt_i386::rel_tls_desc): New function.
7122 (Target_i386::rel_tls_desc_section): New function.
7123 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7124 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7125 R_386_TLS_DESC reloc in rel_tls_desc_section.
7126 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7127 Define struct Tlsdesc_info.
7128 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7129 (Target_x86_64::do_reloc_symbol_index): New function.
7130 (Target_x86_64::add_tlsdesc_info): New function.
7131 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7132 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7133 tlsdesc_rel_ field.
7134 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7135 all callers.
7136 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7137 (Target_x86_64::rela_tlsdesc_section): New function.
7138 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7139 handling.
7140 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7141 (Target_x86_64::do_reloc_addend): New function.
7142 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7143 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7144 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7145 (Output_reloc::type): New function.
7146 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7147 (Output_reloc::is_target_specific): New function.
7148 (Output_reloc::target_arg): New function.
7149 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7150 absolute relocs and target specific relocs.
7151 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7152 add_target_specific.
7153 (class Output_data_reloc) [SHT_RELA]: Likewise.
7154 * output.cc (Output_reloc::Output_reloc): Add four new versions
7155 for absolute relocs and target specific relocs.
7156 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7157 (Output_reloc::get_symbol_index): Likewise.
7158 (Output_reloc::local_section_offset): Check that local_sym_index_
7159 is not TARGET_CODE or 0.
7160 (Output_reloc::symbol_value): Likewise.
7161 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7162 reloc.
7163 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7164 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7165 functions.
7166 * layout.cc (add_target_dynamic_tags): Use output section for
7167 DT_PLTRELSZ and DT_JMPREL.
7168
7169 2010-01-07 Ian Lance Taylor <iant@google.com>
7170
7171 PR 11061
7172 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7173 function.
7174 (class Output_data_reloc_generic): Define.
7175 (class Output_data_reloc_base): Change base class to
7176 Output_data_reloc_generic. Change add() method to call
7177 bump_relative_reloc_count for a relative reloc. Remove
7178 sort_relocs_ field.
7179 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7180 to sort_relocs().
7181 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7182 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7183 appropriate.
7184 * layout.h (class Layout): Update declaration.
7185
7186 2010-01-07 Ian Lance Taylor <iant@google.com>
7187
7188 * output.h (class Output_data): Add const version of
7189 output_section and do_output_section.
7190 (class Output_section_data): Add const version of
7191 do_output_section.
7192 (class Output_section): Likewise.
7193 * layout.cc (Layout::add_target_dynamic_tags): New function.
7194 * layout.h (class Layout): Update declarations.
7195 * arm.cc (Target_arm::do_finalize_sections): Use
7196 add_target_dynamic_tags.
7197 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7198 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7199 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7200 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7201
7202 2010-01-07 Ian Lance Taylor <iant@google.com>
7203
7204 PR 11042
7205 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7206 object as needed.
7207
7208 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7209 Ian Lance Taylor <iant@google.com>
7210
7211 PR 11019
7212 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7213 Xindex::read_symtab_xindex.
7214
7215 2010-01-07 Doug Kwan <dougkwan@google.com>
7216
7217 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7218 (Insn_template::thumb16_bcond_insn): New method declaration.
7219 (Insn_template): Fix spelling.
7220 (Stub::thumb16_special): New method declaration.
7221 (Stub::do_write): Define virtual method which was previously pure
7222 virtual.
7223 (Stub::do_thumb16_special): New method declaration.
7224 (Stub::do_fixed_endian_write): New template member.
7225 (Reloc_stub::do_write): Remove.
7226 (Reloc_stub::do_fixed_endian_write): Remove.
7227 (Cortex_a8_stub): New class definition.
7228 (Stub_factory::make_cortex_a8_stub): New method definition.
7229 (Stub_factory::Stub_factory): Add missing static storage class
7230 qualifier for elf32_arm_stub_a8_veneer_blx.
7231
7232 2010-01-07 Ian Lance Taylor <iant@google.com>
7233
7234 PR 10980
7235 * options.h (class General_options): Add --warn-unresolved-symbols
7236 and --error-unresolved-symbols.
7237 * errors.cc (Errors::undefined_symbol): Implement
7238 --warn-unresolved-symbols.
7239
7240 * options.h (class General_options): Add -z text and -z textoff.
7241 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7242
7243 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7244
7245 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7246 (Garbage_collection::cident_sections): New function.
7247 (Garbage_collection::add_cident_section): New function.
7248 (Garbage_collection::cident_sections_): New member.
7249 (gc_process_relocs): Add references to sections whose names are C
7250 identifiers.
7251 * gold.h (cident_section_start_prefix): New constant.
7252 (cident_section_stop_prefix): New constant.
7253 (is_cident): New function.
7254 * layout.cc (Layout::define_section_symbols): Replace string constants
7255 with the newly defined constants.
7256 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7257 C identifiers.
7258 * testsuite/Makefile.am: Add gc_orphan_section_test.
7259 * testsuite/Makefile.in: Regenerate.
7260 * testsuite/gc_orphan_section_test.cc: New file.
7261 * testsuite/gc_orphan_section_test.sh: New file.
7262
7263 2010-01-06 Ian Lance Taylor <iant@google.com>
7264
7265 PR 10980
7266 * options.h (class General_options): Add --warn-shared-textrel.
7267 * layout.cc (Layout::finish_dynamic_section): Implement
7268 --warn-shared-textrel.
7269
7270 PR 10980
7271 * options.h (class General_options): Add --warn-multiple-gp.
7272
7273 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7274
7275 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7276 $(THREADSLIB) and $(LIBDL).
7277 * Makefile.in: Rebuild.
7278
7279 2010-01-06 Ian Lance Taylor <iant@google.com>
7280
7281 PR 10980
7282 * options.cc (General_options::parse_section_start): New function.
7283 (General_options::section_start): New function.
7284 (General_options::General_options): Initialize all members.
7285 * options.h: Include <map>
7286 (class General_options): Add --section-start. Add section_starts_
7287 member.
7288 * layout.cc (Layout::attach_allocated_section_to_segment): If
7289 --section-start was used, set the address of the segment. Remove
7290 local sort_sections.
7291 (Layout::relaxation_loop_body): If the address of the load segment
7292 has been set by --section-start, don't use it.
7293 * output.h (Output_segment::update_flags_for_output_section): New
7294 function.
7295 * output.cc (Output_segment::add_output_section): Call
7296 update_flags_for_output_section.
7297
7298 2010-01-05 Ian Lance Taylor <iant@google.com>
7299
7300 PR 10980
7301 * options.h (class General_options): Add --undefined-version.
7302 * script.cc (struct Version_expression): Add was_matched_by_symbol
7303 field.
7304 (Version_script_info::matched_symbol): New function.
7305 (Version_script_info::get_symbol_version_helper): Call
7306 matched_symbol.
7307 (Version_script_info::check_unmatched_names): New function.
7308 * script.h (class Version_script_info): Update declarations.
7309 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7310
7311 * options.h (class General_options): Use DEFINE_bool_alias for
7312 allow_multiple_definition.
7313 * resolve.cc (Symbol_table::should_override): Don't test
7314 allow_multiple_definition.
7315
7316 PR 10980
7317 * options.h (class General_options): Add --cref.
7318 * main.cc (main): Print cref table if --cref. Don't close mapfile
7319 until after printing cref table.
7320 * cref.cc: Include "symtab.h".
7321 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7322 (Cref_table_compare::operator()): New function.
7323 (Cref_inputs::gather_cref): New function.
7324 (filecol): New static const.
7325 (Cref_inputs::print_cref): New function.
7326 (Cref::print_cref): New function.
7327 * cref.h: Include <cstdio>.
7328 (class Cref): Update declarations.
7329 * mapfile.h (Mapfile::file): New function.
7330 * object.h (class Object): Define Symbols. Declare virtual
7331 do_get_global_symbols.
7332 (Object::get_global_symbols): New function.
7333 * object.cc (Input_objects::add_object): Pass object to cref_ if
7334 --cref.
7335 (Input_objects::archive_start): Likewise.
7336 (Input_objects::archive_stop): Likewise.
7337 (Input_objects::print_cref): New function.
7338 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7339 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7340 --cref.
7341 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7342 function.
7343 * plugin.h (class Sized_pluginobj): Update declarations.
7344
7345 2010-01-05 Ian Lance Taylor <iant@google.com>
7346
7347 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7348 to is_default_version. Rename insdef to insdefault.
7349 (Symbol_table::add_from_relobj): Rename def to is_default_version
7350 and local to is_forced_local.
7351 (Symbol_table::add_from_pluginobj): Likewise.
7352 (Symbol_table::add_from_dynobj): Likewise.
7353 (Symbol_table::define_special_symbol): Rename insdef to
7354 insdefault.
7355
7356 2010-01-04 Ian Lance Taylor <iant@google.com>
7357
7358 PR 10980
7359 * options.h (class General_options): Add
7360 --allow-multiple-definition and -z muldefs.
7361 * resolve.cc (Symbol_table::should_override): Don't warn about a
7362 multiple symbol definition if --allow-multiple-definition or -z
7363 muldefs.
7364
7365 PR 10980
7366 * options.h (class General_options): Add --add-needed and
7367 --copy-dt-needed-entries. Tweak --as-needed help entry.
7368 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7369 error if --copy-dt-needed-entries aka --add-needed is used and
7370 would cause a change in behaviour.
7371
7372 PR 10980
7373 * options.h (class General_options): Add -G as a short version of
7374 --shared. Add no-op options -assert, -g, and -i.
7375
7376 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7377
7378 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7379 check for .text or .gnu.linkonce.t sections.
7380 * icf.cc (Icf::find_identical_sections): Ditto.
7381 Change the detection for mangled function name within the section
7382 name.
7383 * icf.h (is_section_foldable_candidate): New function.
7384
7385 2009-12-30 Ian Lance Taylor <iant@google.com>
7386
7387 PR 10980
7388 * options.h (class General_options): Permit two dashes with
7389 --retain-symbols-file.
7390
7391 2009-12-30 Ian Lance Taylor <iant@google.com>
7392
7393 PR 10979
7394 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7395 don't put the file header and segment headers in the text
7396 segment.
7397
7398 PR 10979
7399 * common.cc (Sort_commons::operator()): Stabilize sort when both
7400 entries are NULL.
7401 (Symbol_table::do_allocate_commons_list): When allocating common
7402 symbols, skip a symbol which is no longer common.
7403 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7404 an object before checking its type.
7405 * testsuite/common_test_2.c: New file.
7406 * testsuite/common_test_3.c: New file.
7407 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7408 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7409 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7410 (common_test_2_pic.o, common_test_2.so): New targets.
7411 (common_test_3_pic.o, common_test_3.so): New targets.
7412 * testsuite/Makefile.in: Rebuild.
7413
7414 PR 10979
7415 * script.cc (read_input_script): If we see a new SECTIONS clause,
7416 and we have added an input section, give an error.
7417 * layout.h (class Layout): Add have_added_input_section function.
7418 Add have_added_input_section_ field.
7419 * layout.cc (Layout::Layout): Initialize
7420 have_added_input_section_.
7421 (Layout::layout): Set have_added_input_section_.
7422 (Layout::layout_eh_frame): Likewise.
7423
7424 2009-12-30 Ian Lance Taylor <iant@google.com>
7425
7426 PR 10931
7427 * options.h (class General_options): Add --sort-common option.
7428 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7429 * common.cc (Sort_common): Add sort_order parameter to
7430 constructor. Add sort_order_ field.
7431 (Sort_commons::operator): Check sort_order_.
7432 (Symbol_table::allocate_commons): Determine the sort order.
7433 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7434 Change all callers.
7435 (Symbol_table::do_allocate_commons_list): Likewise.
7436
7437 2009-12-30 Ian Lance Taylor <iant@google.com>
7438
7439 PR 10916
7440 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7441 symbols from this object, don't change the visibility of an
7442 undefined symbol.
7443 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7444
7445 2009-12-30 Ian Lance Taylor <iant@google.com>
7446
7447 PR 10861
7448 * script.h (class Version_script_info): Define Language enum.
7449 Update declarations. Define Glob, Exact, and Lookup types. Add
7450 new fields globals_, locals_, and is_finalized_.
7451 * script.cc: Various formatting fixes.
7452 (class Parser_closure): Change language_stack_ from a vector of
7453 std::string to one of Version_script_info::Language. Adjust all
7454 uses accordingly.
7455 (class Lazy_demangler): Remove.
7456 (struct Version_expression): Change language from std::string to
7457 Version_script_info::Language.
7458 (Version_script_info::Version_script_info): New function.
7459 (Version_script_info::~Version_script_info): Don't call clear.
7460 (Version_script_info::finalize): New function.
7461 (Version_script_info::build_lookup_tables): New function.
7462 (Version_script_info::build_expression_list_lookup): New
7463 function.
7464 (Version_script_info::get_symbol_version_helper): Rewrite to use
7465 lookup tables.
7466 (Version_script_info::print_expression_list): Adjust to use
7467 Version_script_info::Language.
7468 (script_push_lex_into_version_mode): Check that the version script
7469 has not been finalized.
7470 (version_script_push_lang): Change language string to
7471 Version_script_info::Language.
7472 * options.cc (Command_line::version_script): New function.
7473 * options.h (class General_options): Add finalize_dynamic_list
7474 function. Change version_script from declaration to definition.
7475 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7476 * testsuite/version_script.map: Remove duplicate def of foo.
7477 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7478 version_script.map.
7479 * testsuite/Makefile.in: Rebuild.
7480
7481 2009-12-30 Ian Lance Taylor <iant@google.com>
7482
7483 PR 10843
7484 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7485 if the input symbol index is 0, make the output symbol index 0.
7486
7487 2009-12-30 Ian Lance Taylor <iant@google.com>
7488
7489 PR 10670
7490 * options.h (class General_options): Add -x/--discard-all.
7491 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7492 --discard-all. If the local symbol needs a dynamic entry, check
7493 that before handling --discard-locals.
7494
7495 2009-12-30 Ian Lance Taylor <iant@google.com>
7496
7497 PR 10450
7498 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7499 flags to PF_R.
7500 (Output_segment::add_output_section): Don't change the flags if
7501 the type is PT_TLS.
7502
7503 PR 10450
7504 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7505 GNU hash table if they need a dynamic value. Otherwise, don't add
7506 them if they are defined in a dynamic object or are forced local.
7507
7508 2009-12-29 Ian Lance Taylor <iant@google.com>
7509
7510 PR 10450
7511 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7512 .gnu.hash table for a 32-bit target.
7513
7514 PR 10450
7515 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7516 regular and a dynamic object only needs a dynamic symbol table
7517 entry if it is externally visible.
7518
7519 PR 10450
7520 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7521 constructor. Add global_offset_table_ field.
7522 (Target_i386::got_section): Set global_offset_table_.
7523 (Target_i386::do_finalize_sections): Set global_offset_table_
7524 size.
7525 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7526 in constructor. Add global_offset_table_ field.
7527 (Target_x86_64::got_section): Set global_offset_table_.
7528 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7529 size.
7530
7531 * layout.cc (Layout::Layout): Initialize increase_relro_.
7532 (Layout::get_output_section): Add is_relro, is_last_relro, and
7533 is_first_non_relro parameters. Change all callers.
7534 (Layout::choose_output_section): Likewise.
7535 (Layout::add_output_section_data): Likewise.
7536 (Layout::make_output_section): Likewise.
7537 (Layout::set_segment_offsets): Clear increase_relro when using a
7538 linker script.
7539 * layout.h (class Layout): Add increase_relro method. Add
7540 increase_relro_ field. Update declarations.
7541 * output.cc (Output_section::Output_section): Initialize
7542 is_last_relro_ and is_first_non_relro_.
7543 (Output_segment::add_output_section): Group relro sections is
7544 do_sort is true. Handle is_last_relro and is_first_non_relro.
7545 (Output_segment::maximum_alignment): Remove relro handling.
7546 (Output_segment::set_section_addresses): Add increase_relro
7547 parameter. Change all callers. Add initial alignment to align
7548 relro sections on separate page. Remove old relro handling.
7549 (Output_segment::set_section_list_addresses): Remove in_relro
7550 parameter. Change all callers.
7551 (Output_segment::set_offset): Add increase parameter. Change all
7552 callers. Remove old relro handling.
7553 * output.h (class Output_section): Add new methods: is_last_relro,
7554 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7555 Add is_last_relro_ and is_first_non_relro_ fields.
7556 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7557 Create separate .got.plt section. Call increase_relro.
7558 * x86_64.cc (Target_x86_64::got_section): Likewise.
7559 * testsuite/relro_script_test.t: Add .got.plt.
7560
7561 PR 10450
7562 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7563 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7564 (Layout::finalize): Call set_dynamic_symbol_size.
7565 (Layout::set_dynamic_symbol_size): New function.
7566 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7567 set_dynamic_symbol_size.
7568
7569 PR 10450
7570 * output.h (class Output_section): Add is_entsize_zero_ field.
7571 * output.cc (Output_section::Output_section): Initialize
7572 is_entsize_zero_.
7573 (Output_section::set_entsize): If two different entsizes are
7574 requested, force it to zero.
7575 (Output_section::add_input_section): Set flags for .debug_str
7576 before updating section flags. Set entsize.
7577 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7578 and SHF_STRING if all input sections have those flags.
7579
7580 2009-12-29 Rafael Espindola <espindola@google.com>
7581
7582 * main.cc (main): Fix the sys time reporting.
7583 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7584 reporting.
7585
7586 2009-12-29 Sriraman Tallam <tmsriram@google.com>
7587
7588 * options.cc (General_options::parse_version): Allow -v to exit
7589 without an error if there is nothing to link.
7590
7591 2009-12-29 Ian Lance Taylor <iant@google.com>
7592
7593 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7594 using a version of gcc before 4.1.
7595 * configure: Rebuild.
7596
7597 2009-12-28 Chris Demetriou <cgd@google.com>
7598
7599 * attributes.cc (Output_attributes_section_data::do_write): Use
7600 std::vector::front rather than std::vector::data.
7601
7602 2009-12-28 Ian Lance Taylor <iant@google.com>
7603
7604 * symtab.h (class Symbol_table): Add enum Defined.
7605 * resolve.cc (Symbol_table::should_override): Add defined
7606 parameter. Change all callers. Test whether object is NULL
7607 before calling a method on it.
7608 (Symbol_table::report_resolve_problem): Add defined parameter.
7609 Change all callers.
7610 (Symbol_table::should_override_with_special): Likewise.
7611 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7612 parameter. Change all callers.
7613 (Symbol_table::do_define_in_output_data): Likewise.
7614 (Symbol_table::define_in_output_segment): Likewise.
7615 (Symbol_table::do_define_in_output_segment): Likewise.
7616 (Symbol_table::define_as_constant): Likewise.
7617 (Symbol_table::do_define_as_constant): Likewise.
7618 * script.h (class Symbol_assignment): Add is_defsym parameter to
7619 constructor; change all callers.
7620 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7621 parameter. Change all callers. Add is_defsym_ field.
7622 (class Parser_closure): Add parsing_defsym parameter to
7623 constructor; change all callers. Add parsing_defsym accessor
7624 function. Add parsing_defsym_ field.
7625
7626 2009-12-28 Ian Lance Taylor <iant@google.com>
7627
7628 * gold.cc (queue_middle_tasks): Fix formatting.
7629 * object.cc (Relobj::is_section_name_included): Likewise.
7630
7631 2009-12-23 Ian Lance Taylor <iant@google.com>
7632
7633 * i386.cc (Target_i386::do_calls_non_split): Recognize
7634 -fsplit-stack prologue for a function with a static chain.
7635 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7636 -fsplit-stack prologue when using %r11.
7637
7638 2009-12-21 Sriraman Tallam <tmsriram@google.com>
7639
7640 * options.cc (General_options::parse_version): Make -v continue and do
7641 the link like GNU ld does.
7642
7643 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
7644
7645 * Makefile.am (CCFILES): Add timer.cc.
7646 (HFILES): Add timer.h.
7647 * configure.ac: Check for sysconf and times.
7648 * main.cc: include timer.h.
7649 (main): Use Timer instead of get_run_time.
7650 * timer.cc: New.
7651 * timer.h: New.
7652 * workqueue.cc: include timer.h.
7653 (Workqueue::find_and_run_task):
7654 Report user, sys and wall time.
7655 * Makefile.in: Regenerate.
7656 * config.in: Regenerate.
7657 * configure: Regenerate.
7658
7659 2009-12-16 Doug Kwan <dougkwan@google.com>
7660
7661 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7662 sections.
7663 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7664 relaxed input sections.
7665 * output.cc (Output_section::find_relaxed_input_section): Change
7666 return type to Output_relaxed_input_section pointer. Adjust code
7667 for new type of relaxed_input_section_map_.
7668 * output.h (Output_section::find_relaxed_input_section): Change
7669 return type to Output_relaxed_input_section pointer.
7670 (Output_section::Output_relaxed_input_section_by_input_section_map):
7671 New type.
7672 (Output_section::relaxed_input_section_map_): Change type to
7673 Output_section::Output_relaxed_input_section_by_input_section_map.
7674 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7675 input section.
7676
7677 2009-12-15 Ian Lance Taylor <iant@google.com>
7678
7679 * layout.cc (Layout::create_shstrtab): Only write out after input
7680 sections if we are compressing debug sections.
7681
7682 2009-12-15 Ian Lance Taylor <iant@google.com>
7683
7684 * archive.cc (Archive::add_symbols): Only look up a symbol without
7685 a version if there is, in fact, a version.
7686
7687 2009-12-14 Ian Lance Taylor <iant@google.com>
7688
7689 Revert -Wshadow changes, all changes from:
7690 2009-12-11 Doug Kwan <dougkwan@google.com>
7691 2009-12-11 Nick Clifton <nickc@redhat.com>
7692 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7693
7694 2009-12-11 Doug Kwan <dougkwan@google.com>
7695
7696 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7697 due to -Wshadow.
7698 * attributes.cc (Object_attribute::size): Ditto.
7699 (Attributes_section_data::size): Ditto.
7700 (Attributes_section_data::Attributes_section_data): Ditto.
7701 (Output_attributes_section_data::do_write): Ditto.
7702 * attributes.h (Object_attribute::set_type): Ditto.
7703 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7704
7705 2009-12-11 Nick Clifton <nickc@redhat.com>
7706
7707 * archive.cc: Fix shadowed variable warnings.
7708 * arm.cc: Likewise.
7709 * compressed_output.cc: Likewise.
7710 * compressed_output.h: Likewise.
7711 * configure: Likewise.
7712 * dwarf_reader.cc: Likewise.
7713 * dynobj.cc: Likewise.
7714 * dynobj.h: Likewise.
7715 * ehframe.cc: Likewise.
7716 * ehframe.h: Likewise.
7717 * errors.cc: Likewise.
7718 * expression.cc: Likewise.
7719 * fileread.cc: Likewise.
7720 * fileread.h: Likewise.
7721 * freebsd.h: Likewise.
7722 * i386.cc: Likewise.
7723 * icf.cc: Likewise.
7724 * incremental.h: Likewise.
7725 * layout.cc: Likewise.
7726 * layout.h: Likewise.
7727 * mapfile.cc: Likewise.
7728 * merge.cc: Likewise.
7729 * merge.h: Likewise.
7730 * object.cc: Likewise.
7731 * object.h: Likewise.
7732 * options.h: Likewise.
7733 * output.cc: Likewise.
7734 * output.h: Likewise.
7735 * parameters.cc: Likewise.
7736 * plugin.cc: Likewise.
7737 * powerpc.cc: Likewise.
7738 * reduced_debug_output.cc: Likewise.
7739 * reduced_debug_output.h: Likewise.
7740 * reloc.cc: Likewise.
7741 * reloc.h: Likewise.
7742 * resolve.cc: Likewise.
7743 * script-sections.cc: Likewise.
7744 * script.cc: Likewise.
7745 * script.h: Likewise.
7746 * sparc.cc: Likewise.
7747 * symtab.cc: Likewise.
7748 * symtab.h: Likewise.
7749 * target-select.cc: Likewise.
7750 * target-select.h: Likewise.
7751 * token.h: Likewise.
7752 * workqueue.cc: Likewise.
7753 * workqueue.h: Likewise.
7754 * x86_64.cc: Likewise.
7755
7756 2009-12-10 Doug Kwan <dougkwan@google.com>
7757
7758 * arm.cc (attributes.h): New include.
7759 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7760 (Arm_relobj::~Arm_relobj): Delete object pointed by
7761 attributes_section_data_.
7762 (Arm_relobj::attributes_section_data): New method definition.
7763 (Arm_relobj::attributes_section_data_): New data member declaration.
7764 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7765 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7766 attributes_section_data_.
7767 (Arm_dynobj::attributes_section_data): New method definition.
7768 (Arm_dynobj::attributes_section_data_): New data member declaration.
7769 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7770 initialization value of may_use_blx_ to false.
7771 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
7772 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7773 object attributes to compute results instead of hard-coding.
7774 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7775 Target_arm::get_secondary_compatible_arch,
7776 Target_arm::set_secondary_compatible_arch
7777 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7778 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7779 New method declarations.
7780 (Target_arm::get_aeabi_object_attribute): New method definition.
7781 (Target_arm::attributes_section_data_): New data member declaration.
7782 (read_arm_attributes_section): New template definition.
7783 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7784 (Arm_dynobj::do_read_symbols): Ditto.
7785 (Target_arm::do_finalize_sections): Merge attributes sections from
7786 input. Check for BLX use after attributes section merging.
7787 Fix __exidx_start and __exidx_end visibility. Create an
7788 .ARM.attributes section if necessary.
7789 (Target_arm::get_secondary_compatible_arch,
7790 Target_arm::set_secondary_compatible_arch,
7791 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7792 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
7793 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
7794 New method definitions.
7795
7796 2009-12-09 Ian Lance Taylor <iant@google.com>
7797
7798 * plugin.cc (Plugin::load): Don't cast from void* to a function
7799 pointer.
7800
7801 2009-12-09 Ian Lance Taylor <iant@google.com>
7802
7803 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7804 information fields.
7805
7806 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7807
7808 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7809 Replace two_file_shared_1.so with two_file_shared_2.so.
7810 * testsuite/Makefile.in: Regenerated.
7811
7812 2009-12-08 Doug Kwan <dougkwan@google.com>
7813
7814 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7815 (HFILES): Add attributes.h and int_encoding.h.
7816 * Makefile.in: Regenerate.
7817 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7818 function definitions to int_encoding.cc
7819 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7820 prototypes to int_encoding.h
7821 * reduced_debug_output.cc (int_encoding.h): New include.
7822 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7823 function definitions to int_encoding.cc
7824 (insert_into_vector, read_from_pointer): Move template definitions to
7825 int_encoding.h
7826 * attributes.cc: New file.
7827 * attributes.h: New file.
7828 * int_encoding.cc: New file.
7829 * int_encoding.h: New file.
7830
7831 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
7832
7833 PR gold/11055
7834 * incremental-dump.cc (dump_incremental_inputs): New.
7835 (main): Use dump_incremental_inputs.
7836
7837 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7838
7839 PR gold/10893
7840 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7841 checking elfcpp::STT_FUNC.
7842 (Target_i386::Relocate::relocate): Likewise.
7843 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7844
7845 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7846 symbols from shared libraries into normal FUNC symbols.
7847
7848 * symtab.h (Symbol): Add is_func and use it.
7849
7850 2009-12-05 Doug Kwan <dougkwan@google.com>
7851
7852 * arm.cc (Target_arm::arm_info): Initialize new fields
7853 attributes_section and attributes_vendor.
7854 * i386.cc (Target_i386::i386_info): Same.
7855 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7856 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7857 fields attributes_section and attributes_vendor.
7858 * sparc.cc (Target_sparc::sparc_info): Same.
7859 * target.h (Target::attributes_section, Target::attributes_vendor,
7860 Target::is_attributes_section, Target::attribute_arg_type,
7861 Target::attributes_order): New method definitions.
7862 (Target::Target_info::attributes_section,
7863 Target::Target_info::attributes_vendor): New fields.
7864 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7865 virtual method definitions.
7866 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7867 attributes_section and attributes_vendor.
7868 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7869
7870 2009-12-05 Doug Kwan <dougkwan@google.com>
7871
7872 * arm.cc: Update comments about interworking and stub generation.
7873 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7874 considered as non-PIC.
7875 (Arm_relocate_functions::base_abs): Fix formatting.
7876 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7877 of function to use GOT entry address instead of offset.
7878 (Target_arm::Scan::global): Issue an error if a symbol would need a
7879 PLT does not get one because it is untyped. Remove code to create
7880 dynamic symbols for relative branches.
7881 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7882 takes unsigned integer instead of boolean.
7883
7884 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7885
7886 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7887 (two_file_test_LDADD): Likewise.
7888 (common_test_1_LDADD): Likewise.
7889 (exception_test_LDADD) Likewise.
7890 (weak_test_LDADD): Likewise.
7891 (many_sections_test_LDADD): Likewise.
7892 (initpri1_LDADD): Likewise.
7893 (script_test_1_LDADD): Likewise.
7894 (script_test_2_LDADD): Likewise.
7895 (justsyms_LDADD): Likewise.
7896 (binary_test_LDADD): Likewise.
7897 (large_LDADD): Likewise.
7898 * testsuite/Makefile.in: Regenerated.
7899
7900 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
7901
7902 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7903 (Symbol_table::override_with_special): Likewise.
7904 (Symbol_table::add_from_object): Likewise.
7905
7906 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7907
7908 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7909 Don't set the data_offset twice.
7910
7911 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
7912
7913 * testsuite/Makefile.in: Regenerate.
7914
7915 2009-12-03 Doug Kwan <dougkwan@google.com>
7916
7917 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7918 (Target_arm::do_finalize_sections): Add parameter for symbol table
7919 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7920 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7921 parameter for symbol table pointer.
7922 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7923 an additional parameter for a pointer to symbol table.
7924 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7925 parameter for a symbol table pointer.
7926 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7927 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7928 Ditto.
7929 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7930 parameter for a symbol table pointer.
7931
7932 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
7933
7934 * incremental.cc (Incremental_inputs_header)
7935 (Incremental_inputs_header_write, Incremental_inputs_entry)
7936 (Incremental_inputs_entry_write): Move ...
7937 * incremental.h (Incremental_inputs_header)
7938 (Incremental_inputs_header_write, Incremental_inputs_entry)
7939 (Incremental_inputs_entry_write): here.
7940
7941 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7942
7943 * incremental.cc (make_sized_incremental_binary): Set the target.
7944 Error if it is incompatible.
7945 * output.h (Output_file): Add filename method.
7946
7947 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7948
7949 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7950 from the get_* methods.
7951
7952 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7953
7954 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7955 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7956 Write 0 for the data_offset of scripts.
7957
7958 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7959
7960 * testsuite/Makefile.am: Add the incremental_test.sh test.
7961 * testsuite/incremental_test.sh: New.
7962 * testsuite/incremental_test_1.c: New.
7963 * testsuite/incremental_test_2.c: New.
7964
7965 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
7966
7967 * incremental-dump.cc (main): Fix typos.
7968
7969 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
7970
7971 PR gold/11025
7972 * incremental-dump.cc (main): Use llu to print 64 bit values.
7973
7974 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7975 H.J. Lu <hongjiu.lu@intel.com>
7976
7977 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7978 $(LIBDL).
7979 (incremental_dump_LDADD): Likewise.
7980 * Makefile.in: Regenerated.
7981
7982 2009-11-25 Doug Kwan <dougkwan@google.com>
7983
7984 Revert:
7985
7986 2009-11-25 Doug Kwan <dougkwan@google.com>
7987
7988 * arm.cc (Target_arm::Target_arm): Move method definition
7989 outside of class definition. Add code to handle
7990 --target1-rel, --target1-abs and --target2= options.
7991 (Target_arm::get_reloc_reloc_type): Change method to be
7992 non-static and const.
7993 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7994 New data member declaration.
7995 (Target_arm::Scan::local, Target_arm::Scan::global,
7996 Target_arm::Relocate::relocate,
7997 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7998 Adjust call to Target_arm::get_real_reloc_type.
7999 (Target_arm::get_real_reloc_type): Use command line options
8000 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8001 * options.h (--target1-rel, --target1-abs, --target2): New
8002 ARM-only options.
8003
8004 2009-11-25 Doug Kwan <dougkwan@google.com>
8005
8006 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8007 class definition. Add code to handle --target1-rel, --target1-abs
8008 and --target2= options.
8009 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8010 and const.
8011 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8012 member declaration.
8013 (Target_arm::Scan::local, Target_arm::Scan::global,
8014 Target_arm::Relocate::relocate,
8015 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8016 call to Target_arm::get_real_reloc_type.
8017 (Target_arm::get_real_reloc_type): Use command line options to
8018 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8019 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8020 options.
8021
8022 2009-11-25 Doug Kwan <dougkwan@google.com>
8023
8024 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8025 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8026 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8027 formatting.
8028 (Arm_relocate_functions::thm_call): Replace body with a call to
8029 Arm_relocate_functions::thumb_branch_common.
8030 (Arm_relocate_functions::thm_jump24,
8031 Arm_relocate_functions::thm_xpc22): New method definitions.
8032 (Arm_relocate_functions::thumb_branch_common): New method definition.
8033 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8034 operator.
8035 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8036 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8037
8038 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8039
8040 * Makefile.am: Build incremental-dump
8041 * Makefile.in: Regenerate.
8042 * incremental-dump.cc: New.
8043 * incremental.cc (Incremental_inputs_header_data,
8044 Incremental_inputs_entry_data): Move to incremental.h
8045 * incremental.h: (Incremental_inputs_header_data,
8046 Incremental_inputs_entry_data): Move from incremental.cc
8047
8048 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8049
8050 * incremental.cc (Incremental_inputs_header,
8051 Incremental_inputs_header_write, Incremental_inputs_entry,
8052 Incremental_inputs_entry_write): Add a typedef with the data type.
8053
8054 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8055
8056 * incremental.cc (Incremental_inputs_header,
8057 Incremental_inputs_header_write, Incremental_inputs_entry,
8058 Incremental_inputs_entry_write): Update comment about which
8059 type has the filed descriptions.
8060
8061 2009-11-15 Doug Kwan <dougkwan@google.com>
8062
8063 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8064 (Arm_relocate_functions::arm_branch_common): Change method defintion
8065 in class definition to a method declaration and update list of formal
8066 parameters.
8067 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8068 Arm_relocation_functions::jump24): Adjust call to
8069 Arm_relocate_functions::arm_branch_common. Update list of formal
8070 parameters.
8071 (Arm_relocate_functions::xpc25): New method definition.
8072 (Arm_relocate_functions::arm_branch_common): Move method defintion
8073 out from class definition. Use stubs for mode-switching and extending
8074 branch ranges.
8075 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8076 specially. Change code to enable use of stubs in ARM branches.
8077
8078 2009-11-10 Doug Kwan <dougkwan@google.com>
8079
8080 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8081 in method declaration.
8082 (Target_arm::relocate_stub): New method declaration.
8083 (Target_arm::default_target): Change to return a pointer instead of
8084 a const reference.
8085 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8086 Target_arm::default_target.
8087 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8088 method definition.
8089 (Target_arm::relocate_section): Adjust view.
8090 (Target_arm::relocate_stub): New method definition.
8091
8092 2009-11-10 Doug Kwan <dougkwan@google.com>
8093
8094 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8095 a format warning.
8096 * incremental.cc (open_incremental_binary): Initialized local
8097 variables to avoid warnings.
8098 * object.cc (make_elf_object): Ditto.
8099 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8100 a format warning.
8101
8102 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8103
8104 PR gold/10930
8105 * testsuite/plugin_test.c: Include "config.h".
8106
8107 2009-11-09 Doug Kwan <dougkwan@google.com>
8108
8109 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8110 (arm_symbol_value): Remove.
8111 (Arm_relocate_functions::arm_branch_common,
8112 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8113 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8114 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8115 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8116 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8117 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8118 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8119 Arm_relocate_functions::thm_mobw_abs_nc,
8120 Arm_relocate_functions::thm_mov_abs,
8121 Arm_relocate_functions::movw_prel_nc,
8122 Arm_relocate_functions::thm_movt_abs,
8123 Arm_relocate_functions::movt_prel,
8124 Arm_relocate_functions::thm_movw_prel_nc,
8125 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8126 (Target_arm::Relocate::relocate): Only decompose address into two
8127 parts if relocation type uses the thumb-bit and pass the actual
8128 bit instead of a flag indicating that the thumb-bit is used. Adjust
8129 calls to methods in Arm_relocate_functions for this change.
8130
8131 2009-11-08 Ian Lance Taylor <iant@google.com>
8132
8133 PR 10925
8134 * reloc.cc: Instantiate
8135 Sized_relobj::initialize_input_to_output_maps and
8136 Sized_relobj:free_input_to_output_maps.
8137
8138 2009-11-06 Ian Lance Taylor <iant@google.com>
8139
8140 PR 10876
8141 * defstd.cc (in_segment): Set only_if_ref true for "end".
8142
8143 2009-11-06 Doug Kwan <dougkwan@google.com>
8144
8145 * arm.cc (class Reloc_stub): Correct a comment.
8146 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8147 (Target_arm::scan_section_for_stubs): New method declaration.
8148 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8149 Change methods from private to protected.
8150 (Target_arm::do_may_relax): New method definition.
8151 (Target_arm::do_relax, Target_arm::group_sections,
8152 Target_arm::scan_reloc_for_stub,
8153 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8154 (Target_arm::arm_input_section_map_): New data member declaration.
8155 (Target_arm::scan_reloc_for_stub,
8156 Target_arm::scan_reloc_section_for_stubs,
8157 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8158 Target_arm::do_relax): New method definitions.
8159
8160 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8161
8162 * configure.ac: Check for (struct stat)::st_mtim
8163 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8164 * config.in: Regenerate.
8165 * configure: Regenerate.
8166
8167 2009-11-05 Ian Lance Taylor <iant@google.com>
8168
8169 PR 10910
8170 * output.cc (Output_segment::add_output_section): Add missing
8171 return statement.
8172
8173 2009-11-04 Ian Lance Taylor <iant@google.com>
8174
8175 PR 10880
8176 * object.h (class Object): Add is_needed and set_is_needed
8177 methods. Add is_needed_ field. Make bool fields into bitfields.
8178 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8179 defined in a dynamic object and referenced by a regular object,
8180 set is_needed for the dynamic object.
8181 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8182 if the file is marked with as_needed and it is not needed.
8183
8184 2009-11-04 Ian Lance Taylor <iant@google.com>
8185
8186 PR 10887
8187 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8188 tags if data is discarded by linker script.
8189 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8190 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8191 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8192 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8193
8194 2009-11-04 Ian Lance Taylor <iant@google.com>
8195
8196 * layout.cc (Layout::get_output_section): Add is_interp and
8197 is_dynamic_linker_section parameters. Change all callers.
8198 (Layout::choose_output_section): Likewise.
8199 (Layout::make_output_section): Likewise.
8200 (Layout::add_output_section_data): Add is_dynamic_linker_section
8201 parameter. Change all callers.
8202 * layout.h (class Layout): Update declarations.
8203 * output.h (class Output_section): Add is_interp, set_is_interp,
8204 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8205 Add is_interp_, is_dynamic_linker_section_ fields. Change
8206 generate_code_fills_at_write_ to a bitfield.
8207 * output.cc (Output_section::Output_sections): Initialize new
8208 fields.
8209 (Output_segment::add_output_section): Add do_sort parameter.
8210 Change all callers.
8211
8212 2009-11-03 Ian Lance Taylor <iant@google.com>
8213
8214 PR 10860
8215 * options.h (class General_options): Add --warn-common.
8216 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8217 merging two common symbols.
8218 (Symbol_table::should_override): Handle --warn-common when merging
8219 a common symbol with a defined symbol. Use report_resolve_problem
8220 for multiple definitions.
8221 (Symbol_table::report_resolve_problem): New function.
8222 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8223
8224 2009-11-03 Doug Kwan <dougkwan@google.com>
8225
8226 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8227 stub_factory_.
8228 (Target_arm::stub_factory): New method definition.
8229 (Target_arm::new_arm_input_section,
8230 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8231 Target_arm::reloc_uses_thumb_bit): New method declarations.
8232 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8233 New type definitions.
8234 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8235 member declarations.
8236 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8237 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8238 New method definitions.
8239
8240 2009-11-03 Ian Lance Taylor <iant@google.com>
8241
8242 * options.h (class General_options): Add --warn_constructors.
8243
8244 2009-11-03 Ian Lance Taylor <iant@google.com>
8245
8246 PR 10893
8247 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8248 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8249
8250 2009-11-03 Ian Lance Taylor <iant@google.com>
8251
8252 PR 10895
8253 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8254 --msgid-bugs-address.
8255 (install-pdf): New target.
8256 (install-data_yes): Look up one directory to find mkinstalldirs.
8257
8258 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8259
8260 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8261 tree.
8262
8263 2009-10-30 Doug Kwan <dougkwan@google.com>
8264
8265 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8266
8267 2009-10-30 Doug Kwan <dougkwan@google.com>
8268
8269 * arm.cc (Stub_addend_reader): New struct template definition
8270 and partial specializations.
8271 (Stub_addend_reader::operator()): New method definition for a
8272 partially specialized template.
8273
8274 2009-10-30 Doug Kwan <dougkwan@google.com>
8275
8276 * arm.cc (Arm_relobj::processor_specific_flags): New method
8277 definition.
8278 (Arm_relobj::do_read_symbols): New method declaration.
8279 (Arm_relobj::processor_specific_flags_): New data member declaration.
8280 (Arm_dynobj): New class definition.
8281 (Target_arm::do_finalize_sections): Add input_objects parameter.
8282 (Target_arm::do_adjust_elf_header): New method declaration.
8283 (Target_arm::are_eabi_versions_compatible,
8284 (Target_arm::merge_processor_specific_flags): New method declaration.
8285 (Target_arm::do_make_elf_object): New overloaded method definitions
8286 and declaration.
8287 (Arm_relobj::do_read_symbols): New method definition.
8288 (Arm_dynobj::do_read_symbols): Ditto.
8289 (Target_arm::do_finalize_sections): Add input_objects parameters.
8290 Merge processor-specific flags from all input objects.
8291 (Target_arm::are_eabi_versions_compatible,
8292 Target_arm::merge_processor_specific_flags,
8293 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8294 New method definitions.
8295 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8296 Input_objects pointer type parameter.
8297 * layout.cc (Layout::finalize): Pass input objects to target's.
8298 finalize_sections function.
8299 * output.cc (Output_file_header::do_sized_write): Set ELF file
8300 header's processor-specific flags.
8301 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8302 Input_objects pointer type parameter.
8303 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8304 * target.h (Input_objects): New forward class declaration.
8305 (Target::processor_specific_flags,
8306 Target::are_processor_specific_flags_sect): New method definitions.
8307 (Target::finalize_sections): Add input_objects parameter.
8308 (Target::Target): Initialize processor_specific_flags_ and
8309 are_processor_specific_flags_set_.
8310 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8311 parameter.
8312 (Target::set_processor_specific_flags): New method definition.
8313 (Target::processor_specific_flags_,
8314 Target::are_processor_specific_flags_set_): New data member
8315 declarations.
8316 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8317 Input_objects pointer type parameter.
8318
8319 2009-10-30 Doug Kwan <dougkwan@google.com>
8320
8321 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8322
8323 2009-10-28 Ian Lance Taylor <iant@google.com>
8324
8325 * object.h (class Relobj): Drop options parameter from
8326 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8327 do_scan_relocs, do_relocate. Change all callers.
8328 (class Sized_relobj): Drop options parameters from
8329 do_gc_process_relocs, do_scan_relocs, do_relocate,
8330 do_relocate_sections, relocate_sections, emit_relocs_scan,
8331 emit_relocs_scan_reltype. Change all callers.
8332 (struct Relocate_info): Remove options field and all references to
8333 it.
8334 * reloc.h (class Read_relocs): Remove options constructor
8335 parameter and options_ field. Change all callers.
8336 (class Gc_process_relocs, class Scan_relocs): Likewise.
8337 (class Relocate_task): Likewise.
8338 * target-reloc.h (scan_relocs): Remove options parameter. Change
8339 all callers.
8340 (scan_relocatable_relocs): Likewise.
8341 * target.h (class Sized_target): Remove options parameter from
8342 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8343 all callers.
8344 * gc.h (gc_process_relocs): Remove options parameter. Change all
8345 callers.
8346 * arm.cc: Update functions to remove options parameters.
8347 * i386.cc: Likewise.
8348 * powerpc.cc: Likewise.
8349 * sparc.cc: Likewise.
8350 * x86_64.cc: Likewise.
8351 * testsuite/testfile.cc: Likewise.
8352
8353 2009-10-28 Doug Kwan <dougkwan@google.com>
8354
8355 * arm.cc (Arm_relobj): New class definition.
8356 (Arm_relobj::scan_sections_for_stubs,
8357 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8358 New method definitions.
8359
8360 2009-10-28 Cary Coutant <ccoutant@google.com>
8361
8362 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8363 (Plugin::cleanup_done_): New member.
8364 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8365 (Plugin_manager::cleanup_done_): Remove.
8366 (Plugin_manager::add_input_file): Edit error message.
8367 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8368 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8369
8370 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8371
8372 * fileread.cc: (File_read::View::~View): Use the new
8373 data_ownership_ filed.
8374 (File_read::~File_read): Dispose the new whole_file_view_.
8375 (File_read::open): Mmap the whole file if needed.
8376 (File_read::open): Use whole_file_view_ instead of contents_.
8377 (File_read::find_view): Use whole_file_view_ if applicable.
8378 (File_read::do_read): Use whole_file_view_ instead of contents_.
8379 (File_read::make_view): Use whole_file_view_ instead of contents_,
8380 update File_read::View::View call.
8381 (File_read::find_or_make_view): Update File_read::View::View
8382 call.
8383 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8384 remove contents_
8385 (File_read::View::Data_ownership): New enum.
8386 (File_read::View::View): Replace bool mapped_ with Data_ownership
8387 argument.
8388 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8389 (File_read::View::data_ownership_): New field.
8390 (File_read::contents_): Remove (replaced by whole_file_view_).
8391 (File_read::whole_file_view_): New field.
8392 * options.h (class General_options): Add --keep-files-mapped.
8393
8394 2009-10-27 Cary Coutant <ccoutant@google.com>
8395
8396 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8397 * testsuite/Makefile.am (plugin_test_5): New test case.
8398 * testsuite/Makefile.in: Regenerate.
8399
8400 2009-10-25 Doug Kwan <dougkwan@google.com>
8401
8402 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8403 from private to protected to allow access by child class.
8404 (Sized_relobj::do_relocate_sections): New method declaration.
8405 (Sized_relobj::relocate_sections): Virtualize.
8406 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8407 Sized_relobj::relocate_sections. Instantiate template explicitly
8408 for different target sizes and endianity.
8409
8410 2009-10-24 Doug Kwan <dougkwan@google.com>
8411
8412 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8413 (Arm_input_section::as_arm_input_section): New method.
8414 (Arm_output_section): New class definition.
8415 (Arm_output_section::create_stub_group,
8416 Arm_output_section::group_sections): New method definitions.
8417
8418 2009-10-22 Doug Kwan <dougkwan@google.com>
8419
8420 * arm.cc (Arm_input_section): New class definition.
8421 (Arm_input_section::init, Arm_input_section:do_write,
8422 Arm_input_section::set_final_data_size,
8423 Arm_input_section::do_reset_address_and_file_offset): New method
8424 definitions.
8425
8426 2009-10-21 Doug Kwan <dougkwan@google.com>
8427
8428 * arm.cc (Stub_table, Arm_input_section): New forward class
8429 declarations.
8430 (Stub_table): New class defintion.
8431 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8432 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8433 New method definition.
8434
8435 2009-10-21 Doug Kwan <dougkwan@google.com>
8436
8437 * arm.cc: Update copyright comments.
8438 (Target_arm): New forward class template declaration.
8439 (Arm_address): New type.
8440 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8441 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8442 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8443 constants.
8444 (Insn_template): Same.
8445 (DEF_STUBS): New macro.
8446 (Stub_type): New enum type.
8447 (Stub_template): New class definition.
8448 (Stub): Same.
8449 (Reloc_stub): Same.
8450 (Stub_factory): Same.
8451 (Target_arm::Target_arm): Initialize may_use_blx_ and
8452 should_force_pic_veneer_.
8453 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8454 Target_arm::should_force_pic_veneer,
8455 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8456 Target_arm::using_thumb_only, Target_arm:;default_target): New
8457 method defintions.
8458 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8459 New data member declarations.
8460 (Insn_template::size, Insn_template::alignment): New method defintions.
8461 (Stub_template::Stub_template): New method definition.
8462 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8463 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8464 (Stub_factory::Stub_factory): New method definition.
8465 * gold.h (string_hash): New template.
8466 * output.h (Input_section_specifier::hash_value): Use
8467 gold::string_hash.
8468 (Input_section_specifier::string_hash): Remove.
8469 * stringpool.cc (Stringpool_template::string_hash): Use
8470 gold::string_hash.
8471
8472 2009-10-20 Doug Kwan <dougkwan@google.com>
8473
8474 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8475 symbols of relaxed input sections.
8476 * output.h (Output_section::find_relaxed_input_section): Make
8477 method public.
8478
8479 2009-10-16 Doug Kwan <dougkwan@google.com>
8480
8481 * dynobj.cc (Versions::Versions): Initialize version_script_.
8482 Only insert base version symbol definition for a shared object
8483 if version script defines any version versions.
8484 (Versions::define_base_version): New method definition.
8485 (Versions::add_def): Check that base version is not needed.
8486 (Versions::add_need): Define base version lazily.
8487 * dynobj.h (Versions::define_base_version): New method declaration.
8488 (Versions::needs_base_version_): New data member declaration.
8489 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8490 (check_DATA): Add no_version_test.stdout.
8491 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8492 New make rules.
8493 * testsuite/Makefile.in: Regenerate.
8494 * testsuite/no_version_test.c: New file.
8495 * testsuite/no_version_test.sh: Ditto.
8496
8497 2009-10-16 Doug Kwan <dougkwan@google.com>
8498
8499 * expression.cc (class Segment_start_expression): New class definition.
8500 (Segment_start_expression::value): New method definition.
8501 (script_exp_function_segment_start): Return a new
8502 Segment_start_expression.
8503 * gold/script-c.h (script_saw_segment_start_expression): New function
8504 prototype.
8505 * script-sections.cc (Script_sections::Script_sections): Initialize
8506 SAW_SEGMENT_START_EXPRESSION_ to false.
8507 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8508 and -Tbbs options to specify section addresses if given in
8509 command line and no SEGMENT_START expression is seen in a script.
8510 * script-sections.h (Script_sections::saw_segment_start_expression,
8511 Script_sections::set_saw_segment_start_expression): New method
8512 definition.
8513 (Script_sections::saw_segment_start_expression_): New data member
8514 declaration.
8515 * script.cc (script_saw_segment_start_expression): New function.
8516 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8517 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8518 script_test_7.sh and script_test_8.sh.
8519 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8520 script_test_8.stdout.
8521 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8522 (script_test_6, script_test_6.stdout, script_test_7,
8523 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8524 * Makefile.in: Regenerate.
8525 * testsuite/script_test_6.sh: New file.
8526 * testsuite/script_test_6.t: Same.
8527 * testsuite/script_test_7.sh: Same.
8528 * testsuite/script_test_7.t: Same.
8529 * testsuite/script_test_8.sh: Same.
8530
8531 2009-10-16 Doug Kwan <dougkwan@google.com>
8532
8533 * output.cc (Output_segment::set_section_list_address): Cast
8534 expressions to unsigned long long type to avoid format warnings.
8535
8536 2009-10-15 Ian Lance Taylor <iant@google.com>
8537
8538 * script.cc (Script_options::add_symbol_assignment): Always add a
8539 dot assignment to script_sections_.
8540 * script-sections.cc (Script_sections::add_dot_assignment):
8541 Initialize if necessary.
8542
8543 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8544 program headers with no load segment if there is a linker script.
8545
8546 * layout.cc (Layout::set_segment_offsets): Align the file offset
8547 to the segment aligment for -N or -n with no load segment.
8548 * output.cc (Output_segment::add_output_section): Don't crash if
8549 the first section is a TLS section.
8550 (Output_segment::set_section_list_addresses): Print an error
8551 message if the address moves backward in a linker script.
8552 * script-sections.cc
8553 (Output_section_element_input::set_section_addresses): Don't
8554 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8555 (Orphan_output_section::set_section_addresses): Likewise.
8556
8557 2009-10-15 Doug Kwan <dougkwan@google.com>
8558
8559 * layout.cc (Layout::finish_dynamic_section): Generate tags
8560 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8561 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8562 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8563
8564 2009-10-14 Ian Lance Taylor <iant@google.com>
8565
8566 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8567 fields.
8568 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8569 data_shdr fields of relinfo.
8570 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8571 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8572 R_386_TLS_LDO_32, adjust based on section flags.
8573 (Target_i386::Relocate::fix_up_ldo): Remove.
8574
8575 2009-10-13 Ian Lance Taylor <iant@google.com>
8576
8577 Add support for -pie.
8578 * options.h (class General_options): Add -pie and
8579 --pic-executable.
8580 (General_options::output_is_position_independent): Test -pie.
8581 (General_options::output_is_executable): Return true if not shared
8582 and not relocatable.
8583 (General_options::output_is_pie): Remove.
8584 * options.cc (General_options::finalize): Reject incompatible uses
8585 of -pie.
8586 * gold.cc (queue_middle_tasks): A -pie link is not static.
8587 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8588 * symtab.cc (Symbol::final_value_is_known): Return false if
8589 output_is_position_independent.
8590 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8591 output_is_position_independent.
8592 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8593 output_is_position_independent.
8594 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8595 output_is_position_independent.
8596 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8597 two_file_pie_test.
8598 (basic_pie_test.o, basic_pie_test): New targets.
8599 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8600 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8601 (two_file_pie_test): New target.
8602 * testsuite/Makefile.in: Rebuild.
8603 * README: Remove note saying that -pie is not supported.
8604
8605 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8606
8607 * options.h (class General_options): Add -init and -fini.
8608 * layout.cc (Layout::finish_dynamic_section): Emit
8609 given init and fini functions.
8610
8611 2009-10-13 Sriraman Tallam <tmsriram@google.com>
8612
8613 * gc.h (gc_process_relocs): Check if icf is enabled using new
8614 function.
8615 * gold.cc (queue_initial_tasks): Likewise.
8616 (queue_middle_tasks): Likewise.
8617 * object.cc (do_layout): Likewise.
8618 * symtab.cc (is_section_folded): Likewise.
8619 * main.cc (main): Likewise.
8620 * reloc.cc (Read_relocs::run): Likewise.
8621 (Sized_relobj::do_scan_relocs): Likewise.
8622 * icf.cc (is_function_ctor_or_dtor): New function.
8623 (Icf::find_identical_sections): Check if function is ctor or dtor when
8624 safe icf is chosen.
8625 * options.h (General_options::icf): Change option to be an enum.
8626 (Icf_status): New enum.
8627 (icf_enabled): New method.
8628 (icf_safe_folding): New method.
8629 (set_icf_status): New method.
8630 (icf_status_): New variable.
8631 * (options.cc) (General_options::finalize): Set icf_status_.
8632 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8633 icf_test and icf_keep_unique_test to use the --icf enum flag.
8634 * testsuite/icf_safe_test.sh: New file.
8635 * testsuite/icf_safe_test.cc: New file.
8636
8637 2009-10-12 Sriraman Tallam <tmsriram@google.com>
8638
8639 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8640 includes to gc.h and icf.h.
8641 * arm.cc: Include gc.h.
8642 * gold.cc: Likewise.
8643 * i386.cc: Likewise.
8644 * powerpc.cc: Likewise.
8645 * sparc.cc: Likewise.
8646 * x86_64.cc: Likewise.
8647 * gc.h: Include icf.h.
8648
8649 2009-10-11 Ian Lance Taylor <iant@google.com>
8650
8651 * plugin.cc: Include "gold.h" before other header files.
8652
8653 2009-10-10 Chris Demetriou <cgd@google.com>
8654
8655 * options.h (Input_file_argument::Input_file_type): New enum.
8656 (Input_file_argument::is_lib_): Replace with...
8657 (Input_file_argument::type_): New member.
8658 (Input_file_argument::Input_file_argument): Take Input_file_type
8659 'type' rather than boolean 'is_lib' as second argument.
8660 (Input_file_argument::is_lib): Use type_.
8661 (Input_file_argument::is_searched_file): New function.
8662 (Input_file_argument::may_need_search): Handle is_searched_file.
8663 * options.cc (General_options::parse_library): Support -l:filename.
8664 (General_options::parse_just_symbols): Update for Input_file_argument
8665 changes.
8666 (Command_line::process): Likewise.
8667 * archive.cc (Archive::get_file_and_offset): Likewise.
8668 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8669 * script.cc (read_script_file, script_add_file): Likewise.
8670 * fileread.cc (Input_file::Input_file): Likewise.
8671 (Input_file::will_search_for): Handle is_searched_file.
8672 (Input_file::open): Likewise.
8673 * readsyms.cc (Read_symbols::get_name): Likewise.
8674 * testsuite/Makefile.am (searched_file_test): New test.
8675 * testsuite/Makefile.in: Regenerate.
8676 * testsuite/searched_file_test.cc: New file.
8677 * testsuite/searched_file_test_lib.cc: New file.
8678
8679 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8680 Ian Lance Taylor <iant@google.com>
8681
8682 * descriptor.cc: Include <cstdio> and "binary-io.h".
8683 (Descriptors::open): Open the files in binary mode always.
8684 * script.cc (Lex::get_token): Treat \r as whitespace.
8685
8686 2009-10-09 Ian Lance Taylor <iant@google.com>
8687
8688 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8689
8690 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8691 Ian Lance Taylor <iant@google.com>
8692
8693 * configure.ac: Check for readv function also.
8694 * fileread.cc (readv): Define if not HAVE_READV.
8695 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8696 does not exist.
8697 * config.in: Regenerate.
8698 * configure: Regenerate.
8699
8700 2009-10-09 Doug Kwan <dougkwan@google.com>
8701
8702 * layout.cc (Layout::make_output_section): Call target hook to make
8703 ordinary output section.
8704 (Layout::finalize): Adjust parameter list of call the
8705 Target::may_relax().
8706 * layout.h (class Layout::section_list): New method.
8707 * merge.h (Output_merge_base::entsize): Change visibility to public.
8708 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8709 New methods.
8710 (Output_merge_string::do_is_string): New method.
8711 * object.cc (Sized_relobj::do_setup): renamed from
8712 Sized_relobj::set_up.
8713 * object.h (Sized_relobj::adjust_shndx,
8714 Sized_relobj::initializ_input_to_output_maps,
8715 Sized_relobj::free_input_to_output_maps): Change visibilities to
8716 protected.
8717 (Sized_relobj::setup): Virtualize.
8718 (Sized_relobj::do_setup): New method declaration.
8719 (Sized_relobj::invalidate_section_offset,
8720 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8721 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8722 * options.cc (parse_int): New function.
8723 * options.h (parse_int): New declaration.
8724 (DEFINE_int): New macro.
8725 (stub_group_size): New option.
8726 * output.cc (Output_section::Output_section): Initialize memebers
8727 merge_section_map_, merge_section_by_properties_map_,
8728 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8729 (Output_section::add_input_section): Handled deferred code-fill
8730 generation and remove an old comment.
8731 (Output_section::add_relaxed_input_section): New method definition.
8732 (Output_section::add_merge_input_section): Use merge section by
8733 properties map to speed to search. Update merge section maps
8734 as appropriate.
8735 (Output_section::build_relaxation_map): New method definition.
8736 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8737 Same.
8738 (Output_section::relax_input_section): Renamed to
8739 Output_section::convert_input_sections_to_relaxed_sections and change
8740 interface to take a vector of pointers to relaxed sections.
8741 (Output_section::find_merge_section,
8742 Output_section::find_relaxed_input_section): New method definitions.
8743 (Output_section::is_input_address_mapped,
8744 Output_section::output_offset, Output_section::output_address):
8745 Use output section data maps to speed up searching.
8746 (Output_section::find_starting_output_address): Add comments.
8747 (Output_section::do_write,
8748 Output_section::write_to_postprocessing_buffer): Do code-fill
8749 generation as appropriate.
8750 (Output_section::get_input_sections): Invalidate relaxed input section
8751 map.
8752 (Output_section::restore_states): Adjust type of checkpoint .
8753 Invalidate relaxed input section map.
8754 * output.h (Output_merge_base): New class declaration.
8755 (Input_section_specifier): New class defintion.
8756 (class Output_relaxed_input_section) Change base class to
8757 Output_section_data_build.
8758 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8759 base class initializer.
8760 (Output_section::add_relaxed_input_section): New method declaration.
8761 (Output_section::Input_section): Change visibility to protected.
8762 (Output_section::Input_section::relobj,
8763 Output_section::Input_section::shndx): Handle relaxed input sections.
8764 Output_section::input_sections) Change visibility to protected. Also
8765 define overload to return a non-const pointer.
8766 (Output_section::Merge_section_properties): New class defintion.
8767 (Output_section::Merge_section_by_properties_map,
8768 Output_section::Output_section_data_by_input_section_map,
8769 Output_section::Relaxation_map): New types.
8770 (Output_section::relax_input_section): Rename method to
8771 Output_section::convert_input_sections_to_relaxed_sections and change
8772 interface to take a vector of relaxed section pointers.
8773 (Output_section::find_merge_section,
8774 Output_section::find_relaxed_input_section,
8775 Output_section::build_relaxation_map,
8776 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8777 New method declarations.
8778 (Output_section::merge_section_map_
8779 Output_section::merge_section_by_properties_map_,
8780 Output_section::relaxed_input_section_map_,
8781 Output_section::is_relaxed_input_section_map_valid_,
8782 Output_section::generate_code_fills_at_write_): New data members.
8783 * script-sections.cc
8784 (Output_section_element_input::set_section_addresses): Call
8785 current_data_size and addralign methods of relaxed input sections.
8786 (Orphan_output_section::set_section_addresses): Call current_data_size
8787 and addralign methods of relaxed input sections.
8788 * symtab.cc (Symbol_table::compute_final_value): Extract template
8789 from the body of Symbol_table::sized_finalize_symbol.
8790 (Symbol_table::sized_finalized_symbol): Call
8791 Symbol_table::compute_final_value.
8792 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8793 (Symbol_table::compute_final_value): New templated method declaration.
8794 * target.cc (Target::do_make_output_section): New method defintion.
8795 * target.h (Target::make_output_section): New method declaration.
8796 (Target::relax): Add more parameters for input objects, symbol table
8797 and layout. Adjust call to do_relax.
8798 (Target::do_make_output_section): New method declaration.
8799 (Target::do_relax): Add parameters for input objects, symbol table
8800 and layout.
8801
8802 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8803
8804 * pread.c: Include stdio.h.
8805
8806 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8807
8808 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8809 defined.
8810
8811 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8812
8813 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8814 Change read_shndx type to unsigned int.
8815 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8816 int.
8817 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8818 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8819 Change read_shndx type to unsigned int.
8820 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8821 int.
8822 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8823 * layout.cc (Layout::create_symtab_sections): Cast the result of
8824 local_symcount * symsize to off_t in the gold_assert.
8825
8826 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8827
8828 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8829 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8830 R_ARM_BASE_ABS.
8831 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8832 (Arm_relocate_functions::thm_abs5): New function.
8833 (Arm_relocate_functions::abs12): New function.
8834 (Arm_relocate_functions::abs16): New function.
8835 (Arm_relocate_functions::base_abs): New function.
8836 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8837 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8838 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8839 R_ARM_BASE_ABS.
8840 (Scan::global): Likewise.
8841 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8842 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8843 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8844 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8845 R_ARM_BASE_ABS.
8846
8847 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8848
8849 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8850 (Arm_relocate_functions::movt_prel): New function.
8851 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8852 (Arm_relocate_functions::thm_movt_prel): New function.
8853 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8854 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8855 (Scan::global, Relocate::relocate): Likewise.
8856 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8857
8858 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8859
8860 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8861 Incremental_checker.
8862 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8863 unsigned int.
8864 (class Incremental_inputs_header): New class.
8865 (Incremental_inputs_header_writer): Edit comment.
8866 (Incremental_inputs_entry): New class.
8867 (Incremental_inputs_entry_writer): Edit comment.
8868 (Sized_incremental_binary::do_find_incremental_inputs_section):
8869 Add *strtab_shndx parameter, fill it.
8870 (Sized_incremental_binary::do_check_inputs): New method.
8871 (Incremental_checker::can_incrementally_link_output_file): Use
8872 Sized_incremental_binary::check_inputs.
8873 (Incremental_inputs::report_command_line): Save command line in
8874 command_line_.
8875 * incremental.h:
8876 (Incremental_binary::find_incremental_inputs_section): New
8877 method.
8878 (Incremental_binary::do_find_incremental_inputs_section): Add
8879 strtab_shndx parameter.
8880 (Incremental_binary::do_check_inputs): New pure virtual method.
8881 (Sized_incremental_binary::do_check_inputs): Declare.
8882 (Incremental_checker::Incremental_checker): Add incremental_inputs
8883 parameter, use it to initialize incremental_inputs_.
8884 (Incremental_checker::incremental_inputs_): New field.
8885 (Incremental_checker::command_line): New method.
8886 (Incremental_checker::inputs): New method.
8887 (Incremental_checker::command_line_): New field.
8888
8889 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8890
8891 * incremental.cc: Include <cstdarg> and "target-select.h".
8892 (vexplain_no_incremental): New function.
8893 (explain_no_incremental): New function.
8894 (Incremental_binary::error): New method.
8895 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8896 method.
8897 (make_sized_incremental_binary): New function.
8898 (open_incremental_binary): New function.
8899 (can_incrementally_link_file): Add checks if output is ELF and has
8900 inputs section.
8901 * incremental.h: Include "elfcpp_file.h" and "output.h".
8902 (Incremental_binary): New class.
8903 (Sized_incremental_binary): New class.
8904 (open_incremental_binary): Declare.
8905 * object.cc (is_elf_object): Use
8906 elfcpp::Elf_recognizer::is_elf_file.
8907 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8908 * output.h (Output_file::filesize): New method.
8909
8910 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8911
8912 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8913 New function.
8914 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8915 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8916 function.
8917 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8918 function.
8919 (Arm_relocate_functions::movw_abs_nc): New function.
8920 (Arm_relocate_functions::movt_abs): New function.
8921 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8922 (Arm_relocate_functions::thm_movt_abs): New function.
8923 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8924 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8925 (Scan::global): Likewise.
8926 (Relocate::relocate): Likewise.
8927 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8928
8929 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8930
8931 * arm.cc (Arm_relocate_functions::got_prel) New function.
8932 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8933 (Relocate::relocate): Likewise.
8934 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8935
8936 2009-10-06 Ian Lance Taylor <iant@google.com>
8937
8938 * options.h (class General_options): Define
8939 split_stack_adjust_size parameter.
8940 * object.h (class Object): Add uses_split_stack_ and
8941 has_no_split_stack_ fields. Add uses_split_stack and
8942 has_no_split_stack accessor functions. Declare
8943 handle_split_stack_section.
8944 (class Reloc_symbol_changes): Define.
8945 (class Sized_relobj): Define Function_offsets. Declare
8946 split_stack_adjust, split_stack_adjust_reltype, and
8947 find_functions.
8948 * object.cc (Object::handle_split_stack_section): New function.
8949 (Sized_relobj::do_layout): Call handle_split_stack_section.
8950 * dynobj.cc (Sized_dynobj::do_layout): Call
8951 handle_split_stack_section.
8952 * reloc.cc (Sized_relobj::relocate_sections): Call
8953 split_stack_adjust for executable sections in split_stack
8954 objects. Pass reloc_map to relocate_section.
8955 (Sized_relobj::split_stack_adjust): New function.
8956 (Sized_relobj::split_stack_adjust_reltype): New function.
8957 (Sized_relobj::find_functions): New function.
8958 * target-reloc.h: Include "object.h".
8959 (relocate_section): Add reloc_symbol_changes parameter. Change
8960 all callers.
8961 * target.h (class Target): Add calls_non_split method. Declare
8962 do_calls_non_split virtual method. Declare match_view and
8963 set_view_to_nop.
8964 * target.cc: Include "elfcpp.h".
8965 (Target::do_calls_non_split): New function.
8966 (Target::match_view): New function.
8967 (Target::set_view_to_nop): New function.
8968 * gold.cc (queue_middle_tasks): Give an error if mixing
8969 split-stack and non-split-stack objects with -r.
8970 * i386.cc (Target_i386::relocate_section): Add
8971 reloc_symbol_changes parameter.
8972 (Target_i386::do_calls_non_split): New function.
8973 * x86_64.cc (Target_x86_64::relocate_section): Add
8974 reloc_symbol_changes parameter.
8975 (Target_x86_64::do_calls_non_split): New function.
8976 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8977 parameter.
8978 * powerpc.cc (Target_powerpc::relocate_section): Add
8979 reloc_symbol_changes parameter.
8980 * sparc.cc (Target_sparc::relocate_section): Add
8981 reloc_symbol_changes parameter.
8982 * configure.ac: Call AM_CONDITIONAL for the default target.
8983 * configure: Rebuild.
8984 * testsuite/Makefile.am (TEST_AS): New variable.
8985 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8986 (check_DATA): Add split_i386 and split_x86_64 files.
8987 (SPLIT_DEFSYMS): Define.
8988 (split_i386_[1234n].o): New targets.
8989 (split_i386_[124]): New targets.
8990 (split_i386_[1234r].stdout): New targets.
8991 (split_x86_64_[1234n].o): New targets.
8992 (split_x86_64_[124]): New targets.
8993 (split_x86_64_[1234r].stdout): New targets.
8994 (MOSTLYCLEANFILES): Add new executables.
8995 * testsuite/split_i386.sh: New file.
8996 * testsuite/split_x86_64.sh: New file.
8997 * testsuite/split_i386_1.s: New file.
8998 * testsuite/split_i386_2.s: New file.
8999 * testsuite/split_i386_3.s: New file.
9000 * testsuite/split_i386_4.s: New file.
9001 * testsuite/split_i386_n.s: New file.
9002 * testsuite/split_x86_64_1.s: New file.
9003 * testsuite/split_x86_64_2.s: New file.
9004 * testsuite/split_x86_64_3.s: New file.
9005 * testsuite/split_x86_64_4.s: New file.
9006 * testsuite/split_x86_64_n.s: New file.
9007 * testsuite/testfile.cc (Target_test): Update relocation_section
9008 function.
9009 * testsuite/Makefile.in: Rebuild.
9010
9011 2009-10-06 Ian Lance Taylor <iant@google.com>
9012
9013 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9014 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9015 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9016 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9017 the address on ldo_addrs_.
9018 (Target_i386::Relocate::fix_up_ldo): New function.
9019
9020 2009-10-06 Rafael Espindola <espindola@google.com>
9021
9022 * plugin.cc (add_input_library): New.
9023 (Plugin::load): Add add_input_library to tv.
9024 (Plugin_manager::add_input_file): Add the is_lib argument.
9025 (add_input_file): Update call to Plugin_manager::add_input_file.
9026 (add_input_library): New.
9027 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9028
9029 2009-09-30 Doug Kwan <dougkwan@google.com>
9030
9031 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9032 symbol and call Symbol::may_need_copy_reloc to determine if
9033 a copy reloc is needed.
9034 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9035 nocopyreloc is given in command line.
9036 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9037 given in command line.
9038 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9039 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9040 of the removed Target_i386::may_need_copy_reloc.
9041 * options.h (copyreloc): New option with default value false.
9042 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9043 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9044 instead of the removed Target_powerpc::may_need_copy_reloc.
9045 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9046 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9047 instead of the removed Target_sparc::may_need_copy_reloc.
9048 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9049 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9050 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9051 instead of the removed Target_x86_64::may_need_copy_reloc.
9052
9053 2009-09-30 Ian Lance Taylor <iant@google.com>
9054
9055 * object.h (class Object): Remove target_ field, and target,
9056 sized_target, and set_target methods.
9057 (Object::sized_target): Remove.
9058 (class Sized_relobj): Update declarations. Remove sized_target.
9059 * object.cc (Sized_relobj::setup): Remove target parameter.
9060 Change all callers.
9061 (Input_objects::add_object): Don't do anything with the target.
9062 (make_elf_sized_object): Add punconfigured parameter. Change all
9063 callers. Set or test parameter target.
9064 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9065 Change all callers.
9066 * parameters.cc (Parameters::set_target): Change parameter type to
9067 be non-const.
9068 (Parameters::default_target): Remove.
9069 (set_parameters_target): Change parameter type to be non-const.
9070 (parameters_force_valid_target): New function.
9071 (parameters_clear_target): New function.
9072 * parameters.h (class Parameters): Update declarations. Remove
9073 default_target method. Add sized_target and clear_target
9074 methods. Change target_ to be non-const.
9075 (set_parameters_target): Update declaration.
9076 (parameters_force_valid_target): Declare.
9077 (parameters_clear_target): Declare.
9078 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9079 as NULL if we aren't searching.
9080 (Add_symbols::run): Don't check for compatible target.
9081 * fileread.cc (Input_file::open_binary): Call
9082 parameters_force_valid_target.
9083 * gold.cc (queue_middle_tasks): Likewise.
9084 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9085 set_target on object.
9086 * dynobj.h (class Sized_dynobj): Update declarations.
9087 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9088 make_elf_object returns NULL.
9089 (Archive::include_member): Don't check whether object target is
9090 compatible.
9091 * output.cc (Output_section::add_input_section): Get target from
9092 parameters.
9093 (Output_section::relax_input_section): Likewise.
9094 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9095 parameters.
9096 (Sized_relobj::do_scan_relocs): Likewise.
9097 (Sized_relobj::relocate_sections): Likewise.
9098 * resolve.cc (Symbol_table::resolve): Likewise.
9099 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9100 parameter. Change all callers.
9101 (Symbol_table::add_from_object): Get target from parameters.
9102 (Symbol_table::add_from_relobj): Don't check object target.
9103 (Symbol_table::add_from_dynobj): Likewise.
9104 (Symbol_table::define_special_symbol): Get target from
9105 parameters.
9106 * symtab.h (class Symbol_table): Update declaration.
9107 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9108 parameter. Change all callers. Clear parameter target.
9109 (Binary_test): Test target here.
9110 * testsuite/object_unittest.cc (gold_testsuite): Remove
9111 target_test_pointer parameter. Change all callers.
9112 (Object_test): Test target here.
9113
9114 2009-09-26 Ian Lance Taylor <iant@google.com>
9115
9116 * testsuite/initpri1.c: Don't try to use constructor priorities if
9117 compiling with gcc before 4.3.
9118
9119 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9120
9121 * testsuite/retain_symbols_file_test.sh (check_present): Change
9122 output file name to retain_symbols_file_test.stdout.
9123 (check_absent): Likewise.
9124
9125 2009-09-18 Craig Silverstein <csilvers@google.com>
9126
9127 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9128 * options.cc: Include <cerrno> and <fstream>.
9129 (General_options::finalize): Parse -retain-symbols-file tag.
9130 * options.h: New flag.
9131 (General_options): New method should_retain_symbol, new
9132 variable symbols_to_retain.
9133 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9134 should_retain_symbol map.
9135 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9136 * testsuite/Makefile.in: Regenerate.
9137 * testsuite/retain_symbols_file_test.sh: New file.
9138
9139 2009-09-18 Nick Clifton <nickc@redhat.com>
9140
9141 * po/es.po: Updated Spanish translation.
9142
9143 2009-09-17 Doug Kwan <dougkwan@google.com>
9144
9145 * debug.h (DEBUG_RELAXATION): New constant.
9146 (DEBUG_ALL): Add DEBUG_RELAXATION.
9147 (debug_string_to_enum): Add relaxation debug option.
9148 * layout.cc
9149 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9150 Layout::Relaxation_debug_check::read_sections,
9151 Layout::Relaxation_debug_check::read_sections): New method definitions.
9152 (Layout::Layout): Initialize data members
9153 record_output_section_data_from_scrips_,
9154 script_output_section_data_list_ and relaxation_debug_check_.
9155 (Layout::save_segments, Layout::restore_segments,
9156 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9157 Layout::relaxation_loop_body): New method definitions.
9158 (Layout::finalize): Support relaxation. Move section layout code to
9159 Layout::relaxation_loop_body.
9160 (Layout::set_asection_address_from_script): Move code for orphan
9161 section placement out.
9162 (Layout::place_orphan_sections_in_script): New method definition.
9163 * layout.h (Output_segment_headers, Output_file_header):
9164 New forward class declarations.
9165 (Layout::~Layout): Define.
9166 (Layout::new_output_section_data_from_script): New method definition.
9167 (Layout::place_orphan_sections_in_script): New method declaration.
9168 (Layout::Segment_states): New type declaration.
9169 (Layout::save_segments, Layout::restore_segments,
9170 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9171 Layout::relaxation_loop_body): New method declarations.
9172 (Layout::Output_section_data_list): New type declaration.
9173 (Layout::Relaxation_debug_check): New class definition.
9174 (Layout::record_output_section_data_from_script_,
9175 Layout::script_output_section_data_list_, Layout::segment_states_,
9176 Layout::relaxation_debug_check_): New data members.
9177 * output.cc: (Output_section_headers::do_size): New method definition.
9178 (Output_section_headers::Output_section_headers): Move size
9179 computation to Output_section_headers::do_size.
9180 (Output_segment_headers::do_size): New method definition.
9181 (Output_file_header::Output_file_header): Move size computation to
9182 Output_file_header::do_size and call it.
9183 (Output_file_header::do_size): New method definition.
9184 (Output_data_group::Output_data_group): Adjust call to
9185 Output_section_data.
9186 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9187 (Output_symtab_xindex::do_write): Add array bound check.
9188 (Output_section::Input_section::print_to_mapfile): Handle
9189 RELAXED_INPUT_SECTION_CODE.
9190 (Output_section::Output_section): Initialize data member checkpoint_.
9191 (Output_section::~Output_section): Delete checkpoint object pointed
9192 by checkpoint_.
9193 (Output_section::add_input_section): Always add an Input_section if
9194 relaxing.
9195 (Output_section::add_merge_input_section): Add assert.
9196 (Output_section::relax_input_section): New method definition.
9197 (Output_section::set_final_data_size): Set load address to zero for
9198 an unallocated section.
9199 (Output_section::do_address_and_file_offset_have_reset_values):
9200 New method definition.
9201 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9202 Handle relaxed input section.
9203 (Output_section::sort_attached_input_sections): Checkpoint input
9204 section list lazily.
9205 (Output_section::get_input_sections): Change type of input_sections to
9206 list of Simple_input_section pointers. Checkpoint input section list
9207 lazily. Also handle relaxed input sections.
9208 (Output_section::add_input_section_for_script): Take a reference to
9209 a Simple_input_section object instead of Relobj pointer and section
9210 index as parameter. Handle relaxed input sections.
9211 (Output_section::save_states, Output_section::restore_states): New
9212 method definitions.
9213 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9214 (Output_data::is_data_size_fixed): New method definition.
9215 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9216 if it is fixed.
9217 (Output_data::address_and_file_offset_have_reset_values): New method
9218 definition.
9219 (Output_data::do_address_and_file_offset_have_reset_values): New method
9220 definition.
9221 (Output_data::set_data_size): Check that data size is not fixed.
9222 (Output_data::fix_data_size): New method definition.
9223 (Output_data::is_data_size_fixed_): New data member.
9224 (Output_section_headers::set_final_data_size): New method definition.
9225 (Output_section_headers::do_size): New method declaration.
9226 (Output_segment_headers::set_final_data_size): New method definition.
9227 (Output_segment_headers::do_size): New method declaration.
9228 (Output_file_header::set_final_data_size)::New method definition.
9229 (Output_file_header::do_size)::New method declaration.
9230 (Output_section_data::Output_section_data): Add new parameter
9231 is_data_size_fixed and use it to fix data size.
9232 (Output_data_const::Output_data_const): Adjust call to base class
9233 constructor and fix data size.
9234 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9235 base class constructor and fix data size.
9236 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9237 base class constructor and fix data size.
9238 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9239 class constructor and fix data size.
9240 (Output_data_group::set_final_data_size): New method definition.
9241 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9242 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9243 class constructor and fix data size.
9244 (Output_relaxed_input_section): New class definition.
9245 (Output_section::Simple_input_section): New class definition.
9246 (Output_section::get_input_sections): Adjust parameter list.
9247 (Output_section::add_input_section_for_script): Same.
9248 (Output_section::save_states, Output_section::restore_states,
9249 Output_section::do_address_and_file_offset_have_reset_values,
9250 (Output_section::Input_section::Input_section): Handle
9251 RELAXED_INPUT_SECTION_CODE. Add new overload for
9252 Output_relaxed_input_section.
9253 (Output_section::Input_section::is_input_section,
9254 Output_section::Input_section::set_output_section): Handle relaxed
9255 input section.
9256 (Output_section::Input_section::is_relaxed_input_section,
9257 Output_section::Input_section::output_section_data,
9258 Output_section::Input_section::relaxed_input_section): New method
9259 definitions.
9260 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9261 value.
9262 (Output_section::Input_section::u1_): Update comments.
9263 (Output_section::Input_section::u2_): Add new union member poris.
9264 (Output_section::Checkpoint_output_section): New classs definition.
9265 (Output_section::relax_input_section): New method declaration.
9266 (Output_section::checkpoint_): New data member.
9267 (Output_segment): Update comments.
9268 (Output_segment::Output_segment): Un-privatize copy constructor.
9269 (Output_segment::operator=): Un-privatize.
9270 * script-sections.cc (Output_section_element::Input_section_list):
9271 Change element type to Output_section::Simple_input_section.
9272 (Output_section_element_dot_assignment::set_section_addresses):
9273 Register output section data for relaxation clean up.
9274 (Output_data_exression::Output_data_expression): Adjust call to base
9275 constructor to fix data size.
9276 (Output_section_element_data::set_section_addresses): Register
9277 Output_data_expression object for relaxation clean up.
9278 (struct Input_section_info): Replace Relobj pointer and section index
9279 pair with Output_section::Simple_input_section and Convert struct to a
9280 class.
9281 (Input_section_sorter::operator()): Adjust access to
9282 Input_section_info data member to use accessors.
9283 (Output_section_element_input::set_section_addresses): Use layout
9284 parameter. Adjust code to use Output_section::Simple_input_section
9285 and Input_secction_info classes. Register filler for relaxation
9286 clean up.
9287 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9288 and section index pair with Output_section::Simple_input_section
9289 class. Adjust code accordingly.
9290 (Phdrs_element::release_segment): New method definition.
9291 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9292 segment list.
9293 (Script_sections::release_segments): New method definition.
9294 * gold/script-sections.h (Script_sections::release_segments): New
9295 method declaration.
9296 * gold/target.h (Target::may_relax, Target::relax,
9297 Target::do_may_relax, Target::do_relax): New method definitions.
9298
9299 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9300
9301 * arm.cc (has_signed_unsigned_overflow): New function.
9302 (Arm_relocate_functions::abs8): New function.
9303 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9304 (Target_arm::Scan::global): Likewise.
9305 (Target_arm::relocate::relocate): Likewise.
9306 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9307 Likewise.
9308
9309 2009-09-16 Cary Coutant <ccoutant@google.com>
9310
9311 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9312 * testsuite/Makefile.in: Regenerate.
9313
9314 2009-09-11 Nick Clifton <nickc@redhat.com>
9315
9316 * po/gold.pot: Updated by the Translation project.
9317
9318 2009-09-08 Cary Coutant <ccoutant@google.com>
9319
9320 * output.cc (Output_file::open): Add execute permission to empty file.
9321 * testsuite/Makefile.am (permission_test): New test.
9322 * testsuite/Makefile.in: Regenerate.
9323
9324 2009-09-02 Ian Lance Taylor <iant@google.com>
9325
9326 * output.cc (Output_file::resize): Call map_no_anonymous rather
9327 than map.
9328
9329 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9330
9331 * gold.cc: Include "incremental.h".
9332 (queue_initial_tasks): Call Incremental_checker methods.
9333 * incremental.cc: Include "output.h".
9334 (Incremental_checker::can_incrementally_link_output_file): New
9335 method.
9336 * incremental.h (Incremental_checker): New class.
9337
9338 * output.cc (Output_file::open_for_modification): New method.
9339 (Output_file::map_anonymous): Changed return type to bool. Record
9340 map in base_ field.
9341 (Output_file::map_no_anonymous): New method, broken out of map.
9342 (Output_file::map): Use map_no_anonymous and map_anonymous.
9343 * output.h (class Output_file): Update declarations.
9344
9345 2009-08-24 Cary Coutant <ccoutant@google.com>
9346
9347 * options.h (Command_line::Pre_options): New class.
9348 (Command_line::pre_options): New member.
9349 * options.cc (gold::options::ready_to_register): New variable.
9350 (One_option::register_option): Do nothing if not registering options.
9351 Assert if same short option registered twice.
9352 (General_options::General_options): Turn off option registration when
9353 done constructing.
9354 (Command_line::Pre_options::Pre_options): New constructor.
9355
9356 2009-08-24 Cary Coutant <ccoutant@google.com>
9357
9358 * options.h (General_options::no_keep_memory): Remove incorrect
9359 short option.
9360
9361 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9362
9363 * Makefile.am (am__skiplex, am__skipyacc): New.
9364 * Makefile.in: Regenerate.
9365
9366 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9367
9368 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9369 (INCLUDES): ... this.
9370 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9371 (AM_CPPFLAGS): Renamed from ...
9372 (INCLUDE): ... this.
9373 * Makefile.in, testsuite/Makefile.in: Regenerate.
9374
9375 * Makefile.in: Regenerate.
9376 * aclocal.m4: Likewise.
9377 * config.in: Likewise.
9378 * configure: Likewise.
9379 * testsuite/Makefile.in: Likewise.
9380
9381 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9382 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9383 * Makefile.in: Regenerate.
9384 * testsuite/Makefile.in: Regenerate.
9385
9386 2009-08-19 Cary Coutant <ccoutant@google.com>
9387
9388 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9389 symbols in shared libraries overridden by hidden or internal symbols
9390 in the main program.
9391
9392 2009-08-19 Chris Demetriou <cgd@google.com>
9393
9394 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9395 checking source file names in error messages.
9396
9397 2009-08-18 Doug Kwan <dougkwan@google.com>
9398
9399 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9400 an elcpp::Ehdr as parameter. Adjust call to set_target.
9401 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9402 an elfcpp::Ehdr as parameter.
9403 * object.cc (Object::set_target): Remove the version that looks up
9404 a target and sets it.
9405 (Sized_relobj::setup): Take a Target object instead of
9406 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9407 (make_elf_sized_object): Find target and ask target to
9408 make an ELF object.
9409 * object.h: (Object::set_target): Remove the version that looks up
9410 a target and sets it.
9411 (Sized_relobj::setup): Take a Target object instead of
9412 an elfcpp:Ehdr as parameter.
9413 * target.cc: Include dynobj.h.
9414 (Target::do_make_elf_object_implementation): New.
9415 (Target::do_make_elf_object): New.
9416 * target.h (Target::make_elf_object): New template declaration.
9417 (Target::do_make_elf_object): New method declarations.
9418 (Target::do_make_elf_object_implementation): New template declaration.
9419
9420 2009-08-14 Ian Lance Taylor <iant@google.com>
9421
9422 * gold.h (FUNCTION_NAME): Define.
9423 (gold_unreachable): Use FUNCTION_NAME.
9424
9425 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9426
9427 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9428 symbol in the --keep-unique list is not found.
9429
9430 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9431
9432 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9433 been maked as --keep-unique.
9434 (Icf::unfold_section): New function.
9435 * icf.h (Icf::unfold_section): New function.
9436 * options.h (General_options::keep_unique): New option.
9437 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9438 * testsuite/Makefile.in: Regenerate.
9439 * testsuite/icf_keep_unique_test.sh: New file.
9440 * testsuite/icf_keep_unique_test.cc: New file.
9441
9442 2009-08-12 Cary Coutant <ccoutant@google.com>
9443
9444 PR 10471
9445 * resolve.cc (Symbol_table::resolve): Check for references from
9446 dynamic objects to hidden and internal symbols.
9447 * testsuite/Makefile.am (hidden_test.sh): New test.
9448 * testsuite/Makefile.in: Regenerate.
9449 * testsuite/hidden_test.sh: New script.
9450 * testsuite/hidden_test_1.c: New test source.
9451 * testsuite/hidden_test_main.c: New test source.
9452
9453 2009-08-11 Doug Kwan <dougkwan@google.com>
9454
9455 * arm.cc: Update comments.
9456 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9457 segment to locate the .ARM.exidx section if present.
9458
9459 2009-08-09 Doug Kwan <dougkwan@google.com>
9460
9461 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9462 patch.
9463
9464 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9465 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9466 compiler warnings.
9467
9468 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9469
9470 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9471 valid tls_segment only for non-debug-section relocations.
9472 * testsuite/Makefile.am: Add gc_tls_test.
9473 * testsuite/Makefile.in: Regenerate.
9474 * testsuite/gc_tls_test.cc: New file.
9475 * testsuite/gc_tls_test.sh: New file.
9476
9477 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9478
9479 * icf.cc: New file.
9480 * icf.h: New file.
9481 * Makefile.am (CCFILES): Add icf.cc.
9482 (HFILES): Add icf.h
9483 * Makefile.in: Regenerate.
9484 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9485 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9486 section, symbol and addend information for the relocs.
9487 * gold.cc (queue_middle_tasks): Call identical code folding.
9488 * gold.h: Add defines for multimap.
9489 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9490 to the call of finalize_local_symbols.
9491 * main.cc (main): Create object of class Icf.
9492 * object.cc (Sized_relobj::do_layout): Allow this function to be
9493 called twice during icf.
9494 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9495 to sections marked as identical by icf.
9496 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9497 when available.
9498 (Sized_relobj::do_section_entsize): New function.
9499 * object.h (Object::section_entsize): New function.
9500 (Object::do_section_entsize): New pure virtual function.
9501 (Relobj::finalize_local_symbols): Add new parameter.
9502 (Relobj::do_section_entsize): New function.
9503 * options.h (General_options::icf): New option.
9504 (General_options::icf_iterations): New option.
9505 (General_options::print_icf_sections): New option.
9506 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9507 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9508 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9509 icf.
9510 * symtab.cc (Symbol_table::is_section_folded): New function.
9511 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9512 to sections marked as identical by icf.
9513 * symtab.h (Symbol_table::set_icf): New function.
9514 (Symbol_table::icf): New function.
9515 (Symbol_table::is_section_folded): New function.
9516 (Symbol_table::icf_): New data member.
9517 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9518 * testsuite/Makefile.am: Add commands to build icf_test.
9519 * testsuite/Makefile.in: Regenerate.
9520 * testsuite/icf_test.sh: New file.
9521 * testsuite/icf_test.cc: New file.
9522
9523 2009-07-24 Chris Demetriou <cgd@google.com>
9524
9525 * layout.cc (is_compressible_debug_section): Fix incorrect
9526 comment about compressed section names.
9527
9528 2009-07-20 Ian Lance Taylor <ian@airs.com>
9529
9530 PR 10419
9531 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9532
9533 2009-07-16 Ian Lance Taylor <iant@google.com>
9534
9535 PR 10400
9536 * layout.h: #include <map>.
9537 (class Kept_section): Change from struct to class. Add accessors
9538 and setters. Add section size to Comdat_group mapping. Change
9539 Comdat_group to std::map. Add is_comdat_ field. Add
9540 linkonce_size field in union.
9541 (class Layout): Update declaration of find_or_add_kept_section.
9542 Don't declare find_kept_object.
9543 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9544 parameter. Add object, shndx, is_comdat, and is_group_name
9545 parameters. Change all callers. Adjust for new Kept_section.
9546 (Layout::find_kept_object): Remove.
9547 * object.cc (Sized_relobj::include_section_group): Update use of
9548 Kept_section. Rename secnum to shndx. Only record
9549 Kept_comdat_section if sections are the same size.
9550 (Sized_relobj::include_linkonce_section): Update use of
9551 Kept_section. Only record Kept_comdat_section if sections are the
9552 same size. Set size of linkonce section.
9553 (Sized_relobj::map_to_kept_section): Update call to
9554 get_kept_comdat_section.
9555 * object.h (class Sized_relobj): Rename fields in
9556 Kept_comdat_section to drop trailing underscores; change object
9557 field to Relobj*. Change Kept_comdat_section_table to store
9558 struct rather than pointer.
9559 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9560 Add kept_object and kept_shndx parameters. Change all callers.
9561 (Sized_relobj::get_kept_comdat_section): Change return type to
9562 bool. Add kept_object and kept_shndx parameters. Change all
9563 callers.
9564 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9565 Layout::find_or_add_kept_section.
9566
9567 2009-07-09 Ian Lance Taylor <iant@google.com>
9568
9569 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9570 Reserve space in the hash table.
9571
9572 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9573
9574 * fileread.cc (File_read::get_mtime): New method.
9575 * fileread.h (Timespec): New structure.
9576 (File_read::get_mtime): New method.
9577 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9578 Renamed from timestamp_nsec.
9579 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9580 Elf_Xword.
9581 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
9582 timestamp_nsec.
9583 (Incremental_inputs::report_archive): Save mtime; style fix.
9584 (Incremental_inputs::report_obejct): Save mtime; style fix.
9585 (Incremental_inputs::report_script): Save mtime; style fix.
9586 (Incremental_inputs::finalize_inputs): Style fix.
9587 (Incremental_inputs::finalize): Style fix.
9588 (Incremental_inputs::create_input_section_data): Store inputs
9589 mtime.
9590 * incremental.h (Incremental_inputs::report_script): Add mtime
9591 argument.
9592 (Incremental_inputs::Input_info::Input_info): Intialize only one
9593 union member.
9594 (Incremental_inputs::Input_info::archive): Move to nameless
9595 union.
9596 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9597 (Incremental_inputs::Input_info::script): Move to nameless union.
9598 (Incremental_inputs::mtime): New field.
9599 * script.cc (read_input_script): Pass file mtime to
9600 Incremental_input.
9601 * script.h (Script_info::inputs): Style fix.
9602
9603 2009-07-01 Ian Lance Taylor <ian@airs.com>
9604
9605 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9606 instead of 32.
9607
9608 2009-06-24 Ian Lance Taylor <iant@google.com>
9609
9610 PR 10156
9611 * layout.cc (Layout::choose_output_section): If we find an
9612 existing section, update the flags.
9613 (Layout::create_notes): New function, broken out of
9614 Layout::finalize.
9615 (Layout::finalize): Don't create note sections.
9616 (Layout::create_note): Don't crash if linker script discards
9617 section.
9618 (Layout::create_gold_note): Likewise.
9619 (Layout::create_build_id): Likewise. Don't set
9620 after_input_sections on the section.
9621 (Layout::create_executable_stack_info): Remove target parameter.
9622 Change caller.
9623 * layout.h (class Layout): Declare create_notes. Update
9624 declaration of create_executable_stack_info.
9625 * gold.cc (queue_middle_tasks): Call create_notes.
9626 * output.cc (Output_section::update_flags_for_input_section): Move
9627 here from output.h. If SHF_ALLOC flag is newly set, mark address
9628 invalid.
9629 * output.h (Output_data::mark_address_invalid): New function.
9630 (class Output_section): Only declare, not define,
9631 update_flags_for_input_section. Remove set_flags.
9632
9633 2009-06-24 Ian Lance Taylor <iant@google.com>
9634
9635 * script-sections.cc (Output_section_definition::
9636 set_section_addresses): Rename shadowing local load_address to
9637 laddr.
9638
9639 2009-06-24 Ian Lance Taylor <iant@google.com>
9640
9641 PR 10244
9642 * reloc.cc (relocate_sections): Skip empty relocation sections.
9643
9644 2009-06-23 Ian Lance Taylor <iant@google.com>
9645
9646 PR 10156
9647 * layout.cc (Layout::create_note): Use choose_output_section
9648 rather than make_output_section.
9649
9650 2009-06-23 Ian Lance Taylor <iant@google.com>
9651
9652 PR 10237
9653 * options.cc (General_options::parse_V): Set printed_version_.
9654 (General_options::General_options): Initialize printed_version_.
9655 * options.h (class General_options): Add printed_version_ field.
9656 * gold.cc (queue_initial_tasks): If there are no input files,
9657 don't give a fatal error if we printed the version information.
9658 (queue_middle_tasks): If using -r with a shared object, give a
9659 fatal error rather than an ordinary error.
9660
9661 2009-06-23 Ian Lance Taylor <iant@google.com>
9662
9663 PR 10219
9664 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9665 (Layout::make_output_section): Set have_stabstr_section_ if we see
9666 a .stab*str section.
9667 (Layout::finalize): Call link_stabs_sections.
9668 (Layout::link_stabs_sections): New file.
9669 * layout.h (class Layout): Add have_stabstr_section_ field.
9670 Declare link_stabs_sections.
9671
9672 2009-06-23 Doug Kwan <dougkwan@google.com>
9673
9674 * Makefile.am (libgold_a_LIBADD): New.
9675 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
9676 * Makefile.in: Regenerate.
9677 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9678 * configure: Regenerate.
9679 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9680 * fileread.cc: Include sys/state.h
9681 * gold.h: Declare memmem and strndup if found missing.
9682 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9683
9684 2009-06-23 Ian Lance Taylor <iant@google.com>
9685
9686 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9687 * configure: Rebuild.
9688
9689 2009-06-23 Ian Lance Taylor <iant@google.com>
9690
9691 PR 10147
9692 * object.cc (Object::section_contents): Don't try to get a view if
9693 the section has length zero.
9694 (Object::handle_gnu_warning_section): If the section is empty, use
9695 the name of the section as the warning.
9696
9697 2009-06-23 Ian Lance Taylor <iant@google.com>
9698
9699 PR 10133
9700 * stringpool.h (class Stringpool_template): Add optimize_ field.
9701 (Stringpool_template::set_optimize): New function.
9702 * stringpool.cc (Stringpool_template::Stringpool_template):
9703 Initialize optimize_ field.
9704 (Stringpool_template::set_string_offsets): Test local optimize
9705 fild rather than parameter.
9706 * layout.cc (Layout::Layout): Call set_optimize on the section
9707 name stringpool.
9708
9709 2009-06-22 Ian Lance Taylor <iant@google.com>
9710
9711 PR 10030
9712 * yyscript.y: Parse TARGET.
9713 * script.cc (script_set_target): New function.
9714 * script-c.h (script_set_target): Declare.
9715 * options.cc (General_options::string_to_object_format): Rename
9716 from string_to_object_format in anonymous namespace. Change
9717 callers.
9718 * options.h (class General_options): Declare
9719 string_to_object_format.
9720
9721 2009-06-22 Ian Lance Taylor <iant@google.com>
9722
9723 * script-sections.cc (Script_sections::create_segments): Don't put
9724 program headers in a PT_LOAD segment if -n or -N.
9725
9726 2009-06-22 Ian Lance Taylor <iant@google.com>
9727
9728 PR 10141
9729 * options.h (class General_options): Add -z lazy and -z now. Sort
9730 -z options into alphabetical order.
9731 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9732
9733 2009-06-21 Ian Lance Taylor <iant@google.com>
9734
9735 * layout.cc (Layout::make_output_section): Call
9736 Target::new_output_section.
9737 (Layout::attach_allocated_section_to_segment): Put large section
9738 sections in a separate load segment with the large segment flag
9739 set.
9740 (Layout::segment_precedes): Sort large data segments after other
9741 load segments.
9742 (align_file_offset): New static function.
9743 (Layout::set_segment_offsets): Use align_file_offset.
9744 * output.h (class Output_section): Add is_small_section_ and
9745 is_large_section_ fields.
9746 (Output_section::is_small_section): New function.
9747 (Output_section::set_is_small_section): New function.
9748 (Output_section::is_large_section): New function.
9749 (Output_section::set_is_large_section): New function.
9750 (Output_section::is_large_data_section): New function.
9751 (class Output_segment): Add is_large_data_segment_ field.
9752 (Output_segment::is_large_data_segment): New function.
9753 (Output_segment::set_is_large_data_segment): New function.
9754 * output.cc (Output_section::Output_section): Initialize new
9755 fields.
9756 (Output_segment::Output_segment): Likewise.
9757 (Output_segment::add_output_section): Add assertion that large
9758 data sections always go in large data segments. Force small data
9759 sections to the end of the list of data sections. Force small BSS
9760 sections to the start of the list of BSS sections. For large BSS
9761 sections to the end of the list of BSS sections.
9762 * symtab.h (class Symbol): Declare is_common_shndx.
9763 (Symbol::is_defined): Check Symbol::is_common_shndx.
9764 (Symbol::is_common): Likewise.
9765 (class Symbol_table): Define enum Commons_section_type. Update
9766 declarations. Add small_commons_ and large_commons_ fields.
9767 * symtab.cc (Symbol::is_common_shndx): New function.
9768 (Symbol_table::Symbol_table): Initialize new fields.
9769 (Symbol_table::add_from_object): Put small and large common
9770 symbols in the right list.
9771 (Symbol_table::sized_finalized_symbol): Check
9772 Symbol::is_common_shndx.
9773 (Symbol_table::sized_write_globals): Likewise.
9774 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9775 common symbol lists. Don't call do_allocate_commons_list if the
9776 list is empty.
9777 (Symbol_table::do_allocate_commons_list): Remove is_tls
9778 parameter. Add comons_section_type parameter. Change all
9779 callers. Handle small and large common symbols.
9780 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9781 Symbol::is_common_shndx.
9782 * resolve.cc (symbol_to_bits): Likewise.
9783 * target.h (Target::small_common_shndx): New function.
9784 (Target::small_common_section_flags): New function.
9785 (Target::large_common_shndx): New function.
9786 (Target::large_common_section_flags): New function.
9787 (Target::new_output_section): New function.
9788 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9789 small_common_section_flags, and large_common_section_flags
9790 fields.
9791 (Target::do_new_output_section): New virtual function.
9792 * arm.cc (Target_arm::arm_info): Initialize new fields.
9793 * i386.cc (Target_i386::i386_info): Likewise.
9794 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9795 Likewise.
9796 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9797 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9798 (Target_x86_64::do_new_output_section): New function.
9799 * configure.ac: Define conditional MCMODEL_MEDIUM.
9800 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9801 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9802 (large_LDFLAGS): Define.
9803 * testsuite/large.c: New file.
9804 * testsuite/testfile.cc (Target_test::test_target_info):
9805 Initialize new fields.
9806 * configure, testsuite/Makefile.in: Rebuild.
9807
9808 2009-06-05 Doug Kwan <dougkwan@google.com>
9809
9810 * Makefile.am (CCFILES): Add target.cc.
9811 * Makefile.in: Regenerate.
9812 * i386.cc (class Target_i386): Define new virtual method to
9813 override do_is_local_label_name in parent.
9814 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9815 local symbols if --discard-locals or -X is given.
9816 * options.h (class General_options): Declare new options
9817 '--discard-locals' and '-X' for discarding locals.
9818 * target.h (class Target): Define new methods is_local_label_name.
9819 Declare new virtual method do_is_local_label_name.
9820 * target.cc: New file.
9821 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9822 (check_SCRIPTS): Add discard_locals_test.sh.
9823 (check_DATA): Add discard_local_tests.syms.
9824 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9825 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9826 * testsuite/Makefile.in: Regenerate.
9827 * testsuite/discard_locals_test.c: New file.
9828 * testsuite/discard_locals_test.sh: Same.
9829
9830 2009-06-05 Doug Kwan <dougkwan@google.com>
9831
9832 * object.cc (Sized_relobj::Sized_relobj): Initialize
9833 discarded_eh_frame_shndx_ to -1U.
9834 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9835 section.
9836 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9837 a discarded .eh_frame section.
9838 (Sized_relobj::do_finalize_local_symbols): Ditto.
9839 * object.h (class Sized_relobj): Declare new member
9840 discarded_eh_frame_shndx_.
9841 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9842 (local_labels_test.o, local_labels_test): New rules.
9843 * testsuite/Makefile.in: Regenerate.
9844
9845 2009-06-04 Doug Kwan <dougkwan@google.com>
9846
9847 * layout.cc (Layout::section_name_mapping): Add mapping for
9848 special ARM sections.
9849
9850 2009-06-03 Doug Kwan <dougkwan@google.com>
9851
9852 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9853 (utils::has_overflow): Same.
9854
9855 2009-06-03 Ian Lance Taylor <iant@google.com>
9856
9857 * layout.cc (Layout::section_name_mapping): New array, replacing
9858 Layout::linkonce_mapping.
9859 (Layout::section_name_mapping_count): New variable, replacing
9860 Layout::linkonce_mapping_count.
9861 (Layout::linkonce_output_name): Remove.
9862 (Layout::output_section_name): Rewrite.
9863 * layout.h (class Layout): Rename Linkonce_mapping to
9864 Section_name_mapping, linkonce_mapping to section_name_mapping,
9865 linkonce_mapping_count to section_name_mapping_count. Don't
9866 declare linkonce_output_name.
9867
9868 2009-06-03 Doug Kwan <dougkwan@google.com>
9869
9870 * gold/arm.cc (namespace utils): New.
9871 (Target_arm::reloc_is_non_pic): Define new method.
9872 (class Arm_relocate_functions): New.
9873 (Target_arm::Relocate::relocate): Handle relocation types used by
9874 Android.
9875
9876 2009-06-03 Ian Lance Taylor <iant@google.com>
9877
9878 * arm.cc (Target_arm::scan::global): Use || instead of |.
9879
9880 2009-06-02 Doug Kwan <dougkwan@google.com>
9881
9882 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9883 issued_non_pic_error_.
9884 (class Target_arm::Scan): Declare new method check_non_pic.
9885 Define new method symbol_needs_plt_entry.
9886 Declare new data member issued_non_pic_error_.
9887 (class Target_arm::Relocate): Declare new method
9888 should_apply_static_reloc.
9889 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9890 (Target_arm::Scan::check_non_pic): Define new method.
9891 (Target_arm::Scan::local): Handle a small subset of reloc types used
9892 by Android.
9893 (Target_arm::Scan::local): Same.
9894 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9895
9896 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9897
9898 * incremental.cc (Incremental_inputs::report_command_line): Filter
9899 out --incremental-* options.
9900
9901 2009-05-29 Doug Kwan <dougkwan@google.com>
9902
9903 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9904 template class.
9905 (class Target_arm): Update comment.
9906 (Target_arm::Target_arm): Initialize new data members GOT_,
9907 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9908 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9909 and Target_arm::rel_dyn_section.
9910 Declare new_enum Target_arm::Got_type.
9911 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9912 and DYNBSS_.
9913 Update commments for member do_dynsym_value.
9914 (Target_arm::got_size, Target_arm::plt_section,
9915 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9916 new methods inside class defintion.
9917 (Target_arm::got_section): Define new method.
9918 (Target_arm::rel_dyn_section): Same.
9919 (Output_data_plt_arm): New template class.
9920 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9921 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9922 (Output_data_plt_arm::add_entry): Same.
9923 (Output_data_plt_arm::first_plt_entry): Define new
9924 static data member for PLT instruction template.
9925 (Output_data_plt_arm::plt_entry): Same.
9926 (Output_data_plt_arm::do_write): Define new method.
9927 (Target_arm::make_plt_entry): Same.
9928 (Target_arm::do_finalize_sections): Same.
9929 (Target_arm::do_dynsym_value): Same.
9930
9931 2009-05-28 Doug Kwan <dougkwan@google.com>
9932
9933 * Makefile.am (TARGETSOURCES): Add arm.cc.
9934 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9935 * Makefile.in: Regenerate.
9936 * arm.cc: New file.
9937 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9938
9939 2009-05-26 Doug Kwan <dougkwan@google.com>
9940
9941 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9942 (General_options::check_excluded_libs): Strip off directories in
9943 archive name before matching like GNU ld does.
9944 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9945 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9946 (exclude_libs_test_LDFLAGS): Add linker option
9947 -Wl,--exclude-libs,libexclude_libs_test_3
9948 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9949 an explicit archive without using -l.
9950 (alt/libexclude_libs_test_3.a): New make rule.
9951 * testsuite/Makefile.in: Regenerate.
9952 * testsuite/exclude_libs_test.c : Declare lib3_default().
9953 (main): Call it.
9954 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9955 * exclude_libs_test_3.c: New file.
9956
9957 2009-05-26 Nick Clifton <nickc@redhat.com>
9958
9959 * po/id.po: New Indonesian translation.
9960 * po/gold.pot: Updated template file.
9961
9962 2009-05-22 Sriraman Tallam <tmsriram@google.com>
9963
9964 * testsuite/Makefile.am: Add -ffunction-sections to compile
9965 gc_comdat_test files. Add -Wl,--gc-sections to build
9966 gc_comdat_test.
9967 * testsuite/Makefile.in: Regenerate.
9968 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9969
9970 2009-05-21 Sriraman Tallam <tmsriram@google.com>
9971
9972 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9973 kept comdat section was garbage collected.
9974 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9975 * testsuite/Makefile.in: Regenerate.
9976 * testsuite/gc_comdat_test.sh: New file.
9977 * testsuite/gc_comdat_test_1.cc: New file.
9978 * testsuite/gc_comdat_test_2.cc: New file.
9979
9980 2009-05-19 Doug Kwan <dougkwan@google.com>
9981
9982 * archive.cc (Archive::Archive): Move constructor from archive.h
9983 to here. Initialize no_export_.
9984 (Archive::get_elf_object_for_member): Set no_export flag of object.
9985 * archive.h (Archive::Archive): Move constructor body to
9986 archive.cc.
9987 (Archive::no_export): New method.
9988 (Archive::no_export_): New field.
9989 * object.h (Object::Object): Initialize no_export_ to false.
9990 (Object::no_export, Object::set_no_export): New methods.
9991 (Object::no_export_): New field.
9992 * options.cc (General_options::parse_exclude_libs): New method.
9993 (General_options::check_excluded_libs) Same.
9994 * options.h (exclude_libs): New option.
9995 (General_options::check_excluded_libs): New method declaration.
9996 (General_options::excluded_libs_): New field.
9997 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9998 default or protected visibility if an object has no-export flag set.
9999 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10000 (check_SCRIPTS): Add exclude_libs_test.sh.
10001 (check_DATA): Add exclude_libs_test.syms.
10002 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10003 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10004 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10005 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10006 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10007 libexclude_libs_test_2.a): New rules.
10008 * testsuite/Makefile.in: Regenerate.
10009 * testsuite/exclude_libs_test.c: New file.
10010 * testsuite/exclude_libs_test.sh: Ditto.
10011 * testsuite/exclude_libs_test_1.c: Ditto.
10012 * testsuite/exclude_libs_test_2.c: Ditto.
10013
10014 2009-05-15 Ian Lance Taylor <iant@google.com>
10015
10016 * configure.ac: Check for declarations for cases where libiberty.h
10017 checks HAVE_DECL_xxx.
10018 * configure, config.in: Rebuild.
10019
10020 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10021
10022 * gold.h (Incremental_argument_list): Remove (invalid) forward
10023 declaration.
10024 * incremental.cc (Incremental_inputs::report_achive): New method.
10025 (Incremental_inputs::report_object): New method.
10026 (Incremental_inputs::report_script): New method.
10027 (Incremental_inputs::finalize_inputs): New method.
10028 (Incremental_inputs::finalize): Call finalize_inputs().
10029 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10030 Create inputs entries.
10031 * incremental.h (Incremental_input_type): New enum.
10032 (Incremental_inputs::Incremental_input): Initialize new fields.
10033 (Incremental_inputs::report_inputs): New method.
10034 (Incremental_inputs::report_achive): New method.
10035 (Incremental_inputs::report_object): New method.
10036 (Incremental_inputs::report_script): New method.
10037 (Incremental_inputs::finalize_inputs): New method.
10038 (Incremental_inputs::Input_info): New struct.
10039 (Incremental_inputs::Input_info_map): New typedef.
10040 (Incremental_inputs::lock_): New field.
10041 (Incremental_inputs::Inputs_): New field.
10042 (Incremental_inputs::Inputs_map): New field.
10043 * main.cc (main): Call Incremental_input::report_inputs.
10044 * options.h (Input_argument_list): Typedef moved from
10045 Input_arguments.
10046 (Input_file_group::Files): Remove, use ::Input_argument_list.
10047 (Input_file_group::Input_argument_list): Remove, use
10048 ::Input_argument_list.
10049 * plugin.cc (Plugin_manager::add_input_file): Add error in
10050 incremental build.
10051 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10052 functions.
10053 * script.cc (read_input_script): Call
10054 Incremental_input::report_script.
10055 * script.h (Script_info): New class.
10056
10057 2009-04-27 Ian Lance Taylor <iant@google.com>
10058
10059 * x86_64.cc (do_adjust_output_section): Set entsize to
10060 plt_entry_size.
10061
10062 2009-04-23 Elliott Hughes <enh@google.com>
10063
10064 * output.cc (Output_file::close): After short writes, continue
10065 writing from the correct offset in the buffer being written.
10066
10067 2009-04-23 Chris Demetriou <cgd@google.com>
10068
10069 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10070 * configure: Regenerate.
10071 * config.in: Regenerate.
10072 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10073 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10074
10075 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10076
10077 * incremental.cc (Incremental_inputs_header_data): Renamed from
10078 Incremental_input_header_data.
10079 (Incremental_inputs_header_data::data_size): New field.
10080 (Incremental_inputs_header_data::put_input_file_count): Renamed
10081 from input_file_count.
10082 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10083 from command_line_offset.
10084 (Incremental_inputs_header_data::put_reserved): Renamed from
10085 put_reserved.
10086 (Incremental_inputs_entry_data): Renamed from
10087 Incremental_input_entry_data.
10088 (Incremental_inputs_entry_data::data_size): New field.
10089 (Incremental_inputs::report_command_line): New method.
10090 (Incremental_inputs::finalize): New method.
10091 (Incremental_inputs::create_incremental_inputs_data): New method.
10092 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10093 * incremental.h: New file.
10094 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10095 (Layout::finalize): Create incremental inputs section in
10096 incremental builds.
10097 (Layout::create_incremental_info_sections): New method.
10098 * layout.h (Layout::incremental_inputs): New method.
10099 (Layout::create_incremental_info_sections): New method.
10100 (Layout::incremental_inputs_): New field.
10101 * main.cc (main): Notify Incremental_input of the command line.
10102
10103 2009-04-01 Ian Lance Taylor <iant@google.com>
10104 Mikolaj Zalewski <mikolajz@google.com>
10105
10106 * gold.h (reserve_unordered_map): Define, three versions, one for
10107 each version of Unordered_map.
10108 * layout.cc (Layout::Layout): Remove options parameter. Add
10109 number_of_input_files parameter. Don't initialize options_.
10110 Initialize number_of_input_files_ and resized_signatures_. Move
10111 sections_are_attached_.
10112 (Layout::layout_group): Reserve space for group_signatures_.
10113 (Layout::find_or_add_kept_section): Change name parameter to be a
10114 reference. Resize signatures_ map when it gets large enough.
10115 (Layout::layout_eh_frame): Use parameters->options() instead of
10116 this->options_.
10117 (Layout::make_output_section): Likewise.
10118 (Layout::attach_allocated_section_to_segment): Likewise.
10119 (Layout::finalize, Layout::create_executable_stack): Likewise.
10120 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10121 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10122 * layout.h (class Layout): Update declarations. Remove options_
10123 field. Add number_of_input_files_ and resized_signatures_
10124 fields. Move sections_are_attached_ field.
10125 * main.cc (main): Pass number of input files to Layout
10126 constructor. Don't pass options.
10127
10128 2009-03-30 Ian Lance Taylor <iant@google.com>
10129
10130 * ffsll.c (ffsll): Correct implementation.
10131
10132 2009-03-27 Ian Lance Taylor <iant@google.com>
10133
10134 * ffsll.c: New file.
10135 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10136 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10137 * ftruncate.c (ftruncate): Declare before definition.
10138 * mremap.c (mremap): Likewise.
10139 * pread.c (pread): Likewise.
10140 * configure, Makefile.in, config.in: Rebuild.
10141
10142 * mremap.c: New file.
10143 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10144 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10145 (mremap): Declare if HAVE_MREMAP is not defined.
10146 * configure, Makefile.in, config.in: Rebuild.
10147
10148 2009-03-27 Cary Coutant <ccoutant@google.com>
10149
10150 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10151 position independent.
10152 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10153 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10154
10155 2009-03-24 Cary Coutant <ccoutant@google.com>
10156
10157 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10158 an executable.
10159 (needs_dynamic_reloc): Likewise.
10160
10161 2009-03-24 Ian Lance Taylor <iant@google.com>
10162
10163 * yyscript.y (file_cmd): Recognize EXTERN.
10164 (extern_name_list, extern_name_list_body): New nonterminals.
10165 * script.cc (script_add_extern): Define.
10166 * script-c.h (script_add_extern): Declare.
10167
10168 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10169
10170 * object.cc (is_elf_object): Define.
10171 * object.h (is_elf_object): Declare.
10172 * archive.cc (Archive::get_elf_object_for_member): Call
10173 is_elf_object.
10174 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10175
10176 2009-03-24 Elliott Hughes <enh@google.com>
10177
10178 * output.cc (Output_file::map_anonymous): Define.
10179 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10180 try an anonymous one. Report the size if the mmap fails.
10181 * output.h (class Output_file): Declare map_anonymous.
10182
10183 2009-03-24 Ian Lance Taylor <iant@google.com>
10184
10185 * target-select.cc (instantiate_target): Don't acquire the lock if
10186 the instantiated_target_ field has already been set.
10187
10188 2009-03-23 Ian Lance Taylor <iant@google.com>
10189
10190 * gold-threads.h (class Initialize_lock): Define.
10191 * gold-threads.cc (class Initialize_lock_once): Define.
10192 (initialize_lock_control): New static variable.
10193 (initialize_lock_pointer): New static variable.
10194 (initialize_lock_once): New static function.
10195 (Initialize_lock::Initialize_lock): Define.
10196 (Initialize_lock::initialize): Define.
10197 * target-select.h: Include "gold-threads.h".
10198 (class Target_selector): Add lock_ and initialize_lock_ fields.
10199 Don't define instantiate_target, just declare it.
10200 * target-select.cc (Target_selector::Target_selector): Initialize
10201 new fields.
10202 (Target_selector::instantiate_target): Define.
10203 * descriptors.h: Include "gold-threads.h".
10204 (class Descriptors): Add initialize_lock_ field.
10205 * descriptors.cc (Descriptors::Descriptors): Initialize new
10206 field.
10207 (Descriptors::open): Use initialize_lock_ field
10208 * errors.h (class Errors): Add initialize_lock_ field.
10209 * errors.cc (Errors::Errors): Initialize new field.
10210 (Errors::initialize_lock): Use initialize_lock_ field.
10211 * powerpc.cc (class Target_selector_powerpc): Remove
10212 instantiated_target_ field. In do_recognize call
10213 instantiate_target rather than do_instantiate_target. In
10214 do_instantiate_target just allocate a new target.
10215 * sparc.cc (class Target_selector_sparc): Likewise.
10216
10217 * freebsd.h: New file.
10218 * i386.cc: Include "freebsd.h".
10219 (Target_i386): Derive from Target_freebsd rather than
10220 Sized_target.
10221 (Target_selector_i386): Derive from Target_selector_freebsd rather
10222 than Target_selector.
10223 * x86_64.cc: Include "freebsd.h".
10224 (Target_x86_64): Derive from Target_freebsd rather than
10225 Sized_target.
10226 (Target_selector_x86_64): Derive from Target_selector_freebsd
10227 rather than Target_selector.
10228 * target.h (class Target): Add adjust_elf_header and
10229 do_adjust_elf_header.
10230 * output.cc (Output_file_header:: do_sized_write): Call target
10231 adjust_elf_header routine.
10232 * configure.tgt: Set targ_osabi.
10233 * configure.ac: Define GOLD_DEFAULT_OSABI.
10234 * parameters.cc (Parameters::default_target): Pass
10235 GOLD_DEFAULT_OSABI to select_target.
10236 * target-select.h (class Target_selector): Make instantiate_target
10237 protected rather than private.
10238 * Makefile.am (HFILES): Add freebsd.h.
10239 * configure, Makefile.in, config.in: Rebuild.
10240
10241 * merge.cc (do_add_input_section): Correct pend value. Change
10242 message about last entry not being null terminated from error to
10243 warning.
10244
10245 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10246
10247 * incremental.cc: New file.
10248 * Makefile.am (CCFILES): Add incremental.cc.
10249 * Makefile.in: Rebuild.
10250
10251 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10252
10253 * layout.cc (Layout::output_section_name): Preserve names
10254 of '.note.' sections.
10255
10256 2009-03-19 Ian Lance Taylor <iant@google.com>
10257
10258 * descriptors.cc (Descriptors::open): Check that the options are
10259 valid before using them.
10260
10261 2009-03-18 Ian Lance Taylor <iant@google.com>
10262
10263 * script-sections.h: Include <list>.
10264 (class Script_sections): Change Sections_elements from std::vector
10265 to std::list. Typedef public Elements_iterator. Add
10266 orphan_section_placement_, data_segment_align_start_, and
10267 saw_data_segment_align_ fields. Remove data_segment_align_index_
10268 field.
10269 * script-sections.cc (class Orphan_section_placement): New class.
10270 (class Sections_element): Add virtual functions is_relro and
10271 orphan_section_init. Remove virtual function place_orphan_here.
10272 (class Output_section_definition): Add is_relro and
10273 orphan_section_init. Remove place_orphan_here.
10274 (class Orphan_output_section): Likewise.
10275 (Script_sections::Script_sections): Update for field changes.
10276 (Script_sections::data_segment_align): Set saw_data_segment_align_
10277 and data_segment_align_start_, not data_segment_align_index.
10278 (Script_sections::data_segment_relro_end): Check
10279 saw_data_segment_align_. Use data_segment_align_start_ rather
10280 than data_segment_align_index_.
10281 (Script_sections::place_orphan): Rewrite to use
10282 Orphan_section_placement.
10283
10284 2009-03-17 Ian Lance Taylor <iant@google.com>
10285
10286 * archive.cc (Archive::add_symbols): Check for a version attached
10287 to the symbol name in the archive map.
10288 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10289 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10290 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10291 (ver_test_11.a): New target.
10292 * testsuite/Makefile.in: Rebuild.
10293
10294 * configure.ac: Check for chsize and posix_fallocate. Replace
10295 ftruncate.
10296 * ftruncate.c: New file, from gnulib.
10297 * output.cc (posix_fallocate): Define dummy version if not
10298 HAVE_POSIX_FALLOCATE.
10299 (Output_file::map): Call posix_fallocate rather than lseek and
10300 write.
10301 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10302 * configure, Makefile.in, config.in: Rebuild.
10303
10304 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10305
10306 * layout.h (Layout::create_note): Add section_name parameter.
10307 * layout.cc (Layout::create_note): Likewise.
10308 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10309
10310 2009-03-17 Ian Lance Taylor <iant@google.com>
10311
10312 * descriptors.cc: Include "options.h".
10313 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10314 (Descriptors::open): Always use O_CLOEXEC when opening a new
10315 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10316 then set FD_CLOEXEC.
10317
10318 * sparc.cc (class Target_sparc): Add has_got_section.
10319 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10320 make sure we have a GOT section.
10321
10322 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10323 (Target_sparc::Scan::local): Likewise.
10324 (Target_sparc::Scan::global): Likewise.
10325 (Target_sparc::Relocate::relocate): Likewise.
10326 (Target_sparc::Relocate::relocate_tls): Likewise.
10327
10328 * symtab.cc (Symbol_table::define_default_version): New function,
10329 broken out of add_from_object.
10330 (Symbol_table::add_from_object): Call define_default_version.
10331 (Symbol_table::define_special_symbol): Add resolve_oldsym
10332 parameter. Change all callers. If the version for a symbol comes
10333 from a version script, resolve it with the symbol with the same
10334 name with no version. Also add the symbol without a version if
10335 appropriate.
10336 (do_define_in_output_data): If resolving with oldsym, don't delete
10337 sym.
10338 (do_define_in_output_segment): Likewise.
10339 (do_define_as_constant): Likewise.
10340 * symtab.h (class Symbol_table): Update declarations.
10341
10342 2009-03-13 Ian Lance Taylor <iant@google.com>
10343
10344 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10345 (Read_symbols::requeue): New function.
10346 (Read_symbols::do_read_symbols): If make_elf_object fails because
10347 the target type is not configured, and the file was searched for,
10348 issue a warning and retry with the next directory.
10349 (Add_symbols::run): If the file has an incompatible format, and
10350 it was searched for, requeue the Read_symbols task. On error,
10351 release the object.
10352 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10353 dirindex parameter to constructor. Change all callers. Declare
10354 incompatible_warning and requeue.
10355 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10356 input_argument_ and input_group_ fields. Add them to
10357 constructor. Change all callers.
10358 (class Read_script): Add dirindex_ field. Add it to constructor.
10359 Change all callers.
10360 * archive.cc (Archive::setup): Remove input_objects parameter.
10361 Change all callers.
10362 (Archive::get_file_and_offset): Likewise.
10363 (Archive::read_all_symbols): Likewise.
10364 (Archive::read_symbols): Likewise.
10365 (Archive::get_elf_object_for_member): Remove input_objects
10366 parameter. Add punconfigured parameter. Change all callers.
10367 (Archive::add_symbols): Change return type to bool. Check return
10368 value of include_member.
10369 (Archive::include_all_members): Likewise.
10370 (Archive::include_member): Change return type to bool. Return
10371 false if first included object has incompatible target. Set
10372 included_member_ field.
10373 (Add_archive_symbols::run): If add_symbols returns false, requeue
10374 Read_symbols task.
10375 * archive.h (class Archive): Add included_member_ field.
10376 Initialize it in constructor. Add input_file and searched_for
10377 methods. Update declarations.
10378 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10379 input_argument_ fields. Add them to constructor. Change all
10380 callers.
10381 * script.cc: Include "target-select.h".
10382 (class Parser_closure): Add skip_on_incompatible_target_ and
10383 found_incompatible_target_ fields. Add
10384 skip_on_incompatible_target parameter to constructor. Change all
10385 callers. Add methods skip_on_incompatible_target,
10386 clear_skip_on_incompatible_target, found_incompatible_target, and
10387 set_found_incompatible_target.
10388 (read_input_script): Add dirindex parameter. Change all callers.
10389 If parser finds an incompatible target, requeue Read_symbols
10390 task.
10391 (script_set_symbol): Clear skip_on_incompatible_target in
10392 closure.
10393 (script_add_assertion, script_parse_option): Likewise.
10394 (script_start_sections, script_add_phdr): Likewise.
10395 (script_check_output_format): New function.
10396 * script.h (read_input_script): Update declaration.
10397 * script-c.h (script_check_output_format): Declare.
10398 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10399 (ignore_cmd): Remove OUTPUT_FORMAT.
10400 * fileread.cc (Input_file::Input_file): Add explicit this.
10401 (Input_file::will_search_for): New function.
10402 (Input_file::open): Add pindex parameter. Change all callers.
10403 * fileread.h (class Input_file): Add input_file_argument method.
10404 Declare will_search_for. Update declarations.
10405 * object.cc (make_elf_object): Add punconfigured parameter.
10406 Change all callers.
10407 * object.h (class Object): Make input_file public. Add
10408 searched_for method.
10409 (make_elf_object): Update declaration.
10410 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10411 restart search.
10412 * dirsearch.h (class Dirsearch): Update declaration.
10413 * options.h (class General_options): Add --warn-search-mismatch.
10414 * parameters.cc (Parameters::is_compatible_target): New function.
10415 * parameters.h (class Parameters): Declare is_compatible_target.
10416 * workqueue.cc (Workqueue::add_blocker): New function.
10417 * workqueue.h (class Workqueue): Declare add_blocker.
10418
10419 * fileread.cc (Input_file::open): Remove options parameter.
10420 Change all callers.
10421 (Input_file::open_binary): Likewise.
10422 * script.cc (read_input_script): Likewise.
10423 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10424 options parameter from constructor. Change all callers.
10425 (class Read_script): Likewise.
10426 * fileread.h (class Input_file): Update declarations.
10427 * script.h (read_input_script): Update declaration.
10428
10429 2009-03-10 Nick Clifton <nickc@redhat.com>
10430
10431 * po/es.po: New Spanish translation.
10432
10433 2009-03-06 Cary Coutant <ccoutant@google.com>
10434
10435 * options.cc (parse_short_option): Keep dash_z from registering itself.
10436
10437 2009-03-03 Ian Lance Taylor <iant@google.com>
10438
10439 PR 9918
10440 * target-reloc.h (relocate_section): Pass output_section to
10441 relocate.
10442 * i386.cc (Target_i386::should_apply_static_reloc): Add
10443 output_section parameter. Change all callers.
10444 (Target_i386::Relocate::relocate): Add output_section parameter.
10445 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10446 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10447 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10448 * testsuite/two_file_shared.sh: New script.
10449 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10450 (check_DATA): Add two_file_shared.dbg.
10451 (two_file_shared.dbg): New target.
10452 * testsuite/Makefile.in: Rebuild.
10453
10454 2009-03-01 Ian Lance Taylor <iant@google.com>
10455
10456 * configure.ac: Check for byteswap.h.
10457 * configure: Rebuild.
10458 * config.in: Rebuild.
10459
10460 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10461
10462 * layout.cc (Layout::find_or_add_kept_section): New function.
10463 (Layout::add_comdat): Removed.
10464 * layout.h (struct Kept_section): Move out of class Layout.
10465 Remove trailing underscores from field names. Add group_sections
10466 field. Rename group_ field to is_group. Change all uses.
10467 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10468 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10469 comdat_groups_ field.
10470 (Sized_relobj::include_section_group): Use
10471 find_or_add_kept_section and Kept_section::group_sections.
10472 (Sized_relobj::include_linkonce_section): Likewise.
10473 * object.cc (class Sized_relobj): Don't define Comdat_group or
10474 Comdat_group_table. Remove find_comdat_group and
10475 add_comdat_group. Remove comdat_groups_ field.
10476 * plugin.cc (include_comdat_group): Use
10477 Layout::find_or_add_kept_section.
10478
10479 2009-02-28 Ian Lance Taylor <iant@google.com>
10480
10481 * README: --gc-sections and map files are now supported. Document
10482 some build requirements.
10483
10484 PR 6992
10485 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10486 relocatable link set the value of the section symbol to zero.
10487 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10488 relocatable link don't include the section address in the local
10489 symbol value.
10490
10491 2009-02-27 Ian Lance Taylor <iant@google.com>
10492
10493 PR 6811
10494 * options.h (class Search_directory): Add is_system_directory.
10495 (class General_options): Declare is_in_system_directory.
10496 * options.cc (get_relative_sysroot): Make static.
10497 (get_default_sysroot): Make static.
10498 (General_optoins::is_in_system_directory): New function.
10499 * fileread.cc (Input_file::is_in_system_directory): New function.
10500 * fileread.h (class Input_file): Declare is_in_system_directory.
10501 * object.h (class Object): Add is_in_system_directory.
10502 (class Input_objects): Remove system_library_directory_ field.
10503 * object.cc (Input_objects::add_object): Don't set
10504 system_library_directory_.
10505 (input_objects::found_in_system_library_directory): Remove.
10506 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10507 parameter. Change all callers.
10508 (Symbol_table::sized_write_globals): Likewise.
10509 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10510 Call Object::is_in_system_directory.
10511 * symtab.h (class Symbol_table): Update declarations.
10512
10513 PR 5990
10514 * descriptors.h (Open_descriptor): Add is_on_stack field.
10515 * descriptors.cc (Descriptors::open): If the descriptor is on the
10516 top of the stack, remove it. Initialize is_on_stack field.
10517 (Descriptors::release): Only add pod to stack if it is not on the
10518 stack already.
10519 (Descriptors::close_some_descriptor): Clear stack_next and
10520 is_on_stack fields.
10521
10522 PR 7091
10523 * output.cc (Output_section::find_starting_output_address): Rename
10524 from starting_output_address; add PADDR parameter; change return
10525 type.
10526 * output.h (class Output_section): Declare
10527 find_starting_output_address instead of starting_output_address.
10528 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10529 section symbol for which we can't find a merge section.
10530
10531 PR 9836
10532 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10533 hidden or internal, force the symbol to be local.
10534 * resolve.cc (Symbol::override_visibility): Define.
10535 (Symbol::override_base): Use override_visibility.
10536 (Symbol_table::resolve): Likewise.
10537 (Symbol::override_base_with_special): Likewise.
10538 (Symbol_table::override_with_special): If the visibility is hidden
10539 or internal, force the symbol to be local.
10540 * symtab.h (class Symbol): Add set_visibility and
10541 override_visibility.
10542 * testsuite/ver_test_1.sh: New file.
10543 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10544 (check_DATA): Add ver_test_1.syms.
10545 (ver_test_1.syms): New target.
10546 * testsuite/Makefile.in: Rebuild.
10547
10548 2009-02-25 Cary Coutant <ccoutant@google.com>
10549
10550 * layout.cc (Layout::choose_output_section): Don't rename sections
10551 when using a linker script that has a SECTIONS clause.
10552 * Makefile.in: Regenerate.
10553
10554 * testsuite/Makefile.am (script_test_5.sh): New test case.
10555 * testsuite/Makefile.in: Regenerate.
10556 * testsuite/script_test_5.cc: New file.
10557 * testsuite/script_test_5.sh: New file.
10558 * testsuite/script_test_5.t: New file.
10559
10560 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
10561
10562 * archive.cc (Archive::include_member): Update calls to add_symbols.
10563 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10564 the Layout argument.
10565 * dynobj.h (do_add_symbols): Add the Layout argument.
10566 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10567 Layout argument.
10568 * object.h (Object::add_symbols): Add the Layout argument.
10569 (Object::do_add_symbols): Add the Layout argument.
10570 (Sized_relobj::do_add_symbols): Add the Layout argument.
10571 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10572 Unify the two versions.
10573 (Add_plugin_symbols): Remove.
10574 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10575 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10576 (Add_plugin_symbols): Remove.
10577 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10578 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10579 (Add_symbols::run): Make it work with Pulginobj.
10580
10581 2009-02-06 Ian Lance Taylor <iant@google.com>
10582
10583 * object.cc (Sized_relobj::do_layout): Make info message start
10584 with lower case letter.
10585
10586 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10587
10588 * binary.cc: Fix file comment.
10589
10590 * options.h (enum Incremental_disposition): Define.
10591 (class General_options): Add new options: --incremental,
10592 --incremental_changed, --incremental_unchanged,
10593 --incremental_unknown. Add incremental_disposition_ and
10594 implicit_incremental_ fields.
10595 (General_options::incremental_disposition): New function.
10596 (class Position_dependent_options): Add incremental_disposition
10597 option.
10598 (Position_dependent_options::copy_from_options): Set incremental
10599 dispositions.
10600 * options.cc (General_options::parse_incremental_changed): New
10601 function.
10602 (General_options::parse_incremental_unchanged): New function.
10603 (General_options::parse_incremental_unknown): New function.
10604 (General_options::General_options): Initialize new fields
10605 incremental_disposition_ and implicit_incremental_.
10606 (General_options::finalize): Check for uasge of --incremental-*
10607 without --incremental.
10608
10609 2009-02-06 Chris Demetriou <cgd@google.com>
10610
10611 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10612 pointer and to report location as the file name associated with
10613 the symbol.
10614 (gold_undefined_symbol_at_location): New function to replace the
10615 old gold_undefined_symbol functionality.
10616 * target-reloc.h (relocate_section): Update to use
10617 gold_undefined_symbol_at_location.
10618 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10619 Call gold_undefined_symbol function rather than gold_error.
10620 * errors.h (Errors::undefined_symbol): Take location as a
10621 string, rather than calculating it from a relocation.
10622 * errors.cc (Errors::fatal): Print "fatal error:" before the
10623 formatted message.
10624 (Errors::error, Errors::error_at_location): Print "error: "
10625 before the formatted message.
10626 (Errors::undefined_symbol): Take location as a string, rather
10627 than calculating it from a relocation.
10628 (gold_undefined_symbol_at_location): New function akin to
10629 old gold_undefined_symbol, calculates location from relocation.
10630 (gold_undefined_symbol): Change to take only a Symbol pointer
10631 and to report location as the file name associated with the symbol.
10632 * testsuite/debug_msg.sh: Update for changed error messages.
10633 * testsuite/undef_symbol.sh: Likewise.
10634
10635 2009-02-04 Duncan Sands <baldrick@free.fr>
10636
10637 PR 9812
10638 * reduced_debug_output.h
10639 (Output_reduced_debug_abbrev_section::failed): Use format for
10640 gold_warning.
10641 (Output_reduced_debug_info_section::faild): Likewise.
10642
10643 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10644
10645 * script.cc (Lazy_demangler): New class.
10646 (Version_script_info::get_symbol_version_helper): Demangle a
10647 symbol only once.
10648
10649 2009-01-29 Cary Coutant <ccoutant@google.com>
10650
10651 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10652 to __tls_get_addr.
10653 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10654
10655 2009-01-28 Ian Lance Taylor <iant@google.com>
10656
10657 * version.cc (version_string): Bump to 1.9.
10658
10659 * gold.h: Include <cstring> and <stdint.h>.
10660 * version.cc: Include <cstdio>.
10661 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10662 warning.
10663 * reduced_debug_output.cc (insert_into_vector): Rename from
10664 Insert_into_vector; change all callers. Use Swap_unaligned to
10665 avoid aliasing issue; remove union since it is unnecessary.
10666
10667 2009-01-27 Sriraman Tallam <tmsriram@google.com>
10668
10669 * Makefile.am (CCFILES): Add gc.cc.
10670 (HFILES): Add gc.h.
10671 * Makefile.in: Regenerate.
10672 * gold.cc (Gc_runner): New class.
10673 (queue_initial_tasks): Call garbage collection related tasks
10674 when corresponding options are invoked.
10675 (queue_middle_gc_tasks): New function.
10676 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10677 processed early before laying out sections during garbage collection.
10678 * gold.h (queue_middle_gc_tasks): New function.
10679 (is_prefix_of): Move from "layout.cc".
10680 * i386.cc (Target_i386::gc_process_relocs): New function.
10681 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10682 * main.cc (main): Create object of class "Garbage_collection".
10683 * object.cc (Relobj::copy_symbols_data): New function.
10684 (Relobj::is_section_name_included): New function.
10685 (Sized_relobj::do_layout): Allow this function to be called twice
10686 during garbage collection and defer layout of section during the
10687 first call.
10688 * object.h (Relobj::get_symbols_data): New function.
10689 (Relobj::is_section_name_included): New function.
10690 (Relobj::copy_symbols_data): New function.
10691 (Relobj::set_symbols_data): New function.
10692 (Relobj::get_relocs_data): New function.
10693 (Relobj::set_relocs_data): New function.
10694 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10695 (Relobj::gc_process_relocs): New function.
10696 (Relobj::do_gc_process_relocs): New pure virtual function.
10697 (Relobj::sd_): New data member.
10698 (Sized_relobj::is_output_section_offset_invalid): New function.
10699 (Sized_relobj::do_gc_process_relocs): New function.
10700 * options.h (General_options::gc_sections): Modify to not be a no-op.
10701 (General_options::print_gc_sections): New option.
10702 * plugin.cc (Plugin_finish::run): Remove function call to
10703 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10704 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10705 * reloc.cc (Read_relocs::run): Add task to process relocs and
10706 determine unreferenced sections when doing garbage collection.
10707 (Gc_process_relocs): New class.
10708 (Sized_relobj::do_gc_process_relocs): New function.
10709 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10710 sections that are garbage collected.
10711 * reloc.h (Gc_process_relocs): New class.
10712 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10713 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10714 symbols whose corresponding sections are garbage collected.
10715 (Symbol_table::Symbol_table): Add new parameter for the garbage
10716 collection object.
10717 (Symbol_table::gc_mark_undef_symbols): New function.
10718 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10719 (Symbol_table::gc_mark_dyn_syms): New function.
10720 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10721 as garbage.
10722 (Symbol_table::add_from_object): Likewise.
10723 (Symbol_table::add_from_relobj): When building shared objects, do not
10724 treat externally visible symbols as garbage.
10725 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10726 table information for static and relocatable links.
10727 * symtab.h (Symbol_table::set_gc): New function.
10728 (Symbol_table::gc): New function.
10729 (Symbol_table::gc_mark_undef_symbols): New function.
10730 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10731 (Symbol_table::gc_mark_dyn_syms): New function.
10732 (Symbol_table::gc_): New data member.
10733 * target.h (Sized_target::gc_process_relocs): New pure virtual
10734 function.
10735 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10736 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10737
10738 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10739
10740 * options.h (General_options::gc_sections): Define as a no-op for now.
10741 (General_options::no_keep_memory): Ditto.
10742 (General_options::Bshareable): Define.
10743 * options.cc (General_options::finalize): Honor -Bshareable.
10744
10745 2009-01-20 Andreas Schwab <schwab@suse.de>
10746
10747 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10748 read the value in the contents, since we don't use it. Use the
10749 template endianness when writing.
10750 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10751
10752 2009-01-19 Andreas Schwab <schwab@suse.de>
10753
10754 * configure.tgt (powerpc64-*): Fix targ_obj.
10755
10756 2009-01-15 Ian Lance Taylor <iant@google.com>
10757
10758 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10759 local symbols when stripping all symbols.
10760
10761 2009-01-14 Cary Coutant <ccoutant@google.com>
10762
10763 * output.cc (Output_reloc): Add explicit instantiations.
10764
10765 2009-01-14 Cary Coutant <ccoutant@google.com>
10766
10767 * archive.cc (Archive::get_elf_object_for_member): Remove call
10768 to File_read::claim_for_plugin.
10769 * descriptors.cc (Descriptors::open): Remove reference to
10770 is_claimed.
10771 (Descriptors::claim_for_plugin): Remove.
10772 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10773 (Descriptors::is_claimed): Remove.
10774 (claim_descriptor_for_plugin): Remove.
10775 * fileread.cc (File_read::claim_for_plugin): Remove.
10776 * fileread.h (File_read::claim_for_plugin): Remove.
10777 (File_read::descriptor): Reopen descriptor if necessary.
10778 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10779 (Plugin_manager::all_symbols_read): Add task parameter. Change
10780 all callers.
10781 (Plugin_manager::get_input_file): New function.
10782 (Plugin_manager::release_input_file): New function.
10783 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10784 corresponding data member.
10785 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10786 and pass to base constructor. Change all callers.
10787 (get_input_file, release_input_file): New functions.
10788 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10789 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10790 (Plugin_manager::all_symbols_read): Add task parameter.
10791 (Plugin_manager::get_input_file): New function.
10792 (Plugin_manager::release_input_file): New function.
10793 (Plugin_manager::task_): New data member.
10794 (Pluginobj::Pluginobj): Add filesize parameter.
10795 (Pluginobj::filename): New function.
10796 (Pluginobj::descriptor): New function.
10797 (Pluginobj::filesize): New function.
10798 (Pluginobj::filesize_): New data member.
10799 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10800 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10801 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10802
10803 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10804 with archive libraries.
10805 * testsuite/Makefile.in: Regenerate.
10806 * testsuite/plugin_test.c (struct sym_info): New type.
10807 (get_input_file, release_input_file): New static variables.
10808 (onload): Capture new transfer vector entries.
10809 (claim_file_hook): Stop reading at end of file according to filesize.
10810 Factor out parsing of readelf output into separate function.
10811 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10812 APIs and get the source file name from the symbol table. Convert
10813 source file name to corresponding object file name. Print info
10814 message when adding new input files.
10815 (parse_readelf_line): New function.
10816 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10817 * testsuite/plugin_test_2.sh: Likewise.
10818 * testsuite/plugin_test_3.sh: Likewise.
10819 * testsuite/plugin_test_4.sh: New test case.
10820
10821 2009-01-07 Ian Lance Taylor <iant@google.com>
10822
10823 * version.cc (version_string): Bump to 1.8.
10824
10825 2008-12-23 Cary Coutant <ccoutant@google.com>
10826
10827 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10828 * plugin.cc (Plugin_manager::finish): Rename as
10829 layout_deferred_objects. Move cleanup to separate function.
10830 (Plugin_manager::cleanup): New function.
10831 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10832 separately.
10833 * plugin.h (Plugin_manager::finish): Rename as
10834 layout_deferred_objects.
10835 (Plugin_manager::cleanup): New function.
10836 (Plugin_manager::cleanup_done): New field.
10837
10838 2008-12-23 Cary Coutant <ccoutant@google.com>
10839
10840 * plugin.cc (is_visible_from_outside): New function.
10841 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10842 so we don't return "IR only" status for exported symbols or -r links.
10843
10844 * testsuite/Makefile.am (plugin_test_3): New test case.
10845 * testsuite/Makefile.in: Regenerate.
10846 * testsuite/plugin_test_3.sh: New file.
10847
10848 2008-12-22 Cary Coutant <ccoutant@google.com>
10849
10850 * object.cc (Sized_relobj::layout_section): New function.
10851 (Sized_relobj::do_layout): Defer layout of input sections until after
10852 plugin has provided replacement files.
10853 (Sized_relobj::do_layout_deferred_sections): New function.
10854 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10855 (Relobj::layout_deferred_sections): New function.
10856 (Relobj::do_layout_deferred_sections): New function.
10857 (Sized_relobj::do_layout_deferred_sections): New function.
10858 (Sized_relobj::layout_section): New function.
10859 (Sized_relobj::Deferred_layout): New structure.
10860 (Sized_relobj::deferred_layout_): New field.
10861 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10862 Change all callers. Layout deferred sections.
10863 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10864 references.
10865 (Plugin_hook::run): Move code from do_plugin_hook inline.
10866 (Plugin_hook::do_plugin_hook): Remove.
10867 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10868 (Plugin_manager::finish): Renamed, was cleanup.
10869 (Plugin_manager::should_defer_layout): New function.
10870 (Plugin_manager::add_deferred_layout_object): New function.
10871 (Plugin_manager::Deferred_layout_list): New type.
10872 (Plugin_manager::deferred_layout_objects_): New field.
10873 (Plugin_hook::do_plugin_hook): Remove.
10874
10875 2008-12-17 Ian Lance Taylor <iant@google.com>
10876
10877 * options.h (class General_options): Add --no case for
10878 --export-dynamic.
10879
10880 2008-12-16 Cary Coutant <ccoutant@google.com>
10881
10882 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10883 vector.
10884 (Plugin_manager::claim_file): Create plugin object even if
10885 plugin did not call the add_symbols callback.
10886 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10887 asking for more symbols than were added.
10888 * testsuite/Makefile.am (plugin_test_1): Add test case with
10889 no global symbols.
10890 (empty.syms): New target.
10891 * testsuite/Makefile.in: Regenerate.
10892 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10893 message. Don't call add_symbols if no globals.
10894 (all_symbols_read_hook): Don't provide replacement for empty
10895 claimed file.
10896
10897 2008-12-12 Ian Lance Taylor <iant@google.com>
10898
10899 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10900 r_type == 0 for a local symbol with r_sym == 0.
10901 (scan_relocatable_relocs): Pass r_sym to
10902 local_non_section_strategy.
10903 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10904 r_sym parameter.
10905
10906 * configure.ac: Update test for TLS descriptors: they are
10907 supported as of glibc 2.9.
10908 * configure: Rebuild.
10909
10910 2008-12-11 Ian Lance Taylor <iant@google.com>
10911
10912 PR 7091
10913 * target-reloc.h (Default_scan_relocatable_relocs): For each
10914 function, map r_type == 0 to RELOC_DISCARD.
10915
10916 2008-12-10 Cary Coutant <ccoutant@google.com>
10917
10918 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10919 object to override a kept COMDAT group from a plugin object.
10920
10921 2008-12-09 Ian Lance Taylor <iant@google.com>
10922
10923 PR 7088
10924 * yyscript.y (file_cmd): Handle INPUT.
10925
10926 * testsuite/initpri1.c: Change all declarations to be full
10927 prototypes by adding void, to avoid compiler warnings.
10928
10929 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
10930
10931 * options.cc (General_options::parse_plugin_opt): New.
10932 (General_options::add_plugin): The argument now is just the filename.
10933 (General_options::add_plugin_option): New.
10934 * options.h (plugin_opt): New.
10935 (add_plugin): Change argument name.
10936 (add_plugin_option): New.
10937 * plugin.cc (Plugin::load): Don't parse the plugin option.
10938 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10939 (Plugin::add_option): New.
10940 (Plugin::args_): Change type.
10941 (Plugin::filename_): New.
10942 (Plugin_manager::add_plugin_option): New.
10943 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10944 * testsuite/Makefile.in: Regenerate.
10945
10946 2008-12-05 Cary Coutant <ccoutant@google.com>
10947
10948 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10949 Handle --strip-lto-sections option.
10950 * options.h (strip_lto_sections): New option.
10951
10952 2008-12-01 Cary Coutant <ccoutant@google.com>
10953
10954 * plugin.cc (ld_plugin_message): Change format parameter to const.
10955 Fix mismatch between new[] and delete.
10956
10957 2008-11-14 Cary Coutant <ccoutant@google.com>
10958
10959 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10960 instead of -1U.
10961
10962 2008-11-05 Craig Silverstein <csilvers@google.com>
10963
10964 * options.cc (General_options::parse_dynamic_list): New function.
10965 * options.h (General_options): New flags dynamic_list,
10966 dynamic_list_data, dynamic_list_cpp_new, and
10967 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10968 (General_options::in_dynamic_list): New function.
10969 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10970 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10971 (Lex::can_continue_name): Likewise.
10972 (yylex): Likewise.
10973 (read_script_file): New parameter script_options.
10974 (read_dynamic_list): New function.
10975 (Script_options::define_dynamic_list): New function.
10976 (dynamic_list_keyword_parsecodes): New variable.
10977 (dynamic_list_keywords): New variable.
10978 * script.h (Script_options::define_dynamic_list): New function
10979 prototype.
10980 (read_dynamic_list): New function prototype.
10981 * symtab.cc (strprefix): New macro.
10982 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10983 dynamic_list_data, dynamic_list_cpp_new, and
10984 dynamic_list_cpp_typeinfo.
10985 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10986 (dynamic_list_expr): New rule.
10987 (dynamic_list_nodes): Likewise.
10988 (dynamic_list_node): Likewise.
10989 * testsuite/Makefile.am (dynamic_list): New test.
10990 * testsuite/Makefile.in: Regenerated.
10991 * testsuite/dynamic_list.t: New file.
10992 * testsuite/dynamic_list.sh: New file.
10993
10994 2008-11-05 Craig Silverstein <csilvers@google.com>
10995
10996 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10997 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10998 (t11_last): Likewise.
10999 * testsuite/ver_test_6.c (main): Likewise.
11000
11001 2008-10-07 Cary Coutant <ccoutant@google.com>
11002
11003 * options.c (General_options::finalize): Add check for -static and
11004 -shared.
11005 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11006 is not empty.
11007
11008 2008-10-02 Cary Coutant <ccoutant@google.com>
11009
11010 * plugin.cc (make_sized_plugin_object): Fix conditional
11011 compilation to work when not all targets are enabled.
11012
11013 2008-09-29 Cary Coutant <ccoutant@google.com>
11014
11015 * archive.cc (Archive::get_file_and_offset): Use filename instead
11016 of name to get library path.
11017 (Archive::include_member): Unlock external member of a thin archive.
11018
11019 * testsuite/Makefile.am (TEST_AR): New variable.
11020 (thin_archive_test_1): New test.
11021 (thin_archive_test_2): New test.
11022 * testsuite/Makefile.in: Regenerate.
11023 * testsuite/thin_archive_main.cc: New file.
11024 * testsuite/thin_archive_test_1.cc: New file.
11025 * testsuite/thin_archive_test_2.cc: New file.
11026 * testsuite/thin_archive_test_3.cc: New file.
11027 * testsuite/thin_archive_test_4.cc: New file.
11028
11029 2008-09-29 Cary Coutant <ccoutant@google.com>
11030
11031 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11032 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11033 instead of -1U.
11034 (Sized_relobj::do_finalize_local_symbols): Likewise.
11035 (Sized_relobj::map_to_kept_section): Likewise.
11036 * object.h (Sized_relobj::invalid_address): New constant.
11037 (Sized_relobj::do_output_section_offset): Check for invalid_address
11038 and return -1ULL.
11039 * output.cc (Output_reloc::local_section_offset): Use constant
11040 invalid_address instead of -1U.
11041 (Output_reloc::get_address): Likewise.
11042 (Output_section::output_address): Change -1U to -1ULL.
11043 * output.h (Output_reloc::invalid_address): New constant.
11044 * reloc.cc (Sized_relobj::write_sections): Use constant
11045 invalid_address instead of -1U.
11046 (Sized_relobj::relocate_sections): Likewise.
11047 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11048 values for merge sections.
11049 * target-reloc.h (relocate_for_relocatable): Use constant
11050 invalid_address instead of -1U.
11051
11052 2008-09-19 Cary Coutant <ccoutant@google.com>
11053
11054 Add plugin functionality for link-time optimization (LTO).
11055 * configure.ac (plugins): Add --enable-plugins option.
11056 * configure: Regenerate.
11057 * config.in: Regenerate.
11058 * Makefile.am (LIBDL): New variable.
11059 (CCFILES): Add plugin.cc.
11060 (HFILES): Add plugin.h.
11061 (ldadd_var): Add LIBDL.
11062 * Makefile.in: Regenerate.
11063
11064 * archive.cc: Include "plugin.h".
11065 (Archive::setup): Don't preread archive symbols when using a plugin.
11066 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11067 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11068 files.
11069 (Archive::include_member): Add symbols from plugin objects.
11070 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11071 * descriptors.cc (Descriptors::open): Check for file descriptors
11072 abandoned by plugins.
11073 (Descriptors::claim_for_plugin): New function.
11074 * descriptors.h (Descriptors::claim_for_plugin): New function.
11075 (Open_descriptor::is_claimed): New field.
11076 (claim_descriptor_for_plugin): New function.
11077 * fileread.cc (File_read::claim_for_plugin): New function.
11078 * fileread.h (File_read::claim_for_plugin): New function.
11079 (File_read::descriptor): New function.
11080 * gold.cc: Include "plugin.h".
11081 (queue_initial_tasks): Add task to call plugin hooks for generating
11082 new object files.
11083 * main.cc: Include "plugin.h".
11084 (main): Load plugin libraries.
11085 * object.h (Pluginobj): Declare.
11086 (Object::pluginobj): New function.
11087 (Object::do_pluginobj): New function.
11088 (Object::set_target): New function.
11089 * options.cc: Include "plugin.h".
11090 (General_options::parse_plugin): New function.
11091 (General_options::General_options): Initialize plugins_ field.
11092 (General_options::add_plugin): New function.
11093 * options.h (Plugin_manager): Declare.
11094 (General_options): Add --plugin option.
11095 (General_options::has_plugins): New function.
11096 (General_options::plugins): New function.
11097 (General_options::add_plugin): New function.
11098 (General_options::plugins_): New field.
11099 * plugin.cc: New file.
11100 * plugin.h: New file.
11101 * readsyms.cc: Include "plugin.h".
11102 (Read_symbols::do_read_symbols): Check for archive before checking
11103 for ELF file. Call plugin hooks to claim files.
11104 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11105 from a real object file; force override when processing replacement
11106 files.
11107 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11108 (Symbol::init_base_object): Likewise.
11109 (Symbol::init_base_output_data): Likewise.
11110 (Symbol::init_base_output_segment): Likewise.
11111 (Symbol::init_base_constant): Likewise.
11112 (Symbol::init_base_undefined): Likewise.
11113 (Symbol::output_section): Assert that object is not a plugin.
11114 (Symbol_table::add_from_pluginobj): New function.
11115 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11116 undefined.
11117 (Symbol_table::sized_write_globals): Likewise.
11118 (Symbol_table::add_from_pluginobj): Instantiate template.
11119 * symtab.h (Sized_pluginobj): Declare.
11120 (Symbol::in_real_elf): New function.
11121 (Symbol::set_in_real_elf): New function.
11122 (Symbol::in_real_elf_): New field.
11123 (Symbol_table::add_from_pluginobj): New function.
11124
11125 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11126 (LIBDL): New variable.
11127 (LDADD): Add LIBDL.
11128 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11129 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11130 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11131 (MOSTLYCLEANFILES): Likewise.
11132 * testsuite/Makefile.in: Regenerate.
11133 * testsuite/plugin_test.c: New file.
11134 * testsuite/plugin_test_1.sh: New file.
11135 * testsuite/plugin_test_2.sh: New file.
11136
11137 2008-09-16 Ian Lance Taylor <iant@google.com>
11138
11139 * target-reloc.h (relocate_section): Check whether a symbol is
11140 defined by the ABI before reporting an undefined symbol error.
11141 * target.h (Target::is_defined_by_abi): Make parameter const.
11142 (Target::do_is_defined_by_abi): Likewise.
11143 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11144 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11145 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11146 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11147 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11148 * testsuite/Makefile.in: Rebuild.
11149
11150 * fileread.cc (make_view): Add casts to avoid warning.
11151
11152 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11153
11154 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11155 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11156
11157 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11158
11159 * options.h (General_options::output_is_executable): New.
11160 (General_options::output_is_pie): New.
11161 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11162 for shared libraries.
11163 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11164
11165 2008-09-11 Chris Demetriou <cgd@google.com>
11166
11167 * options.h (origin): New -z option.
11168 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11169 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11170 in DT_FLAGS_1.
11171
11172 2008-09-05 Cary Coutant <ccoutant@google.com>
11173
11174 * fileread.cc (File_read::make_view): Add check for attempt to map
11175 beyond end of file.
11176
11177 2008-09-05 Cary Coutant <ccoutant@google.com>
11178
11179 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11180 explicit instantiations.
11181
11182 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11183
11184 PR gold/6858
11185 * options.cc (General_options::finalize): Allow undefined symbols
11186 in shlibs if linking -shared.
11187
11188 PR gold/6859
11189 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11190 symbols as not needing a dynsym entry.
11191
11192 2008-08-20 Craig Silverstein <csilvers@google.com>
11193
11194 * fileread.cc (File_read::open): Do not lock the file unless it
11195 was successfully opened.
11196
11197 2008-08-14 Cary Coutant <ccoutant@google.com>
11198
11199 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11200 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11201 * testsuite/tls_test.cc (struct int128): 128-bit struct
11202 for testing TLS relocs with non-zero addend.
11203 (v12): New TLS variable.
11204 (t12): New test.
11205 (t_last): Add check for v12.
11206 * testsuite/tls_test.h (t12): New function.
11207 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11208
11209 2008-08-13 Ian Lance Taylor <iant@google.com>
11210
11211 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11212 set tls_segment_ or relro_segment_.
11213 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11214 when appropriate.
11215 * output.h (Output_section::clear_is_relro): New function.
11216 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11217 sections specially even when output_data_ is empty.
11218 (Output_segment::maximum_alignment): When first section is relro,
11219 only force alignment for PT_LOAD segments.
11220 * script.cc (script_data_segment_align): New function.
11221 (script_data_segment_relro_end): New function.
11222 * script-c.h (script_data_segment_align): Declare.
11223 (script_data_segment_relro_end): Declare.
11224 * script-sections.h (class Script_sections): Declare
11225 data_segment_align and data_segment_relro_end. Add fields
11226 segment_align_index_ and saw_relro_end_.
11227 * script-sections.cc (class Sections_element): Add set_is_relro
11228 virtual function. Add new bool* parameter to place_orphan_here.
11229 Add get_output_section virtual function.
11230 (class Output_section_definition): Add set_is_relro. Add new
11231 bool* parameter to place_orphan_here. Add get_output_section.
11232 Add is_relro_ field.
11233 (Output_section_definition::Output_section_definition): Initialize
11234 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11235 and is_relro_ fields.
11236 (Output_section_definition::place_orphan_here): Add is_relro
11237 parameter.
11238 (Output_section_definition::set_section_addresses): Set relro for
11239 output section.
11240 (Output_section_definition::alternate_constraint): Likewise.
11241 (class Orphan_output_section): Add new bool* parameter to
11242 place_orphan_here. Add get_output_section.
11243 (Orphan_output_section::place_orphan_here): Add is_relro
11244 parameter.
11245 (Script_sections::Script_sections): Initialize
11246 data_segment_align_index_ and saw_relro_end_.
11247 (Script_sections::data_segment_align): New function.
11248 (Script_sections::data_segment_relro_end): New function.
11249 (Script_sections::place_orphan): Set or clear is_relro.
11250 (Script_sections::set_section_addresses): Force alignment of first
11251 TLS section.
11252 * yyscript.y (exp): Call script_data_segment_align and
11253 script_data_segment_relro_end.
11254 * testsuite/relro_script_test.t: New file.
11255 * testsuite/relro_test.cc (using_script): Declare.
11256 (t1, t2): Test using_script.
11257 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11258 (relro_script_test_SOURCES): Define.
11259 (relro_script_test_DEPENDENCIES): Define.
11260 (relro_script_test_LDFLAGS): Define.
11261 (relro_script_test_LDADD): Define.
11262 (relro_script_test.so): New target.
11263 * testsuite/Makefile.in: Rebuild.
11264
11265 2008-08-06 Cary Coutant <ccoutant@google.com>
11266
11267 * archive.cc (Archive::total_archives, Archive::total_members)
11268 (Archive::total_members_loaded): New variables.
11269 (Archive::setup): Add parameter. Add option to preread
11270 archive symbols.
11271 (Archive::read_armap): Add counter.
11272 (Archive::get_file_and_offset): New function.
11273 (Archive::get_elf_object_for_member): New function.
11274 (Archive::read_all_symbols): New function.
11275 (Archive::read_symbols): New function.
11276 (Archive::add_symbols): Add counters.
11277 (Archive::include_all_members): Use armap to find members if it's
11278 already built.
11279 (Archive::include_member): Skip reading symbols if already read.
11280 Factored code into Archive::get_file_and_offset and
11281 Archive::get_elf_object_for_member. Changed call to
11282 Mapfile::report_include_archive_member.
11283 (Archive::print_stats): New function.
11284 * archive.h: Declare Object and Read_symbols_data classes.
11285 (Archive::Archive): Add initializers for new members.
11286 (Archive::setup): Add parameter.
11287 (Archive::print_stats): New function.
11288 (Archive::total_archives, Archive::total_members)
11289 (Archive::total_members_loaded): New variables.
11290 (Archive::get_file_and_offset): New function.
11291 (Archive::get_elf_object_for_member): New function.
11292 (Archive::read_all_symbols): New function.
11293 (Archive::read_symbols): New function.
11294 (Archive::Archive_member): New class.
11295 (Archive::members_): New member.
11296 (Archive::num_members_): New member.
11297 * main.cc: Include archive.h.
11298 (main): Call Archive::print_stats.
11299 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11300 archive parameter; member_name is now the fully-decorated name.
11301 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11302 * options.h: (General_options): Add --preread-archive-symbols option.
11303 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11304 Archive::setup.
11305
11306 2008-08-04 Ian Lance Taylor <iant@google.com>
11307
11308 * symtab.h (Symbol::use_plt_offset): New function.
11309 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11310 * powerpc.cc (Relocate::relocate): Likewise.
11311 * sparc.cc (Relocate::relocate): Likewise.
11312 * x86_64.cc (Relocate::relocate): Likewise.
11313 * testsuite/weak_plt.sh: New test.
11314 * testsuite/weak_plt_main.cc: New test.
11315 * testsuite/weak_plt_shared.cc: New test.
11316 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11317 (check_PROGRAMS): Add weak_plt.
11318 (check_DATA): Add weak_plt_shared.so.
11319 (weak_plt_main_pic.o, weak_plt): New targets.
11320 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11321 * testsuite/Makefile.in: Rebuild.
11322
11323 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11324 gcctestdir/ld.
11325 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11326 * testsuite/Makefile.in: Rebuild.
11327
11328 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11329
11330 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11331 * Makefile.in: Regenerate.
11332 * po/POTFILES.in: Regenerate.
11333
11334 2008-07-29 Ian Lance Taylor <iant@google.com>
11335
11336 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11337 symbols before other symbols.
11338 * testsuite/script_test_2.cc (test_addr): Declare.
11339 (test_addr_alias): Declare.
11340 (main): Check that test_addr and test_addr_alias have the right
11341 values.
11342 * testsuite/script_test_2.t: Define test_addr_alias and
11343 test_addr.
11344
11345 2008-07-24 Ian Lance Taylor <iant@google.com>
11346
11347 PR 5990
11348 * descriptors.cc: New file.
11349 * descriptors.h: New file.
11350 * gold-threads.h (class Hold_optional_lock): New class.
11351 * fileread.cc: Include "descriptors.h".
11352 (File_read::~File_read): Release descriptor rather than closing
11353 it.
11354 (File_read::open) [file]: Call open_descriptor rather than open.
11355 Set is_descriptor_opened_.
11356 (File_read::open) [memory]: Assert that descriptor is not open.
11357 (File_read::reopen_descriptor): New function.
11358 (File_read::release): Release descriptor.
11359 (File_read::do_read): Make non-const. Reopen descriptor.
11360 (File_read::read): Make non-const.
11361 (File_read::make_view): Reopen descriptor.
11362 (File_read::do_readv): Likewise.
11363 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11364 Update declarations.
11365 * layout.cc: Include "descriptors.h".
11366 (Layout::create_build_id): Use open_descriptor rather than open.
11367 * output.cc: Include "descriptors.h".
11368 (Output_file::open): Use open_descriptor rather than open.
11369 * archive.cc (Archive::const_iterator): Change Archive to be
11370 non-const.
11371 (Archive::begin, Archive::end): Make non-const.
11372 (Archive::count_members): Likewise.
11373 * archive.h (class Archive): Update declarations.
11374 * object.h (Object::read): Make non-const.
11375 * Makefile.am (CCFILES): Add descriptors.cc.
11376 (HFILES): Add descriptors.h.
11377 * Makefile.in: Rebuild.
11378
11379 PR 6716
11380 * gold.h: Always include <clocale>. Add Solaris workarounds
11381 following code in binutils/sysdep.h.
11382
11383 PR 6048
11384 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11385 this->eh_frame_hdr_ is NULL before using it.
11386
11387 * dynobj.cc (Versions::Versions): Update comment.
11388
11389 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11390 the base version name.
11391
11392 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11393 array size plus one.
11394 (Stringpool_template::set_string_offsets): Subtract one from key
11395 before using it as an array index.
11396 (Stringpool_template::get_offset_with_length): Likewise.
11397 (Stringpool_template::write_to_buffer): Likewise.
11398 * stringpool.h (Stringpool_template::get_offset_from_key):
11399 Likewise.
11400
11401 2008-07-23 Ian Lance Taylor <iant@google.com>
11402
11403 PR 6658
11404 * object.h (Merged_symbol_value::value): Do our best to handle a
11405 negative addend.
11406
11407 PR 6647
11408 * script.cc (Version_script_info::get_versions): Don't add empty
11409 version tag to return value.
11410 (Version_script_info::get_symbol_version_helper): Change return
11411 type to bool. Add pversion parameter. Change all callers.
11412 (script_register_vers_node): Don't require a non-NULL tag.
11413 * script.h (class Version_script_info): Update declarations.
11414 (Version_script_info::get_symbol_version): Change return type to
11415 bool. Add version parameter. Change all callers.
11416 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11417 handling. Handle an empty version from a version script.
11418 (Symbol_table::define_special_symbol): Likewise.
11419 * testsuite/ver_test_10.script: New file.
11420 * testsuite/ver_test_10.sh: New file.
11421 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11422 (check_DATA): Add ver_test_10.syms.
11423 (ver_test_10.syms, ver_test_10.so): New target.
11424 * testsuite/Makefile.in: Rebuild.
11425
11426 2008-07-23 Simon Baldwin <simonb@google.com>
11427
11428 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11429 to zero for undefined symbols from dynamic libraries.
11430
11431 2008-07-23 Ian Lance Taylor <iant@google.com>
11432
11433 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11434 Change all callers.
11435 * symtab.h (class Symbol_table): Update declaration.
11436 * testsuite/ver_test_9.cc: New file.
11437 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11438 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11439 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11440 (ver_test_9.so, ver_test_9.o): New targets.
11441 * testsuite/Makefile.in: Rebuild.
11442
11443 2008-07-22 Ian Lance Taylor <iant@google.com>
11444
11445 * options.h (class General_options): Define --check-sections.
11446 * layout.cc (Layout::set_segment_offsets): Handle
11447 --check-sections.
11448
11449 * options.h (class General_options): Define -n/--nmagic and
11450 -N/--omagic.
11451 * options.cc (General_options::finalize): For -n/--nmagic or
11452 -N/--omagic, set -static.
11453 * layout.cc (Layout::attach_allocated_section_to_segment): If
11454 -N/--omagic, don't put read-only and read-write sections in
11455 different segments.
11456 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11457 finding a read-only segment.
11458 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11459 don't set the minimum segment alignment to the common page size,
11460 and don't set the file offset to the address modulo the page size.
11461 * script-sections.cc (Script_sections::create_segments): If
11462 -n/--omagic, don't put read-only and read-write sections in
11463 different segments.
11464
11465 * cref.cc: New file.
11466 * cref.h: New file.
11467 * options.h (class General_options): Add --print-symbol-counts.
11468 * main.cc (main): Issue defined symbol report if requested.
11469 * archive.cc (Archive::interpret_header): Make into a const member
11470 function.
11471 (Archive::add_symbols): Call Input_objects::archive_start and
11472 archive_stop.
11473 (Archive::const_iterator): Define new class.
11474 (Archive::begin, Archive::end): New functions.
11475 (Archive::include_all_members): Rewrite to use iterator.
11476 (Archive::count_members): New function.
11477 * archive.h (class Archive): Update declarations.
11478 (Archive::filename): New function.
11479 * object.cc: Include "cref.h".
11480 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11481 (Sized_relobj::do_get_global_symbol_counts): New function.
11482 (Input_objects::add_object): Add object to cross-referencer.
11483 (Input_objects::archive_start): New function.
11484 (Input_objects::archive_stop): New function.
11485 (Input_objects::print_symbol_counts): New function.
11486 * object.h: Declare Cref and Archive.
11487 (Object::get_global_symbol_counts): New function.
11488 (Object::do_get_global_symbol_counts): New pure virtual function.
11489 (class Sized_relobj): Add defined_count_ field. Update
11490 declarations.
11491 (class Input_objects): Add cref_ field. Update constructor.
11492 Update declarations.
11493 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11494 defined_count_.
11495 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11496 symbol counts.
11497 (Sized_dynobj::do_get_global_symbol_counts): New function.
11498 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11499 defined_count_. Update declarations. Define Symbols typedef.
11500 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11501 parameter. Change all callers.
11502 (Symbol_table::add_from_dynobj): Add sympointers and defined
11503 parameters. Change all callers.
11504 * symtab.h (class Symbol_table): Update declarations.
11505 * Makefile.am (CCFILES): Add cref.cc.
11506 (HFILES): Add cref.h.
11507 * Makefile.in: Rebuild.
11508
11509 2008-07-22 Simon Baldwin <simonb@google.com>
11510
11511 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11512 to zero when writing undefined symbols.
11513
11514 2008-07-22 Ian Lance Taylor <iant@google.com>
11515
11516 * output.cc (Output_section::add_input_section): Don't try to
11517 merge empty merge sections.
11518
11519 2008-07-21 Craig Silverstein <csilvers@google.com>
11520
11521 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11522 Include symbol version in error message.
11523
11524 2008-07-20 Chris Demetriou <cgd@google.com>
11525
11526 * configure.ac (gold_cv_c_random_seed): New configured variable.
11527 (RANDOM_SEED_CFLAGS): New substituted variable.
11528 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11529 * configure: Rebuild.
11530 * Makefile.in: Likewise.
11531 * testsuite/Makefile.in: Likewise.
11532
11533 2008-07-18 Ian Lance Taylor <iant@google.com>
11534
11535 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11536 where we see NAME/NULL and NAME/VERSION as separate symbols.
11537 * testsuite/ver_test_main.cc (main): Call t4.
11538 (t4, t4_2a): Define.
11539 * testsuite/ver_test_2.cc (t4_2): Define.
11540 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11541 * testsuite/ver_test_4.cc (t4_2a): Define.
11542 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11543 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11544
11545 2008-07-17 Ian Lance Taylor <iant@google.com>
11546
11547 * dynobj.cc (Versions::add_def): If we give an error about a
11548 missing version, go ahead and create the version anyhow.
11549
11550 2008-07-10 Ian Lance Taylor <iant@google.com>
11551
11552 Handle output sections with more than 0x7fffffff bytes.
11553 * object.h (class Relobj): Change map_to_output_ to
11554 output_sections_, and just keep a section pointer. Change all
11555 uses. Move comdat group support to Sized_relobj.
11556 (Relobj::is_section_specially_mapped): Remove.
11557 (Relobj::output_section): Remove poff parameter. Change all
11558 callers.
11559 (Relobj::output_section_offset): New function.
11560 (Relobj::set_section_offset): Rewrite.
11561 (Relobj::map_to_output): Remove.
11562 (Relobj::output_sections): New function.
11563 (Relobj::do_output_section_offset): New pure virtual function.
11564 (Relobj::do_set_section_offset): Likewise.
11565 (class Sized_relobj): Add section_offsets_ field. Add comdat
11566 group support from Relobj. Update declarations.
11567 (Sized_relobj::get_output_section_offset): New function.
11568 (Sized_relobj::do_output_section_offset): New function.
11569 (Sized_relobj::do_set_section_offset): New function.
11570 * object.cc (Relobj::output_section_address): Remove.
11571 (Sized_relobj::Sized_relobj): Initialize new fields.
11572 (Sized_relobj::include_section_group): Cast find_kept_object to
11573 Sized_relobj.
11574 (Sized_relobj::include_linkonce_section): Likewise.
11575 (Sized_relobj::do_layout): Use separate arrays for output section
11576 and output offset.
11577 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11578 output_sections.
11579 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11580 output_sections and section_offsets.
11581 (Sized_relobj::write_local_symbols): Likewise.
11582 (map_to_kept_section): Compute output address directly.
11583 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11584 output_sections and section_offsets.
11585 (Sized_relobj::write_sections): Likewise.
11586 (Sized_relobj::relocate_sections): Likewise.
11587 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11588 * output.h (class Output_reloc): Update declarations. Change
11589 u2_.relobj to Sized_relobj*.
11590 (class Output_data_reloc): Change add functions to use
11591 Sized_relobj*.
11592 * output.cc (Output_reloc::Output_reloc): Change relobj to
11593 Sized_relobj*.
11594 (Output_reloc::local_section_offset): Change return type to
11595 Elf_Addr. Use get_output_section_offset.
11596 (Output_reloc::get_address): Likewise.
11597 (Output_section::is_input_address_mapped): Don't call
11598 is_section_specially_mapped.
11599 (Output_section::output_offset): Likewise.
11600 (Output_section::output_address): Likewise.
11601 (Output_section::starting_output_address): Likewise.
11602 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11603 parameter to Sized_relobj*.
11604 (Copy_relocs::need_copy_reloc): Likewise.
11605 (Copy_relocs::save): Likewise.
11606 * copy-relocs.h (class Copy_relocs): Update declarations.
11607 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11608 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11609 * target-reloc.h (relocate_for_relocatable): Change
11610 offset_in_output_section type to Elf_Addr. Change code that uses
11611 it as well.
11612 * layout.cc (Layout::layout): Always set *off.
11613 * mapfile.cc (Mapfile::print_input_section): Use
11614 output_section_offset.
11615 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11616 Sized_relobj*.
11617 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11618 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11619 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11620
11621 2008-07-03 Ian Lance Taylor <iant@google.com>
11622
11623 * layout.cc (Layout::include_section): Do not discard unrecognized
11624 SHT_STRTAB sections.
11625
11626 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11627
11628 * script.cc (Lex::can_continue_name): Make '?' allowable in
11629 version-script names.
11630 * testsuite/version_script.map: Change glob pattern to use '?'
11631
11632 2008-06-30 Manish Singh <yosh@gimp.org>
11633
11634 PR 6585
11635 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11636 Correct typo.
11637
11638 2008-06-30 Ian Lance Taylor <iant@google.com>
11639
11640 PR 6660
11641 PR 6682
11642 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11643 versions]: Don't try to read the value in the contents, since we
11644 don't use it. Use the template endianness when writing.
11645
11646 2008-06-25 Cary Coutant <ccoutant@google.com>
11647
11648 * fileread.cc (File_read::make_view): Assert on zero-length view.
11649 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11650 symbol table when there are no symbols to read.
11651
11652 2008-06-23 Craig Silverstein <csilvers@google.com>
11653
11654 * version.cc (version_string): Bump to 1.7
11655
11656 2008-06-18 Craig Silverstein <csilvers@google.com>
11657
11658 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11659 constant 0xFFFF to type Valtype.
11660 (Powerpc_relocate_functions::rel16_ha): Likewise.
11661
11662 2008-06-17 Ian Lance Taylor <iant@google.com>
11663
11664 * output.h (Output_section::Input_section): Initialize p2align_ to
11665 zero for Output_section_data constructors.
11666 (Output_section::Input_section::addralign): If not an input
11667 section, return the alignment of the Output_section_data.
11668 * testsuite/copy_test.cc: New file.
11669 * testsuite/copy_test_1.cc: New file.
11670 * testsuite/copy_test_2.cc: New file.
11671 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11672 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11673 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11674 (copy_test_1_pic.o, copy_test_1.so): New targets.
11675 (copy_test_2_pic.o, copy_test_2.so): New targets.
11676 * testsuite/Makefile.in: Rebuild.
11677
11678 * script-sections.cc (Script_sections::place_orphan): Initialize
11679 local variable exact.
11680
11681 2008-06-13 David Edelsohn <edelsohn@gnu.org>
11682
11683 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11684
11685 2008-06-12 David Edelsohn <edelsohn@gnu.org>
11686 David S. Miller <davem@davemloft.net>
11687
11688 * powerpc.cc: New file.
11689 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11690 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11691 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11692 * Makefile.in: Rebuild.
11693
11694 2008-06-09 Ian Lance Taylor <iant@google.com>
11695
11696 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11697 <exception>.
11698 (throwing, orig_terminate): New static variables.
11699 (terminate_handler): New static function.
11700 (t2): Set terminate handler.
11701
11702 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11703
11704 PR 6584
11705 * binary.cc (Binary_to_elf::sized_convert): Fix .data
11706 alignment.
11707
11708 2008-05-30 Cary Coutant <ccoutant@google.com>
11709
11710 * archive.cc (Archive::include_all_members) Correct to step
11711 over symbol table and extended name table in thin archives.
11712
11713 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11714
11715 PR 6407
11716 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11717 calculation.
11718
11719 2008-05-28 Caleb Howe <cshowe@google.com>
11720
11721 * reduced_debug_output.cc: New file.
11722 * reduced_debug_output.h: New file.
11723 * options.h (class General_options): Add --strip-debug-non-line.
11724 * options.cc (General_options::finalize): Add strip_debug_non_line
11725 to the strip heirarchy.
11726 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11727 fields.
11728 * layout.cc: Include "reduced_debug_output.h".
11729 (Layout::Layout): Initialize new fields.
11730 (line_only_debug_sections): New static array.
11731 (is_lines_only_debug_sections): New static inline function.
11732 (Layout::include_section): Handle --strip-debug-non-line.
11733 (Layout::make_output_section): If --strip-debug-non-line, build
11734 new output sections for .debug_abbrev and .debug_info.
11735 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11736 gold. Warn about possible overflow.
11737 (read_signed_LEB_128): Likewise.
11738 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11739 (read_signed_LEB_128): Declare.
11740 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11741 (HFILES): Add reduced_debug_output.h.
11742 * Makefile.in: Rebuild.
11743
11744 2008-05-21 Ian Lance Taylor <iant@google.com>
11745
11746 * mapfile.cc: New file.
11747 * mapfile.h: New file.
11748 * options.h (class General_options): Add -M/--print-map and -Map.
11749 * options.cc (General_options::finalize): Make -M equivalent to
11750 -Map -.
11751 * main.cc: Include <cstdio> and "mapfile.h".
11752 (main): Open mapfile if requested.
11753 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11754 constructor. Change caller.
11755 (queue_initial_tasks): Add mapfile parameter. Change caller.
11756 (queue_middle_tasks): Likewise.
11757 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11758 declarations.
11759 * archive.cc: Include "mapfile.h".
11760 (Archive::add_symbols): Add mapfile parameter. Change all
11761 callers. Pass mapfile, symbol, and reason to include_member.
11762 (Archive::include_all_members): Add mapfile parameter. Change all
11763 callers.
11764 (Archive::include_member): Add mapfile, sym, and why parameters.
11765 Change all callers. Report inclusion to map file.
11766 * archive.h: Include "fileread.h".
11767 (class Archive): Update declarations.
11768 (Archive::file): New const method.
11769 (class Add_archive_symbols): Add mapfile_ field. Update
11770 constructor. Change all callers.
11771 * readsyms.h (class Read_symbols): Likewise.
11772 (class Finish_group): Likewise.
11773 (class Read_script): Likewise.
11774 * common.cc: Include "mapfile.h".
11775 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11776 all callers.
11777 (Symbol_table::do_allocate_commons): Likewise.
11778 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11779 symbol allocation to mapfile.
11780 * common.h (class Allocate_commons_task): Add mapfile_ field.
11781 Update constructor. Change all callers.
11782 * symtab.h (class Symbol_table): Update declarations.
11783 * layout.cc: Include "mapfile.h".
11784 (Layout_task_runner::run): Print information to mapfile.
11785 (Layout::create_gold_note): Change Output_data_fixed_space to
11786 Output_data_zero_fill.
11787 (Layout::create_build_id): Likewise.
11788 (Layout::print_to_mapfile): New function.
11789 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11790 constructor. Change caller.
11791 (class Layout): Declare print_to_mapfile.
11792 * output.cc (Output_section::Input_section::print_to_mapfile): New
11793 function.
11794 (Output_section::add_input_section): If producing a map, always
11795 add to input_sections_ list.
11796 (Output_section::do_print_to_mapfile): New function.
11797 (Output_segment::print_sections_to_mapfile): New function.
11798 (Output_segment::print_section_list_to_mapfile): New function.
11799 * output.h: Include "mapfile.h".
11800 (Output_data::print_to_mapfile): New function.
11801 (Output_data::do_print_to_mapfile): New virtual function.
11802 (Output_segment_headers::do_print_to_mapfile): New function.
11803 (Output_file_header::do_print_to_mapfile): New function.
11804 (Output_data_const::do_print_to_mapfile): New function.
11805 (class Output_data_const_buffer): Add map_name_ field. Update
11806 constructor. Change all callers. Add do_print_to_mapfile
11807 function.
11808 (class Output_data_fixed_space): Likewise.
11809 (class Output_data_space): Likewise.
11810 (class Output_data_zero_fill): New class.
11811 (Output_data_strtab::do_print_to_mapfile): New function.
11812 (Output_data_reloc_base::do_print_to_mapfile): New function.
11813 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11814 (Output_data_group::do_print_to_mapfile): New function.
11815 (Output_data_got::do_print_to_mapfile): New function.
11816 (Output_data_dynamic::do_print_to_mapfile): New function.
11817 (Output_symtab_xindex::do_print_to_mapfile): New function.
11818 (class Output_section): Declare do_print_to_mapflie. Declare
11819 print_to_mapfile in Input_section.
11820 (class Output_segment): Declare new functions.
11821 * object.h (Sized_relobj::symbol_count): New function.
11822 * script-sections.cc
11823 (Output_section_element_dot_assignment::set_section_addresses):
11824 Change Output_data_fixed_space to Output_data_zero_fill.
11825 (Output_data_expression::do_print_to_mapfile): New function.
11826 * script.cc (read_input_script): Add mapfile parameter. Change
11827 all callers.
11828 * script.h (read_input_script): Update declaration.
11829 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11830 (Eh_frame::do_print_to_mapfile): New function.
11831 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11832 (Output_merge_string::do_print_to_mapfile): New function.
11833 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11834 function.
11835 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11836 function.
11837 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11838 function.
11839 * Makefile.am (CCFILES): Add mapfile.cc.
11840 (HFILES): Add mapfile.h.
11841 * Makefile.in: Rebuild.
11842
11843 2008-05-19 Ian Lance Taylor <iant@google.com>
11844
11845 * options.h (class General_options): Add -z relro.
11846 * layout.cc (Layout::Layout): Initialize relro_segment_.
11847 (Layout::add_output_section_data): Return the output section.
11848 (Layout::make_output_section): Rcognize relro sections and mark
11849 them appropriately.
11850 (Layout::attach_allocated_section_to_segment): Put relro sections
11851 in a PT_GNU_RELRO segment.
11852 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11853 section as relro.
11854 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11855 PT_TLS segments.
11856 (Layout::linkonce_mapping): Map d.rel.ro.local to
11857 .data.rel.ro.local.
11858 (Layout::output_section_name): Us .data.rel.ro.local for any
11859 section which begins with that.
11860 * layout.h (class Layout): Update add_output_section_data
11861 declaration. Add relro_segment_ field.
11862 * output.cc (Output_section::Output_section): Initialize is_relro_
11863 and is_relro_local_ fields.
11864 (Output_segment::add_output_section): Group relro sections.
11865 (Output_segment::is_first_section_relro): New function.
11866 (Output_segment::maximum_alignment): If there is a relro section,
11867 align the segment to the common page size.
11868 (Output_segment::set_section_addresses): Track whether we are
11869 looking at relro sections. If the last section is a relro
11870 section, align to the common page size.
11871 (Output_segment::set_section_list_addresses): Add in_relro
11872 parameter. Change all callers. Align to the page size when
11873 moving from relro to non-relro section.
11874 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11875 segment.
11876 * output.h (class Output_section): Add is_relro_ and
11877 is_relro_local_ fields.
11878 (Output_section::is_relro): New function.
11879 (Output_section::set_is_relro): New function.
11880 (Output_section::is_relro_local): New function.
11881 (Output_section::set_is_relro_local): New function.
11882 (class Output_segment): Update declarations.
11883 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11884 * sparc.cc (Target_sparc::got_section): Likewise.
11885 * x86_64.cc (Target_x86_64::got_section): Likewise.
11886 * testsuite/relro_test_main.cc: New file.
11887 * testsuite/relro_test.cc: New file.
11888 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11889 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11890 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11891 (relro_test.so, relro_test_pic.o): New targets.
11892 * testsuite/Makefile.in: Rebuild.
11893
11894 2008-05-16 Ian Lance Taylor <iant@google.com>
11895
11896 * output.cc (Output_segment::add_output_section): Remove front
11897 parameter.
11898 * output.h (class Output_segment): Remove
11899 add_initial_output_section and overloaded add_output_section.
11900 Update declaration of remaining add_output_section.
11901 * layout.cc (Layout::create_interp): Call add_output_section
11902 rather than add_initial_output_section.
11903 (Layout::finish_dynamic_section): Likewise.
11904
11905 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11906 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11907 know the dynamic type.
11908 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11909 field. Initialize it in constructor.
11910 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11911 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11912 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11913 reloc.
11914
11915 * output.cc (Output_reloc::get_address): Change return type to
11916 Elf_Addr.
11917 * output.h (class Output_reloc): Update get_address declaration.
11918 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11919 for section addresses.
11920
11921 2008-05-09 Ian Lance Taylor <iant@google.com>
11922
11923 PR 6493
11924 * gold.cc (gold_nomem): Use return value of write.
11925
11926 2008-05-08 Ian Lance Taylor <iant@google.com>
11927
11928 * symtab.c (Symbol::init_base_output_data): Add version
11929 parameter. Change all callers.
11930 (Symbol::init_base_output_segment): Likewise.
11931 (Symbol::init_base_constant): Likewise.
11932 (Symbol::init_base_undefined): Likewise.
11933 (Sized_symbol::init_output_data): Likewise.
11934 (Sized_symbol::init_output_segment): Likewise.
11935 (Sized_symbol::init_constant): Likewise.
11936 (Sized_symbol::init_undefined): Likewise.
11937 (Symbol_table::do_define_in_output_data): If the new symbol has a
11938 version, mark it as the default.
11939 (Symbol_table::do_define_in_output_segment): Likewise.
11940 (Symbol_table::do_define_as_constant): Likewise.
11941 * symtab.h (class Symbol): Update declarations.
11942 (class Sized_symbol): Likewise.
11943 * resolve.cc (Symbol::override_version): New function.
11944 (Symbol::override_base): Call override_version.
11945 (Symbol::override_base_with_special): Likewise.
11946 * testsuite/ver_script_8.script: New file.
11947 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11948 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11949 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11950 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11951
11952 2008-05-06 Ian Lance Taylor <iant@google.com>
11953
11954 PR 6049
11955 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11956 functions.
11957 (class General_options): Remove existing --undefined, and add
11958 --no-undefined instead. Add new --undefined as synonym for -u.
11959 * archive.cc (Archive::add_symbols): Check whether symbol was
11960 named with -u.
11961 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11962 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11963 all uses. Add IS_UNDEFINED. Update declarations to split
11964 different versions of init_base. Declare init_base_undefined.
11965 (Symbol::is_defined): Handle IS_UNDEFINED.
11966 (Symbol::is_undefined): Likewise.
11967 (Symbol::is_weak_undefined): Call is_undefined.
11968 (Symbol::is_absolute): Handle IS_CONSTANT.
11969 (class Sized_symbol): Update declarations to split different
11970 versions of init. Declare init_undefined.
11971 (class Symbol_table): Declare new functions.
11972 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11973 Change all callers.
11974 (Symbol::init_base_output_data): Likewise.
11975 (Symbol::init_base_output_segment): Likewise.
11976 (Symbol::init_base_constant): Likewise.
11977 (Symbol::init_base_undefined): New function.
11978 (Sized_symbol::init_object): Rename from init. Change all
11979 callers.
11980 (Sized_symbol::init_output_data): Likewise.
11981 (Sized_symbol::init_output_segment): Likewise.
11982 (Sized_symbol::init_constant): Likewise.
11983 (Sized_symbol::init_undefined): New function.
11984 (Symbol_table::add_undefined_symbols_from_command_line): New
11985 function.
11986 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11987 function.
11988 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11989 (Symbol::output_section): Likewise.
11990 (Symbol::set_output_section): Likewise.
11991 (Symbol_table::sized_finalize_symbol): Likewise.
11992 (Symbol_table::sized_write_globals): Likewise.
11993 * resolve.cc (Symbol_table::should_override): Likewise.
11994 (Symbol::override_base_with_special): Likewise.
11995
11996 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11997 symbol, change it to have default visibility.
11998 * testsuite/protected_1.cc: New file.
11999 * testsuite/protected_2.cc: New file.
12000 * testsuite/protected_3.cc: New file.
12001 * testsuite/protected_main_1.cc: New file.
12002 * testsuite/protected_main_2.cc: New file.
12003 * testsuite/protected_main_3.cc: New file.
12004 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12005 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12006 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12007 (protected_1.so): New target.
12008 (protected_1_pic.o, protected_2_pic.o): New targets.
12009 (protected_3_pic.o): New target.
12010 (check_PROGRAMS): Add protected_2.
12011 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12012 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12013 * testsuite/Makefile.in: Rebuild.
12014
12015 * options.h (DEFINE_var): Add set_user_set_##varname__.
12016 (DEFINE_bool_alias): New macro.
12017 (class General_options): Define -Bstatic using DEFINE_bool_alias
12018 rather than DEFINE_special. Add --undefined as an alias for -z
12019 defs.
12020 * options.cc (General_options::parse_Bstatic): Remove.
12021
12022 * options.h (class General_options): Add --fatal-warnings.
12023 * main.cc (main): Implement --fatal-warnings.
12024 * errors.h (Errors::warning_count): New function.
12025
12026 * options.h (class General_options): Add -Bsymbolic-functions.
12027 * symtab.h (Symbol::is_preemptible): Check for
12028 -Bsymbolic-functions.
12029
12030 2008-05-05 Ian Lance Taylor <iant@google.com>
12031
12032 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12033 as noVARNAME rather than no-VARNAME.
12034 (class General_options): Add option -z combreloc.
12035 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12036 get_address.
12037 (Output_reloc::sort_before) [SHT_REL]: New function.
12038 (Output_reloc::sort_before) [SHT_RELA]: New function.
12039 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12040 Sort_relocs_comparison.
12041 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12042 parameter. Change all callers.
12043 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12044 sort_relocs parameter. Change all callers.
12045 * output.cc (Output_reloc::get_address): New function, broken out
12046 of write_rel.
12047 (Output_reloc::write_rel): Call it.
12048 (Output_reloc::compare): New function.
12049 (Output_data_reloc_base::do_write): Optionally sort relocs.
12050
12051 * configure.ac: If targ_extra_obj is set, link it in.
12052 * configure.tgt: Initialize all variables.
12053 (x86_64*): Set targ_extra_obj and targ_extra_size.
12054 * configure: Rebuild.
12055
12056 * object.cc (Sized_relobj::include_section_group): Adjust section
12057 indexes read from group data. Build vector to pass to
12058 layout_group.
12059 * layout.cc (Layout::layout_group): Add flags and shndxes
12060 parameters. Remove contents parameter. Change caller. Update
12061 explicit instantiations.
12062 * layout.h (class Layout): Update layout_group declaration.
12063 * output.cc (Output_data_group::Output_data_group): Add flags and
12064 input_shndxes parameters. Remove contents parameter. Change
12065 caller.
12066 (Output_data_group::do_write): Change input_sections_ to
12067 input_shndxes_.
12068 * output.h (class Output_data_group): Update constructor
12069 declaration. Rename input_sections_ to input_shndxes_.
12070 * testsuite/many_sections_test.cc: Add template.
12071
12072 2008-04-30 Cary Coutant <ccoutant@google.com>
12073
12074 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12075
12076 * layout.cc (Layout::include_section): Refactored check for debug
12077 info section.
12078 (Layout::add_comdat): Add new parameters. Change type
12079 of signature parameter. Add object and shndx to signatures table.
12080 (Layout::find_kept_object): New function.
12081 * layout.h: Include <cstring>.
12082 (Layout::is_debug_info_section): New function.
12083 (Layout::add_comdat): Add new parameters.
12084 (Layout::find_kept_object): New function.
12085 (Layout::Kept_section): New struct.
12086 (Layout::Signatures): Change type of map range.
12087 * object.cc (Relobj::output_section_address): New function.
12088 (Sized_relobj::include_section_group): Add new parameters. Change
12089 calls to Layout::add_comdat. Change to build table of kept comdat
12090 groups and table mapping discarded sections to kept sections.
12091 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12092 (Sized_relobj::do_layout): Change calls to include_section_group and
12093 include_linkonce_section.
12094 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12095 value to zero when section is discarded.
12096 (Sized_relobj::map_to_kept_section): New function.
12097 * object.h (Relobj::output_section_address): New function.
12098 (Relobj::Comdat_group): New type.
12099 (Relobj::find_comdat_group): New function.
12100 (Relobj::Comdat_group_table): New type.
12101 (Relobj::Kept_comdat_section): New type.
12102 (Relobj::Kept_comdat_section_table): New type.
12103 (Relobj::add_comdat_group): New function.
12104 (Relobj::set_kept_comdat_section): New function.
12105 (Relobj::get_kept_comdat_section): New function.
12106 (Relobj::comdat_groups_): New field.
12107 (Relobj::kept_comdat_sections_): New field.
12108 (Symbol_value::input_value): Update comment.
12109 (Sized_relobj::map_to_kept_section) New function.
12110 (Sized_relobj::include_linkonce_section): Add new parameter.
12111 * target-reloc.h (Comdat_behavior): New type.
12112 (get_comdat_behavior): New function.
12113 (relocate_section): Add code to map a discarded section to the
12114 corresponding kept section when applying a relocation.
12115
12116 2008-04-30 Craig Silverstein <csilvers@google.com>
12117
12118 * dwarf_reader.cc (next_generation_count): New static var.
12119 (Addr2line_cache_entry): New struct.
12120 (addr2line_cache): New static var.
12121 (Dwarf_line_info::one_addr2line): Added caching.
12122 (Dwarf_line_info::clear_addr2line_cache): New function.
12123 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12124 cache-size parameter.
12125 (Dwarf_line_info::one_addr2line_cache): New function.
12126 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12127 new cache-size argument to one_addr2line(), and clear cache.
12128
12129 2008-04-28 Cary Coutant <ccoutant@google.com>
12130
12131 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12132 R_386_PC8 relocations.
12133
12134 2008-04-23 Ian Lance Taylor <iant@google.com>
12135
12136 * object.cc (Sized_relobj::include_section_group): Check for
12137 invalid section group.
12138
12139 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12140 header size.
12141
12142 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12143 than read for file header.
12144 * archive.cc (Archive::include_member): Likewise.
12145
12146 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12147
12148 * aclocal.m4: Regenerate.
12149 * configure: Regenerate.
12150
12151 2008-04-19 Ian Lance Taylor <iant@google.com>
12152
12153 * version.cc (version_string): Bump to 1.6.
12154
12155 * testsuite/Makefile.am (many_sections_r_test): New target.
12156 (many_sections_r_test_SOURCES): Remove.
12157 (many_sections_r_test_DEPENDENCIES): Remove.
12158 (many_sections_r_test_LDFLAGS): Remove.
12159 (many_sections_r_test_LDADD): Remove.
12160
12161 * object.cc (Sized_relobj::do_add_symbols): Always pass
12162 local_symbol_count_ to add_from_relobj.
12163
12164 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12165 every thousand variables.
12166 * testsuite/Makefile.in: Rebuild.
12167
12168 * object.cc (Xindex::initialize_symtab_xindex): New function.
12169 (Xindex::read_symtab_xindex): New function.
12170 (Xindex::sym_xindex_to_shndx): New function.
12171 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12172 available.
12173 (Sized_relobj::do_initialize_xindex): New function.
12174 (Sized_relobj::do_read_symbols): Adjust section links.
12175 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12176 parameter. Change all callers.
12177 (Sized_relobj::include_section_group): Adjust section links and
12178 symbol section indexes.
12179 (Sized_relobj::do_layout): Adjust section links.
12180 (Sized_relobj::do_count_local_symbols): Adjust section links and
12181 symbol section indexes.
12182 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12183 ordinary and special symbols.
12184 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12185 dynsym_xindex parameters. Change all callers. Adjust section
12186 links. Use SHN_XINDEX when needed.
12187 (Sized_relobj::get_symbol_location_info): Adjust section links.
12188 Don't get fooled by special symbols.
12189 * object.h (class Xindex): Define.
12190 (class Object): Add xindex_ parameter. Declare virtual functoin
12191 do_initialize_xindex.
12192 (Object::adjust_sym_shndx): New function.
12193 (Object::set_xindex): New protected function.
12194 (class Symbol_value): Add is_ordinary_shndx_ field.
12195 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12196 (Symbol_value::value): Assert ordinary section.
12197 (Symbol_value::initialize_input_to_output_map): Likewise.
12198 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12199 Change all callers.
12200 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12201 all callers.
12202 (class Sized_relobj): Update declarations.
12203 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12204 parameter. Change all callers.
12205 (Sized_relobj::adjust_shndx): New function.
12206 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12207 field.
12208 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12209 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12210 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12211 (Sized_dynobj::read_dynsym_section): Adjust section links.
12212 (Sized_dynobj::read_dynamic): Likewise.
12213 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12214 section links.
12215 (Sized_dynobj::do_initialize_xindex): New function.
12216 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12217 do_initialize_xindex.
12218 (Sized_dynobj::adjust_shndx): New function.
12219 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12220 dynsym_xindex_ fields.
12221 (Layout::finalize): Add a call to set_section_indexes before
12222 creating the symtab sections.
12223 (Layout::set_section_indexes): Don't do anything if the section
12224 already has a section index.
12225 (Layout::create_symtab_sections): Add shnum parameter. Change
12226 caller. Create .symtab_shndx section if needed.
12227 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12228 caller.
12229 (Layout::allocated_output_section_count): New function.
12230 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12231 needed.
12232 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12233 fields. Update declarations.
12234 (Layout::symtab_xindex): New function.
12235 (Layout::dynsym_xindex): New function.
12236 (class Write_symbols_task): Add layout_ field.
12237 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12238 Change caller.
12239 * output.cc (Output_section_headers::Output_section_headers): Add
12240 shstrtab_section parameter. Change all callers.
12241 (Output_section_headers::do_sized_write): Store overflow values
12242 for section count and section string table section index in
12243 section header zero.
12244 (Output_file_header::do_sized_write): Check for overflow of
12245 section count and section string table section index.
12246 (Output_symtab_xindex::do_write): New function.
12247 (Output_symtab_xindex::endian_do_write): New function.
12248 * output.h (class Output_section_headers): Add shstrtab_section_.
12249 Update declarations.
12250 (class Output_symtab_xindex): Define.
12251 (Output_section::has_out_shndx): New function.
12252 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12253 field.
12254 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12255 Change all callers.
12256 (Sized_symbol::init): Likewise.
12257 (Symbol::output_section): Check for ordinary symbol.
12258 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12259 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12260 callers.
12261 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12262 Change all callers. Simplify handling of symbols from sections
12263 not included in the link.
12264 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12265 distinction.
12266 (Weak_alias_sorter::operator()): Assert that symbols are
12267 ordinary.
12268 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12269 distinction.
12270 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12271 parameters. Change all callers.
12272 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12273 symbol distinction. Use SHN_XINDEX when needed.
12274 (Symbol_table::write_section_symbol): Add symtab_xindex
12275 parameter. Change all callers.
12276 (Symbol_table::sized_write_section_symbol): Likewise. Use
12277 SHN_XINDEX when needed.
12278 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12279 declarations.
12280 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12281 (Symbol::is_defined): Check is_ordinary.
12282 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12283 (Symbol::is_absolute, Symbol::is_common): Likewise.
12284 (class Sized_symbol): Update declarations.
12285 (class Symbol_table): Update declarations.
12286 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12287 parameters. Change all callers.
12288 (Sized_symbol::override): Likewise.
12289 (Symbol_table::override): Likewise.
12290 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12291 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12292 is_ordinary, and orig_st_shndx parameters. Change all callers.
12293 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12294 to be in an ordinary section.
12295 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12296 object and is_ordinary parameters. Change all callers.
12297 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12298 Change all callers. Don't add undefined or non-ordinary symbols
12299 to reloc_map_.
12300 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12301 Change all callers.
12302 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12303 declarations.
12304 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12305 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12306 (Sized_relobj::relocate_sections): Likewise.
12307 * target-reloc.h (scan_relocs): Adjust section symbol index.
12308 (scan_relocatable_relocs): Likewise.
12309 * i386.cc (Scan::local): Check for ordinary symbols.
12310 * sparc.cc (Scan::local): Likewise.
12311 * x86_64.cc (Scan::local): Likewise.
12312 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12313 to symbol_section_and_value.
12314 * testsuite/many_sections_test.cc: New file.
12315 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12316 (check_PROGRAMS): Add many_sections_test.
12317 (many_sections_test_SOURCES): Define.
12318 (many_sections_test_DEPENDENCIES): Define.
12319 (many_sections_test_LDFLAGS): Define.
12320 (BUILT_SOURCES): Add many_sections_define.h.
12321 (many_sections_define.h): New target.
12322 (BUILT_SOURCES): Add many_sections_check.h.
12323 (many_sections_check.h): New target.
12324 (check_PROGRAMS): Add many_sections_r_test.
12325 (many_sections_r_test_SOURCES): Define.
12326 (many_sections_r_test_DEPENDENCIES): Define.
12327 (many_sections_r_test_LDFLAGS): Define.
12328 (many_sections_r_test_LDADD): Define.
12329 (many_sections_r_test.o): New target.
12330 * testsuite/Makefile.in: Rebuild.
12331
12332 2008-04-17 Cary Coutant <ccoutant@google.com>
12333
12334 * errors.cc (Errors::info): New function.
12335 (gold_info): New function.
12336 * errors.h (Errors::info): New function.
12337 * gold.h (gold_info): New function.
12338 * object.cc (Input_objects::add_object): Print trace output.
12339 * options.cc (options::parse_set): New function.
12340 (General_options::parse_wrap): Deleted.
12341 (General_options::General_options): Deleted initializer.
12342 * options.h (options::String_set): New typedef.
12343 (options::parse_set): New function.
12344 (DEFINE_set): New macro.
12345 (General_options::wrap): Changed to use DEFINE_set. Changed
12346 callers of any_wrap_symbols and is_wrap_symbol.
12347 (General_options::trace, General_options::trace_symbol):
12348 New options.
12349 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12350 (General_options::wrap_symbols_): Deleted.
12351 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12352
12353 2008-04-17 David S. Miller <davem@davemloft.net>
12354
12355 * options.cc (General_options::parse_V): New function.
12356 * options.h: Add entries for -V and -Qy.
12357
12358 2008-04-17 Ian Lance Taylor <iant@google.com>
12359
12360 * common.cc (Symbol_table::allocate_commons): Remove options
12361 parameter. Change caller.
12362 (Symbol_table::do_allocate_commons): Remove options parameter.
12363 Change caller. Just call do_allocate_commons_list twice.
12364 (Symbol_table::do_allocate_commons_list): New function, broken out
12365 of do_allocate_commons.
12366 * common.h (class Allocate_commons_task): Remove options_ field.
12367 Update constructor.
12368 * symtab.cc (Symbol_table::Symbol_table): Initialize
12369 tls_commons_.
12370 (Symbol_table::add_from_object): Put TLS common symbols on
12371 tls_commons_ list.
12372 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12373 which are IN_OUTPUT_DATA.
12374 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12375 allocate_commons and do_allocate_commons declarations. Declare
12376 do_allocate_commons_list.
12377 * gold.cc (queue_middle_tasks): Update creation of
12378 Allocate_commons_task to not pass options.
12379 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12380 (TLS_TEST_C_FLAGS): New variable.
12381 (tls_test_c_pic.o): New target.
12382 (tls_test_shared.so): Link in tls_test_c_pic.o.
12383 (tls_test_c_pic_ie.o): New target.
12384 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12385 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12386 (tls_test_c.o): New target.
12387 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12388 (tls_pic_test_LDADD): Likewise.
12389 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12390 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12391 (tls_test_c_gnu2.o): New target.
12392 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12393 tls_test_c_gnu2.o.
12394 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12395 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12396 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12397 * testsuite/tls_test.cc: Include "config.h".
12398 (t_last): Call t11_last.
12399 * testsuite/tls_test.h (t11, t11_last): Declare.
12400 * testsuite/tls_test_c.c: New file.
12401 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12402 * configure.ac: Check for OpenMP support.
12403 * configure, config.in, Makefile.in: Rebuild.
12404 * testsuite/Makefile.in: Rebuild.
12405
12406 2008-04-16 Cary Coutant <ccoutant@google.com>
12407
12408 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12409 (Target_i386::tls_base_symbol_defined_): New field.
12410 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12411 (Target_i386::Scan::global): Likewise.
12412 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12413 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12414 (Target_x86_64::tls_base_symbol_defined_): New field.
12415 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12416 (Target_x86_64::Scan::global): Likewise.
12417
12418 2008-04-16 Cary Coutant <ccoutant@google.com>
12419
12420 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12421 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12422 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12423 building shared libraries.
12424 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12425 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12426 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12427 * testsuite/Makefile.in: Rebuild.
12428 * testsuite/weak_undef.h: New file.
12429 * testsuite/weak_undef_file1.cc: Add extra test cases.
12430 * testsuite/weak_undef_file2.cc: Likewise.
12431 * testsuite/weak_undef_test.cc: Likewise.
12432
12433 2008-04-16 David S. Miller <davem@davemloft.net>
12434
12435 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12436 Add issued_non_pic_error_ field. Declare check_non_pic.
12437 (Target_sparc::Scan::check_non_pic): New function.
12438 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12439 (Target_sparc::Scan::global): Likewise.
12440
12441 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12442 * configure: Rebuild.
12443
12444 * options.h (DEFINE_enable): New macro.
12445 (new_dtags): New enable option.
12446 (initfirst, interpose, loadfltr, nodefaultlib,
12447 nodelete, nodlopen, nodump): New -z options.
12448 * layout.cc (Layout:finish_dynamic_section): If new
12449 dtags enabled, emit DT_RUNPATH. Also, emit a
12450 DT_FLAGS_1 containing any specified -z flags.
12451
12452 2008-04-16 Ian Lance Taylor <iant@google.com>
12453
12454 * copy-relocs.cc: New file.
12455 * copy-relocs.h: New file.
12456 * reloc.cc: Remove Copy_relocs code.
12457 * reloc.h: Likewise.
12458 * reloc-types.h (struct Reloc_types) [both versions]: Add
12459 get_reloc_addend_noerror.
12460 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12461 variants of add_global which take an addend which must be zero.
12462 * i386.cc: Include "copy-relocs.h".
12463 (class Target_i386): Change type of copy_relocs_ to variable,
12464 update initializer.
12465 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12466 Change all callers.
12467 (Target_i386::do_finalize_sections): Change handling of
12468 copy_relocs_.
12469 * sparc.cc: Include "copy-relocs.h".
12470 (class Target_sparc): Change type of copy_relocs_ to variable,
12471 update initializer.
12472 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12473 Change all callers.
12474 (Target_sparc::do_finalize_sections): Change handling of
12475 copy_relocs_.
12476 * x86_64.cc: Include "copy-relocs.h".
12477 (class Target_x86_64): Change type of copy_relocs_ to variable,
12478 update initializer.
12479 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12480 class. Change all callers.
12481 (Target_x86_64::do_finalize_sections): Change handling of
12482 copy_relocs_.
12483 * Makefile.am (CCFILES): Add copy-relocs.cc.
12484 (HFILES): Add copy-relocs.h.
12485
12486 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12487
12488 * testsuite/script_test_4.sh: Permit leading zeroes.
12489
12490 2008-04-15 Ian Lance Taylor <iant@google.com>
12491
12492 * script-sections.cc (Script_sections::create_segments): Use
12493 header_size_adjustment even when there is enough room for the
12494 headers.
12495 * testsuite/script_test_4.sh: New file.
12496 * testsuite/script_test_4.t: New file.
12497 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12498 (check_DATA): Add script_test_4.stdout.
12499 (MOSTLYCLEANFILES): Likewise.
12500 (script_test_4): New target.
12501 (script_test_4.stdout): New target.
12502 * testsuite/Makefile.in: Rebuild.
12503
12504 * sparc.cc: Add definitions for Output_data_plt_sparc class
12505 constants.
12506
12507 2008-04-14 David S. Miller <davem@davemloft.net>
12508
12509 * sparc.cc: New file.
12510 * Makefile.am (TARGETSOURCES): Add sparc.cc
12511 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12512 * configure.tgt: Document targ_extra_size and
12513 targ_extra_big_endian. Add entries for sparc-* and
12514 sparc64-*.
12515 * configure.ac: Handle targ_extra_size and
12516 targ_extra_big_endian.
12517 * Makefile.in: Rebuild.
12518 * configure: Likewise.
12519 * po/POTFILES.in: Likewise.
12520 * po/gold.pot: Likewise.
12521
12522 2008-04-14 Ian Lance Taylor <iant@google.com>
12523
12524 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12525 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12526 in the name/type/flags to section mapping. Don't call
12527 allocate_output_section.
12528 (Layout::choose_output_section): Change parameter from adjust_name
12529 to is_input_section. Don't permit input sections after sections
12530 are attached to segments. Don't call allocate_output_section.
12531 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12532 not write_enable_output_section.
12533 (Layout::make_output_section): Don't push to
12534 unattached_section_list_ nor call attach_to_segment. Call
12535 attach_section_to_segment if sections are attached.
12536 (Layout::attach_sections_to_segments): New function.
12537 (Layout::attach_section_to_segment): New function.
12538 (Layout::attach_allocated_section_to_segment): Rename from
12539 attach_to_segment. Remove flags parameter.
12540 (Layout::allocate_output_section): Remove function.
12541 (Layout::write_enable_output_section): Remove function.
12542 * layout.h (class Layout): Update for above changes. Add new
12543 field sections_are_attached_.
12544 * output.h (Output_section::update_flags_for_input_section): New
12545 function.
12546 * output.cc (Output_section::add_input_section): Call
12547 update_flags_for_input_section.
12548 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12549
12550 2008-04-11 Cary Coutant <ccoutant@google.com>
12551
12552 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12553 thought unnecessary.
12554 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12555
12556 2008-04-11 Ian Lance Taylor <iant@google.com>
12557
12558 * output.h (class Output_section_data): Remove inline definition
12559 of set_addralign.
12560 * output.cc (Output_section_data::set_addralign): New function.
12561
12562 2008-04-11 Cary Coutant <ccoutant@google.com>
12563
12564 Add support for TLS descriptors for i386 and x86_64.
12565 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12566 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12567 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12568 GOT_TYPE_TLS_DESC.
12569 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12570 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12571 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12572 relocations.
12573 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12574 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12575 Fix problem with initial-exec relocations.
12576 (Target_i386::Relocate::relocate_tls): Likewise.
12577 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12578 relaxation.
12579 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12580 support for section-plus-offset dynamic table entries.
12581 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12582 (Output_data_dynamic::Dynamic_entry): Add support for
12583 section-plus-offset dynamic table entries.
12584 (Output_data_dynamic::Classification): Likewise.
12585 (Output_data_dynamic::classification_): Renamed offset_.
12586 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12587 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12588 (Target_x86_64::make_plt_section): New function.
12589 (Target_x86_64::reserve_tlsdesc_entries): New function.
12590 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12591 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12592 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12593 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12594 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12595 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12596 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12597 add extra PLT entry for TLS descriptors.
12598 (Output_data_plt_x86_64::got_): New field.
12599 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12600 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12601 fields.
12602 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12603 descriptors.
12604 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12605 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12606 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12607 R_386_TLS_DESC_CALL relocations.
12608 (Target_x86_64::Scan::global): Likewise.
12609 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12610 for TLS descriptors.
12611 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12612 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12613 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12614 GD-to-IE relaxation.
12615 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12616 and TLS_DESCRIPTORS.
12617 * Makefile.in: Rebuild.
12618 * configure: Rebuild.
12619 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12620 (tls_test_shared2.so): New target.
12621 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12622 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12623 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12624 (tls_shared_gd_to_ie_test_LDADD): New variable.
12625 (tls_shared_gnu2_gd_to_ie_test): New target.
12626 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12627 New targets.
12628 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12629 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12630 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12631 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12632 (tls_shared_gnu2_test): New target.
12633 (tls_test_gnu2_shared.so): New target.
12634 (tls_shared_gnu2_test_SOURCES): New variable.
12635 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12636 (tls_shared_gnu2_test_LDFLAGS): New variable.
12637 (tls_shared_gnu2_test_LDADD): New variable.
12638 * testsuite/Makefile.in: Rebuild.
12639 * testsuite/Makefile.
12640
12641 2008-04-11 Ian Lance Taylor <iant@google.com>
12642
12643 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12644 justsyms.t.
12645 * testsuite/Makefile.in: Rebuild.
12646
12647 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12648 long.
12649 * testsuite/script_test_2.cc (main): Adjust test.
12650
12651 2008-04-11 David S. Miller <davem@davemloft.net>
12652 Ian Lance Taylor <iant@google.com>
12653
12654 * options.h (General_options): Add entries for '-Y' and
12655 '-relax'.
12656 * options.cc (General_options:finalize): If -Y was used, add those
12657 entries to the library path instead of the default "/lib" and
12658 "/usr/lib".
12659
12660 2008-04-11 David S. Miller <davem@davemloft.net>
12661
12662 * testsuite/justsyms.t: Start at 0x100.
12663 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
12664 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12665 long.
12666 * testsuite/script_test_2.cc: Adjust string and section length
12667 checks.
12668
12669 2008-04-09 Ian Lance Taylor <iant@google.com>
12670
12671 PR gold/5996
12672 * script-sections.cc (Sections_element::allocate_to_segment): Add
12673 orphan parameter.
12674 (Output_section_definition::allocate_to_segment): Likewise.
12675 (Orphan_output_section::allocate_to_segment): Likewise.
12676 (Script_sections::attach_sections_using_phdrs_clause): Don't
12677 propagate non-PT_LOAD segments to orphan sections.
12678 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12679 readelf rather than objdump.
12680 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12681 .interp section and PT_INTERP segment are the same size.
12682 * testsuite/Makefile.in: Rebuild.
12683
12684 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12685 aliases for symbols defined in the same object.
12686 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12687 (weak_alias_test_SOURCES): New variable.
12688 (weak_alias_test_DEPENDENCIES): New variable.
12689 (weak_alias_test_LDFLAGS): New variable.
12690 (weak_alias_test_LDADD): New variable.
12691 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12692 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12693 (weak_alias_test_3.o): New target.
12694 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12695 * testsuite/weak_alias_test_main.cc: New file.
12696 * testsuite/weak_alias_test_1.cc: New file.
12697 * testsuite/weak_alias_test_2.cc: New file.
12698 * testsuite/weak_alias_test_3.cc: New file.
12699
12700 2008-04-08 Ian Lance Taylor <iant@google.com>
12701
12702 * options.h (class General_options): Add --noinhibit-exec option.
12703 * main.cc (main): Check --noinhibit-exec.
12704
12705 * options.h (class General_options): Define --wrap as a special
12706 option. Add wrap_symbols_ field.
12707 (General_options::any_wrap_symbols): New function.
12708 (General_options::is_wrap_symbol): New function.
12709 * options.cc (General_options::parse_wrap): New function.
12710 (General_options::General_options): Initialize wrap_symbols_.
12711 * symtab.cc (Symbol_table::wrap_symbol): New function.
12712 (Symbol_table::add_from_object): Handle --wrap.
12713 * symtab.h (class Symbol_table): Declare wrap_symbol.
12714 * target.h (Target::wrap_char): New function.
12715 (Target::Target_info): Add wrap_char field.
12716 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12717 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12718 * testsuite/testfile.cc (Target_test::test_target_info):
12719 Likewise.
12720
12721 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12722 there is one.
12723
12724 * layout.h (class Layout): Add added_eh_frame_data_ field.
12725 * layout.cc (Layout::Layout): Initialize new field.
12726 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12727 output section until we find a section we merged successfully.
12728 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12729 that the size be non-zero.
12730
12731 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12732 qualifier.
12733
12734 2008-04-08 Craig Silverstein <csilvers@google.com>
12735
12736 * configure.ac: Export new conditional variable HAVE_ZLIB.
12737 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12738 on HAVE_ZLIB.
12739 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12740 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12741
12742 2008-04-07 Ian Lance Taylor <iant@google.com>
12743
12744 * version.cc (version_string): Set to "1.5".
12745
12746 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12747 Add issued_non_pic_error_ field. Declare check_non_pic.
12748 (Target_x86_64::Scan::check_non_pic): New function.
12749 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12750 (Target_x86_64::Scan::global): Likewise.
12751
12752 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12753 addend parameter. Change caller. Handle merge sections.
12754 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12755 Address to Addend. Don't add in the result of
12756 local_section_offset, pass down the addend and use the returned
12757 value.
12758 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12759 Update declarations of local_section_offset and symbol_value.
12760 * testsuite/two_file_test_1.cc (t18): New function.
12761 * testsuite/two_file_test_2.cc (f18): New function.
12762 * testsuite/two_file_test_main.cc (main): Call t18.
12763 * testsuite/two_file_test.h (t18, f18): Declare.
12764
12765 * configure.ac: Don't test for objdump, c++filt, or readelf.
12766 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12767 conditionals.
12768 (TEST_READELF): New variable.
12769 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12770 (check_PROGRAMS): Add two_file_strip_test.
12771 (two_file_strip_test): New target.
12772 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12773 (two_file_same_shared_strip_test_SOURCES): New variable.
12774 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12775 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12776 (two_file_same_shared_strip_test_LDADD): New variable.
12777 (two_file_shared_strip.so): New target.
12778 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12779 (ver_test_5.syms, ver_test_7.syms): Likewise.
12780 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12781 (strip_test_3.stdout): Use TEST_OBJDUMP.
12782 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12783
12784 2008-04-04 Cary Coutant <ccoutant@google.com>
12785
12786 * symtab.h (Symbol::is_weak_undefined): New function.
12787 (Symbol::is_strong_undefined): New function.
12788 (Symbol::is_absolute): New function.
12789 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12790 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12791 absolute symbols.
12792 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12793 (weak_undef_test): New target.
12794 * testsuite/Makefile.in: Rebuild.
12795 * testsuite/weak_undef_file1.cc: New file.
12796 * testsuite/weak_undef_file2.cc: New file.
12797 * testsuite/weak_undef_test.cc: New file.
12798
12799 2008-04-03 Craig Silverstein <csilvers@google.com>
12800
12801 * compressed_output.h (class Output_compressed_section): Use
12802 unsigned buffer.
12803 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12804 add zlib header.
12805 (zlib_compressed_suffix): Removed.
12806 (Output_compressed_section::set_final_data_size): Use unsigned
12807 buffers.
12808 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12809 Fix linker invocation.
12810 (flagstest_o_specialfile_and_compress_debug_sections):
12811 Likewise.
12812 * testsuite/Makefile.in: Regenerated.
12813
12814 2008-04-02 David S. Miller <davem@davemloft.net>
12815
12816 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12817 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12818
12819 2008-04-02 Craig Silverstein <csilvers@google.com>
12820
12821 * TODO: New file.
12822
12823 2008-04-02 Ian Lance Taylor <iant@google.com>
12824
12825 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12826 parameters. Update for new key type to views_. Change all
12827 callers.
12828 (File_read::read): Adjust for byteshift in returned view.
12829 (File_read::add_view): New function, broken out of
12830 find_and_make_view.
12831 (File_read::make_view): New function, broken out of
12832 find_and_make_view.
12833 (File_read::find_or_make_view): Add offset and aligned
12834 parameters. Rewrite accordingly. Change all callers.
12835 (File_read::get_view): Add offset and aligned parameters. Adjust
12836 for byteshift in return value.
12837 (File_read::get_lasting_view): Likewise.
12838 * fileread.h (class File_read): Update declarations.
12839 (class File_read::View): Add byteshift_ field. Add byteshift to
12840 constructor. Add byteshift method.
12841 * archive.h (Archive::clear_uncached_views): New function.
12842 (Archive::get_view): Add aligned parameter. Change all callers.
12843 * object.h (Object::get_view): Add aligned parameter. Change all
12844 callers.
12845 (Object::get_lasting_view): Likewise.
12846
12847 * fileread.cc (File_read::release): Don't call clear_views if
12848 there are multiple objects.
12849 * fileread.h (File_read::clear_uncached_views): New function.
12850 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12851 on the archive.
12852
12853 2008-03-31 Cary Coutant <ccoutant@google.com>
12854
12855 Add thin archive support.
12856 * archive.cc (Archive::armagt): New const.
12857 (Archive::setup): Remove task parameter and calls to unlock.
12858 (Archive::unlock_nested_archives): New function.
12859 (Archive::read_header): Add nested_off parameter. Change
12860 all callers.
12861 (Archive::interpret_header): Likewise.
12862 (Archive::include_all_members): Change to handle thin
12863 archives.
12864 (Archive::include_member): Likewise.
12865 * archive.h (Archive::Archive): Add new parameters and
12866 initializers.
12867 (Archive::armagt): New const.
12868 (Archive::setup): Remove task parameter.
12869 (Archive::unlock_nested_archives): New function.
12870 (Archive::read_header): Add nested_off parameter.
12871 (Archive::interpret_header): Likewise.
12872 (Archive::Nested_archive_table): New typedef.
12873 (Archive::is_thin_archive_): New field.
12874 (Archive::nested_archives_): New field.
12875 (Archive::options_): New field.
12876 (Archive::dirpath_): New field.
12877 (Archive::task_): New field.
12878 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12879 for thin archives. Pass additional parameters to
12880 Archive::Archive. Unlock the archive file after calling
12881 Archive::setup.
12882
12883 2008-03-29 Ian Lance Taylor <iant@google.com>
12884
12885 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12886 version symbol to be local.
12887 * testsuite/ver_test_4.sh: New file.
12888 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12889 (check_DATA): Add ver_test_4.syms.
12890 (ver_test_4.syms): New target.
12891 * testsuite/Makefile.in: Rebuild.
12892
12893 * output.cc
12894 (Output_section::Input_section_sort_entry::has_priority): New
12895 function.
12896 (Output_section::Input_section_sort_entry::match_file_name): New
12897 function.
12898 (Output_section::Input_section_sort_entry::match_section_name):
12899 Remove.
12900 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12901 Remove.
12902 (Output_section::Input_section_sort_entry::match_section_file):
12903 Remove.
12904 (Output_section::Input_section_sort_compare::operator()): Rewrite
12905 using new Input_section_sort_entry functions. Sort crtbegin and
12906 crtend first. Sort sections with no priority before sections with
12907 a priority.
12908 * testsuite/initpri1.c (d3): Check j != 4.
12909 (cd5): New constructor/destructor function.
12910 (main): Check j != 2.
12911
12912 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12913 new symbol when resolving, don't call set_is_default.
12914 * testsuite/ver_test_7.cc: New file.
12915 * testsuite/ver_test_7.sh: New file.
12916 * testsuite/Makefile.am (ver_test_7.so): New target.
12917 (ver_test_7.o): New target.
12918 (check_SCRIPTS): Add ver_test_7.sh.
12919 (check_DATA): Add ver_test_7.syms.
12920 (ver_test_7.syms): New target.
12921
12922 2008-03-28 Ian Lance Taylor <iant@google.com>
12923
12924 * layout.cc (Layout::layout): If we see an input section with a
12925 name that needs sorting, set the must_sort flag for the output
12926 section.
12927 (Layout::make_output_section): If the name of the output section
12928 indicates that it might require sorting, set the may_sort flag.
12929 * output.h (Output_section::may_sort_attached_input_sections): New
12930 function.
12931 (Output_section::set_may_sort_attached_input_sections): New
12932 function.
12933 (Output_section::must_sort_attached_input_sections): New
12934 function.
12935 (Output_section::set_must_sort_attached_input_sections): New
12936 function.
12937 (class Output_section): Declare Input_section_sort_entry. Define
12938 Input_section_sort_compare. Declare
12939 sort_attached_input_sections. Add new fields:
12940 may_sort_attached_input_sections_,
12941 must_sort_attached_input_sections_,
12942 attached_input_sections_are_sorted_.
12943 * output.cc (Output_section::Output_section): Initialize new
12944 fields.
12945 (Output_section::add_input_section): Add an entry to
12946 input_sections_ if may_sort or must_sort are true.
12947 (Output_section::set_final_data_size): Call
12948 sort_attached_input_sections if necessary.
12949 (Output_section::Input_section_sort_entry): Define new class.
12950 (Output_section::Input_section_sort_compare::operator()): New
12951 function.
12952 (Output_section::sort_attached_input_sections): New function.
12953 * configure.ac: Check whether the compiler supports constructor
12954 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12955 * testsuite/initpri1.c: New file.
12956 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12957 CONSTRUCTOR_PRIORITY.
12958 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12959 (initpri1_LDFLAGS): New variable.
12960 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12961
12962 2008-03-27 Ian Lance Taylor <iant@google.com>
12963
12964 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12965 * testsuite/common_test_1.c: New file.
12966 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12967 (common_test_1_SOURCES): New variable.
12968 (common_test_1_DEPENDENCIES): New variable.
12969 (common_test_1_LDFLAGS): New variable.
12970
12971 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12972 and commons_ correctly when NAME/VERSION does not override
12973 NAME/NULL.
12974 * testsuite/ver_test_6.c: New file.
12975 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12976 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12977 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12978
12979 2008-03-26 Ian Lance Taylor <iant@google.com>
12980
12981 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12982 of an undefined symbol from a version script.
12983 * testsuite/Makefile.am (ver_test_5.so): New target.
12984 (ver_test_5.o): New target.
12985 (check_SCRIPTS): Add ver_test_5.sh.
12986 (check_DATA): Add ver_test_5.syms.
12987 (ver_test_5.syms): New target.
12988 * testsuite/ver_test_5.cc: New file.
12989 * testsuite/ver_test_5.script: New file.
12990 * testsuite/ver_test_5.sh: New file.
12991 * Makefile.in, testsuite/Makefile.in: Rebuild.
12992
12993 PR gold/5986
12994 Fix problems building gold with gcc 4.3.0.
12995 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12996 (gold_error_at_location, gold_warning_at_location): Use it.
12997 * configure.ac: Check whether we can compile and use a template
12998 function with a printf attribute.
12999 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13000 when jumping over bytes.
13001 * object.cc: Instantiate Object::read_section_data.
13002 * debug.h: Include <cstring>
13003 * dwarf_reader.cc: Include <algorithm>
13004 * main.cc: Include <cstring>.
13005 * options.cc: Include <cstring>.
13006 * output.cc: Include <cstring>.
13007 * script.cc: Include <cstring>.
13008 * script.h: Include <string>.
13009 * symtab.cc: Include <cstring> and <algorithm>.
13010 * target-select.cc: Include <cstring>.
13011 * version.cc: Include <string>.
13012 * testsuite/testmain.cc: Include <cstdlib>.
13013 * configure, config.in: Rebuild.
13014
13015 2008-03-25 Ian Lance Taylor <iant@google.com>
13016
13017 * options.cc: Include "../bfd/bfdver.h".
13018 (options::help): Print bug reporting address.
13019
13020 * version.cc (print_version): Adjust output for current value of
13021 BFD_VERSION_STRING.
13022
13023 * NEWS: New file.
13024
13025 * options.cc (options::help): Print list of supported targets.
13026 * target-select.h: Include <vector>.
13027 (class Target_selector): Make machine_, size_, and is_big_endian_
13028 fields const. Add bfd_name_ and instantiated_target_ fields.
13029 (Target_selector::Target_selector): Add bfd_name parameter.
13030 (Target_selector::recognize): Make non-virtual, call
13031 do_recognize.
13032 (Target_selector::recognize_by_name): Make non-virtual, call
13033 do_recognize_by_name.
13034 (Target_selector::supported_names): New function.
13035 (Target_selector::bfd_name): New function.
13036 (Target_selector::do_instantiate_target): New pure virtual
13037 function.
13038 (Target_selector::do_recognize): New virtual function.
13039 (Target_selector::do_recognize_by_name): New virtual function.
13040 (Target_selector::instantiate_target): New private function.
13041 (supported_target_names): Declare.
13042 * target-select.cc (Target_selector::Target_selector): Update for
13043 new parameter and fields.
13044 (select_target_by_name): Check that the name matches before
13045 calling recognize_by_name.
13046 (supported_target_names): New function.
13047 * i386.cc (class Target_selector_i386): Update Target_selector
13048 constructor call. Remove recognize and recognize_by_name. Add
13049 do_instantiate_target.
13050 * x86_64.cc (class Target_selector_x86_64): Likewise.
13051 * testsuite/testfile.cc (class Target_selector_test): Update for
13052 changes to Target_selector.
13053
13054 * README: Rewrite, with some notes on unsupported features.
13055
13056 2008-03-24 Cary Coutant <ccoutant@google.com>
13057
13058 * i386.cc (Target_i386::Got_type): New enum declaration.
13059 (Target_i386::Scan::local): Updated callers of Output_data_got
13060 member functions.
13061 (Target_i386::Scan::global): Likewise.
13062 (Target_i386::Relocate::relocate): Likewise.
13063 (Target_i386::Relocate::relocate_tls): Likewise.
13064 * object.h (Got_offset_list): New class.
13065 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13066 (Sized_relobj::local_got_offset): Likewise.
13067 (Sized_relobj::set_local_got_offset): Likewise.
13068 (Sized_relobj::local_has_tls_got_offset): Removed.
13069 (Sized_relobj::local_tls_got_offset): Removed.
13070 (Sized_relobj::set_local_tls_got_offset): Removed.
13071 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13072 * output.cc (Output_data_got::add_global): Added got_type parameter.
13073 (Output_data_got::add_global_with_rel): Likewise.
13074 (Output_data_got::add_global_with_rela): Likewise.
13075 (Output_data_got::add_global_pair_with_rel): New function.
13076 (Output_data_got::add_global_pair_with_rela): New function.
13077 (Output_data_got::add_local): Added got_type parameter.
13078 (Output_data_got::add_local_with_rel): Likewise.
13079 (Output_data_got::add_local_with_rela): Likewise.
13080 (Output_data_got::add_local_pair_with_rel): New function.
13081 (Output_data_got::add_local_pair_with_rela): New function.
13082 (Output_data_got::add_global_tls): Removed.
13083 (Output_data_got::add_global_tls_with_rel): Removed.
13084 (Output_data_got::add_global_tls_with_rela): Removed.
13085 (Output_data_got::add_local_tls): Removed.
13086 (Output_data_got::add_local_tls_with_rel): Removed.
13087 (Output_data_got::add_local_tls_with_rela): Removed.
13088 * output.h (Output_data_got::add_global): Added got_type parameter.
13089 (Output_data_got::add_global_with_rel): Likewise.
13090 (Output_data_got::add_global_with_rela): Likewise.
13091 (Output_data_got::add_global_pair_with_rel): New function.
13092 (Output_data_got::add_global_pair_with_rela): New function.
13093 (Output_data_got::add_local): Added got_type parameter.
13094 (Output_data_got::add_local_with_rel): Likewise.
13095 (Output_data_got::add_local_with_rela): Likewise.
13096 (Output_data_got::add_local_pair_with_rel): New function.
13097 (Output_data_got::add_local_pair_with_rela): New function.
13098 (Output_data_got::add_global_tls): Removed.
13099 (Output_data_got::add_global_tls_with_rel): Removed.
13100 (Output_data_got::add_global_tls_with_rela): Removed.
13101 (Output_data_got::add_local_tls): Removed.
13102 (Output_data_got::add_local_tls_with_rel): Removed.
13103 (Output_data_got::add_local_tls_with_rela): Removed.
13104 * resolve.cc (Symbol::override_base_with_special): Removed
13105 reference to has_got_offset_ field.
13106 * symtab.cc (Symbol::init_fields): Replaced initialization
13107 of got_offset_ with got_offsets_. Removed initialization
13108 of has_got_offset_
13109 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13110 (Symbol::got_offset): Likewise.
13111 (Symbol::set_got_offset): Likewise.
13112 (Symbol::has_tls_got_offset): Removed.
13113 (Symbol::tls_got_offset): Removed.
13114 (Symbol::set_tls_got_offset): Removed.
13115 (Symbol::got_offset_): Removed.
13116 (Symbol::tls_mod_got_offset_): Removed.
13117 (Symbol::tls_pair_got_offset_): Removed.
13118 (Symbol::got_offsets_): New field.
13119 (Symbol::has_got_offset): Removed.
13120 (Symbol::has_tls_mod_got_offset): Removed.
13121 (Symbol::has_tls_pair_got_offset): Removed.
13122 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13123 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13124 member functions.
13125 (Target_x86_64::Scan::global): Likewise.
13126 (Target_x86_64::Relocate::relocate): Likewise.
13127 (Target_x86_64::Relocate::relocate_tls): Likewise.
13128
13129 2008-03-25 Ben Elliston <bje@au.ibm.com>
13130
13131 * yyscript.y: Fix spelling error in comment.
13132
13133 2008-03-24 Ian Lance Taylor <iant@google.com>
13134
13135 * options.h (class General_options): Define build_id option.
13136 * layout.h (class Layout): Declare write_build_id, create_note,
13137 create_build_id. Add build_id_note_ member.
13138 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13139 "libiberty.h", "md5.h", "sha1.h".
13140 (Layout::Layout): Initialize eh_frame_data_,
13141 eh_frame_hdr_section_, and build_id_note_.
13142 (Layout::finalize): Call create_build_id.
13143 (Layout::create_note): New function, broken out of
13144 Layout::create_gold_note.
13145 (Layout::create_gold_note): Call create_note.
13146 (Layout::create_build_id): New function.
13147 (Layout::write_build_id): New function.
13148 (Close_task_runner::run): Call write_build_id.
13149
13150 * x86_64.cc: Correct license to GPLv3.
13151
13152 2008-03-23 Ian Lance Taylor <iant@google.com>
13153
13154 * options.cc: Include "demangle.h".
13155 (parse_optional_string): New function.
13156 (parse_long_option): Handle takes_optional_argument.
13157 (parse_short_option): Update dash_z initializer. Handle
13158 takes_optional_argument.
13159 (General_options::General_options): Initialize do_demangle_.
13160 (General_options::finalize): Set do_demangle_. Handle demangling
13161 style.
13162 * options.h (parse_optional_string): Declare.
13163 (struct One_option): Add optional_arg field. Update constructor.
13164 Update call constructor calls. Add takes_optional_argument
13165 function.
13166 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13167 (DEFINE_optional_string): Define.
13168 (General_options::demangle): Change from DEFINE_bool to
13169 DEFINE_optional_string.
13170 (General_options::no_demangle): New function.
13171 (General_options::do_demangle): New function.
13172 (General_options::set_do_demangle): New function.
13173 (General_options::execstack_status_): Move definition to end of
13174 class definition.
13175 (General_options::static_): Likewise.
13176 (General_options::do_demangle_): New field.
13177 * object.cc (big_endian>::get_symbol_location_info): Call
13178 Options::do_demangle, not Options::demangle.
13179 * symtab.cc (demangle): Likewise.
13180
13181 2008-03-22 Ian Lance Taylor <iant@google.com>
13182
13183 * gold.h: Include <cstddef> and <sys/types.h>
13184 * options.h: Include <cstring>.
13185
13186 2008-03-21 Ian Lance Taylor <iant@google.com>
13187
13188 * Added source code to GNU binutils.
This page took 0.296024 seconds and 5 git commands to generate.